diff --git a/Dockerfile b/Dockerfile index b331075b4c..45776206a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ EXPOSE 3006 EXPOSE 4200 RUN npm install -g nodemon RUN npm install -g ts-node -CMD ["node", "dev.js"] +CMD ["node", "dev.mjs"] diff --git a/Methodology Library/CDM/CDM ACM0001/ACM0001.policy b/Methodology Library/CDM/CDM ACM0001/ACM0001.policy new file mode 100644 index 0000000000..04a20e4abc Binary files /dev/null and b/Methodology Library/CDM/CDM ACM0001/ACM0001.policy differ diff --git a/Methodology Library/CDM/CDM ACM0001/readme.md b/Methodology Library/CDM/CDM ACM0001/readme.md index 3e4387eeb9..fd7d457e48 100644 --- a/Methodology Library/CDM/CDM ACM0001/readme.md +++ b/Methodology Library/CDM/CDM ACM0001/readme.md @@ -11,7 +11,6 @@ - Key Documents & Schemas - Token (Carbon Emisison Reduction) - Workflow -- IPFS Timestamp - Step-by-Step @@ -89,13 +88,120 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. ## Policy Workflow ![image](https://github.com/hashgraph/guardian/assets/79293833/02c6baf0-3eec-4247-b6c1-7de60029b0fd) + +### Step By Step + +1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. + +![image](https://github.com/hashgraph/guardian/assets/79293833/f4b27077-d4ab-4c26-8147-f154abc03d8c) + +![image](https://github.com/hashgraph/guardian/assets/79293833/edf45195-a9dc-4be2-8fec-7b85ecee9d30) + +![image](https://github.com/hashgraph/guardian/assets/79293833/09644fe1-cbdf-4498-9713-a1107bff4c8e) + +![image](https://github.com/hashgraph/guardian/assets/79293833/ee9da057-009d-494d-b54c-52831cfbe451) + +2. Once the policy has successfully imported, you will be redirected to the policy configurator. The policy configurator can be used to edit the policy using the workflow blocks. There will also be a tab for the “Tools” used within this policy as illustrated in the image below. To start using the policy you must first change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” or “Go” button. This can be done through the policy configurator page or though the “Policies” page. + +![image](https://github.com/hashgraph/guardian/assets/79293833/0cdba5f4-ff13-4fa7-aa3b-9a6b20438bca) + +![image](https://github.com/hashgraph/guardian/assets/79293833/8e01b989-030b-4186-bfd6-472efb6d8d5a) + +![image](https://github.com/hashgraph/guardian/assets/79293833/01d23a42-781b-4fc7-b8a3-35515266bd15) + +![image](https://github.com/hashgraph/guardian/assets/79293833/bb0967de-41f0-4803-839f-e6b9f5f177b3) + +![image](https://github.com/hashgraph/guardian/assets/79293833/420d69b1-f925-49b4-9bcd-8f8190f630df) + +3. Create a new user by clicking the “Create User” button and assign their role as “Project Participant”. + +![image](https://github.com/hashgraph/guardian/assets/79293833/91c516c2-1ff3-47a6-b776-33b58c991b06) + +![image](https://github.com/hashgraph/guardian/assets/79293833/001661ec-c65a-4da6-bcbf-6b525081b6a4) + +![image](https://github.com/hashgraph/guardian/assets/79293833/76e07aef-a9ef-4893-89fe-173dacc3c19a) + +4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). + +![image](https://github.com/hashgraph/guardian/assets/79293833/10beecbf-d50d-4d2f-b74c-f3290bb6b51a) + +5. Сreate a new user again and assign their role as “VVB”. + +![image](https://github.com/hashgraph/guardian/assets/79293833/3cab49f3-f403-4b62-9bf4-ba4d9b7da562) + +6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). + +![image](https://github.com/hashgraph/guardian/assets/79293833/a87353a7-769c-4ec7-8fab-93342686c7b6) + +7. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. + +![image](https://github.com/hashgraph/guardian/assets/79293833/1e42c343-4a2b-4ac8-9fed-96ba62ff77ce) + +![image](https://github.com/hashgraph/guardian/assets/79293833/2834c776-e2d1-423b-a369-d4007fcd3acf) + +8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. + +![image](https://github.com/hashgraph/guardian/assets/79293833/8d823f1f-b39a-4970-98c4-cae37a9721eb) + +![image](https://github.com/hashgraph/guardian/assets/79293833/3c631f08-4118-467a-bbac-3e6bbbb59204) + +9. Log back in as the SR and after reviewing the document located in the “Projects” tab, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. + +![image](https://github.com/hashgraph/guardian/assets/79293833/7070f6c4-3076-48f1-a72c-dd5d6feea839) + +10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. + +![image](https://github.com/hashgraph/guardian/assets/79293833/6cd9edee-59ec-4fc4-ab37-b46db71508d7) + +![image](https://github.com/hashgraph/guardian/assets/79293833/34f92cd6-e9c1-4dbd-9053-2e19c7068215) + +11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. + +![image](https://github.com/hashgraph/guardian/assets/79293833/6f3e8272-4d5a-4713-990f-dbb744e962ae) + +12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. + +![image](https://github.com/hashgraph/guardian/assets/79293833/dddd36bf-1b9a-4a7a-91e1-43e5742b2634) + +13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. + +![image](https://github.com/hashgraph/guardian/assets/79293833/d5e340ec-4559-411c-b7de-8145a3456cbe) + +14. Once the minting process is completed, you can view the token amount by navigating to the “VPs” tab. + +![image](https://github.com/hashgraph/guardian/assets/79293833/21acc77c-e5dd-4aea-8482-7fdbc7388a04) + +15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1/472495” when the tokens are still minting like the example provided below. + +![image](https://github.com/hashgraph/guardian/assets/79293833/ce3f60f3-be3d-4fbe-a729-1fadb7fde8ab) + +![image](https://github.com/hashgraph/guardian/assets/79293833/c452e666-f789-4e90-a109-052ab83bd194) + + + + + + + + + + + + + + + + + + + + + + + -## IPFS Timestamp -Coming Soon -### Step By Step -Coming Soon diff --git a/Methodology Library/CDM/CDM ACM0002/ACM0002.policy b/Methodology Library/CDM/CDM ACM0002/ACM0002.policy new file mode 100644 index 0000000000..3d65a78638 Binary files /dev/null and b/Methodology Library/CDM/CDM ACM0002/ACM0002.policy differ diff --git a/Methodology Library/CDM/CDM ACM0002/CDM ACM0002.policy b/Methodology Library/CDM/CDM ACM0002/CDM ACM0002.policy deleted file mode 100644 index a3ee36abf0..0000000000 Binary files a/Methodology Library/CDM/CDM ACM0002/CDM ACM0002.policy and /dev/null differ diff --git a/Methodology Library/CDM/CDM ACM0007/ACM0007.policy b/Methodology Library/CDM/CDM ACM0007/ACM0007.policy index eade34ef98..ecb5bbf555 100644 Binary files a/Methodology Library/CDM/CDM ACM0007/ACM0007.policy and b/Methodology Library/CDM/CDM ACM0007/ACM0007.policy differ diff --git a/Methodology Library/CDM/CDM AMS-I.F/CDM AMS-I.F Policy.policy b/Methodology Library/CDM/CDM AMS-I.F/CDM AMS-I.F Policy.policy new file mode 100644 index 0000000000..780fcacf07 Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-I.F/CDM AMS-I.F Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G Policy.policy b/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G Policy.policy new file mode 100644 index 0000000000..1e767faf12 Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G.policy b/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G.policy deleted file mode 100644 index f0e696c41d..0000000000 Binary files a/Methodology Library/CDM/CDM AMS-II.G/CDM AMS-II.G.policy and /dev/null differ diff --git a/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J Policy.policy b/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J Policy.policy new file mode 100644 index 0000000000..50879083e1 Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J.policy b/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J.policy deleted file mode 100644 index 9806510670..0000000000 Binary files a/Methodology Library/CDM/CDM AMS-II.J/CDM AMS-II.J.policy and /dev/null differ diff --git a/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR Policy.policy b/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR Policy.policy new file mode 100644 index 0000000000..6ccff4e54e Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR.policy b/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR.policy deleted file mode 100644 index 699bb1862e..0000000000 Binary files a/Methodology Library/CDM/CDM AMS-III.AR/CDM AMS-III.AR.policy and /dev/null differ diff --git a/Methodology Library/CDM/CDM AMS-III.AV/CDM AMS-III.AV Policy.policy b/Methodology Library/CDM/CDM AMS-III.AV/CDM AMS-III.AV Policy.policy index c3e9732f9e..38025a37e7 100644 Binary files a/Methodology Library/CDM/CDM AMS-III.AV/CDM AMS-III.AV Policy.policy and b/Methodology Library/CDM/CDM AMS-III.AV/CDM AMS-III.AV Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D Policy.policy b/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D Policy.policy new file mode 100644 index 0000000000..a507033b23 Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D.policy b/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D.policy deleted file mode 100644 index 851f6f1487..0000000000 Binary files a/Methodology Library/CDM/CDM AMS-III.D/CDM AMS-III.D.policy and /dev/null differ diff --git a/Methodology Library/CDM/CDM AMS-III.F/CDM AMS-III.F Policy.policy b/Methodology Library/CDM/CDM AMS-III.F/CDM AMS-III.F Policy.policy index e399fdaef4..bf014dc214 100644 Binary files a/Methodology Library/CDM/CDM AMS-III.F/CDM AMS-III.F Policy.policy and b/Methodology Library/CDM/CDM AMS-III.F/CDM AMS-III.F Policy.policy differ diff --git a/Methodology Library/CDM/CDM AMS-III.H/AMS-III.H.policy b/Methodology Library/CDM/CDM AMS-III.H/AMS-III.H.policy new file mode 100644 index 0000000000..bd5afa8bd3 Binary files /dev/null and b/Methodology Library/CDM/CDM AMS-III.H/AMS-III.H.policy differ diff --git a/Methodology Library/readme.md b/Methodology Library/readme.md index d36d4d3001..628c2531a9 100644 --- a/Methodology Library/readme.md +++ b/Methodology Library/readme.md @@ -30,30 +30,60 @@ This folder contains sub folders for each Methodology and their authors (with ma 7. GCC - KrypC 8. Gold Standard Afforestation / Reforestation - Envision 9. Gold Standard Carbon Sequestration through Accelerated Carbonation of Concrete Aggregate - Envision -10. CDM ACM0007 - Envision -11. CDM AMS-II.G - Envision -12. CDM AMS-III.AR - Envision -13. CDM AMS-III.BB - Envision -14. CDM AMS-III.D - Envision -15. CDM AMS-I.D - Envision -16. CDM AR-ACM0003 - Envision -17. CDM AMS-II.J - Envision -18. CDM ACM0002 - Envision -19. CDM AMS-III.F - Envision -20. CDM AMS-III.AV - Envision -21. CDM AMS-III.H - Envision -22. CDM AMS-I.F - Envision -23. CDM AMS-I.C (Coming Soon) -24. CDM ACM0001 (Coming Soon) -25. CDM ACM0018 (Coming Soon) -26. CDM AMS-I.A (Coming Soon) +10. MMCM - Dovu +11. CDM ACM0007 - Envision +12. CDM AMS-II.G - Envision +13. CDM AMS-III.AR - Envision +14. CDM AMS-III.BB - Envision +15. CDM AMS-III.D - Envision +16. CDM AMS-I.D - Envision +17. CDM AR-ACM0003 - Envision +18. CDM AMS-II.J - Envision +19. CDM ACM0002 - Envision +20. CDM AMS-III.F - Envision +21. CDM AMS-III.AV - Envision +22. CDM AMS-III.H - Envision +23. CDM AMS-I.F - Envision +24. CDM AMS-I.C (Coming Soon) +25. CDM ACM0001 (Coming Soon) +26. CDM ACM0018 (Coming Soon) +27. CDM AMS-I.A (Coming Soon) ### Emission Policies 1. GHG Methodology - Remote Workflow - Envision 2. CET & CRU - Tymlez 3. GHG Scope II - Atma -4. GHGP Corporate Standard - Envision -5. GHGP Product Standard - Avery Dennison (Coming soon) -6. E-Mission (Coming soon) -7. EPA CFR 40 p75 - Serapis (Coming soon) +4. GHG Scope 3 - Atma +5. GHGP Corporate Standard - Envision +6. GHGP Product Standard - Avery Dennison (Coming soon) +7. E-Mission (Coming soon) +8. EPA CFR 40 p75 - Serapis (Coming soon) + +### Hackathon Policies (Under Testing) + +1. UrbanO2asis +2. Verra VM0048 +3. GF0001 +4. Puro.Earth Biochar +5. SaniChain +6. Verra VM0047 with Forward Module +7. VErra VMR0006 +8. Verra VM0038 ( Electrical vehicle charging systems ) +9. CDM AMS-III.Z - Sustainable Brick Manufacturing Methodology +10. SmartCookStove +11. CDM AMS-III.C +12. CDM AM0124 +13. SDVISTa SDVM001 - Improved Cookstoves (ICS) +14. CDM ACM0014 +15. Improved-Waste-Collection-Segregation-and-Handling (IWCSH) +16. GreenTrace +17. M/CE-R01 Circular Economy Methodology for Encouraging Plastic Recycling (MCER01) +18. Solar Positive Household Methodology +19. ZEV Ledger: Tokenization & management of ZEV credits in alignment with the "VM0038 Methodology for Electric Vehicle Charging Systems" and "Two and Three Wheeled Personal Transportation" methodologies +20. Agrify Regenerative Methodology +21. Sector-Specific Food Loss & Waste GHG Reduction Policy 1.0 (SSFLWGRP001) +22. Food Loss & Waste (International) 1.0 Methodology +23. ESG Verifier +24. Verra VM0019 Methodology +25. EcoRegen Alliance diff --git a/README.md b/README.md index dd1b36f1c0..e49dc4ca7f 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,7 @@ If you want to manually build every component with debug information, then build * [NodeJS V20](https://nodejs.org) * [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) * [Nats 1.12.2](https://nats.io/) +* [Redict 7.3.0](https://redict.io/) ### Build and start each component diff --git a/ai-service/.dockerignore b/ai-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/ai-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/ai-service/Dockerfile b/ai-service/Dockerfile index b07d1257f0..59ac1c81de 100644 --- a/ai-service/Dockerfile +++ b/ai-service/Dockerfile @@ -1,51 +1,56 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS apiAIServiceBuilder -WORKDIR /usr/local/ai-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./ai-service/package.json ./ -COPY ./ai-service/tsconfig*.json ./ -ADD ./ai-service/data ./data/. -ADD ./ai-service/faiss-vector ./faiss-vector/. -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" - -RUN yarn install -ADD ./ai-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/ai-service -WORKDIR /usr/local/ai-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./ai-service/package*.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link ai-service/package.json ai-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link ai-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production -RUN yarn install -COPY --from=apiAIServiceBuilder /usr/local/ai-service/dist ./dist -ADD ./ai-service/data ./data/. -ADD ./ai-service/faiss-vector ./faiss-vector/. +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/ai-service/package.json b/ai-service/package.json index 8009d3eb67..33ebf5bb90 100644 --- a/ai-service/package.json +++ b/ai-service/package.json @@ -1,13 +1,13 @@ { "name": "ai-service", - "version": "2.23.1", + "version": "2.24.0", "main": "dist/app.js", "license": "Apache-2.0", "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@types/express": "^4.17.18", @@ -32,7 +32,5 @@ "devDependencies": { "nodemon": "^3.0.1" }, - "resolutions": { - "@types/mime": "3.0.4" - } + "type": "module" } diff --git a/ai-service/src/ai-manager.ts b/ai-service/src/ai-manager.ts index 7de6552116..a91aacc11b 100644 --- a/ai-service/src/ai-manager.ts +++ b/ai-service/src/ai-manager.ts @@ -1,12 +1,11 @@ -import { FilesManager } from './helpers/files-manager-helper'; +import { FilesManager } from './helpers/files-manager-helper.js'; import { FaissStore } from 'langchain/vectorstores/faiss'; import { RetrievalQAChain } from 'langchain/chains'; import { OpenAI } from 'langchain/llms/openai'; -import { OpenAIConnect } from './helpers/openai-helper'; -import { VectorStorage } from './helpers/vector-storage-helper'; -import { AISuggestionsDB } from './helpers/ai-suggestions-db'; -import { PolicyDescription } from './models/models'; - +import { OpenAIConnect } from './helpers/openai-helper.js'; +import { VectorStorage } from './helpers/vector-storage-helper.js'; +import { AISuggestionsDB } from './helpers/ai-suggestions-db.js'; +import { PolicyDescription } from './models/models.js'; import * as dotenv from 'dotenv'; import { Logger, Policy, PolicyCategory } from '@guardian/common'; diff --git a/ai-service/src/api/service/ai-suggestions-service.ts b/ai-service/src/api/service/ai-suggestions-service.ts index 9bbe799597..19e3c7e65f 100644 --- a/ai-service/src/api/service/ai-suggestions-service.ts +++ b/ai-service/src/api/service/ai-suggestions-service.ts @@ -1,5 +1,5 @@ -import { ApiResponse } from '../../helpers/api-response'; -import { AIManager } from '../../ai-manager'; +import { ApiResponse } from '../../helpers/api-response.js'; +import { AIManager } from '../../ai-manager.js'; import { MessageAPI } from '@guardian/interfaces'; import { MessageError, MessageResponse } from '@guardian/common'; diff --git a/ai-service/src/app.ts b/ai-service/src/app.ts index dc9b580e8a..a70134bb6f 100644 --- a/ai-service/src/app.ts +++ b/ai-service/src/app.ts @@ -1,8 +1,8 @@ +import { AISuggestionService } from './helpers/suggestions.js'; +import { aiSuggestionsAPI } from './api/service/ai-suggestions-service.js'; +import { AISuggestionsDB } from './helpers/ai-suggestions-db.js'; +import { AIManager } from './ai-manager.js'; import { ApplicationState, Logger, MessageBrokerChannel } from '@guardian/common'; -import { AISuggestionService } from './helpers/suggestions'; -import { aiSuggestionsAPI } from './api/service/ai-suggestions-service'; -import { AISuggestionsDB } from './helpers/ai-suggestions-db'; -import { AIManager } from './ai-manager'; import * as process from 'process'; import { ApplicationStates } from '@guardian/interfaces'; diff --git a/ai-service/src/config.ts b/ai-service/src/config.ts index 831e39976a..d77b5b36e8 100644 --- a/ai-service/src/config.ts +++ b/ai-service/src/config.ts @@ -1,16 +1,7 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import 'reflect-metadata' import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@subscribers': __dirname + 'dist/subscribers', - '@helpers': __dirname + '/helpers', - '@auth': __dirname + '/auth', - '@middlewares': __dirname + '/middlewares', -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.ai-service.${process.env.GUARDIAN_ENV}` : './configs/.env.ai-service'; diff --git a/ai-service/src/helpers/api-response.ts b/ai-service/src/helpers/api-response.ts index fa584ea36b..7fe39b1cf3 100644 --- a/ai-service/src/helpers/api-response.ts +++ b/ai-service/src/helpers/api-response.ts @@ -1,4 +1,4 @@ -import { AISuggestionService } from './suggestions'; +import { AISuggestionService } from './suggestions.js'; import { ApplicationState, MessageResponse } from '@guardian/common'; /** diff --git a/ai-service/src/helpers/files-manager-helper.ts b/ai-service/src/helpers/files-manager-helper.ts index c372821a73..53ce508734 100644 --- a/ai-service/src/helpers/files-manager-helper.ts +++ b/ai-service/src/helpers/files-manager-helper.ts @@ -1,8 +1,9 @@ import * as fs from 'fs'; import * as path from 'path'; -import { GroupCategories } from './general-helper'; + +import { GroupCategories } from './general-helper.js'; +import { PolicyDescription } from '../models/models.js'; import { PolicyCategoryType } from '@guardian/interfaces'; -import { PolicyDescription } from '../models/models'; import { Logger, Policy, PolicyCategory } from '@guardian/common'; const MIN_DESCRIPTION_WORDS = 5; diff --git a/ai-service/src/helpers/general-helper.ts b/ai-service/src/helpers/general-helper.ts index 5bb8287322..0abc4f2339 100644 --- a/ai-service/src/helpers/general-helper.ts +++ b/ai-service/src/helpers/general-helper.ts @@ -1,4 +1,4 @@ -import { Methodology } from '../models/models'; +import { Methodology } from '../models/models.js'; import { Policy, PolicyCategory } from '@guardian/common'; export function GetMehodologiesByPolicies(responseText: string, policies: Policy[]) { diff --git a/ai-service/src/helpers/openai-helper.ts b/ai-service/src/helpers/openai-helper.ts index 706b751639..455afd5cb4 100644 --- a/ai-service/src/helpers/openai-helper.ts +++ b/ai-service/src/helpers/openai-helper.ts @@ -1,8 +1,8 @@ import { OpenAI } from 'langchain/llms/openai'; import { FaissStore } from 'langchain/vectorstores/faiss'; import { loadQAStuffChain, RetrievalQAChain } from 'langchain/chains'; -import { Methodology, ResponseData } from '../models/models'; -import { GetMehodologiesByPolicies } from './general-helper'; +import { Methodology, ResponseData } from '../models/models.js'; +import { GetMehodologiesByPolicies } from './general-helper.js'; import { Policy } from '@guardian/common'; const answerAfter = 'For the most up-to-date and comprehensive information on Guardian methodologies, including any new methodologies that might have been introduced since my last update, I recommend visiting the official Guardian website or consulting the Methodologies'; diff --git a/ai-service/src/index.ts b/ai-service/src/index.ts index 11b146661a..dae6021377 100644 --- a/ai-service/src/index.ts +++ b/ai-service/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/ai-service/tsconfig.json b/ai-service/tsconfig.json index fd847e9b33..bf42554e66 100644 --- a/ai-service/tsconfig.json +++ b/ai-service/tsconfig.json @@ -10,10 +10,10 @@ "lib": [ "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/ai-service/tsconfig.production.json b/ai-service/tsconfig.production.json index 3d30cee3aa..9eacd317e1 100644 --- a/ai-service/tsconfig.production.json +++ b/ai-service/tsconfig.production.json @@ -10,10 +10,10 @@ "lib": [ "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/ai-service/yarn.lock b/ai-service/yarn.lock deleted file mode 100644 index 0ba0de4ded..0000000000 --- a/ai-service/yarn.lock +++ /dev/null @@ -1,1370 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@anthropic-ai/sdk@^0.6.2": - version "0.6.2" - resolved "https://registry.yarnpkg.com/@anthropic-ai/sdk/-/sdk-0.6.2.tgz#4be415e6b1d948df6f8e03af84aedf102ec74b70" - integrity sha512-fB9PUj9RFT+XjkL+E9Ol864ZIJi+1P8WnbHspN3N3/GK2uSzjd0cbVIKTGgf4v3N8MwaQu+UWnU7C4BG/fap/g== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - digest-fetch "^1.3.0" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - -"@types/body-parser@*": - version "1.19.3" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.3.tgz#fb558014374f7d9e56c8f34bab2042a3a07d25cd" - integrity sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.36" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" - integrity sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@^4.17.33": - version "4.17.37" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.37.tgz#7e4b7b59da9142138a2aaa7621f5abedce8c7320" - integrity sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - "@types/send" "*" - -"@types/express@^4.17.18": - version "4.17.18" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.18.tgz#efabf5c4495c1880df1bdffee604b143b29c4a95" - integrity sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.33" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/http-errors@*": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.2.tgz#a86e00bbde8950364f8e7846687259ffcd96e8c2" - integrity sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg== - -"@types/mime@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.2.tgz#c1ae807f13d308ee7511a5b81c74f327028e66e8" - integrity sha512-Wj+fqpTLtTbG7c0tH47dkahefpLKEbB+xAZuLq7b4/IDHPl/n6VoXcyUQ2bypFlbSwvCr0y+bD4euTTqTJsPxQ== - -"@types/mime@^1": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.3.tgz#bbe64987e0eb05de150c305005055c7ad784a9ce" - integrity sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg== - -"@types/node-fetch@^2.6.4": - version "2.6.6" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" - integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== - dependencies: - "@types/node" "*" - form-data "^4.0.0" - -"@types/node@*", "@types/node@^20.8.0": - version "20.8.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.0.tgz#10ddf0119cf20028781c06d7115562934e53f745" - integrity sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ== - -"@types/node@^18.11.18": - version "18.18.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.1.tgz#80b22f3df719f15c9736207980e95f35d01ec1aa" - integrity sha512-3G42sxmm0fF2+Vtb9TJQpnjmP+uKlWvFa8KoEGquh4gqRmoUG/N0ufuhikw6HEsdG2G2oIKhog1GCTfz9v5NdQ== - -"@types/qs@*": - version "6.9.8" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.8.tgz#f2a7de3c107b89b441e071d5472e6b726b4adf45" - integrity sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg== - -"@types/range-parser@*": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.5.tgz#38bd1733ae299620771bd414837ade2e57757498" - integrity sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA== - -"@types/retry@0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" - integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== - -"@types/send@*": - version "0.17.2" - resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.2.tgz#af78a4495e3c2b79bfbdac3955fdd50e03cc98f2" - integrity sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw== - dependencies: - "@types/mime" "^1" - "@types/node" "*" - -"@types/serve-static@*": - version "1.15.3" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.3.tgz#2cfacfd1fd4520bbc3e292cca432d5e8e2e3ee61" - integrity sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg== - dependencies: - "@types/http-errors" "*" - "@types/mime" "*" - "@types/node" "*" - -"@types/uuid@^9.0.1": - version "9.0.4" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.4.tgz#e884a59338da907bda8d2ed03e01c5c49d036f1c" - integrity sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" - -agentkeepalive@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" - integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== - dependencies: - humanize-ms "^1.2.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - -base64-js@^1.3.1, base64-js@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -binary-extensions@^2.0.0, binary-extensions@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -binary-search@^1.3.5: - version "1.3.6" - resolved "https://registry.yarnpkg.com/binary-search/-/binary-search-1.3.6.tgz#e32426016a0c5092f0f3598836a1c7da3560565c" - integrity sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -camelcase@6: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -charenc@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" - integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-type@~1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" - integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -crypt@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - -detect-libc@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d" - integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw== - -digest-fetch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661" - integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA== - dependencies: - base-64 "^0.1.0" - md5 "^2.3.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== - -end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -eventemitter3@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -expand-template@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" - integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== - -expr-eval@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expr-eval/-/expr-eval-2.0.2.tgz#fa6f044a7b0c93fde830954eb9c5b0f7fbc7e201" - integrity sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg== - -express@^4.18.2: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -faiss-node@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/faiss-node/-/faiss-node-0.5.0.tgz#ecabad18c6115e3a15ae166ebfe441ec2bbf705e" - integrity sha512-Esjaq0KA4CDGFyS2V1VLNu6/no8ntD1r0Oj41PMWgN4QD138WipbWeFjdDXVTHtNwxDjSISE0uatnu2jMs6KEw== - dependencies: - bindings "^1.5.0" - node-addon-api "^6.0.0" - prebuild-install "^7.1.1" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -form-data-encoder@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" - integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -formdata-node@^4.3.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.4.1.tgz#23f6a5cb9cb55315912cbec4ff7b0f59bbd191e2" - integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ== - dependencies: - node-domexception "1.0.0" - web-streams-polyfill "4.0.0-beta.3" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-intrinsic@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" - integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-proto "^1.0.1" - has-symbols "^1.0.3" - -github-from-package@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" - integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" - integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== - dependencies: - ms "^2.0.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== - -inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-any-array@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-any-array/-/is-any-array-2.0.1.tgz#9233242a9c098220290aa2ec28f82ca7fa79899e" - integrity sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -js-tiktoken@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.7.tgz#56933fcd2093e8304060dfde3071bda91812e6f5" - integrity sha512-biba8u/clw7iesNEWLOLwrNGoBP2lA+hTaBLs/D45pJdUPFXyxD6nhcDVtADChghv4GgyAiMKYMiRx7x6h7Biw== - dependencies: - base64-js "^1.5.1" - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsonpointer@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" - integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== - -langchain@^0.0.156: - version "0.0.156" - resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.0.156.tgz#476ceb7920d72b18267c429e0a52c264c99c8d79" - integrity sha512-mEaRqQdBPTMjI+FE0nmgynX8lY78SMvW+G0ChxqPARuoIXbz1QORvIz/BfpSbzjKkx/b5rEGocLcw1dAsr52YQ== - dependencies: - "@anthropic-ai/sdk" "^0.6.2" - ansi-styles "^5.0.0" - binary-extensions "^2.2.0" - camelcase "6" - decamelize "^1.2.0" - expr-eval "^2.0.2" - flat "^5.0.2" - js-tiktoken "^1.0.7" - js-yaml "^4.1.0" - jsonpointer "^5.0.1" - langchainhub "~0.0.6" - langsmith "~0.0.31" - ml-distance "^4.0.0" - object-hash "^3.0.0" - openai "~4.4.0" - openapi-types "^12.1.3" - p-queue "^6.6.2" - p-retry "4" - uuid "^9.0.0" - yaml "^2.2.1" - zod "^3.21.4" - zod-to-json-schema "^3.20.4" - -langchainhub@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/langchainhub/-/langchainhub-0.0.6.tgz#9d2d06e4ce0807b4e8a31e19611f57aef990b54d" - integrity sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w== - -langsmith@~0.0.31: - version "0.0.41" - resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.41.tgz#3cf5dc0b320748d8dfa65bcbec4a776d745b0003" - integrity sha512-QRJMrCg8IzQJmva+30SbbQznaX91R/5IIfNj0yy0EFhNzgEmJP+XYnTiS0Ph5Htv6Kb4mYhxP7x198ECupW98A== - dependencies: - "@types/uuid" "^9.0.1" - commander "^10.0.1" - p-queue "^6.6.2" - p-retry "4" - uuid "^9.0.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -md5@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" - integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g== - dependencies: - charenc "0.0.2" - crypt "0.0.2" - is-buffer "~1.1.6" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.3: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -ml-array-mean@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/ml-array-mean/-/ml-array-mean-1.1.6.tgz#d951a700dc8e3a17b3e0a583c2c64abd0c619c56" - integrity sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ== - dependencies: - ml-array-sum "^1.1.6" - -ml-array-sum@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/ml-array-sum/-/ml-array-sum-1.1.6.tgz#d1d89c20793cd29c37b09d40e85681aa4515a955" - integrity sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw== - dependencies: - is-any-array "^2.0.0" - -ml-distance-euclidean@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ml-distance-euclidean/-/ml-distance-euclidean-2.0.0.tgz#3a668d236649d1b8fec96380b9435c6f42c9a817" - integrity sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q== - -ml-distance@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/ml-distance/-/ml-distance-4.0.1.tgz#4741d17a1735888c5388823762271dfe604bd019" - integrity sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw== - dependencies: - ml-array-mean "^1.1.6" - ml-distance-euclidean "^2.0.0" - ml-tree-similarity "^1.0.0" - -ml-tree-similarity@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ml-tree-similarity/-/ml-tree-similarity-1.0.0.tgz#24705a107e32829e24d945e87219e892159c53f0" - integrity sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg== - dependencies: - binary-search "^1.3.5" - num-sort "^2.0.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" - integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== - -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -node-abi@^3.3.0: - version "3.47.0" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.47.0.tgz#6cbfa2916805ae25c2b7156ca640131632eb05e8" - integrity sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A== - dependencies: - semver "^7.3.5" - -node-addon-api@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" - integrity sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA== - -node-domexception@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - -node-fetch@^2.6.7: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - -nodemon@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-3.0.1.tgz#affe822a2c5f21354466b2fc8ae83277d27dadc7" - integrity sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw== - dependencies: - chokidar "^3.5.2" - debug "^3.2.7" - ignore-by-default "^1.0.1" - minimatch "^3.1.2" - pstree.remy "^1.1.8" - semver "^7.5.3" - simple-update-notifier "^2.0.0" - supports-color "^5.5.0" - touch "^3.1.0" - undefsafe "^2.0.5" - -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== - dependencies: - abbrev "1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -num-sort@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/num-sort/-/num-sort-2.1.0.tgz#1cbb37aed071329fdf41151258bc011898577a9b" - integrity sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg== - -object-hash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" - integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== - -object-inspect@^1.9.0: - version "1.12.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" - integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== - -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -openai@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.4.0.tgz#dbaab326eb044ddec479951b245850c482678031" - integrity sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - digest-fetch "^1.3.0" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - -openapi-types@^12.1.3: - version "12.1.3" - resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3" - integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-queue@^6.6.2: - version "6.6.2" - resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" - integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== - dependencies: - eventemitter3 "^4.0.4" - p-timeout "^3.2.0" - -p-retry@4: - version "4.6.2" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" - integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== - dependencies: - "@types/retry" "0.12.0" - retry "^0.13.1" - -p-timeout@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" - integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== - dependencies: - p-finally "^1.0.0" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -prebuild-install@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" - integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw== - dependencies: - detect-libc "^2.0.0" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^3.3.0" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^4.0.0" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -pstree.remy@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" - integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^3.1.1, readable-stream@^3.4.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -retry@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - -safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^7.3.5, semver@^7.5.3: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" - integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== - dependencies: - decompress-response "^6.0.0" - once "^1.3.1" - simple-concat "^1.0.0" - -simple-update-notifier@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz#d70b92bdab7d6d90dfd73931195a30b6e3d7cebb" - integrity sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w== - dependencies: - semver "^7.5.3" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - -supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -tar-fs@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" - integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== - dependencies: - nopt "~1.0.10" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typescript@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" - integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== - -undefsafe@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" - integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== - -uuid@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - -web-streams-polyfill@4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz#2898486b74f5156095e473efe989dcf185047a38" - integrity sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^2.2.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" - integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== - -zod-to-json-schema@^3.20.4: - version "3.21.4" - resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.21.4.tgz#de97c5b6d4a25e9d444618486cb55c0c7fb949fd" - integrity sha512-fjUZh4nQ1s6HMccgIeE0VP4QG/YRGPmyjO9sAh890aQKPEk3nqbfUXhMFaC+Dr5KvYBm8BCyvfpZf2jY9aGSsw== - -zod@^3.21.4: - version "3.22.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b" - integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg== diff --git a/analytics-service/.dockerignore b/analytics-service/.dockerignore index 25ab276c1d..995dcad415 100644 --- a/analytics-service/.dockerignore +++ b/analytics-service/.dockerignore @@ -1,4 +1,9 @@ -node_modules -npm-debug.log -dist +.dockerignore .env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/analytics-service/Dockerfile b/analytics-service/Dockerfile index 23921497a1..6c454d4b98 100644 --- a/analytics-service/Dockerfile +++ b/analytics-service/Dockerfile @@ -1,54 +1,58 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS analyticsBuilder -WORKDIR /usr/local/analytics-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./analytics-service/package.json ./ -COPY ./analytics-service/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./analytics-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/analytics-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=analyticsBuilder /usr/local/analytics-service/yarn.lock ./ -COPY ./analytics-service/package.json ./ -COPY ./analytics-service/public ./public -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=analyticsBuilder /usr/local/analytics-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link analytics-service/package.json analytics-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link analytics-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link ./analytics-service/public ./public + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD npm start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/analytics-service/package.json b/analytics-service/package.json index 90361982d8..c7faceb7d1 100644 --- a/analytics-service/package.json +++ b/analytics-service/package.json @@ -9,13 +9,12 @@ }, "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "author": "Envision Blockchain Solutions ", "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/jwt": "^10.0.3", @@ -82,5 +81,6 @@ "start": "node dist/index.js", "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/analytics-service/src/analytics/document.service.ts b/analytics-service/src/analytics/document.service.ts index 0190a25d92..1ed09918f8 100644 --- a/analytics-service/src/analytics/document.service.ts +++ b/analytics-service/src/analytics/document.service.ts @@ -9,15 +9,15 @@ import { VCMessage, VPMessage } from '@guardian/common'; -import { AnalyticsDocument as Document } from '@entity/analytics-document'; -import { AnalyticsPolicyInstance as PolicyInstance } from '@entity/analytics-policy-instance'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsTopic as Topic } from '@entity/analytics-topic'; -import { DocumentType } from '@interfaces/document.type'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { Tasks } from '@helpers/tasks'; -import { AnalyticsUtils } from '@helpers/utils'; +import { AnalyticsDocument as Document } from '../entity/analytics-document.js'; +import { AnalyticsPolicyInstance as PolicyInstance } from '../entity/analytics-policy-instance.js'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsTopic as Topic } from '../entity/analytics-topic.js'; +import { DocumentType } from '../interfaces/document.type.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { Tasks } from '../helpers/tasks.js'; +import { AnalyticsUtils } from '../helpers/utils.js'; /** * Search documents in policy topics @@ -216,4 +216,4 @@ export class AnalyticsDocumentService { return report; } -} \ No newline at end of file +} diff --git a/analytics-service/src/analytics/policy.service.ts b/analytics-service/src/analytics/policy.service.ts index a4392a3425..ae93f0e282 100644 --- a/analytics-service/src/analytics/policy.service.ts +++ b/analytics-service/src/analytics/policy.service.ts @@ -10,19 +10,19 @@ import { TokenMessage, UrlType, } from '@guardian/common'; -import { AnalyticsModule as Module } from '@entity/analytics-module'; -import { AnalyticsPolicy as Policy } from '@entity/analytics-policy'; -import { AnalyticsPolicyInstance as PolicyInstance } from '@entity/analytics-policy-instance'; -import { AnalyticsSchema as Schema } from '@entity/analytics-schema'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsTag as Tag } from '@entity/analytics-tag'; -import { AnalyticsToken as Token } from '@entity/analytics-token'; -import { AnalyticsUser as User } from '@entity/analytics-user'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { UserType } from '@interfaces/user.type'; -import { Tasks } from '@helpers/tasks'; -import { AnalyticsUtils } from '@helpers/utils'; +import { AnalyticsModule as Module } from '../entity/analytics-module.js'; +import { AnalyticsPolicy as Policy } from '../entity/analytics-policy.js'; +import { AnalyticsPolicyInstance as PolicyInstance } from '../entity/analytics-policy-instance.js'; +import { AnalyticsSchema as Schema } from '../entity/analytics-schema.js'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsTag as Tag } from '../entity/analytics-tag.js'; +import { AnalyticsToken as Token } from '../entity/analytics-token.js'; +import { AnalyticsUser as User } from '../entity/analytics-user.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { UserType } from '../interfaces/user.type.js'; +import { Tasks } from '../helpers/tasks.js'; +import { AnalyticsUtils } from '../helpers/utils.js'; /** * Search policy\version\schemas\tokens in user topics @@ -340,4 +340,4 @@ export class AnalyticsPolicyService { return report; } -} \ No newline at end of file +} diff --git a/analytics-service/src/analytics/report.service.ts b/analytics-service/src/analytics/report.service.ts index f40cab7dfc..99105df05e 100644 --- a/analytics-service/src/analytics/report.service.ts +++ b/analytics-service/src/analytics/report.service.ts @@ -2,30 +2,30 @@ import { DataBaseHelper, Logger, MessageAction } from '@guardian/common'; import { GenerateUUIDv4 } from '@guardian/interfaces'; import JSZip from 'jszip'; import xl from 'excel4node'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsUser as User } from '@entity/analytics-user'; -import { AnalyticsPolicy as Policy } from '@entity/analytics-policy'; -import { AnalyticsPolicyInstance as PolicyInstance } from '@entity/analytics-policy-instance'; -import { AnalyticsTopicCache as TopicCache } from '@entity/analytics-topic-cache'; -import { AnalyticsDocument as Document } from '@entity/analytics-document'; -import { AnalyticsModule as Module } from '@entity/analytics-module'; -import { AnalyticsToken as Token } from '@entity/analytics-token'; -import { AnalyticsTokenCache as TokenCache } from '@entity/analytics-token-cache'; -import { AnalyticsTopic as Topic } from '@entity/analytics-topic'; -import { AnalyticsSchema as Schema } from '@entity/analytics-schema'; -import { AnalyticsTag as Tag } from '@entity/analytics-tag'; -import { AnalyticsDashboard as Dashboard } from '@entity/analytics-dashboard'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { UserType } from '@interfaces/user.type'; -import { ReportType } from '@interfaces/report.type'; -import { DocumentType } from '@interfaces/document.type'; -import { AnalyticsUtils } from '@helpers/utils'; -import { Table } from '@helpers/table'; -import { AnalyticsTokenService } from './token.service'; -import { AnalyticsDocumentService } from './document.service'; -import { AnalyticsUserService } from './user.service'; -import { AnalyticsPolicyService } from './policy.service'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsUser as User } from '../entity/analytics-user.js'; +import { AnalyticsPolicy as Policy } from '../entity/analytics-policy.js'; +import { AnalyticsPolicyInstance as PolicyInstance } from '../entity/analytics-policy-instance.js'; +import { AnalyticsTopicCache as TopicCache } from '../entity/analytics-topic-cache.js'; +import { AnalyticsDocument as Document } from '../entity/analytics-document.js'; +import { AnalyticsModule as Module } from '../entity/analytics-module.js'; +import { AnalyticsToken as Token } from '../entity/analytics-token.js'; +import { AnalyticsTokenCache as TokenCache } from '../entity/analytics-token-cache.js'; +import { AnalyticsTopic as Topic } from '../entity/analytics-topic.js'; +import { AnalyticsSchema as Schema } from '../entity/analytics-schema.js'; +import { AnalyticsTag as Tag } from '../entity/analytics-tag.js'; +import { AnalyticsDashboard as Dashboard } from '../entity/analytics-dashboard.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { UserType } from '../interfaces/user.type.js'; +import { ReportType } from '../interfaces/report.type.js'; +import { DocumentType } from '../interfaces/document.type.js'; +import { AnalyticsUtils } from '../helpers/utils.js'; +import { Table } from '../helpers/table.js'; +import { AnalyticsTokenService } from './token.service.js'; +import { AnalyticsDocumentService } from './document.service.js'; +import { AnalyticsUserService } from './user.service.js'; +import { AnalyticsPolicyService } from './policy.service.js'; import moment from 'moment'; /** diff --git a/analytics-service/src/analytics/token.service.ts b/analytics-service/src/analytics/token.service.ts index 7baf0acf78..8f43875fde 100644 --- a/analytics-service/src/analytics/token.service.ts +++ b/analytics-service/src/analytics/token.service.ts @@ -4,14 +4,14 @@ import { MessageType, TagMessage, } from '@guardian/common'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsTag as Tag } from '@entity/analytics-tag'; -import { AnalyticsToken as Token } from '@entity/analytics-token'; -import { AnalyticsTokenCache as TokenCache } from '@entity/analytics-token-cache'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { Tasks } from '@helpers/tasks'; -import { AnalyticsUtils } from '@helpers/utils'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsTag as Tag } from '../entity/analytics-tag.js'; +import { AnalyticsToken as Token } from '../entity/analytics-token.js'; +import { AnalyticsTokenCache as TokenCache } from '../entity/analytics-token-cache.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { Tasks } from '../helpers/tasks.js'; +import { AnalyticsUtils } from '../helpers/utils.js'; /** * Search tokens info @@ -205,4 +205,4 @@ export class AnalyticsTokenService { return report; } -} \ No newline at end of file +} diff --git a/analytics-service/src/analytics/user.service.ts b/analytics-service/src/analytics/user.service.ts index fa0cbb522a..7a4506361e 100644 --- a/analytics-service/src/analytics/user.service.ts +++ b/analytics-service/src/analytics/user.service.ts @@ -1,10 +1,10 @@ import { DataBaseHelper, MessageType, RegistrationMessage } from '@guardian/common'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsUser as User } from '@entity/analytics-user'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { UserType } from '@interfaces/user.type'; -import { AnalyticsUtils } from '@helpers/utils'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsUser as User } from '../entity/analytics-user.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { UserType } from '../interfaces/user.type.js'; +import { AnalyticsUtils } from '../helpers/utils.js'; /** * Search users @@ -68,4 +68,4 @@ export class AnalyticsUserService { return report; } } -} \ No newline at end of file +} diff --git a/analytics-service/src/api/analytics.ts b/analytics-service/src/api/analytics.ts index 888d810d81..8147309ab2 100644 --- a/analytics-service/src/api/analytics.ts +++ b/analytics-service/src/api/analytics.ts @@ -1,5 +1,5 @@ import { Controller, Get, HttpCode, HttpException, HttpStatus, Req, Response } from '@nestjs/common'; -import { ReportService } from '../analytics/report.service'; +import { ReportService } from '../analytics/report.service.js'; import { ApiExtraModels, ApiInternalServerErrorResponse, @@ -9,10 +9,10 @@ import { ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { ReportDTO } from '@middlewares/validation/schemas/report'; -import { DashboardDTO } from '@middlewares/validation/schemas/dashboard'; -import { DataContainerDTO } from '@middlewares/validation/schemas/report-data'; +import { InternalServerErrorDTO } from '../middlewares/validation/schemas/errors.js'; +import { ReportDTO } from '../middlewares/validation/schemas/report.js'; +import { DashboardDTO } from '../middlewares/validation/schemas/dashboard.js'; +import { DataContainerDTO } from '../middlewares/validation/schemas/report-data.js'; /** * Analytics Api @@ -332,4 +332,4 @@ export class AnalyticsApi { throw error; } } -} \ No newline at end of file +} diff --git a/analytics-service/src/app.module.ts b/analytics-service/src/app.module.ts index b760a15171..b4a28c559f 100644 --- a/analytics-service/src/app.module.ts +++ b/analytics-service/src/app.module.ts @@ -4,8 +4,8 @@ import hpp from 'hpp'; import process from 'process'; import express from 'express'; import fileUpload from 'express-fileupload'; -import { AnalyticsApi } from '@api/analytics'; -import { MetricsApi } from '@api/metrics'; +import { AnalyticsApi } from './api/analytics.js'; +import { MetricsApi } from './api/metrics.js'; const JSON_REQUEST_LIMIT = process.env.JSON_REQUEST_LIMIT || '1mb'; const RAW_REQUEST_LIMIT = process.env.RAW_REQUEST_LIMIT || '1gb'; diff --git a/analytics-service/src/app.ts b/analytics-service/src/app.ts index 2df15c52c2..d8bd3805df 100644 --- a/analytics-service/src/app.ts +++ b/analytics-service/src/app.ts @@ -13,11 +13,11 @@ import { MicroserviceOptions, Transport } from '@nestjs/microservices'; import { CronJob } from 'cron'; import express from 'express'; import process from 'process'; -import { ReportService } from './analytics/report.service'; -import { AppModule } from './app.module'; +import { ReportService } from './analytics/report.service.js'; +import { AppModule } from './app.module.js'; import { SwaggerModule } from '@nestjs/swagger'; -import { SwaggerConfig } from '@helpers/swagger-config'; -import { AnalyticsUtils } from '@helpers/utils'; +import { SwaggerConfig } from './helpers/swagger-config.js'; +import { AnalyticsUtils } from './helpers/utils.js'; const PORT = process.env.PORT || 3020; Promise.all([ diff --git a/analytics-service/src/config.ts b/analytics-service/src/config.ts index d35778e469..2fa9d83360 100644 --- a/analytics-service/src/config.ts +++ b/analytics-service/src/config.ts @@ -1,16 +1,7 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import 'reflect-metadata' import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@helpers': __dirname + '/helpers', - '@entity': __dirname + '/entity', - '@interfaces': __dirname + '/interfaces', - '@middlewares': __dirname + '/middlewares', -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.analytics.${process.env.GUARDIAN_ENV}` : './configs/.env.analytics'; diff --git a/analytics-service/src/entity/analytics-document.ts b/analytics-service/src/entity/analytics-document.ts index c051121393..9e08250989 100644 --- a/analytics-service/src/entity/analytics-document.ts +++ b/analytics-service/src/entity/analytics-document.ts @@ -1,6 +1,6 @@ import { BeforeCreate, Entity, Index, Property } from '@mikro-orm/core'; import { BaseEntity } from '@guardian/common'; -import { DocumentType } from '@interfaces/document.type'; +import { DocumentType } from '../interfaces/document.type.js'; /** * Document collection diff --git a/analytics-service/src/entity/analytics-status.ts b/analytics-service/src/entity/analytics-status.ts index 6ae8343f0a..972594de08 100644 --- a/analytics-service/src/entity/analytics-status.ts +++ b/analytics-service/src/entity/analytics-status.ts @@ -1,8 +1,8 @@ import { BeforeCreate, Entity, Property, Unique } from '@mikro-orm/core'; import { BaseEntity } from '@guardian/common'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; -import { ReportType } from '@interfaces/report.type'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; +import { ReportType } from '../interfaces/report.type.js'; /** * Report collection diff --git a/analytics-service/src/entity/analytics-user.ts b/analytics-service/src/entity/analytics-user.ts index d46053ee92..1da7f57fab 100644 --- a/analytics-service/src/entity/analytics-user.ts +++ b/analytics-service/src/entity/analytics-user.ts @@ -1,6 +1,6 @@ import { Entity, Property, Index } from '@mikro-orm/core'; import { BaseEntity } from '@guardian/common'; -import { UserType } from '@interfaces/user.type'; +import { UserType } from '../interfaces/user.type.js'; /** * StandardRegistry collection diff --git a/analytics-service/src/helpers/utils.ts b/analytics-service/src/helpers/utils.ts index 9ff3bd9fab..fef84782e2 100644 --- a/analytics-service/src/helpers/utils.ts +++ b/analytics-service/src/helpers/utils.ts @@ -1,9 +1,9 @@ import { DataBaseHelper, Workers } from '@guardian/common'; import { WorkerTaskType } from '@guardian/interfaces'; -import { AnalyticsStatus as Status } from '@entity/analytics-status'; -import { AnalyticsTopicCache as TopicCache } from '@entity/analytics-topic-cache'; -import { ReportStatus } from '@interfaces/report-status.type'; -import { ReportSteep } from '@interfaces/report-steep.type'; +import { AnalyticsStatus as Status } from '../entity/analytics-status.js'; +import { AnalyticsTopicCache as TopicCache } from '../entity/analytics-topic-cache.js'; +import { ReportStatus } from '../interfaces/report-status.type.js'; +import { ReportSteep } from '../interfaces/report-steep.type.js'; class Counter { private count: number; diff --git a/analytics-service/src/index.ts b/analytics-service/src/index.ts index 11b146661a..dae6021377 100644 --- a/analytics-service/src/index.ts +++ b/analytics-service/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/analytics-service/tsconfig.json b/analytics-service/tsconfig.json index f49b3fcd48..7299b36831 100644 --- a/analytics-service/tsconfig.json +++ b/analytics-service/tsconfig.json @@ -12,7 +12,7 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", "paths": { @@ -32,7 +32,7 @@ "middlewares/*" ] }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", @@ -42,4 +42,4 @@ "include": [ "src/**/*" ] -} \ No newline at end of file +} diff --git a/analytics-service/tsconfig.production.json b/analytics-service/tsconfig.production.json index e0a298ce41..861119fd8f 100644 --- a/analytics-service/tsconfig.production.json +++ b/analytics-service/tsconfig.production.json @@ -12,7 +12,7 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", "paths": { @@ -32,7 +32,7 @@ "middlewares/*" ] }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", @@ -42,4 +42,4 @@ "include": [ "src/**/*" ] -} \ No newline at end of file +} diff --git a/api-gateway/.dockerignore b/api-gateway/.dockerignore index 25ab276c1d..57c7a935a9 100644 --- a/api-gateway/.dockerignore +++ b/api-gateway/.dockerignore @@ -1,4 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile node_modules npm-debug.log -dist -.env diff --git a/api-gateway/Dockerfile b/api-gateway/Dockerfile index f07e384fb4..937d56dde3 100644 --- a/api-gateway/Dockerfile +++ b/api-gateway/Dockerfile @@ -1,55 +1,57 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS apiGatewayBuilder -WORKDIR /usr/local/api-gateway -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./api-gateway/package.json ./ -COPY ./api-gateway/tsconfig*.json ./ -COPY ./api-gateway/Gulpfile.js ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./api-gateway/environments ./environments/. -ADD ./api-gateway/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/api-gateway -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=apiGatewayBuilder /usr/local/api-gateway/yarn.lock ./ -COPY ./api-gateway/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=apiGatewayBuilder /usr/local/api-gateway/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link api-gateway/package.json api-gateway/tsconfig*.json api-gateway/Gulpfile.mjs yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ +COPY --link api-gateway/environments environments/ +COPY --link api-gateway/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD npm start +CMD [ "node", "dist/index.js" ] diff --git a/api-gateway/Dockerfile.demo b/api-gateway/Dockerfile.demo index 2745ae4776..be27d1c868 100644 --- a/api-gateway/Dockerfile.demo +++ b/api-gateway/Dockerfile.demo @@ -1,55 +1,57 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS apiGatewayBuilder -WORKDIR /usr/local/api-gateway -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./api-gateway/package.json ./ -COPY ./api-gateway/tsconfig*.json ./ -COPY ./api-gateway/Gulpfile.js ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./api-gateway/environments ./environments/. -ADD ./api-gateway/src ./src/. -RUN yarn run build:demo - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/api-gateway -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=apiGatewayBuilder /usr/local/api-gateway/yarn.lock ./ -COPY ./api-gateway/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=apiGatewayBuilder /usr/local/api-gateway/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link api-gateway/package.json api-gateway/tsconfig*.json api-gateway/Gulpfile.mjs yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ +COPY --link api-gateway/environments environments/ +COPY --link api-gateway/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:demo + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD npm start +CMD [ "node", "dist/index.js" ] diff --git a/api-gateway/Gulpfile.js b/api-gateway/Gulpfile.mjs similarity index 88% rename from api-gateway/Gulpfile.js rename to api-gateway/Gulpfile.mjs index 4be1d2ab2c..bc72367a0b 100644 --- a/api-gateway/Gulpfile.js +++ b/api-gateway/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { return gulp diff --git a/api-gateway/configs/.env.gateway b/api-gateway/configs/.env.gateway index 8fdf749ca3..da59ece3f7 100644 --- a/api-gateway/configs/.env.gateway +++ b/api-gateway/configs/.env.gateway @@ -13,3 +13,7 @@ MQ_MAX_PAYLOAD="1048576" #MQ_MESSAGE_CHUNK=5000000 #RAW_REQUEST_LIMIT="1gb" #JSON_REQUEST_LIMIT="1mb" + +#CACHE +HOST_CACHE='localhost' +PORT_CACHE='6379' diff --git a/api-gateway/configs/.env.gateway.develop b/api-gateway/configs/.env.gateway.develop index 941727be0e..0171a49166 100644 --- a/api-gateway/configs/.env.gateway.develop +++ b/api-gateway/configs/.env.gateway.develop @@ -13,3 +13,7 @@ MQ_MAX_PAYLOAD="1048576" #MQ_MESSAGE_CHUNK=5000000 #RAW_REQUEST_LIMIT="1gb" #JSON_REQUEST_LIMIT="1mb" + +#CACHE +HOST_CACHE='localhost' +PORT_CACHE='6379' diff --git a/api-gateway/configs/.env.gateway.template b/api-gateway/configs/.env.gateway.template index f435d680f7..24697962cf 100644 --- a/api-gateway/configs/.env.gateway.template +++ b/api-gateway/configs/.env.gateway.template @@ -13,3 +13,7 @@ MQ_MAX_PAYLOAD="" #MQ_MESSAGE_CHUNK=5000000 #RAW_REQUEST_LIMIT="1gb" #JSON_REQUEST_LIMIT="1mb" + +#CACHE +HOST_CACHE='' +PORT_CACHE='' diff --git a/api-gateway/package.json b/api-gateway/package.json index d483125c98..aec735f371 100644 --- a/api-gateway/package.json +++ b/api-gateway/package.json @@ -1,20 +1,13 @@ { "packageManager": "yarn@1.22.21", - "_moduleAliases": { - "@api": "dist/api", - "@helpers": "dist/helpers", - "@auth": "dist/auth", - "@subscribers": "dist/subscribers" - }, "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "author": "Envision Blockchain Solutions ", "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/jwt": "^10.0.3", @@ -36,16 +29,17 @@ "gulp-typescript": "^6.0.0-alpha.1", "hpp": "^0.2.3", "http-errors": "^2.0.0", + "ioredis": "^5.3.2", "jsonwebtoken": "^8.5.1", "jszip": "^3.7.1", "module-alias": "^2.2.2", "prom-client": "^14.1.1", "prometheus-api-metrics": "3.2.2", "reflect-metadata": "^0.1.13", + "rxjs": "^7.8.1", "ws": "^8.2.1", "yaml": "^2.3.1", - "yup": "^1.1.1", - "rxjs": "^7.8.1" + "yup": "^1.1.1" }, "description": "", "devDependencies": { @@ -83,5 +77,6 @@ "start": "node dist/index.js", "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/api-gateway/src/api/service/account.ts b/api-gateway/src/api/service/account.ts index 87c31665dc..b7da1f3d82 100644 --- a/api-gateway/src/api/service/account.ts +++ b/api-gateway/src/api/service/account.ts @@ -1,17 +1,19 @@ -import { Users } from '@helpers/users'; +import { Users } from '../../helpers/users.js'; import { IAuthUser, Logger, NotificationHelper } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { SchemaEntity, UserRole } from '@guardian/interfaces'; -import { PolicyEngine } from '@helpers/policy-engine'; -import { PolicyListResponse } from '@entities/policy'; -import { StandardRegistryAccountResponse } from '@entities/account'; +import { PolicyEngine } from '../../helpers/policy-engine.js'; +import { PolicyListResponse } from '../../entities/policy.js'; +import { StandardRegistryAccountResponse } from '../../entities/account.js'; import { ClientProxy } from '@nestjs/microservices'; import { Body, Controller, Get, Headers, HttpCode, HttpException, HttpStatus, Inject, Post, Req } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; -import { AccountsResponseDTO, AccountsSessionResponseDTO, AggregatedDTOItem, BalanceResponseDTO, LoginUserDTO, RegisterUserDTO } from '@middlewares/validation/schemas/accounts'; +import { checkPermission } from '../../auth/authorization-helper.js'; +import { AccountsResponseDTO, AccountsSessionResponseDTO, AggregatedDTOItem, BalanceResponseDTO, LoginUserDTO, RegisterUserDTO } from '../../middlewares/validation/schemas/accounts.js'; import { ApiBearerAuth, ApiExtraModels, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { ApplicationEnvironment } from '../../environment'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { ApplicationEnvironment } from '../../environment.js'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; /** * User account route @@ -20,8 +22,8 @@ import { ApplicationEnvironment } from '../../environment'; @ApiTags('accounts') export class AccountApi { - constructor(@Inject('GUARDIANS') public readonly client: ClientProxy) { - } + constructor(@Inject('GUARDIANS') public readonly client: ClientProxy) { + } /** * getSession @@ -46,6 +48,7 @@ export class AccountApi { @ApiBearerAuth() @HttpCode(HttpStatus.OK) @Get('/session') + @UseCache() async getSession(@Headers() headers: { [key: string]: string }): Promise { const users = new Users(); try { @@ -57,7 +60,6 @@ export class AccountApi { return null; // throw new HttpException(error.message, HttpStatus.UNAUTHORIZED); } - } /** @@ -223,6 +225,7 @@ export class AccountApi { // @UseGuards(AuthGuard) @HttpCode(HttpStatus.OK) @Get() + @UseCache() async getAllAccounts(@Req() req): Promise { // await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); const authHeader = req.headers.authorization; @@ -276,6 +279,7 @@ export class AccountApi { }) @Get('/standard-registries') @HttpCode(HttpStatus.OK) + @UseCache() async getStandatdRegistries(@Req() req): Promise { const authHeader = req.headers.authorization; const token = authHeader?.split(' ')[1]; @@ -334,6 +338,7 @@ export class AccountApi { }) @Get('/standard-registries/aggregated') @HttpCode(HttpStatus.OK) + @UseCache() async getAggregatedStandardRegistries(): Promise { const engineService = new PolicyEngine(); const guardians = new Guardians(); @@ -369,6 +374,9 @@ export class AccountApi { } } + /** + * @param headers + */ @ApiOperation({ summary: 'Returns user\'s Hedera account balance.', description: 'Requests current Hedera account balance.' @@ -395,6 +403,7 @@ export class AccountApi { }) @Get('/balance') @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.SHORT_TTL }) async getBalance(@Headers() headers): Promise { try { const authHeader = headers.authorization; diff --git a/api-gateway/src/api/service/ai-suggestions.ts b/api-gateway/src/api/service/ai-suggestions.ts index 5b5e98bfcd..77b7c62c88 100644 --- a/api-gateway/src/api/service/ai-suggestions.ts +++ b/api-gateway/src/api/service/ai-suggestions.ts @@ -2,9 +2,9 @@ import { Logger } from '@guardian/common'; import { ClientProxy } from '@nestjs/microservices'; import { Controller, Get, HttpCode, HttpStatus, Inject, Put, Req } from '@nestjs/common'; import { ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { AISuggestions } from '@helpers/ai-suggestions'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas'; +import { AISuggestions } from '../../helpers/ai-suggestions.js'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/index.js'; /** * AI suggestions route diff --git a/api-gateway/src/api/service/analytics.ts b/api-gateway/src/api/service/analytics.ts index c65f90e36b..7aee58253f 100644 --- a/api-gateway/src/api/service/analytics.ts +++ b/api-gateway/src/api/service/analytics.ts @@ -1,4 +1,4 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Body, Controller, HttpCode, HttpException, HttpStatus, Post, Req } from '@nestjs/common'; import { ApiInternalServerErrorResponse, @@ -10,7 +10,7 @@ import { ApiSecurity, ApiTags } from '@nestjs/swagger'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { UserRole } from '@guardian/interfaces'; import { FilterDocumentsDTO, @@ -26,7 +26,7 @@ import { SearchPoliciesDTO, FilterToolsDTO, CompareToolsDTO -} from '@middlewares/validation/schemas'; +} from '../../middlewares/validation/schemas/index.js'; const ONLY_SR = ' Only users with the Standard Registry role are allowed to make the request.' diff --git a/api-gateway/src/api/service/artifact.ts b/api-gateway/src/api/service/artifact.ts index d08d8bbfed..118a2b6344 100644 --- a/api-gateway/src/api/service/artifact.ts +++ b/api-gateway/src/api/service/artifact.ts @@ -1,8 +1,20 @@ import { UserRole } from '@guardian/interfaces'; import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; -import { Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Post, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { Guardians } from '../../helpers/guardians.js'; +import { + Controller, + Delete, + Get, + HttpCode, + HttpException, + HttpStatus, + Post, + Req, + Response, + UploadedFiles, + UseInterceptors, +} from '@nestjs/common'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiExtraModels, ApiInternalServerErrorResponse, @@ -12,12 +24,15 @@ import { ApiTags, ApiUnauthorizedResponse, ApiForbiddenResponse, - getSchemaPath + getSchemaPath, + ApiBody, + ApiConsumes } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator'; -import { ArtifactDTOItem } from '@middlewares/validation/schemas/artifacts'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator.js'; +import { ArtifactDTOItem } from '../../middlewares/validation/schemas/artifacts.js'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { FilesInterceptor } from '@nestjs/platform-express'; @Controller('artifacts') @ApiTags('artifacts') @@ -127,6 +142,23 @@ export class ArtifactApi { required: true, example: '000000000000000000000001' }) + @ApiConsumes('multipart/form-data') + @ApiBody({ + description: 'Form data with artifacts.', + required: true, + schema: { + type: 'array', + items: { + type: 'object', + properties: { + 'artifacts': { + type: 'string', + format: 'binary', + } + } + } + } + }) @ApiOkResponse({ description: 'Successful operation.', schema: { @@ -149,26 +181,25 @@ export class ArtifactApi { } }) @ApiExtraModels(ArtifactDTOItem, InternalServerErrorDTO) + @UseInterceptors(FilesInterceptor('artifacts')) @HttpCode(HttpStatus.CREATED) - async uploadArtifacts(@Req() req, @Response() res): Promise { + async uploadArtifacts(@Req() req, @UploadedFiles() files): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { - const files = req.files; if (!files) { throw new HttpException('There are no files to upload', HttpStatus.UNPROCESSABLE_ENTITY) } const owner = req.user.did; const parentId = req.params.parentId; const uploadedArtifacts = []; - const artifacts = Array.isArray(files.artifacts) ? files.artifacts : [files.artifacts]; const guardian = new Guardians(); - for (const artifact of artifacts) { + for (const artifact of files) { if (artifact) { const result = await guardian.uploadArtifact(artifact, owner, parentId); uploadedArtifacts.push(result); } } - return res.status(201).json(uploadedArtifacts); + return uploadedArtifacts; } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error; diff --git a/api-gateway/src/api/service/branding.ts b/api-gateway/src/api/service/branding.ts index bfaa303c4d..3b8d6642ca 100644 --- a/api-gateway/src/api/service/branding.ts +++ b/api-gateway/src/api/service/branding.ts @@ -1,9 +1,10 @@ import { Body, Controller, Get, HttpCode, HttpStatus, Post } from '@nestjs/common'; import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { ApiTags } from '@nestjs/swagger'; -import { Auth } from '@auth/auth.decorator'; +import { Auth } from '../../auth/auth.decorator.js'; import { UserRole } from '@guardian/interfaces'; +import { UseCache } from '../../helpers/decorators/cache.js'; /** * Branding route @@ -39,23 +40,23 @@ export class BrandingApi{ termsAndConditions }; - const guardians = new Guardians(); - await guardians.setBranding(JSON.stringify(data)); + const guardians = new Guardians(); + await guardians.setBranding(JSON.stringify(data)); } catch (error) { - new Logger().error(error, ['API_GATEWAY']); - throw error; + new Logger().error(error, ['API_GATEWAY']); + throw error; } return; } @Get('/') + @UseCache() async getBranding(): Promise { try { const guardians = new Guardians(); const brandingDataString = await guardians.getBranding(); - const brandingData = JSON.parse(brandingDataString.config); - return brandingData; + return JSON.parse(brandingDataString.config); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error; diff --git a/api-gateway/src/api/service/contract.ts b/api-gateway/src/api/service/contract.ts index 22d49d4cf9..e5317b459f 100644 --- a/api-gateway/src/api/service/contract.ts +++ b/api-gateway/src/api/service/contract.ts @@ -1,18 +1,18 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { ContractType, UserRole } from '@guardian/interfaces'; import { Logger } from '@guardian/common'; import { - Controller, - Delete, - Get, - HttpCode, - HttpException, - HttpStatus, - Post, - Req, - Response, + Controller, + Delete, + Get, + HttpCode, + HttpException, + HttpStatus, + Post, + Req, + Response, } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiInternalServerErrorResponse, ApiOkResponse, @@ -27,7 +27,7 @@ import { ApiQuery, ApiParam, } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; import { ContractDTO, RetirePoolDTO, @@ -35,7 +35,8 @@ import { RetireRequestDTO, RetireRequestTokenDTO, WiperRequestDTO, -} from '@middlewares/validation/schemas/contracts'; +} from '../../middlewares/validation/schemas/contracts.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; /** * Contracts api @@ -229,6 +230,9 @@ export class ContractsApi { } } + /** + * @param req + */ @Get('/:contractId/permissions') @ApiBearerAuth() @ApiExtraModels(InternalServerErrorDTO) @@ -259,6 +263,7 @@ export class ContractsApi { type: InternalServerErrorDTO, }) @HttpCode(HttpStatus.OK) + @UseCache() async contractPermissions(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { @@ -329,6 +334,10 @@ export class ContractsApi { //#endregion //#region Wipe contract endpoints + /** + * @param req + * @param res + */ @Get('/wipe/requests') @ApiBearerAuth() @ApiExtraModels(ContractDTO, InternalServerErrorDTO) @@ -383,6 +392,7 @@ export class ContractsApi { type: InternalServerErrorDTO, }) @HttpCode(HttpStatus.OK) + // @UseCache({ isExpress: true }) async getWipeRequests(@Req() req, @Response() res): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { @@ -394,6 +404,7 @@ export class ContractsApi { req.query.pageIndex as any, req.query.pageSize as any ); + res.locals.data = contracts return res.setHeader('X-Total-Count', count).json(contracts); } catch (error) { new Logger().error(error, ['API_GATEWAY']); @@ -1048,6 +1059,10 @@ export class ContractsApi { } } + /** + * @param req + * @param res + */ @Get('/retire/requests') @ApiBearerAuth() @ApiExtraModels(RetireRequestDTO, InternalServerErrorDTO) @@ -1101,6 +1116,7 @@ export class ContractsApi { type: InternalServerErrorDTO, }) @HttpCode(HttpStatus.OK) + // @UseCache({ isExpress: true }) async getRetireRequests(@Req() req, @Response() res): Promise { await checkPermission( UserRole.STANDARD_REGISTRY, @@ -1115,6 +1131,7 @@ export class ContractsApi { req.query.pageIndex as any, req.query.pageSize as any ); + res.locals.data = contracts return res.setHeader('X-Total-Count', count).json(contracts); } catch (error) { new Logger().error(error, ['API_GATEWAY']); @@ -1125,6 +1142,10 @@ export class ContractsApi { } } + /** + * @param req + * @param res + */ @Get('/retire/pools') @ApiBearerAuth() @ApiExtraModels(RetirePoolDTO, InternalServerErrorDTO) @@ -1185,6 +1206,7 @@ export class ContractsApi { type: InternalServerErrorDTO, }) @HttpCode(HttpStatus.OK) + // @UseCache({ isExpress: true }) async getRetirePools(@Req() req, @Response() res): Promise { await checkPermission( UserRole.STANDARD_REGISTRY, @@ -1200,6 +1222,7 @@ export class ContractsApi { req.query.pageIndex as any, req.query.pageSize as any ); + res.locals.data = contracts return res.setHeader('X-Total-Count', count).json(contracts); } catch (error) { new Logger().error(error, ['API_GATEWAY']); @@ -1721,6 +1744,10 @@ export class ContractsApi { } } + /** + * @param req + * @param res + */ @Get('/retire') @ApiBearerAuth() @ApiExtraModels(RetirePoolDTO, InternalServerErrorDTO) @@ -1767,6 +1794,7 @@ export class ContractsApi { type: InternalServerErrorDTO, }) @HttpCode(HttpStatus.OK) + // @UseCache({ isExpress: true }) async getRetireVCs(@Req() req, @Response() res): Promise { await checkPermission( UserRole.STANDARD_REGISTRY, @@ -1780,6 +1808,7 @@ export class ContractsApi { req.query.pageIndex as any, req.query.pageSize as any ); + res.locals.data = vcs return res.setHeader('X-Total-Count', count).json(vcs); } catch (error) { new Logger().error(error, ['API_GATEWAY']); diff --git a/api-gateway/src/api/service/demo.ts b/api-gateway/src/api/service/demo.ts index 9ae9381241..81c584950a 100644 --- a/api-gateway/src/api/service/demo.ts +++ b/api-gateway/src/api/service/demo.ts @@ -1,14 +1,15 @@ -import { Guardians } from '@helpers/guardians'; -import { Users } from '@helpers/users'; +import { Guardians } from '../../helpers/guardians.js'; +import { Users } from '../../helpers/users.js'; import { Logger, RunFunctionAsync } from '@guardian/common'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; import { Controller, Get, HttpCode, HttpException, HttpStatus } from '@nestjs/common'; import { ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; import { TaskAction, UserRole } from '@guardian/interfaces'; -import { RegisteredUsersDTO } from '@middlewares/validation/schemas'; -import { AuthUser } from '@auth/authorization-helper'; -import { Auth } from '@auth/auth.decorator'; +import { RegisteredUsersDTO } from '../../middlewares/validation/schemas/index.js'; +import { AuthUser } from '../../auth/authorization-helper.js'; +import { Auth } from '../../auth/auth.decorator.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('demo') @ApiTags('demo') @@ -26,6 +27,7 @@ export class DemoApi { }) @Get('/registered-users') @HttpCode(HttpStatus.OK) + @UseCache() async registeredUsers(): Promise { const users = new Users(); const guardians = new Guardians(); diff --git a/api-gateway/src/api/service/external.ts b/api-gateway/src/api/service/external.ts index ea95ff5307..be1e952428 100644 --- a/api-gateway/src/api/service/external.ts +++ b/api-gateway/src/api/service/external.ts @@ -1,8 +1,8 @@ -import { PolicyEngine } from '@helpers/policy-engine'; +import { PolicyEngine } from '../../helpers/policy-engine.js'; import { Logger } from '@guardian/common'; import { Controller, HttpCode, HttpStatus, Post, Req, Response } from '@nestjs/common'; import { ApiBody, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; @Controller('external') @ApiTags('external') diff --git a/api-gateway/src/api/service/ipfs.ts b/api-gateway/src/api/service/ipfs.ts index e91ba0eb88..bc78b0ba5a 100644 --- a/api-gateway/src/api/service/ipfs.ts +++ b/api-gateway/src/api/service/ipfs.ts @@ -1,9 +1,11 @@ import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Body, Controller, Get, HttpCode, HttpException, HttpStatus, Param, Post, Req, Response } from '@nestjs/common'; import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger'; -import { Auth } from '@auth/auth.decorator'; +import { Auth } from '../../auth/auth.decorator.js'; import { UserRole } from '@guardian/interfaces'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('ipfs') @ApiTags('ipfs') @@ -38,6 +40,10 @@ export class IpfsApi { } } + /** + * @param body + * @param policyId + */ @ApiOperation({ summary: 'Add file from ipfs for dry run mode.', description: 'Add file from ipfs for dry run mode.', @@ -65,6 +71,10 @@ export class IpfsApi { } } + /** + * @param req + * @param res + */ @ApiOperation({ summary: 'Get file from ipfs.', description: 'Get file from ipfs.', @@ -72,6 +82,7 @@ export class IpfsApi { @ApiSecurity('bearerAuth') @Get('/file/:cid') @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.LONG_TTL, isExpress: true }) async getFile(@Req() req, @Response() res): Promise { if (!req.user) { throw new HttpException('Unauthorized', HttpStatus.UNAUTHORIZED); @@ -94,6 +105,10 @@ export class IpfsApi { } } + /** + * @param cid + * @param res + */ @ApiOperation({ summary: 'Get file from ipfs for dry run mode.', description: 'Get file from ipfs for dry run mode.', @@ -105,6 +120,7 @@ export class IpfsApi { ) @Get('/file/:cid/dry-run') @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.LONG_TTL, isExpress: true }) async getFileDryRun(@Param('cid') cid: string, @Response() res): Promise { try { const guardians = new Guardians(); diff --git a/api-gateway/src/api/service/logger.ts b/api-gateway/src/api/service/logger.ts index da6a41e994..3b13125e9a 100644 --- a/api-gateway/src/api/service/logger.ts +++ b/api-gateway/src/api/service/logger.ts @@ -2,9 +2,10 @@ import { IPageParameters, MessageAPI, UserRole } from '@guardian/interfaces'; import { Logger } from '@guardian/common'; import { Controller, Get, HttpCode, HttpStatus, Inject, Injectable, Post, Req, Response } from '@nestjs/common'; import { ClientProxy } from '@nestjs/microservices'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiTags } from '@nestjs/swagger'; import axios from 'axios'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Injectable() export class LoggerService { @@ -78,16 +79,19 @@ export class LoggerApi { } } + /** + * @param req + */ @Get('attributes') @HttpCode(HttpStatus.OK) - async getAttributes(@Req() req, @Response() res): Promise { + @UseCache() + async getAttributes(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { if (req.query.existingAttributes && !Array.isArray(req.query.existingAttributes)) { req.query.existingAttributes = [req.query.existingAttributes as string]; } - const attributes = await this.loggerService.getAttributes(escapeRegExp(req.query.name as string), req.query.existingAttributes as string[]); - return res.send(attributes); + return await this.loggerService.getAttributes(escapeRegExp(req.query.name as string), req.query.existingAttributes as string[]); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error; diff --git a/api-gateway/src/api/service/map.ts b/api-gateway/src/api/service/map.ts index 588dfe8603..ceece1cbb1 100644 --- a/api-gateway/src/api/service/map.ts +++ b/api-gateway/src/api/service/map.ts @@ -1,12 +1,15 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Controller, Get, HttpCode, HttpStatus } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('map') @ApiTags('map') export class MapApi { @Get('/key') @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.LONG_TTL }) async getKey() { const guardians = new Guardians(); return await guardians.getMapApiKey(); @@ -14,6 +17,7 @@ export class MapApi { @Get('/sh') @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.LONG_TTL }) async getSentinelKey() { const guardians = new Guardians(); return await guardians.getSentinelApiKey(); diff --git a/api-gateway/src/api/service/module.ts b/api-gateway/src/api/service/module.ts index ab49cf7b2c..2b416f440d 100644 --- a/api-gateway/src/api/service/module.ts +++ b/api-gateway/src/api/service/module.ts @@ -1,12 +1,13 @@ import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Post, Put, Query, Req, Res, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { SchemaCategory, SchemaHelper, UserRole } from '@guardian/interfaces'; import { ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator'; -import { SchemaUtils } from '@helpers/schema-utils'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator.js'; +import { SchemaUtils } from '../../helpers/schema-utils.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('modules') @ApiTags('modules') @@ -144,8 +145,16 @@ export class ModulesApi { } } + /** + * @param req + * @param res + * @param pageIndex + * @param pageSize + * @param topicId + */ @Get('/schemas') @HttpCode(HttpStatus.OK) + @UseCache({ isExpress: true }) async getModuleSchemas( @Req() req, @Res() res, @@ -169,6 +178,7 @@ export class ModulesApi { items.forEach((s) => { s.readonly = s.readonly || s.owner !== owner }); + res.locals.data = SchemaUtils.toOld(items) return res .setHeader('X-Total-Count', count) .json(SchemaUtils.toOld(items)); @@ -233,6 +243,9 @@ export class ModulesApi { } } + /** + * @param req + */ @ApiOperation({ summary: 'Return a list of modules.', description: 'Returns modules menu. Only users with the Standard Registry and Installer role are allowed to make the request.' @@ -257,18 +270,22 @@ export class ModulesApi { }) @Get('/menu') @HttpCode(HttpStatus.OK) - async getMenu(@Req() req, @Response() res): Promise { + @UseCache() + async getMenu(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { const guardians = new Guardians(); - const items = await guardians.getMenuModule(req.user.did); - return res.json(items); + return await guardians.getMenuModule(req.user.did); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); } } + /** + * @param req + * @param res + */ @ApiOperation({ summary: 'Retrieves module configuration.', description: 'Retrieves module configuration for the specified module ID. Only users with the Standard Registry role are allowed to make the request.' diff --git a/api-gateway/src/api/service/notifications.ts b/api-gateway/src/api/service/notifications.ts index 6b4d2b0e45..1ffa720cc7 100644 --- a/api-gateway/src/api/service/notifications.ts +++ b/api-gateway/src/api/service/notifications.ts @@ -1,7 +1,7 @@ -import { AuthGuard } from '@auth/auth-guard'; +import { AuthGuard } from '../../auth/auth-guard.js'; import { Logger, NotificationService } from '@guardian/common'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { NotificationDTO, ProgressDTO, } from '@middlewares/validation/schemas/notifications'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { NotificationDTO, ProgressDTO, } from '../../middlewares/validation/schemas/notifications.js'; import { Controller, Delete, Get, HttpCode, HttpStatus, Post, Req, Response, UseGuards, } from '@nestjs/common'; import { ApiBearerAuth, ApiExtraModels, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiParam, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath, } from '@nestjs/swagger'; diff --git a/api-gateway/src/api/service/policy.ts b/api-gateway/src/api/service/policy.ts index 7e32804ad5..f944502d75 100644 --- a/api-gateway/src/api/service/policy.ts +++ b/api-gateway/src/api/service/policy.ts @@ -1,18 +1,21 @@ -import { Auth } from '@auth/auth.decorator'; -import { AuthUser, checkPermission } from '@auth/authorization-helper'; +import { Auth } from '../../auth/auth.decorator.js'; +import { AuthUser, checkPermission } from '../../auth/authorization-helper.js'; import { IAuthUser, Logger, RunFunctionAsync } from '@guardian/common'; import { DocumentType, PolicyType, TaskAction, UserRole } from '@guardian/interfaces'; -import { PolicyEngine } from '@helpers/policy-engine'; -import { ProjectService } from '@helpers/projects'; -import { ServiceError } from '@helpers/service-requests-base'; -import { TaskManager } from '@helpers/task-manager'; -import { Users } from '@helpers/users'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { MigrationConfigDTO, PolicyCategoryDTO } from '@middlewares/validation/schemas/policies'; -import { Body, Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Param, Post, Put, Query, Req, Response } from '@nestjs/common'; -import { ApiAcceptedResponse, ApiBody, ApiExtraModels, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiParam, ApiQuery, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath } from '@nestjs/swagger'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; -import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator'; +import { PolicyEngine } from '../../helpers/policy-engine.js'; +import { ProjectService } from '../../helpers/projects.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { Users } from '../../helpers/users.js'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { MigrationConfigDTO, PolicyCategoryDTO, } from '../../middlewares/validation/schemas/policies.js'; +import { Body, Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Param, Post, Put, Query, Req, Response, UploadedFiles, UseInterceptors, } from '@nestjs/common'; +import { AnyFilesInterceptor } from '@nestjs/platform-express'; +import { ApiAcceptedResponse, ApiBody, ApiConsumes, ApiExtraModels, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiParam, ApiQuery, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath, } from '@nestjs/swagger'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator.js'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; const ONLY_SR = ' Only users with the Standard Registry role are allowed to make the request.' @@ -626,6 +629,10 @@ export class PolicyApi { } } + /** + * use cache test dry run + * @param req + */ @ApiOperation({ summary: 'Returns a policy navigation.', description: 'Returns a policy navigation.', @@ -646,17 +653,22 @@ export class PolicyApi { @ApiSecurity('bearerAuth') @Get('/:policyId/navigation') @HttpCode(HttpStatus.OK) - async getPolicyNavigation(@Req() req, @Response() res): Promise { + @UseCache() + async getPolicyNavigation(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY, UserRole.USER)(req.user); const engineService = new PolicyEngine(); try { - return res.send(await engineService.getNavigation(req.user, req.params.policyId)); + return await engineService.getNavigation(req.user, req.params.policyId); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); } } + /** + * use cache need test + * @param req + */ @ApiOperation({ summary: 'Returns a list of groups the user is a member of.', description: 'Returns a list of groups the user is a member of.', @@ -677,11 +689,12 @@ export class PolicyApi { @ApiSecurity('bearerAuth') @Get('/:policyId/groups') @HttpCode(HttpStatus.OK) - async getPolicyGroups(@Req() req, @Response() res): Promise { + // @UseCache() + async getPolicyGroups(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY, UserRole.USER)(req.user); const engineService = new PolicyEngine(); try { - return res.send(await engineService.getGroups(req.user, req.params.policyId)); + return await engineService.getGroups(req.user, req.params.policyId); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); @@ -761,6 +774,253 @@ export class PolicyApi { } } + @ApiOperation({ + summary: 'Get policy data.', + description: 'Get policy data.' + ONLY_SR, + }) + @ApiExtraModels(InternalServerErrorDTO) + @ApiParam({ + description: 'Policy identifier.', + name: 'policyId', + required: true + }) + @ApiSecurity('bearerAuth') + @ApiOkResponse({ + description: 'Policy data.', + schema: { + type: 'string', + format: 'binary' + } + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @ApiSecurity('bearerAuth') + @Get('/:policyId/data') + @HttpCode(HttpStatus.OK) + async downloadPolicyData(@Req() req, @Response() res): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const engineService = new PolicyEngine(); + try { + const policy = await engineService.getPolicy({ + userDid: req.user.did, + filters: req.params.policyId, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + const downloadResult = await engineService.downloadPolicyData( + req.params.policyId, + req.user.did + ); + res.setHeader( + 'Content-Disposition', + `attachment; filename=${policy.name}.data` + ); + res.setHeader('Content-Type', 'application/policy-data'); + return res.send(downloadResult); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + + @ApiOperation({ + summary: 'Upload policy data.', + description: 'Upload policy data.' + ONLY_SR, + }) + @ApiExtraModels(InternalServerErrorDTO) + @ApiSecurity('bearerAuth') + @ApiBody({ + description: 'Policy data file', + schema: { + type: 'string', + format: 'binary' + } + }) + @ApiOkResponse({ + description: 'Uploaded policy.', + schema: { + type: 'object' + } + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @ApiSecurity('bearerAuth') + @Post('/data') + @HttpCode(HttpStatus.OK) + async uploadPolicyData(@Req() req): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const engineService = new PolicyEngine(); + try { + return await engineService.uploadPolicyData(req.user.did, req.body); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + + @ApiOperation({ + summary: 'Get policy tag block map.', + description: 'Get policy tag block map.' + ONLY_SR, + }) + @ApiExtraModels(InternalServerErrorDTO) + @ApiParam({ + description: 'Policy identifier.', + name: 'policyId', + required: true + }) + @ApiSecurity('bearerAuth') + @ApiOkResponse({ + description: 'Policy tag block map.', + schema: { + type: 'object' + } + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @ApiSecurity('bearerAuth') + @Get('/:policyId/tag-block-map') + @HttpCode(HttpStatus.OK) + async getTagBlockMap(@Req() req): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const engineService = new PolicyEngine(); + try { + return await engineService.getTagBlockMap( + req.params.policyId, + req.user.did + ); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + + @ApiOperation({ + summary: 'Get policy virtual keys.', + description: 'Get policy virtual keys.' + ONLY_SR, + }) + @ApiExtraModels(InternalServerErrorDTO) + @ApiParam({ + description: 'Policy identifier.', + name: 'policyId', + required: true + }) + @ApiSecurity('bearerAuth') + @ApiOkResponse({ + description: 'Policy virtual keys.', + schema: { + type: 'string', + format: 'binary' + } + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @ApiSecurity('bearerAuth') + @Get('/:policyId/virtual-keys') + @HttpCode(HttpStatus.OK) + async downloadVirtualKeys(@Req() req, @Response() res): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const engineService = new PolicyEngine(); + try { + const policy = await engineService.getPolicy({ + userDid: req.user.did, + filters: req.params.policyId, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + const downloadResult = await engineService.downloadVirtualKeys( + req.params.policyId, + req.user.did + ); + res.setHeader( + 'Content-Disposition', + `attachment; filename=${policy.name}.vk` + ); + res.setHeader('Content-Type', 'application/virtual-keys'); + return res.send(downloadResult); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + + @ApiOperation({ + summary: 'Upload policy virtual keys.', + description: 'Upload policy virtual keys.' + ONLY_SR, + }) + @ApiExtraModels(InternalServerErrorDTO) + @ApiParam({ + description: 'Policy identifier.', + name: 'policyId', + required: true + }) + @ApiSecurity('bearerAuth') + @ApiBody({ + description: 'Virtual keys file', + schema: { + type: 'string', + format: 'binary' + } + }) + @ApiOkResponse({ + description: 'Operation completed.', + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @ApiSecurity('bearerAuth') + @Post('/:policyId/virtual-keys') + @HttpCode(HttpStatus.OK) + async uploadVirtualKeys(@Req() req): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const engineService = new PolicyEngine(); + try { + return await engineService.uploadVirtualKeys( + req.user.did, + req.body, + req.params.policyId + ); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + @ApiOperation({ summary: 'Makes the selected group active.', description: 'Makes the selected group active. if UUID is not set then returns the user to the default state.', @@ -792,6 +1052,10 @@ export class PolicyApi { } } + /** + * @param req + * @param res + */ @ApiOperation({ summary: 'Retrieves data for the policy root block.', description: 'Returns data from the root policy block. Only users with the Standard Registry and Installer role are allowed to make the request.', @@ -1178,11 +1442,19 @@ export class PolicyApi { const engineService = new PolicyEngine(); const versionOfTopicId = req.query ? req.query.versionOfTopicId : null; try { - const policies = await engineService.importMessage(req.user, req.body.messageId, versionOfTopicId); + const policies = await engineService.importMessage( + req.user, + req.body.messageId, + versionOfTopicId, + req.body.metadata + ); return res.status(201).send(policies); } catch (error) { new Logger().error(error, ['API_GATEWAY']); - throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); } } @@ -1212,14 +1484,29 @@ export class PolicyApi { const messageId = req.body.messageId; const versionOfTopicId = req.query ? req.query.versionOfTopicId : null; const taskManager = new TaskManager(); - const task = taskManager.start(TaskAction.IMPORT_POLICY_MESSAGE, user.id); - RunFunctionAsync(async () => { - const engineService = new PolicyEngine(); - await engineService.importMessageAsync(user, messageId, versionOfTopicId, task); - }, async (error) => { - new Logger().error(error, ['API_GATEWAY']); - taskManager.addError(task.taskId, { code: 500, message: 'Unknown error: ' + error.message }); - }); + const task = taskManager.start( + TaskAction.IMPORT_POLICY_MESSAGE, + user.id + ); + RunFunctionAsync( + async () => { + const engineService = new PolicyEngine(); + await engineService.importMessageAsync( + user, + messageId, + versionOfTopicId, + task, + req.body.metadata + ); + }, + async (error) => { + new Logger().error(error, ['API_GATEWAY']); + taskManager.addError(task.taskId, { + code: 500, + message: 'Unknown error: ' + error.message, + }); + } + ); return res.status(202).send(task); } @@ -1347,6 +1634,91 @@ export class PolicyApi { } } + /** + * Policy import from a zip file with metadata. + */ + @Post('/import/file-metadata') + @Auth( + UserRole.STANDARD_REGISTRY + ) + @ApiSecurity('bearerAuth') + @ApiOperation({ + summary: 'Imports new policy from a zip file with metadata.', + description: 'Imports new policy and all associated artifacts, such as schemas and VCs, from the provided zip file into the local DB.' + ONLY_SR, + }) + @ApiImplicitQuery({ + name: 'versionOfTopicId', + type: String, + description: 'Topic Id', + required: false + }) + @ApiConsumes('multipart/form-data') + @ApiBody({ + description: 'Form data with policy file and metadata.', + required: true, + schema: { + type: 'object', + properties: { + 'policyFile': { + type: 'string', + format: 'binary', + }, + 'metadata': { + type: 'string', + format: 'binary', + } + } + } + }) + @ApiOkResponse({ + description: 'Successful operation.', + schema: { + 'type': 'object' + }, + }) + @ApiUnauthorizedResponse({ + description: 'Unauthorized.', + }) + @ApiForbiddenResponse({ + description: 'Forbidden.', + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + type: InternalServerErrorDTO + }) + @HttpCode(HttpStatus.CREATED) + @UseInterceptors(AnyFilesInterceptor()) + async importPolicyFromFileWithMetadata( + @AuthUser() user: IAuthUser, + @UploadedFiles() files: any, + @Query('versionOfTopicId') versionOfTopicId, + ): Promise { + try { + const policyFile = files.find( + (item) => item.fieldname === 'policyFile' + ); + if (!policyFile) { + throw new Error('There is no policy file'); + } + const metadata = files.find( + (item) => item.fieldname === 'metadata' + ); + const engineService = new PolicyEngine(); + return await engineService.importFile( + user, + policyFile.buffer, + versionOfTopicId, + metadata?.buffer && JSON.parse(metadata.buffer.toString()) + ); + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + /** * Policy import from a zip file (async). */ @@ -1405,6 +1777,98 @@ export class PolicyApi { return res.status(202).send(task); } + /** + * Policy import from a zip file with metadata (async). + */ + @Post('/push/import/file-metadata') + @Auth( + UserRole.STANDARD_REGISTRY + ) + @ApiSecurity('bearerAuth') + @ApiOperation({ + summary: 'Imports new policy from a zip file with metadata.', + description: 'Imports new policy and all associated artifacts, such as schemas and VCs, from the provided zip file into the local DB.' + ONLY_SR, + }) + @ApiImplicitQuery({ + name: 'versionOfTopicId', + type: String, + description: 'Topic Id', + required: false + }) + @ApiConsumes('multipart/form-data') + @ApiBody({ + description: 'Form data with policy file and metadata.', + required: true, + schema: { + type: 'object', + properties: { + 'policyFile': { + type: 'string', + format: 'binary', + }, + 'metadata': { + type: 'string', + format: 'binary', + } + } + } + }) + @ApiOkResponse({ + description: 'Successful operation.', + schema: { + 'type': 'object' + }, + }) + @ApiUnauthorizedResponse({ + description: 'Unauthorized.', + }) + @ApiForbiddenResponse({ + description: 'Forbidden.', + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + type: InternalServerErrorDTO + }) + @HttpCode(HttpStatus.ACCEPTED) + @UseInterceptors(AnyFilesInterceptor()) + async importPolicyFromFileWithMetadataAsync( + @AuthUser() user: IAuthUser, + @UploadedFiles() files: any, + @Query('versionOfTopicId') versionOfTopicId, + ): Promise { + const taskManager = new TaskManager(); + const task = taskManager.start(TaskAction.IMPORT_POLICY_FILE, user.id); + RunFunctionAsync( + async () => { + const policyFile = files.find( + (item) => item.fieldname === 'policyFile' + ); + if (!policyFile) { + throw new Error('There is no policy file'); + } + const metadata = files.find( + (item) => item.fieldname === 'metadata' + ); + const engineService = new PolicyEngine(); + await engineService.importFileAsync( + user, + policyFile.buffer, + versionOfTopicId, + task, + metadata?.buffer && JSON.parse(metadata.buffer.toString()) + ); + }, + async (error) => { + new Logger().error(error, ['API_GATEWAY']); + taskManager.addError(task.taskId, { + code: 500, + message: 'Unknown error: ' + error.message, + }); + } + ); + return task; + } + /** * Policy preview from a zip file. */ @@ -1624,13 +2088,17 @@ export class PolicyApi { } } + /** + * @param req + */ @Get('/blocks/about') @HttpCode(HttpStatus.OK) - async getBlockAbout(@Req() req, @Response() res) { + @UseCache({ ttl: CACHE.LONG_TTL }) + async getBlockAbout(@Req() req) { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); const engineService = new PolicyEngine(); try { - return res.send(await engineService.blockAbout()); + return await engineService.blockAbout(); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); @@ -1879,6 +2347,8 @@ export class PolicyApi { } } + /** + */ @Get('/methodologies/categories') @ApiOperation({ summary: 'Get all categories', @@ -1896,11 +2366,11 @@ export class PolicyApi { } }) @HttpCode(HttpStatus.ACCEPTED) - async getPolicyCategoriesAsync(@Req() req, @Response() res): Promise { + @UseCache() + async getPolicyCategoriesAsync(): Promise { try { const projectService = new ProjectService(); - const categories = await projectService.getPolicyCategories(); - return res.send(categories); + return await projectService.getPolicyCategories(); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); diff --git a/api-gateway/src/api/service/profile.ts b/api-gateway/src/api/service/profile.ts index faaf3a1607..0157dd3c7d 100644 --- a/api-gateway/src/api/service/profile.ts +++ b/api-gateway/src/api/service/profile.ts @@ -1,14 +1,16 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { DidDocumentStatus, SchemaEntity, TaskAction, TopicType, UserRole } from '@guardian/interfaces'; import { IAuthUser, Logger, RunFunctionAsync } from '@guardian/common'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; import { Controller, Get, HttpCode, HttpException, HttpStatus, Put, Param, Post, Body } from '@nestjs/common'; -import { AuthUser } from '@auth/authorization-helper'; -import { Auth } from '@auth/auth.decorator'; +import { AuthUser } from '../../auth/authorization-helper.js'; +import { Auth } from '../../auth/auth.decorator.js'; import { ApiBody, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse } from '@nestjs/swagger'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; -import { ProfileDTO, InternalServerErrorDTO, TaskDTO, CredentialsDTO, DidDocumentDTO, DidDocumentStatusDTO, DidDocumentWithKeyDTO, DidKeyStatusDTO } from '@middlewares/validation/schemas'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { ProfileDTO, InternalServerErrorDTO, TaskDTO, CredentialsDTO, DidDocumentDTO, DidDocumentStatusDTO, DidDocumentWithKeyDTO, DidKeyStatusDTO } from '../../middlewares/validation/schemas/index.js'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('profiles') @ApiTags('profiles') @@ -259,6 +261,7 @@ export class ProfileApi { type: InternalServerErrorDTO }) @HttpCode(HttpStatus.OK) + @UseCache({ ttl: CACHE.SHORT_TTL }) async getUserBalance( @AuthUser() user: IAuthUser, @Param('username') username: string diff --git a/api-gateway/src/api/service/project.ts b/api-gateway/src/api/service/project.ts index 9525a1d6fd..d499af73e9 100644 --- a/api-gateway/src/api/service/project.ts +++ b/api-gateway/src/api/service/project.ts @@ -1,11 +1,13 @@ import { Logger } from '@guardian/common'; import { ClientProxy } from '@nestjs/microservices'; -import { Controller, Body, HttpCode, HttpException, HttpStatus, Post, Req, Response, Get, Inject } from '@nestjs/common'; +import { Body, Controller, Get, HttpCode, HttpException, HttpStatus, Inject, Post, Req, Response } from '@nestjs/common'; import { ApiBody, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { ProjectService } from '@helpers/projects'; -import { ProjectDTO, PropertiesDTO } from '@middlewares/validation/schemas/projects'; -import { CompareDocumentsDTO, FilterDocumentsDTO, InternalServerErrorDTO } from '@middlewares/validation/schemas'; -import { Guardians } from '@helpers/guardians'; +import { ProjectService } from '../../helpers/projects.js'; +import { ProjectDTO, PropertiesDTO } from '../../middlewares/validation/schemas/projects.js'; +import { CompareDocumentsDTO, FilterDocumentsDTO, InternalServerErrorDTO } from '../../middlewares/validation/schemas/index.js'; +import { Guardians } from '../../helpers/guardians.js'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; /** * Projects route @@ -145,6 +147,8 @@ export class ProjectsAPI { } } + /** + */ @Get('/properties') @ApiOperation({ summary: 'Get all properties', @@ -162,11 +166,11 @@ export class ProjectsAPI { } }) @HttpCode(HttpStatus.ACCEPTED) - async getPolicyProperties(@Req() req, @Response() res): Promise { + @UseCache({ ttl: CACHE.LONG_TTL }) + async getPolicyProperties(): Promise { try { const projectService = new ProjectService(); - const policyProperties = await projectService.getPolicyProperties(); - return res.send(policyProperties); + return await projectService.getPolicyProperties(); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); diff --git a/api-gateway/src/api/service/record.ts b/api-gateway/src/api/service/record.ts index 5f2748ce50..c0d186a390 100644 --- a/api-gateway/src/api/service/record.ts +++ b/api-gateway/src/api/service/record.ts @@ -1,14 +1,14 @@ import { PolicyType, UserRole } from '@guardian/interfaces'; -import { PolicyEngine } from '@helpers/policy-engine'; +import { PolicyEngine } from '../../helpers/policy-engine.js'; import { IAuthUser, Logger } from '@guardian/common'; import { Controller, Get, HttpCode, HttpException, HttpStatus, Post, Response, Param, Body } from '@nestjs/common'; import { ApiBody, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; -import { Guardians } from '@helpers/guardians'; -import { Auth } from '@auth/auth.decorator'; -import { AuthUser } from '@auth/authorization-helper'; -import { RecordActionDTO, RecordStatusDTO, RunningDetailsDTO, RunningResultDTO } from '@middlewares/validation/schemas/record'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { Guardians } from '../../helpers/guardians.js'; +import { Auth } from '../../auth/auth.decorator.js'; +import { AuthUser } from '../../auth/authorization-helper.js'; +import { RecordActionDTO, RecordStatusDTO, RunningDetailsDTO, RunningResultDTO } from '../../middlewares/validation/schemas/record.js'; /** * Check policy @@ -619,4 +619,4 @@ export class RecordApi { throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); } } -} \ No newline at end of file +} diff --git a/api-gateway/src/api/service/schema.ts b/api-gateway/src/api/service/schema.ts index c29764ea9a..6ac7934b06 100644 --- a/api-gateway/src/api/service/schema.ts +++ b/api-gateway/src/api/service/schema.ts @@ -1,18 +1,20 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { ISchema, SchemaCategory, SchemaEntity, SchemaHelper, SchemaStatus, StatusType, TaskAction, UserRole } from '@guardian/interfaces'; import { IAuthUser, Logger, RunFunctionAsync, SchemaImportExport } from '@guardian/common'; import { ApiBody, ApiExtraModels, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse } from '@nestjs/swagger'; import { Body, Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Param, Post, Put, Req, Response } from '@nestjs/common'; import process from 'process'; -import { AuthUser, checkPermission } from '@auth/authorization-helper'; +import { AuthUser, checkPermission } from '../../auth/authorization-helper.js'; import { Client, ClientProxy, Transport } from '@nestjs/microservices'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; -import { SchemaUtils } from '@helpers/schema-utils'; -import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; -import { ExportSchemaDTO, InternalServerErrorDTO, MessageSchemaDTO, SchemaDTO, SystemSchemaDTO, TaskDTO, VersionSchemaDTO } from '@middlewares/validation/schemas'; -import { Auth } from '@auth/auth.decorator'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; +import { SchemaUtils } from '../../helpers/schema-utils.js'; +import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator.js'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { ExportSchemaDTO, InternalServerErrorDTO, MessageSchemaDTO, SchemaDTO, SystemSchemaDTO, TaskDTO, VersionSchemaDTO } from '../../middlewares/validation/schemas/index.js'; +import { Auth } from '../../auth/auth.decorator.js'; +import { CACHE } from '../../constants/index.js'; +import { UseCache } from '../../helpers/decorators/cache.js'; const ONLY_SR = ' Only users with the Standard Registry role are allowed to make the request.' @@ -125,9 +127,14 @@ export async function updateSchema(newSchema: ISchema, owner: string): Promise { + @UseCache({ ttl: CACHE.SHORT_TTL }) + async getSchema(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY, UserRole.AUDITOR, UserRole.USER)(req.user); try { const user = req.user; @@ -150,7 +157,7 @@ export class SingleSchemaApi { } else { SchemaHelper.updatePermission([schema], owner); } - return res.json(SchemaUtils.toOld(schema)); + return SchemaUtils.toOld(schema); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error @@ -533,16 +540,16 @@ export class SchemaApi { type: InternalServerErrorDTO }) @HttpCode(HttpStatus.OK) - async getAll(@Req() req, @Response() res): Promise { + @UseCache() + async getAll(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { const user = req.user; const guardians = new Guardians(); if (user.did) { - const schemas = await guardians.getListSchemas(user.did); - return res.send(schemas); + return await guardians.getListSchemas(user.did); } - res.send([]); + return []; } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error; @@ -588,19 +595,19 @@ export class SchemaApi { type: InternalServerErrorDTO }) @HttpCode(HttpStatus.OK) - async getSub(@Req() req, @Response() res): Promise { + @UseCache() + async getSub(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { const guardians = new Guardians(); if (!req.user.did) { - return res.send([]); + return []; } - const schemas = await guardians.getSubSchemas( + return await guardians.getSubSchemas( req.query.category, req.query.topicId, req.user.did ); - return res.send(schemas); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error; @@ -2214,6 +2221,7 @@ export class SchemaApi { type: InternalServerErrorDTO }) @HttpCode(HttpStatus.OK) + @UseCache({ isExpress: true }) async exportTemplate( @AuthUser() user: IAuthUser, @Response() res: any @@ -2225,6 +2233,7 @@ export class SchemaApi { const fileBuffer = Buffer.from(file, 'base64'); res.setHeader('Content-disposition', `attachment; filename=` + filename); res.setHeader('Content-type', 'application/zip'); + res.locals.data = fileBuffer return res.send(fileBuffer); } catch (error) { new Logger().error(error, ['API_GATEWAY']); diff --git a/api-gateway/src/api/service/settings.ts b/api-gateway/src/api/service/settings.ts index 16c664e128..6da3bc5546 100644 --- a/api-gateway/src/api/service/settings.ts +++ b/api-gateway/src/api/service/settings.ts @@ -1,11 +1,11 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { AboutInterface, CommonSettings, UserRole } from '@guardian/interfaces'; import { Logger } from '@guardian/common'; import { Body, Controller, Get, HttpCode, HttpException, HttpStatus, Post, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { SettingsDTO } from '@middlewares/validation/schemas/settings'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { SettingsDTO } from '../../middlewares/validation/schemas/settings.js'; import process from 'process'; @Controller('settings') diff --git a/api-gateway/src/api/service/suggestions.ts b/api-gateway/src/api/service/suggestions.ts index 992dd16f5b..eec6c3b9bf 100644 --- a/api-gateway/src/api/service/suggestions.ts +++ b/api-gateway/src/api/service/suggestions.ts @@ -1,11 +1,11 @@ import { UserRole } from '@guardian/interfaces'; import { Body, Controller, Get, HttpCode, HttpStatus, Post, Req, UseGuards, } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; -import { Guardians } from '@helpers/guardians'; +import { checkPermission } from '../../auth/authorization-helper.js'; +import { Guardians } from '../../helpers/guardians.js'; import { ApiBearerAuth, ApiCreatedResponse, ApiExtraModels, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiSecurity, ApiTags, ApiUnauthorizedResponse, getSchemaPath, } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; -import { SuggestionsConfigDTO, SuggestionsConfigItemDTO, SuggestionsInputDTO, SuggestionsOutputDTO, } from '@middlewares/validation/schemas/suggestions'; -import { AuthGuard } from '@auth/auth-guard'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; +import { SuggestionsConfigDTO, SuggestionsConfigItemDTO, SuggestionsInputDTO, SuggestionsOutputDTO, } from '../../middlewares/validation/schemas/suggestions.js'; +import { AuthGuard } from '../../auth/auth-guard.js'; @Controller('suggestions') @ApiTags('suggestions') diff --git a/api-gateway/src/api/service/tags.ts b/api-gateway/src/api/service/tags.ts index 8974b98b6a..ca138f9c88 100644 --- a/api-gateway/src/api/service/tags.ts +++ b/api-gateway/src/api/service/tags.ts @@ -1,10 +1,11 @@ import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { SchemaCategory, SchemaHelper, UserRole } from '@guardian/interfaces'; -import { SchemaUtils } from '@helpers/schema-utils'; +import { SchemaUtils } from '../../helpers/schema-utils.js'; import { Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Post, Put, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiTags } from '@nestjs/swagger'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('tags') @ApiTags('tags') @@ -137,8 +138,13 @@ export class TagsApi { } } + /** + * @param req + * @param res + */ @Get('/schemas') @HttpCode(HttpStatus.OK) + @UseCache({ isExpress: true }) async getSchemas(@Req() req, @Response() res): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { @@ -153,6 +159,7 @@ export class TagsApi { } const { items, count } = await guardians.getTagSchemas(owner, pageIndex, pageSize); items.forEach((s) => { s.readonly = s.readonly || s.owner !== owner }); + res.locals.data = SchemaUtils.toOld(items) return res .setHeader('X-Total-Count', count) .json(SchemaUtils.toOld(items)); diff --git a/api-gateway/src/api/service/task.ts b/api-gateway/src/api/service/task.ts index b1c5c42ca0..72ffdc57d8 100644 --- a/api-gateway/src/api/service/task.ts +++ b/api-gateway/src/api/service/task.ts @@ -1,5 +1,5 @@ import { Logger } from '@guardian/common'; -import { TaskManager } from '@helpers/task-manager'; +import { TaskManager } from '../../helpers/task-manager.js'; import { Controller, Get, HttpCode, HttpStatus, Req, Response } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; diff --git a/api-gateway/src/api/service/themes.ts b/api-gateway/src/api/service/themes.ts index 156dae0937..e48051ea78 100644 --- a/api-gateway/src/api/service/themes.ts +++ b/api-gateway/src/api/service/themes.ts @@ -1,5 +1,5 @@ import { Logger } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Post, Put, Req, Response } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; diff --git a/api-gateway/src/api/service/tokens.ts b/api-gateway/src/api/service/tokens.ts index 8edc3625d1..38d66b39aa 100644 --- a/api-gateway/src/api/service/tokens.ts +++ b/api-gateway/src/api/service/tokens.ts @@ -1,12 +1,23 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { ITokenInfo, TaskAction, UserRole } from '@guardian/interfaces'; import { Logger, RunFunctionAsync } from '@guardian/common'; -import { PolicyEngine } from '@helpers/policy-engine'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; -import { prepareValidationResponse } from '@middlewares/validation'; -import { Controller, Delete, Get, HttpCode, HttpException, HttpStatus, Post, Put, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { PolicyEngine } from '../../helpers/policy-engine.js'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; +import { prepareValidationResponse } from '../../middlewares/validation/index.js'; +import { + Controller, + Delete, + Get, + HttpCode, + HttpException, + HttpStatus, + Post, + Put, + Req, + Response, +} from '@nestjs/common'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { ApiInternalServerErrorResponse, ApiOkResponse, @@ -17,8 +28,12 @@ import { ApiTags, ApiBearerAuth, ApiParam, + ApiBody, + ApiSecurity, + ApiUnprocessableEntityResponse, } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/index.js'; +import { Auth } from '../../auth/auth.decorator.js'; /** * Token route @@ -179,6 +194,66 @@ export class TokensApi { return res.status(202).send(task); } + @Put('/') + @Auth( + UserRole.STANDARD_REGISTRY + ) + @ApiSecurity('bearerAuth') + @ApiOperation({ + summary: 'Update token.', + description: 'Update token. Only users with the Standard Registry role are allowed to make the request.', + }) + @ApiBody({ + description: 'Token', + required: true, + schema: { + type: 'object' + } + }) + @ApiOkResponse({ + description: 'Updated token.', + schema: { + 'type': 'object' + }, + }) + @ApiForbiddenResponse({ + description: 'Forbidden.', + }) + @ApiUnprocessableEntityResponse({ + description: 'Unprocessable entity.' + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + type: InternalServerErrorDTO + }) + @HttpCode(HttpStatus.CREATED) + async updateToken(@Req() req): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const user = req.user; + const token = req.body; + + if (!user.did) { + throw new HttpException('User is not registered', HttpStatus.UNPROCESSABLE_ENTITY); + } + + if (!token.tokenId) { + throw new HttpException('The field tokenId is required', HttpStatus.UNPROCESSABLE_ENTITY); + } + + const guardians = new Guardians(); + const tokenObject = await guardians.getTokenById(token.tokenId); + + if (!tokenObject) { + throw new HttpException('Token not found', HttpStatus.NOT_FOUND) + } + + if (tokenObject.owner !== user.did) { + throw new HttpException('Invalid creator.', HttpStatus.FORBIDDEN) + } + + return await guardians.updateToken(token); + } + @Put('/push') @HttpCode(HttpStatus.ACCEPTED) async updateTokenAsync(@Req() req, @Response() res): Promise { @@ -559,6 +634,10 @@ export class TokensApi { return res.status(202).send(task); } + /** + * @param req + * @param res + */ @Get('/:tokenId/:username/info') @HttpCode(HttpStatus.OK) async getTokenInfo(@Req() req, @Response() res): Promise { @@ -585,6 +664,10 @@ export class TokensApi { } } + /** + * @param req + * @param res + */ @Get('/:tokenId/serials') @ApiBearerAuth() @ApiExtraModels(InternalServerErrorDTO) diff --git a/api-gateway/src/api/service/tool.ts b/api-gateway/src/api/service/tool.ts index 6e35017aa3..cc3ca567bc 100644 --- a/api-gateway/src/api/service/tool.ts +++ b/api-gateway/src/api/service/tool.ts @@ -1,20 +1,24 @@ import { Logger, RunFunctionAsync } from '@guardian/common'; -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { - Controller, - Delete, - Get, - HttpCode, - HttpException, - HttpStatus, - Post, - Put, - Req, - Response + Controller, + Delete, + Get, + HttpCode, + HttpException, + HttpStatus, + Post, + Put, + Req, + Response, + UploadedFiles, + UseInterceptors, } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { TaskAction, UserRole } from '@guardian/interfaces'; import { + ApiBody, + ApiConsumes, ApiForbiddenResponse, ApiInternalServerErrorResponse, ApiOkResponse, @@ -24,11 +28,13 @@ import { ApiUnauthorizedResponse, getSchemaPath } from '@nestjs/swagger'; -import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; -import { InternalServerErrorDTO, TaskDTO, ToolDTO } from '@middlewares/validation/schemas'; -import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator'; +import { ApiImplicitQuery } from '@nestjs/swagger/dist/decorators/api-implicit-query.decorator.js'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; +import { InternalServerErrorDTO, TaskDTO, ToolDTO } from '../../middlewares/validation/schemas/index.js'; +import { ApiImplicitParam } from '@nestjs/swagger/dist/decorators/api-implicit-param.decorator.js'; +import { AnyFilesInterceptor } from '@nestjs/platform-express'; +import { UseCache } from '../../helpers/decorators/cache.js'; const ONLY_SR = ' Only users with the Standard Registry role are allowed to make the request.' @@ -710,6 +716,82 @@ export class ToolsApi { } } + /** + * Import tool from file with metadata + */ + @Post('/import/file-metadata') + @ApiSecurity('bearerAuth') + @ApiOperation({ + summary: 'Imports new tool from a zip file.', + description: 'Imports new tool and all associated artifacts, such as schemas and VCs, from the provided zip file into the local DB.' + ONLY_SR + }) + @ApiOkResponse({ + description: 'Successful operation.', + schema: { + $ref: getSchemaPath(ToolDTO) + } + }) + @ApiConsumes('multipart/form-data') + @ApiBody({ + description: 'Form data with tool file and metadata.', + required: true, + schema: { + type: 'object', + properties: { + 'file': { + type: 'string', + format: 'binary', + }, + 'metadata': { + type: 'string', + format: 'binary', + } + } + } + }) + @ApiUnauthorizedResponse({ + description: 'Unauthorized.', + }) + @ApiForbiddenResponse({ + description: 'Forbidden.', + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO) + } + }) + @UseInterceptors(AnyFilesInterceptor()) + @HttpCode(HttpStatus.CREATED) + async toolImportFileWithMetadata( + @Req() req, + @UploadedFiles() files: any + ): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + const guardian = new Guardians(); + try { + const file = files.find((item) => item.fieldname === 'file'); + if (!file) { + throw new Error('There is no tool file'); + } + const metadata = files.find( + (item) => item.fieldname === 'metadata' + ); + const tool = await guardian.importToolFile( + file.buffer, + req.user.did, + metadata?.buffer && JSON.parse(metadata.buffer.toString()) + ); + return tool; + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + /** * Import tool from IPFS (Async) */ @@ -760,6 +842,101 @@ export class ToolsApi { } } + /** + * Import tool from file with metadata (Async) + */ + @Post('/push/import/file-metadata') + @ApiSecurity('bearerAuth') + @ApiOperation({ + summary: 'Imports new tool from a zip file.', + description: + 'Imports new tool and all associated artifacts, such as schemas and VCs, from the provided zip file into the local DB.' + + ONLY_SR, + }) + @ApiConsumes('multipart/form-data') + @ApiBody({ + description: 'Form data with tool file and metadata.', + required: true, + schema: { + type: 'object', + properties: { + 'file': { + type: 'string', + format: 'binary', + }, + 'metadata': { + type: 'string', + format: 'binary', + } + } + } + }) + @ApiOkResponse({ + description: 'Successful operation.', + schema: { + $ref: getSchemaPath(TaskDTO), + }, + }) + @ApiUnauthorizedResponse({ + description: 'Unauthorized.', + }) + @ApiForbiddenResponse({ + description: 'Forbidden.', + }) + @ApiInternalServerErrorResponse({ + description: 'Internal server error.', + schema: { + $ref: getSchemaPath(InternalServerErrorDTO), + }, + }) + @UseInterceptors(AnyFilesInterceptor()) + @HttpCode(HttpStatus.ACCEPTED) + async toolImportFileWithMetadataAsync( + @Req() req, + @UploadedFiles() files: any + ): Promise { + await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); + try { + const file = files.find(item => item.fieldname === 'file'); + if (!file) { + throw new Error('There is no tool file'); + } + const metadata = files.find(item => item.fieldname === 'metadata'); + const user = req.user; + const owner = req.user.did; + const guardian = new Guardians(); + const taskManager = new TaskManager(); + const task = taskManager.start( + TaskAction.IMPORT_TOOL_FILE, + user.id + ); + RunFunctionAsync( + async () => { + await guardian.importToolFileAsync( + file.buffer, + owner, + task, + metadata?.buffer && JSON.parse(metadata.buffer.toString()) + ); + }, + async (error) => { + new Logger().error(error, ['API_GATEWAY']); + taskManager.addError(task.taskId, { + code: 500, + message: error.message, + }); + } + ); + return task; + } catch (error) { + new Logger().error(error, ['API_GATEWAY']); + throw new HttpException( + error.message, + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + /** * Import tool from IPFS (Async) */ @@ -837,12 +1014,12 @@ export class ToolsApi { } }) @HttpCode(HttpStatus.OK) - async getMenu(@Req() req, @Response() res): Promise { + @UseCache() + async getMenu(@Req() req): Promise { await checkPermission(UserRole.STANDARD_REGISTRY)(req.user); try { const guardians = new Guardians(); - const items = await guardians.getMenuTool(req.user.did); - return res.json(items); + return await guardians.getMenuTool(req.user.did); } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR); diff --git a/api-gateway/src/api/service/trust-chains.ts b/api-gateway/src/api/service/trust-chains.ts index 410d4830a3..55d79d7ba5 100644 --- a/api-gateway/src/api/service/trust-chains.ts +++ b/api-gateway/src/api/service/trust-chains.ts @@ -1,10 +1,11 @@ -import { Guardians } from '@helpers/guardians'; -import { Users } from '@helpers/users'; +import { Guardians } from '../../helpers/guardians.js'; +import { Users } from '../../helpers/users.js'; import { IAuthUser, Logger } from '@guardian/common'; import { Controller, Get, HttpCode, HttpStatus, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { UserRole } from '@guardian/interfaces'; import { ApiTags } from '@nestjs/swagger'; +import { UseCache } from '../../helpers/decorators/cache.js'; @Controller('trust-chains') @ApiTags('trust-chains') @@ -45,9 +46,13 @@ export class TrustChainsApi { } } + /** + * @param req + */ @Get('/:hash') @HttpCode(HttpStatus.OK) - async getTrustChainByHash(@Req() req, @Response() res): Promise { + @UseCache() + async getTrustChainByHash(@Req() req): Promise { await checkPermission(UserRole.AUDITOR)(req.user); try { const guardians = new Guardians(); @@ -73,7 +78,7 @@ export class TrustChainsApi { return { username: user.username, did: user.did } }) - return res.json({ chain, userMap }); + return { chain, userMap }; } catch (error) { new Logger().error(error, ['API_GATEWAY']); throw error diff --git a/api-gateway/src/api/service/websockets.ts b/api-gateway/src/api/service/websockets.ts index 4f03ed9ffe..25be7876b7 100644 --- a/api-gateway/src/api/service/websockets.ts +++ b/api-gateway/src/api/service/websockets.ts @@ -1,11 +1,12 @@ -import WebSocket from 'ws'; +import WebSocket, { WebSocketServer } from 'ws' + import { IncomingMessage, Server } from 'http'; -import { Users } from '@helpers/users'; +import { Users } from '../../helpers/users.js'; import { ExternalProviders, GenerateUUIDv4, MessageAPI, NotifyAPI, UserRole } from '@guardian/interfaces'; import { generateNumberFromString, Logger, MeecoApprovedSubmission, MessageResponse, NatsService, NotificationHelper, Singleton } from '@guardian/common'; import { NatsConnection } from 'nats'; import { Injectable } from '@nestjs/common'; -import { MeecoAuth } from '@helpers/meeco'; +import { MeecoAuth } from '../../helpers/meeco.js'; import { Mutex } from 'async-mutex'; /** @@ -48,7 +49,7 @@ export class WebSocketsService { * WebSocket server * @private */ - private readonly wss: WebSocket.Server; + private readonly wss: WebSocketServer; private readonly clients = new Map(); @@ -68,7 +69,7 @@ export class WebSocketsService { private readonly notificationReadingMap: Set = new Set(); constructor(private readonly server: Server, cn: NatsConnection) { - this.wss = new WebSocket.Server({ server: this.server }); + this.wss = new WebSocketServer({ server: this.server }); this.channel = new WebSocketsServiceChannel(); this.channel.setConnection(cn); } diff --git a/api-gateway/src/api/service/wizard.ts b/api-gateway/src/api/service/wizard.ts index a79a017eb8..d8bfc6128e 100644 --- a/api-gateway/src/api/service/wizard.ts +++ b/api-gateway/src/api/service/wizard.ts @@ -1,12 +1,12 @@ -import { Guardians } from '@helpers/guardians'; +import { Guardians } from '../../helpers/guardians.js'; import { Logger, RunFunctionAsync, } from '@guardian/common'; -import { TaskManager } from '@helpers/task-manager'; -import { ServiceError } from '@helpers/service-requests-base'; +import { TaskManager } from '../../helpers/task-manager.js'; +import { ServiceError } from '../../helpers/service-requests-base.js'; import { Controller, HttpCode, HttpStatus, Post, Req, Response } from '@nestjs/common'; -import { checkPermission } from '@auth/authorization-helper'; +import { checkPermission } from '../../auth/authorization-helper.js'; import { TaskAction, UserRole } from '@guardian/interfaces'; import { ApiBody, ApiInternalServerErrorResponse, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger'; -import { InternalServerErrorDTO } from '@middlewares/validation/schemas/errors'; +import { InternalServerErrorDTO } from '../../middlewares/validation/schemas/errors.js'; @Controller('wizard') @ApiTags('wizard') diff --git a/api-gateway/src/app.module.ts b/api-gateway/src/app.module.ts index 429bf0efc5..c453e66604 100644 --- a/api-gateway/src/app.module.ts +++ b/api-gateway/src/app.module.ts @@ -1,44 +1,45 @@ import { MiddlewareConsumer, Module } from '@nestjs/common'; -import { AccountApi } from '@api/service/account'; -import { AnalyticsApi } from '@api/service/analytics'; -import { ArtifactApi } from '@api/service/artifact'; -import { ContractsApi } from '@api/service/contract'; -import { DemoApi } from '@api/service/demo'; -import { ExternalApi } from '@api/service/external'; -import { IpfsApi } from '@api/service/ipfs'; -import { LoggerApi, LoggerService } from '@api/service/logger'; -import { MapApi } from '@api/service/map'; +import { AccountApi } from './api/service/account.js'; +import { AnalyticsApi } from './api/service/analytics.js'; +import { ArtifactApi } from './api/service/artifact.js'; +import { ContractsApi } from './api/service/contract.js'; +import { DemoApi } from './api/service/demo.js'; +import { ExternalApi } from './api/service/external.js'; +import { IpfsApi } from './api/service/ipfs.js'; +import { LoggerApi, LoggerService } from './api/service/logger.js'; +import { MapApi } from './api/service/map.js'; import { ClientsModule, Transport } from '@nestjs/microservices'; -import { MetricsApi } from '@api/service/metrics'; -import { ModulesApi } from '@api/service/module'; -import { ToolsApi } from '@api/service/tool'; -import { ProfileApi } from '@api/service/profile'; -import { authorizationHelper } from '@auth/authorization-helper'; -import { PolicyApi } from '@api/service/policy'; -import { SchemaApi, SingleSchemaApi } from '@api/service/schema'; -import { SettingsApi } from '@api/service/settings'; -import { TagsApi } from '@api/service/tags'; -import { TaskApi } from '@api/service/task'; -import { TokensApi } from '@api/service/tokens'; -import { TrustChainsApi } from '@api/service/trust-chains'; -import { WizardApi } from '@api/service/wizard'; +import { MetricsApi } from './api/service/metrics.js'; +import { ModulesApi } from './api/service/module.js'; +import { ToolsApi } from './api/service/tool.js'; +import { ProfileApi } from './api/service/profile.js'; +import { authorizationHelper } from './auth/authorization-helper.js'; +import { PolicyApi } from './api/service/policy.js'; +import { SchemaApi, SingleSchemaApi } from './api/service/schema.js'; +import { SettingsApi } from './api/service/settings.js'; +import { TagsApi } from './api/service/tags.js'; +import { TaskApi } from './api/service/task.js'; +import { TokensApi } from './api/service/tokens.js'; +import { TrustChainsApi } from './api/service/trust-chains.js'; +import { WizardApi } from './api/service/wizard.js'; import process from 'process'; import express from 'express'; -import fileUpload from 'express-fileupload'; import hpp from 'hpp'; -import { ThemesApi } from '@api/service/themes'; -import { BrandingApi } from '@api/service/branding'; -import { SuggestionsApi } from '@api/service/suggestions'; -import { MatchConstraint } from '@helpers/decorators/match.validator'; +import { ThemesApi } from './api/service/themes.js'; +import { BrandingApi } from './api/service/branding.js'; +import { SuggestionsApi } from './api/service/suggestions.js'; +import { MatchConstraint } from './helpers/decorators/match.validator.js'; import { NotificationService } from '@guardian/common'; -import { NotificationsApi } from '@api/service/notifications'; -import { ApplicationEnvironment } from './environment'; -import { AuthGuard } from '@auth/auth-guard'; -import { UsersService } from '@helpers/users'; -import { RolesGuard } from '@auth/roles-guard'; -import { RecordApi } from '@api/service/record'; -import { ProjectsAPI } from '@api/service/project'; -import { AISuggestionsAPI } from '@api/service/ai-suggestions'; +import { NotificationsApi } from './api/service/notifications.js'; +import { ApplicationEnvironment } from './environment.js'; +import { AuthGuard } from './auth/auth-guard.js'; +import { UsersService } from './helpers/users.js'; +import { RolesGuard } from './auth/roles-guard.js'; +import { RecordApi } from './api/service/record.js'; +import { ProjectsAPI } from './api/service/project.js'; +import { AISuggestionsAPI } from './api/service/ai-suggestions.js'; +import { cacheProvider } from './helpers/cache-provider.js'; +import { CacheService } from './helpers/cache-service.js'; const JSON_REQUEST_LIMIT = process.env.JSON_REQUEST_LIMIT || '1mb'; const RAW_REQUEST_LIMIT = process.env.RAW_REQUEST_LIMIT || '1gb'; @@ -108,7 +109,9 @@ const RAW_REQUEST_LIMIT = process.env.RAW_REQUEST_LIMIT || '1gb'; NotificationService, AuthGuard, RolesGuard, - UsersService + UsersService, + cacheProvider, + CacheService, ] }) export class AppModule { @@ -146,7 +149,6 @@ export class AppModule { limit: RAW_REQUEST_LIMIT, type: 'binary/octet-stream' })).forRoutes('*'); - consumer.apply(fileUpload()).forRoutes('*'); consumer.apply(hpp()).forRoutes('*'); } } diff --git a/api-gateway/src/app.ts b/api-gateway/src/app.ts index 1faa82d363..b2a861e06f 100644 --- a/api-gateway/src/app.ts +++ b/api-gateway/src/app.ts @@ -1,24 +1,24 @@ -import { Guardians } from '@helpers/guardians'; -import { IPFS } from '@helpers/ipfs'; -import { PolicyEngine } from '@helpers/policy-engine'; -import { WebSocketsService } from '@api/service/websockets'; -import { Users } from '@helpers/users'; -import { Wallet } from '@helpers/wallet'; +import { Guardians } from './helpers/guardians.js'; +import { IPFS } from './helpers/ipfs.js'; +import { PolicyEngine } from './helpers/policy-engine.js'; +import { WebSocketsService } from './api/service/websockets.js'; +import { Users } from './helpers/users.js'; +import { Wallet } from './helpers/wallet.js'; import { LargePayloadContainer, Logger, MessageBrokerChannel } from '@guardian/common'; -import { TaskManager } from '@helpers/task-manager'; -import { AppModule } from './app.module'; +import { TaskManager } from './helpers/task-manager.js'; +import { AppModule } from './app.module.js'; import { NestFactory } from '@nestjs/core'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; import process from 'process'; import { HttpStatus, ValidationPipe } from '@nestjs/common'; import { json } from 'express'; import { SwaggerModule } from '@nestjs/swagger'; -import { SwaggerConfig } from '@helpers/swagger-config'; -import { SwaggerModels, SwaggerPaths } from './old-descriptions'; -import { MeecoAuth } from '@helpers/meeco'; -import * as extraModels from './middlewares/validation/schemas' -import { ProjectService } from '@helpers/projects'; -import { AISuggestions } from '@helpers/ai-suggestions'; +import { SwaggerConfig } from './helpers/swagger-config.js'; +import { SwaggerModels, SwaggerPaths } from './old-descriptions.js'; +import { MeecoAuth } from './helpers/meeco.js'; +import * as extraModels from './middlewares/validation/schemas/index.js' +import { ProjectService } from './helpers/projects.js'; +import { AISuggestions } from './helpers/ai-suggestions.js'; const PORT = process.env.PORT || 3002; diff --git a/api-gateway/src/auth/auth-guard.ts b/api-gateway/src/auth/auth-guard.ts index 429f2a431a..c7b588f734 100644 --- a/api-gateway/src/auth/auth-guard.ts +++ b/api-gateway/src/auth/auth-guard.ts @@ -1,5 +1,5 @@ import { CanActivate, ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'; -import { UsersService } from '@helpers/users'; +import { UsersService } from '../helpers/users.js'; import { IAuthUser } from '@guardian/common'; import { Request } from 'express'; diff --git a/api-gateway/src/auth/auth.decorator.ts b/api-gateway/src/auth/auth.decorator.ts index 2b161f6dc3..82acad2c4c 100644 --- a/api-gateway/src/auth/auth.decorator.ts +++ b/api-gateway/src/auth/auth.decorator.ts @@ -1,8 +1,8 @@ import { applyDecorators, SetMetadata, UseGuards } from '@nestjs/common'; -import { AuthGuard } from '@auth/auth-guard'; +import { AuthGuard } from '../auth/auth-guard.js'; import { ApiBearerAuth, ApiUnauthorizedResponse } from '@nestjs/swagger'; import { UserRole } from '@guardian/interfaces'; -import { RolesGuard } from '@auth/roles-guard'; +import { RolesGuard } from '../auth/roles-guard.js'; export function Auth(...roles: UserRole[]) { return applyDecorators( diff --git a/api-gateway/src/auth/authorization-helper.ts b/api-gateway/src/auth/authorization-helper.ts index 81c1aef673..301a4d830a 100644 --- a/api-gateway/src/auth/authorization-helper.ts +++ b/api-gateway/src/auth/authorization-helper.ts @@ -1,5 +1,5 @@ import { NextFunction, Response } from 'express'; -import { Users } from '@helpers/users'; +import { Users } from '../helpers/users.js'; import { AuthenticatedRequest, IAuthUser, Logger } from '@guardian/common'; import { createParamDecorator, ExecutionContext, HttpException, HttpStatus, Injectable, NestMiddleware } from '@nestjs/common'; diff --git a/api-gateway/src/config.ts b/api-gateway/src/config.ts index c7ddcdbb66..141f3441f0 100644 --- a/api-gateway/src/config.ts +++ b/api-gateway/src/config.ts @@ -1,16 +1,7 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import 'reflect-metadata' import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@subscribers': __dirname + 'dist/subscribers', - '@helpers': __dirname + '/helpers', - '@auth': __dirname + '/auth', - '@middlewares': __dirname + '/middlewares', -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.gateway.${process.env.GUARDIAN_ENV}` : './configs/.env.gateway'; diff --git a/api-gateway/src/constants/cache.ts b/api-gateway/src/constants/cache.ts new file mode 100644 index 0000000000..0582d92134 --- /dev/null +++ b/api-gateway/src/constants/cache.ts @@ -0,0 +1,5 @@ +export const CACHE = { + SHORT_TTL: 30, + DEFAULT_TTL: 600, + LONG_TTL: 3600, +} diff --git a/api-gateway/src/constants/index.ts b/api-gateway/src/constants/index.ts new file mode 100644 index 0000000000..07195f4a29 --- /dev/null +++ b/api-gateway/src/constants/index.ts @@ -0,0 +1,3 @@ +export { META_DATA } from './meta-data.js'; + +export { CACHE } from './cache.js'; diff --git a/api-gateway/src/constants/meta-data.ts b/api-gateway/src/constants/meta-data.ts new file mode 100644 index 0000000000..f69a0b90e7 --- /dev/null +++ b/api-gateway/src/constants/meta-data.ts @@ -0,0 +1,4 @@ +export const META_DATA = { + TTL: 'ttl', + EXPRESS: 'express' +}; diff --git a/api-gateway/src/helpers/ai-suggestions.ts b/api-gateway/src/helpers/ai-suggestions.ts index f38cfebeaa..163555a612 100644 --- a/api-gateway/src/helpers/ai-suggestions.ts +++ b/api-gateway/src/helpers/ai-suggestions.ts @@ -1,6 +1,6 @@ import { NatsService } from '@guardian/common'; import { GenerateUUIDv4, MessageAPI } from '@guardian/interfaces'; -import { Singleton } from './decorators/singleton'; +import { Singleton } from './decorators/singleton.js'; /** * AI Suggestions service diff --git a/api-gateway/src/helpers/cache-provider.ts b/api-gateway/src/helpers/cache-provider.ts new file mode 100644 index 0000000000..5975866368 --- /dev/null +++ b/api-gateway/src/helpers/cache-provider.ts @@ -0,0 +1,22 @@ +import { Provider } from '@nestjs/common'; + +import Cache from 'ioredis'; + +//types and interfaces +export type CacheClient = Cache; + +//constants +export const CACHE_CLIENT = 'CACHE_CLIENT' + +const HOST = process.env.HOST_CACHE; +const PORT = Number(process.env.PORT_CACHE); + +export const cacheProvider: Provider = { + useFactory: (): CacheClient => { + return new Cache({ + host: HOST, + port: PORT, + }); + }, + provide: CACHE_CLIENT, +}; diff --git a/api-gateway/src/helpers/cache-service.ts b/api-gateway/src/helpers/cache-service.ts new file mode 100644 index 0000000000..8745c30d3a --- /dev/null +++ b/api-gateway/src/helpers/cache-service.ts @@ -0,0 +1,20 @@ +import { Inject, Injectable } from '@nestjs/common'; + +//helpers +import { CACHE_CLIENT, CacheClient } from './cache-provider.js'; + +@Injectable() +export class CacheService { + public constructor( + @Inject(CACHE_CLIENT) + private readonly client: CacheClient, + ) {} + + async set(key: string, value: string, expirationSeconds: number) { + await this.client.set(key, value, 'EX', expirationSeconds); + } + + async get(key: string): Promise { + return this.client.get(key); + } +} diff --git a/api-gateway/src/helpers/decorators/cache.ts b/api-gateway/src/helpers/decorators/cache.ts new file mode 100644 index 0000000000..33d8926ac8 --- /dev/null +++ b/api-gateway/src/helpers/decorators/cache.ts @@ -0,0 +1,18 @@ +import { UseInterceptors, applyDecorators, SetMetadata } from '@nestjs/common'; + +//interceptors +import { CacheInterceptor } from '../../helpers/interceptors/cache.js'; + +//constants +import { CACHE, META_DATA } from '../../constants/index.js'; + +export function UseCache( + { ttl = CACHE.DEFAULT_TTL, isExpress = false, interceptors = [] }: + { ttl?: number, isExpress?: boolean, interceptors?: any[] } = {}) { + + return applyDecorators( + SetMetadata(META_DATA.EXPRESS, isExpress), + SetMetadata(META_DATA.TTL, ttl), + UseInterceptors(...[...interceptors, CacheInterceptor]), + ); +} diff --git a/api-gateway/src/helpers/decorators/inject.ts b/api-gateway/src/helpers/decorators/inject.ts index e3d3f48409..9fdf893b26 100644 --- a/api-gateway/src/helpers/decorators/inject.ts +++ b/api-gateway/src/helpers/decorators/inject.ts @@ -1,6 +1,6 @@ -import {Guardians} from '../guardians'; -import {Users} from '../users'; -import {Wallet} from '../wallet'; +import {Guardians} from '../guardians.js'; +import {Users} from '../users.js'; +import {Wallet} from '../wallet.js'; /** * Service injector diff --git a/api-gateway/src/helpers/guardians.ts b/api-gateway/src/helpers/guardians.ts index 1737fce280..ac884afebe 100644 --- a/api-gateway/src/helpers/guardians.ts +++ b/api-gateway/src/helpers/guardians.ts @@ -1,7 +1,7 @@ -import { Singleton } from '@helpers/decorators/singleton'; -import { ApplicationStates, CommonSettings, ContractAPI, ContractType, GenerateUUIDv4, IArtifact, IChainItem, IContract, IDidObject, IRetirePool, IRetireRequest, ISchema, IToken, ITokenInfo, IUser, IVCDocument, IVPDocument, MessageAPI, RetireTokenPool, RetireTokenRequest, SchemaNode, SuggestionsOrderPriority } from '@guardian/interfaces'; +import { Singleton } from '../helpers/decorators/singleton.js'; +import { ApplicationStates, CommonSettings, ContractAPI, ContractType, GenerateUUIDv4, IArtifact, IChainItem, IContract, IDidObject, IRetirePool, IRetireRequest, ISchema, IToken, ITokenInfo, IUser, IVCDocument, IVPDocument, MessageAPI, PolicyToolMetadata, RetireTokenPool, RetireTokenRequest, SchemaNode, SuggestionsOrderPriority } from '@guardian/interfaces'; import { IAuthUser, NatsService } from '@guardian/common'; -import { NewTask } from './task-manager'; +import { NewTask } from './task-manager.js'; /** * Filters type @@ -170,6 +170,14 @@ export class Guardians extends NatsService { return await this.sendMessage(MessageAPI.SET_TOKEN_ASYNC, { token, owner, task }); } + /** + * Update token + * @param token + */ + public async updateToken(token: IToken | any): Promise { + return await this.sendMessage(MessageAPI.UPDATE_TOKEN, { token }); + } + /** * Async create new token * @param token @@ -1942,9 +1950,10 @@ export class Guardians extends NatsService { * Load tool file for import * @param zip * @param owner + * @param metadata */ - public async importToolFile(zip: any, owner: string) { - return await this.sendMessage(MessageAPI.TOOL_IMPORT_FILE, { zip, owner }); + public async importToolFile(zip: any, owner: string, metadata?: PolicyToolMetadata) { + return await this.sendMessage(MessageAPI.TOOL_IMPORT_FILE, { zip, owner, metadata }); } /** @@ -1979,9 +1988,10 @@ export class Guardians extends NatsService { * @param zip * @param owner * @param task + * @param metadata */ - public async importToolFileAsync(zip: any, owner: string, task: NewTask) { - return await this.sendMessage(MessageAPI.TOOL_IMPORT_FILE_ASYNC, { zip, owner, task }); + public async importToolFileAsync(zip: any, owner: string, task: NewTask, metadata?: PolicyToolMetadata) { + return await this.sendMessage(MessageAPI.TOOL_IMPORT_FILE_ASYNC, { zip, owner, task, metadata }); } /** diff --git a/api-gateway/src/helpers/interceptors/cache.ts b/api-gateway/src/helpers/interceptors/cache.ts new file mode 100644 index 0000000000..2d7caf4bba --- /dev/null +++ b/api-gateway/src/helpers/interceptors/cache.ts @@ -0,0 +1,70 @@ +import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common'; + +import crypto from 'crypto'; + +import { Observable, of, switchMap, tap } from 'rxjs'; + +//services +import { CacheService } from '../cache-service.js'; +import { Users } from '../users.js'; + +//constants +import { CACHE, META_DATA } from '../../constants/index.js'; + +@Injectable() +export class CacheInterceptor implements NestInterceptor { + constructor(private readonly cacheService: CacheService) { + } + + async intercept(context: ExecutionContext, next: CallHandler): Promise> { + const httpContext = context.switchToHttp(); + const request = httpContext.getRequest(); + const responseContext = httpContext.getResponse(); + + const ttl = Reflect.getMetadata(META_DATA.TTL, context.getHandler()) ?? CACHE.DEFAULT_TTL; + const isExpress = Reflect.getMetadata(META_DATA.EXPRESS, context.getHandler()); + + const token = request.headers.authorization?.split(' ')[1]; + let user = {} + + if(token) { + const users: Users = new Users(); + user = await users.getUserByToken(token); + } + + const hashUser: string = crypto.createHash('md5').update(JSON.stringify(user)).digest('hex'); + const { url: route } = request; + const cacheKey = `cache/${route}:${hashUser}`; + + return of(null).pipe( + switchMap(async () => { + const cachedResponse: string = await this.cacheService.get(cacheKey); + + if (cachedResponse) { + return JSON.parse(cachedResponse); + } + }), + switchMap(resultResponse => { + if (resultResponse) { + if (isExpress) { + return of(responseContext.json(resultResponse)); + } + + return of(resultResponse); + } + + return next.handle().pipe( + tap(async response => { + let result = response; + + if (isExpress) { + result = response.locals.data; + } + + await this.cacheService.set(cacheKey, JSON.stringify(result), ttl); + }), + ); + }), + ); + } +} diff --git a/api-gateway/src/helpers/interceptors/performance.ts b/api-gateway/src/helpers/interceptors/performance.ts new file mode 100644 index 0000000000..3acc713181 --- /dev/null +++ b/api-gateway/src/helpers/interceptors/performance.ts @@ -0,0 +1,22 @@ +import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common'; + +import { Observable, tap } from 'rxjs'; +import { performance } from 'perf_hooks'; + +@Injectable() +export class PerformanceInterceptor implements NestInterceptor { + intercept(context: ExecutionContext, next: CallHandler): Observable { + const start: number = performance.now(); + + const request = context.switchToHttp().getRequest(); + const route = request?.url; + + return next.handle().pipe( + tap(() => { + const end: number = performance.now(); + const executionTime: number = end - start; + console.log(`Execution time for ${route}: ${executionTime.toFixed(2)}ms`); + }), + ); + } +} diff --git a/api-gateway/src/helpers/ipfs.ts b/api-gateway/src/helpers/ipfs.ts index d12961dd27..9f885d7078 100644 --- a/api-gateway/src/helpers/ipfs.ts +++ b/api-gateway/src/helpers/ipfs.ts @@ -6,7 +6,7 @@ import { IFileResponse, GenerateUUIDv4 } from '@guardian/interfaces'; -import { Singleton } from './decorators/singleton'; +import { Singleton } from './decorators/singleton.js'; /** * IPFS service diff --git a/api-gateway/src/helpers/meeco.ts b/api-gateway/src/helpers/meeco.ts index 3e4f27bca4..0ce026efe7 100644 --- a/api-gateway/src/helpers/meeco.ts +++ b/api-gateway/src/helpers/meeco.ts @@ -1,4 +1,4 @@ -import { Singleton } from '@helpers/decorators/singleton'; +import { Singleton } from '../helpers/decorators/singleton.js'; import { AuthEvents, GenerateUUIDv4 } from '@guardian/interfaces'; import { CredentialSubject, generateNumberFromString, MeecoApprovedSubmission, MeecoJwt, NatsService, Vc, VerifiableCredential } from '@guardian/common'; import * as jwt from 'jsonwebtoken'; diff --git a/api-gateway/src/helpers/policy-engine.ts b/api-gateway/src/helpers/policy-engine.ts index 4d27d58083..e64df03c3f 100644 --- a/api-gateway/src/helpers/policy-engine.ts +++ b/api-gateway/src/helpers/policy-engine.ts @@ -1,7 +1,7 @@ -import { Singleton } from '@helpers/decorators/singleton'; -import { DocumentType, GenerateUUIDv4, MigrationConfig, PolicyEngineEvents } from '@guardian/interfaces'; +import { Singleton } from '../helpers/decorators/singleton.js'; +import { DocumentType, GenerateUUIDv4, MigrationConfig, PolicyEngineEvents, PolicyToolMetadata } from '@guardian/interfaces'; import { IAuthUser, NatsService } from '@guardian/common'; -import { NewTask } from './task-manager'; +import { NewTask } from './task-manager.js'; /** * Policy engine service @@ -269,9 +269,20 @@ export class PolicyEngine extends NatsService { * @param user * @param zip * @param versionOfTopicId - */ - public async importFile(user: IAuthUser, zip: Buffer, versionOfTopicId?: string) { - return await this.sendMessage(PolicyEngineEvents.POLICY_IMPORT_FILE, { zip, user, versionOfTopicId }); + * @param metadata + */ + public async importFile( + user: IAuthUser, + zip: Buffer, + versionOfTopicId?: string, + metadata?: PolicyToolMetadata + ) { + return await this.sendMessage(PolicyEngineEvents.POLICY_IMPORT_FILE, { + zip, + user, + versionOfTopicId, + metadata, + }); } /** @@ -280,18 +291,38 @@ export class PolicyEngine extends NatsService { * @param zip * @param versionOfTopicId * @param task + * @param metadata */ - public async importFileAsync(user: IAuthUser, zip: Buffer, versionOfTopicId: string, task: NewTask) { - return await this.sendMessage(PolicyEngineEvents.POLICY_IMPORT_FILE_ASYNC, { zip, user, versionOfTopicId, task }); + public async importFileAsync( + user: IAuthUser, + zip: Buffer, + versionOfTopicId: string, + task: NewTask, + metadata?: PolicyToolMetadata + ) { + return await this.sendMessage( + PolicyEngineEvents.POLICY_IMPORT_FILE_ASYNC, + { zip, user, versionOfTopicId, task, metadata } + ); } /** * Import policy from message * @param user * @param messageId + * @param versionOfTopicId + * @param metadata */ - public async importMessage(user: IAuthUser, messageId: string, versionOfTopicId: string) { - return await this.sendMessage(PolicyEngineEvents.POLICY_IMPORT_MESSAGE, { messageId, user, versionOfTopicId }); + public async importMessage( + user: IAuthUser, + messageId: string, + versionOfTopicId: string, + metadata?: PolicyToolMetadata + ) { + return await this.sendMessage( + PolicyEngineEvents.POLICY_IMPORT_MESSAGE, + { messageId, user, versionOfTopicId, metadata } + ); } /** @@ -300,9 +331,19 @@ export class PolicyEngine extends NatsService { * @param messageId * @param versionOfTopicId * @param task + * @param metadata */ - public async importMessageAsync(user: IAuthUser, messageId: string, versionOfTopicId: string, task: NewTask) { - return await this.sendMessage(PolicyEngineEvents.POLICY_IMPORT_MESSAGE_ASYNC, { messageId, user, versionOfTopicId, task }); + public async importMessageAsync( + user: IAuthUser, + messageId: string, + versionOfTopicId: string, + task: NewTask, + metadata?: PolicyToolMetadata + ) { + return await this.sendMessage( + PolicyEngineEvents.POLICY_IMPORT_MESSAGE_ASYNC, + { messageId, user, versionOfTopicId, task, metadata } + ); } /** @@ -541,4 +582,77 @@ export class PolicyEngine extends NatsService { ): Promise { await this.sendMessage(PolicyEngineEvents.MIGRATE_DATA_ASYNC, { owner, migrationConfig, task }); } + + /** + * Download policy date + * @param policyId Policy identifier + * @param owner Owner + * @returns Data + */ + public async downloadPolicyData(policyId: string, owner: string) { + return Buffer.from( + (await this.sendMessage(PolicyEngineEvents.DOWNLOAD_POLICY_DATA, { + policyId, + owner, + })) as string, + 'base64' + ); + } + + /** + * Download virtual keys + * @param policyId Policy identifier + * @param owner Owner + * @returns Virtual keys + */ + public async downloadVirtualKeys(policyId: string, owner: string) { + return Buffer.from( + (await this.sendMessage(PolicyEngineEvents.DOWNLOAD_VIRTUAL_KEYS, { + policyId, + owner, + })) as string, + 'base64' + ); + } + + /** + * Upload policy data + * @param user User + * @param data Data + * @returns Uploaded policy + */ + public async uploadPolicyData(user: string, data: any) { + return await this.sendMessage(PolicyEngineEvents.UPLOAD_POLICY_DATA, { + user, + data, + }); + } + + /** + * Upload virtual keys + * @param owner Owner + * @param data Data + * @param policyId Policy identifier + * @returns Operation completed + */ + public async uploadVirtualKeys(owner: string, data: any, policyId: string) { + return await this.sendMessage(PolicyEngineEvents.UPLOAD_VIRTUAL_KEYS, { + owner, + data, + policyId + }); + } + + /** + * Get tag block map + * @param policyId Policy identifier + * @param owner Owner + * @returns Tag block map + */ + public async getTagBlockMap(policyId: string, owner: string): Promise { + return await this.sendMessage(PolicyEngineEvents.GET_TAG_BLOCK_MAP, { + policyId, + owner, + }) + } } diff --git a/api-gateway/src/helpers/projects.ts b/api-gateway/src/helpers/projects.ts index 718c364407..cf997e76d9 100644 --- a/api-gateway/src/helpers/projects.ts +++ b/api-gateway/src/helpers/projects.ts @@ -3,7 +3,7 @@ import { MessageAPI, GenerateUUIDv4 } from '@guardian/interfaces'; -import { Singleton } from './decorators/singleton'; +import { Singleton } from './decorators/singleton.js'; /** * Project service diff --git a/api-gateway/src/helpers/task-manager.ts b/api-gateway/src/helpers/task-manager.ts index 63448ddcb6..f4ec920b9b 100644 --- a/api-gateway/src/helpers/task-manager.ts +++ b/api-gateway/src/helpers/task-manager.ts @@ -1,4 +1,4 @@ -import { WebSocketsService } from '@api/service/websockets'; +import { WebSocketsService } from '../api/service/websockets.js'; import { MessageResponse, NatsService } from '@guardian/common'; import { GenerateUUIDv4, @@ -7,7 +7,7 @@ import { StatusType, TaskAction, } from '@guardian/interfaces'; -import { Singleton } from '@helpers/decorators/singleton'; +import { Singleton } from '../helpers/decorators/singleton.js'; import { NatsConnection } from 'nats'; /** diff --git a/api-gateway/src/helpers/users.ts b/api-gateway/src/helpers/users.ts index 68d9f84505..cdad3842fb 100644 --- a/api-gateway/src/helpers/users.ts +++ b/api-gateway/src/helpers/users.ts @@ -1,4 +1,4 @@ -import { Singleton } from '@helpers/decorators/singleton'; +import { Singleton } from '../helpers/decorators/singleton.js'; import { ApplicationStates, AuthEvents, GenerateUUIDv4, MessageAPI, UserRole } from '@guardian/interfaces'; import { AuthenticatedRequest, IAuthUser, NatsService, ProviderAuthUser } from '@guardian/common'; import { Injectable } from '@nestjs/common'; diff --git a/api-gateway/src/helpers/wallet.ts b/api-gateway/src/helpers/wallet.ts index 8d1bccbced..2c26b5af2e 100644 --- a/api-gateway/src/helpers/wallet.ts +++ b/api-gateway/src/helpers/wallet.ts @@ -1,5 +1,5 @@ -import { Singleton } from '@helpers/decorators/singleton'; -import { WalletEvents, IWalletAccount, GenerateUUIDv4 } from '@guardian/interfaces'; +import { Singleton } from '../helpers/decorators/singleton.js'; +import { GenerateUUIDv4, IWalletAccount, WalletEvents } from '@guardian/interfaces'; import { NatsService } from '@guardian/common'; /** @@ -7,7 +7,8 @@ import { NatsService } from '@guardian/common'; */ export enum KeyType { ID = 'ID', - KEY = 'KEY' + KEY = 'KEY', + FIREBLOCKS_KEY = 'FIREBLOCKS_KEY', } /** diff --git a/api-gateway/src/index.ts b/api-gateway/src/index.ts index 11b146661a..dae6021377 100644 --- a/api-gateway/src/index.ts +++ b/api-gateway/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/api-gateway/src/middlewares/validation/schemas/accounts.ts b/api-gateway/src/middlewares/validation/schemas/accounts.ts index 59eee87469..24cdff8eab 100644 --- a/api-gateway/src/middlewares/validation/schemas/accounts.ts +++ b/api-gateway/src/middlewares/validation/schemas/accounts.ts @@ -1,10 +1,10 @@ import * as yup from 'yup'; -import fieldsValidation from '../fields-validation' +import fieldsValidation from '../fields-validation.js' import { IsIn, IsNotEmpty, IsString } from 'class-validator'; import { UserRole } from '@guardian/interfaces'; import { Expose } from 'class-transformer'; import { ApiProperty } from '@nestjs/swagger'; -import { Match } from '@helpers/decorators/match.validator'; +import { Match } from '../../../helpers/decorators/match.validator.js'; export class AccountsResponseDTO { @ApiProperty() diff --git a/api-gateway/src/middlewares/validation/schemas/index.ts b/api-gateway/src/middlewares/validation/schemas/index.ts index 742ec6bcb1..59ebd587cd 100644 --- a/api-gateway/src/middlewares/validation/schemas/index.ts +++ b/api-gateway/src/middlewares/validation/schemas/index.ts @@ -1,13 +1,13 @@ -export * from './accounts' -export * from './artifacts' -export * from './contracts' -export * from './errors' -export * from './notifications' -export * from './schemas' -export * from './settings' -export * from './suggestions' -export * from './task' -export * from './tool' -export * from './analytics' -export * from './demo' -export * from './profiles' \ No newline at end of file +export * from './accounts.js' +export * from './artifacts.js' +export * from './contracts.js' +export * from './errors.js' +export * from './notifications.js' +export * from './schemas.js' +export * from './settings.js' +export * from './suggestions.js' +export * from './task.js' +export * from './tool.js' +export * from './analytics.js' +export * from './demo.js' +export * from './profiles.js' diff --git a/api-gateway/src/middlewares/validation/schemas/policies.ts b/api-gateway/src/middlewares/validation/schemas/policies.ts index 7af7b66f5c..f8b8c5eacf 100644 --- a/api-gateway/src/middlewares/validation/schemas/policies.ts +++ b/api-gateway/src/middlewares/validation/schemas/policies.ts @@ -35,7 +35,7 @@ export class MigrationConfigDTO { * Policies */ @ApiProperty({ type: () => MigrationConfigPoliciesDTO }) - policies: MigrationConfigPoliciesDTO + policies: MigrationConfigPoliciesDTO; /** * VC documents */ @@ -50,15 +50,47 @@ export class MigrationConfigDTO { * Schemas */ @ApiProperty({ type: 'object' }) - schemas: { [key: string]: string } + schemas: { [key: string]: string }; /** * Groups */ @ApiProperty({ type: 'object' }) - groups: { [key: string]: string } + groups: { [key: string]: string }; /** * Roles */ @ApiProperty({ type: 'object' }) - roles: { [key: string]: string } + roles: { [key: string]: string }; + /** + * Blocks + */ + @ApiProperty({ type: 'object' }) + blocks: { [key: string]: string }; + /** + * Tokens + */ + @ApiProperty({ type: 'object' }) + tokens: { [key: string]: string }; + /** + * Migrate state + */ + @ApiProperty({ type: 'boolean' }) + migrateState: boolean; + /** + * Migrate retire pools + */ + @ApiProperty({ type: 'boolean' }) + migrateRetirePools: boolean; + /** + * Edited VCs + */ + @ApiProperty({ type: 'object' }) + editedVCs: { [key: string]: any }; + /** + * Retire contract identifier + */ + @ApiProperty({ + type: 'string', + }) + retireContractId: string; } diff --git a/api-gateway/src/middlewares/validation/schemas/schemas.ts b/api-gateway/src/middlewares/validation/schemas/schemas.ts index 352078e9fb..6a551612ea 100644 --- a/api-gateway/src/middlewares/validation/schemas/schemas.ts +++ b/api-gateway/src/middlewares/validation/schemas/schemas.ts @@ -1,5 +1,5 @@ import * as yup from 'yup'; -import fieldsValidation from '../fields-validation' +import fieldsValidation from '../fields-validation.js' import { ApiProperty } from '@nestjs/swagger'; import { IsIn, IsNotEmpty, IsString } from 'class-validator'; import { UserRole } from '@guardian/interfaces'; @@ -135,4 +135,4 @@ export class MessageSchemaDTO { @IsString() @IsNotEmpty() messageId: string; -} \ No newline at end of file +} diff --git a/api-gateway/src/middlewares/validation/schemas/settings.ts b/api-gateway/src/middlewares/validation/schemas/settings.ts index d968945125..c008922b00 100644 --- a/api-gateway/src/middlewares/validation/schemas/settings.ts +++ b/api-gateway/src/middlewares/validation/schemas/settings.ts @@ -1,4 +1,4 @@ -import fieldsValidation from '@middlewares/validation/fields-validation'; +import fieldsValidation from '../../../middlewares/validation/fields-validation.js'; import * as yup from 'yup'; import { ApiProperty } from '@nestjs/swagger'; import { IsNotEmpty, IsString } from 'class-validator'; diff --git a/api-gateway/tsconfig.json b/api-gateway/tsconfig.json index 84a8efc94b..66cdbc5a22 100644 --- a/api-gateway/tsconfig.json +++ b/api-gateway/tsconfig.json @@ -12,27 +12,10 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", - "paths": { - "@api/*": [ - "api/*" - ], - "@entities/*": [ - "entities/*" - ], - "@helpers/*": [ - "helpers/*" - ], - "@auth/*": [ - "auth/*" - ], - "@middlewares/*": [ - "middlewares/*" - ] - }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/api-gateway/tsconfig.production.json b/api-gateway/tsconfig.production.json index a58f01d630..2411af62cd 100644 --- a/api-gateway/tsconfig.production.json +++ b/api-gateway/tsconfig.production.json @@ -12,27 +12,10 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", - "paths": { - "@api/*": [ - "api/*" - ], - "@entities/*": [ - "entities/*" - ], - "@helpers/*": [ - "helpers/*" - ], - "@auth/*": [ - "auth/*" - ], - "@middlewares/*": [ - "middlewares/*" - ] - }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/api-tests/helpers.js b/api-tests/helpers.js index 0eeec5c809..e6013ba49e 100644 --- a/api-tests/helpers.js +++ b/api-tests/helpers.js @@ -1,5 +1,6 @@ -const axios = require("axios"); -const BASE_URL = 'http://localhost:3002' +import axios from 'axios'; + +const BASE_URL = 'http://localhost:3002'; let tokens = [ ]; @@ -139,11 +140,11 @@ function GenerateUUIDv4() { }); } -module.exports = { +export { sleep, GetURL, SaveToken, GetToken, GenerateTokens, - GenerateUUIDv4 -} + GenerateUUIDv4, +}; diff --git a/api-tests/index.js b/api-tests/index.js index 0aee46248d..3a536ba628 100644 --- a/api-tests/index.js +++ b/api-tests/index.js @@ -1,5 +1,5 @@ -const { spawn } = require('child_process'); -const path = require('path'); +import { spawn } from 'child_process'; +import path from 'path'; async function Run() { diff --git a/api-tests/package.json b/api-tests/package.json index 9ad9c12c0f..290bb8243a 100644 --- a/api-tests/package.json +++ b/api-tests/package.json @@ -1,8 +1,9 @@ { "name": "api-tests", - "version": "2.23.1", + "version": "2.24.0", "description": "API Tests", "main": "index.js", + "type": "module", "scripts": { "test": "mocha index.js", "test:ci": "mocha index.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/api-tests.xml" @@ -25,8 +26,5 @@ "gulp-rename": "^2.0.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1" - }, - "resolutions": { - "@types/mime": "3.0.4" } } diff --git a/api-tests/test-suits/accounts.js b/api-tests/test-suits/accounts.js index 17ccd913ec..1a6c21230c 100644 --- a/api-tests/test-suits/accounts.js +++ b/api-tests/test-suits/accounts.js @@ -1,6 +1,7 @@ -const axios = require('axios'); -const assert = require('assert') -const {GetURL, sleep, SaveToken, GetToken} = require('../helpers'); +import axios from 'axios'; +import assert from 'assert'; + +import { GetURL, GetToken } from '../helpers'; function Accounts() { it('/accounts/login', async function() { @@ -180,6 +181,6 @@ function Accounts() { }); } -module.exports = { - Accounts -} +export { + Accounts, +}; diff --git a/api-tests/test-suits/ipfs.js b/api-tests/test-suits/ipfs.js index de053ba434..a5c7c5c469 100644 --- a/api-tests/test-suits/ipfs.js +++ b/api-tests/test-suits/ipfs.js @@ -1,5 +1,7 @@ -const axios = require("axios"); -const {GetURL, GetToken} = require("../helpers"); +import axios from 'axios'; +import assert from 'assert'; + +import { GetURL, GetToken } from '../helpers'; function Ipfs() { it('/ipfs/file', async function() { @@ -19,6 +21,6 @@ function Ipfs() { }) } -module.exports = { - Ipfs -} +export { + Ipfs, +}; diff --git a/api-tests/test-suits/policies.js b/api-tests/test-suits/policies.js index eabba30e34..a35f92dd23 100644 --- a/api-tests/test-suits/policies.js +++ b/api-tests/test-suits/policies.js @@ -1,6 +1,7 @@ -const axios = require("axios"); -const {GetURL, GetToken} = require("../helpers"); -const assert = require("assert"); +import axios from 'axios'; +import assert from 'assert'; + +import { GetURL, GetToken } from '../helpers'; function Policies() { let policyId, policyTag, policyOwner; @@ -337,6 +338,6 @@ function Policies() { }) } -module.exports = { - Policies -} +export { + Policies, +}; diff --git a/api-tests/test-suits/profiles.js b/api-tests/test-suits/profiles.js index 14880c8316..dc64c3925d 100644 --- a/api-tests/test-suits/profiles.js +++ b/api-tests/test-suits/profiles.js @@ -1,6 +1,6 @@ -const axios = require("axios"); -const { GetURL, GetToken } = require("../helpers"); -const assert = require("assert"); +import axios from 'axios'; + +import { GetURL, GetToken } from '../helpers'; function Profiles() { it('/profiles/balance', async function () { @@ -79,6 +79,6 @@ function Profiles() { }) } -module.exports = { - Profiles -} +export { + Profiles, +}; diff --git a/api-tests/test-suits/schemas.js b/api-tests/test-suits/schemas.js index 91c83ee4b1..c529cbc9d0 100644 --- a/api-tests/test-suits/schemas.js +++ b/api-tests/test-suits/schemas.js @@ -1,6 +1,7 @@ -const axios = require("axios"); -const {GetURL, GetToken, GenerateUUIDv4 } = require("../helpers"); -const assert = require("assert"); +import axios from 'axios'; +import assert from 'assert'; + +import { GetURL, GetToken, GenerateUUIDv4 } from '../helpers'; function Schemas() { let schemaId, schemaUUID, messageId, schemaBlob; @@ -221,6 +222,6 @@ function Schemas() { }) } -module.exports = { - Schemas -} +export { + Schemas, +}; diff --git a/api-tests/test-suits/trust-chains.js b/api-tests/test-suits/trust-chains.js index 4e27e590b4..06bb3c0ff5 100644 --- a/api-tests/test-suits/trust-chains.js +++ b/api-tests/test-suits/trust-chains.js @@ -1,6 +1,7 @@ -const axios = require("axios"); -const {GetURL, GetToken} = require("../helpers"); -const assert = require("assert"); +import axios from 'axios'; +import assert from 'assert'; + +import { GetURL, GetToken } from '../helpers'; function TrustChains() { it('/trust-chains', async function () { @@ -62,6 +63,6 @@ function TrustChains() { }); } -module.exports = { - TrustChains: TrustChains -} +export { + TrustChains, +}; diff --git a/application-events/.dockerignore b/application-events/.dockerignore index bac6d50d52..995dcad415 100644 --- a/application-events/.dockerignore +++ b/application-events/.dockerignore @@ -1,4 +1,9 @@ -node_modules -npm-debug.log -Dockerfile .dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/application-events/Dockerfile b/application-events/Dockerfile index e662753f1c..2c45a3fb9a 100644 --- a/application-events/Dockerfile +++ b/application-events/Dockerfile @@ -1,55 +1,59 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS applicationMetricsBuilder -WORKDIR /usr/local/application-events -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./application-events/package.json ./ -COPY ./application-events/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./application-events/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/application-events -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=applicationMetricsBuilder /usr/local/application-events/yarn.lock ./ -COPY ./application-events/package.json ./ -COPY ./application-events/.env.docker ./.env -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY ./application-events/docs ./docs -COPY --from=applicationMetricsBuilder /usr/local/application-events/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link application-events/package.json application-events/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link application-events/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link application-events/.env.docker ./.env +COPY --link application-events/docs docs/ + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD npm start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/application-events/package.json b/application-events/package.json index 6235a08574..84201d63a7 100644 --- a/application-events/package.json +++ b/application-events/package.json @@ -23,9 +23,9 @@ "dependencies": { "@guardian/common": "^2.13.0", "@guardian/interfaces": "^2.13.0", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", - "@mikro-orm/reflection": "5.7.12", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", + "@mikro-orm/reflection": "^6.1.11", "@types/express": "^4.17.17", "@types/mongoose": "^5.11.97", "@types/morgan": "^1.9.4", @@ -34,8 +34,8 @@ "express": "^4.17.3", "http-errors": "^2.0.0", "js-yaml": "^4.1.0", - "mikro-orm": "^5.6.12", - "mongodb": "5.6.0", + "mikro-orm": "^6.1.11", + "mongodb": "6.5.0", "mongoose": "^6.10.0", "morgan": "^1.10.0", "nats": "^2.12.1", @@ -60,5 +60,6 @@ "ts-node": "^10.9.1", "tslint": "^5.20.1", "tslint-config-standard": "^9.0.0" - } + }, + "type": "module" } diff --git a/application-events/src/connections/db/MongodbAdapter.ts b/application-events/src/connections/db/MongodbAdapter.ts index 00abef3947..79d0ec90b5 100644 --- a/application-events/src/connections/db/MongodbAdapter.ts +++ b/application-events/src/connections/db/MongodbAdapter.ts @@ -1,7 +1,7 @@ -import IConnection from './interfaces/IConnection'; +import IConnection from './interfaces/IConnection.js'; import { ObjectId } from '@mikro-orm/mongodb'; import { EntityClass } from '@mikro-orm/core/typings'; -import MongodbConnection from '../../singletons/MongodbConnection'; +import MongodbConnection from '../../singletons/MongodbConnection.js'; /** * MongodbAdapter diff --git a/application-events/src/connections/pub-subs/NatsPubSubAdapter.ts b/application-events/src/connections/pub-subs/NatsPubSubAdapter.ts index d8f52188ef..fb130705ca 100644 --- a/application-events/src/connections/pub-subs/NatsPubSubAdapter.ts +++ b/application-events/src/connections/pub-subs/NatsPubSubAdapter.ts @@ -1,5 +1,5 @@ import { MessageBrokerChannel } from '@guardian/common'; -import PubSub from './interfaces/PubSub'; +import PubSub from './interfaces/PubSub.js'; export default class NatsPubSubAdapter implements PubSub { private natsServer!: MessageBrokerChannel; diff --git a/application-events/src/index.ts b/application-events/src/index.ts index 48724fea1b..ba10ed1c02 100644 --- a/application-events/src/index.ts +++ b/application-events/src/index.ts @@ -4,11 +4,13 @@ import * as yaml from 'js-yaml'; import morgan from 'morgan'; import path from 'path'; import swaggerUi from 'swagger-ui-express'; +import eventRoutes from './routes/events.js'; +import webhookRoutes from './routes/webooks.js'; -import eventRoutes from './routes/events'; -import webhookRoutes from './routes/webooks'; +import EventListenerService from './services/EventListenerService.js'; -import EventListenerService from './services/EventListenerService'; +import dotenv from 'dotenv'; +dotenv.config(); const configPath = path.join(process.cwd(), 'docs', 'swagger.yaml'); const swaggerDocument = yaml.load(readFileSync(configPath, 'utf8'), { diff --git a/application-events/src/middlewares/validation/schemas/webhook.ts b/application-events/src/middlewares/validation/schemas/webhook.ts index 9d7859680e..1542efdbd2 100644 --- a/application-events/src/middlewares/validation/schemas/webhook.ts +++ b/application-events/src/middlewares/validation/schemas/webhook.ts @@ -1,5 +1,5 @@ import * as yup from 'yup'; -import fieldsValidation from '../fields-validation' +import fieldsValidation from '../fields-validation.js' export const storeWebhookSchema = () => { const { url, events } = fieldsValidation diff --git a/application-events/src/routes/events.ts b/application-events/src/routes/events.ts index 1de9f34e9c..3ee5582096 100644 --- a/application-events/src/routes/events.ts +++ b/application-events/src/routes/events.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; -import { externalMessageEvents } from '../services/ApplicationMetricService'; -import NatsPubSubAdapter from '../connections/pub-subs/NatsPubSubAdapter'; +import { externalMessageEvents } from '../services/ApplicationMetricService.js'; +import NatsPubSubAdapter from '../connections/pub-subs/NatsPubSubAdapter.js'; const eventRoutes = Router(); diff --git a/application-events/src/routes/webooks.ts b/application-events/src/routes/webooks.ts index a541b68dd2..f290028d52 100644 --- a/application-events/src/routes/webooks.ts +++ b/application-events/src/routes/webooks.ts @@ -1,9 +1,9 @@ -import validate from '../middlewares/validation'; -import { storeWebhookSchema, updateWebhookSchema } from '../middlewares/validation/schemas/webhook'; +import validate from '../middlewares/validation/index.js'; +import { storeWebhookSchema, updateWebhookSchema } from '../middlewares/validation/schemas/webhook.js'; import { Request, Response, Router, NextFunction } from 'express'; -import WebhookService from '../services/WebhookService'; -import MongodbAdapter from '../connections/db/MongodbAdapter'; -import { Webhook } from '../entities/Webhook'; +import WebhookService from '../services/WebhookService.js'; +import MongodbAdapter from '../connections/db/MongodbAdapter.js'; +import { Webhook } from '../entities/Webhook.js'; const webhookRoutes = Router(); const dbConnection = new MongodbAdapter(); diff --git a/application-events/src/services/ApplicationMetricService.ts b/application-events/src/services/ApplicationMetricService.ts index e8ba6e776a..1081878cbc 100644 --- a/application-events/src/services/ApplicationMetricService.ts +++ b/application-events/src/services/ApplicationMetricService.ts @@ -1,13 +1,13 @@ import axios from 'axios'; -import PubSub from 'connections/pub-subs/interfaces/PubSub'; -import WebhookService from './WebhookService'; +import PubSub from '../connections/pub-subs/interfaces/PubSub.js'; +import WebhookService from './WebhookService.js'; import { PolicyEvents, PolicyEngineEvents, ExternalMessageEvents } from '@guardian/interfaces'; -import WebhookStore from '../singletons/WebhookStore'; +import WebhookStore from '../singletons/WebhookStore.js'; const avoidEvents = [ 'WRITE_LOG', diff --git a/application-events/src/services/EventListenerService.ts b/application-events/src/services/EventListenerService.ts index a7ab98183f..b4baa50a17 100644 --- a/application-events/src/services/EventListenerService.ts +++ b/application-events/src/services/EventListenerService.ts @@ -1,7 +1,7 @@ -import MongodbAdapter from '../connections/db/MongodbAdapter'; -import NatsPubSubAdapter from '../connections/pub-subs/NatsPubSubAdapter'; -import WebhookService from './WebhookService'; -import ApplicationMetricService from './ApplicationMetricService'; +import MongodbAdapter from '../connections/db/MongodbAdapter.js'; +import NatsPubSubAdapter from '../connections/pub-subs/NatsPubSubAdapter.js'; +import WebhookService from './WebhookService.js'; +import ApplicationMetricService from './ApplicationMetricService.js'; export default class EventListenerService { private readonly dbConnection; diff --git a/application-events/src/services/WebhookService.ts b/application-events/src/services/WebhookService.ts index f93dcf0561..1fc1cdb7a8 100644 --- a/application-events/src/services/WebhookService.ts +++ b/application-events/src/services/WebhookService.ts @@ -1,6 +1,6 @@ -import IConnection from '../connections/db/interfaces/IConnection' -import { Webhook } from '../entities/Webhook'; -import WebhookStore from '../singletons/WebhookStore'; +import IConnection from '../connections/db/interfaces/IConnection.js' +import { Webhook } from '../entities/Webhook.js'; +import WebhookStore from '../singletons/WebhookStore.js'; export default class WebhookService { private webhookStore: WebhookStore; diff --git a/application-events/src/singletons/MongodbConnection.ts b/application-events/src/singletons/MongodbConnection.ts index 3e1975b5a1..3c460a20bf 100644 --- a/application-events/src/singletons/MongodbConnection.ts +++ b/application-events/src/singletons/MongodbConnection.ts @@ -1,6 +1,6 @@ import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; -import { Webhook } from '../entities/Webhook'; +import { Webhook } from '../entities/Webhook.js'; export default class MongodbConnection { @@ -14,7 +14,6 @@ export default class MongodbConnection { dbName: 'application_events', driver: MongoDriver, entities: [ Webhook ], - type: 'mongo', }); }; diff --git a/application-events/src/singletons/WebhookStore.ts b/application-events/src/singletons/WebhookStore.ts index 88e86d4ba5..fef2e9b92c 100644 --- a/application-events/src/singletons/WebhookStore.ts +++ b/application-events/src/singletons/WebhookStore.ts @@ -1,4 +1,4 @@ -import { Webhook } from '../entities/Webhook'; +import { Webhook } from '../entities/Webhook.js'; export default class WebhookStore { private static instance: WebhookStore; diff --git a/application-events/tests/index.ts b/application-events/tests/index.ts index c6ab3e160b..4bb706d560 100644 --- a/application-events/tests/index.ts +++ b/application-events/tests/index.ts @@ -1,4 +1,4 @@ -import webhookApiTest from './webhook'; +import webhookApiTest from './webhook.js'; describe('Application events tests', async () => { webhookApiTest(); diff --git a/application-events/tests/webhook.ts b/application-events/tests/webhook.ts index 2c04a2b0e7..0616ceff0b 100644 --- a/application-events/tests/webhook.ts +++ b/application-events/tests/webhook.ts @@ -1,7 +1,7 @@ import chai, { expect } from 'chai'; import chaiHttp from 'chai-http'; import { describe, it } from 'mocha'; -import app from '../src/index'; +import app from '../src/index.js'; chai.use(chaiHttp); const webhookApiTest = () => { diff --git a/application-events/tsconfig.json b/application-events/tsconfig.json index b346534031..f3f86f8f6d 100644 --- a/application-events/tsconfig.json +++ b/application-events/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "baseUrl": "src", - "target": "es6", - "module": "commonjs", + "module": "ESNext", + "target": "es2022", "experimentalDecorators": true, "outDir": "./dist", "strict": true, diff --git a/application-events/tsconfig.production.json b/application-events/tsconfig.production.json index 69cdc8769c..836800b9f7 100644 --- a/application-events/tsconfig.production.json +++ b/application-events/tsconfig.production.json @@ -1,8 +1,8 @@ { "compilerOptions": { "baseUrl": "src", - "target": "es6", - "module": "commonjs", + "module": "ESNext", + "target": "es2022", "experimentalDecorators": true, "outDir": "./dist", "strict": true, diff --git a/auth-service/.dockerignore b/auth-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/auth-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/auth-service/Dockerfile b/auth-service/Dockerfile index f41e7edc22..463d367e22 100644 --- a/auth-service/Dockerfile +++ b/auth-service/Dockerfile @@ -1,55 +1,58 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS authServiceBuilder -WORKDIR /usr/local/auth-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./auth-service/package.json ./ -COPY ./auth-service/tsconfig*.json ./ -COPY ./auth-service/Gulpfile.js ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./auth-service/environments ./environments/. -ADD ./auth-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/auth-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=authServiceBuilder /usr/local/auth-service/yarn.lock ./ -COPY ./auth-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=authServiceBuilder /usr/local/auth-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link auth-service/package.json auth-service/tsconfig*.json auth-service/Gulpfile.mjs yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ +COPY --link auth-service/environments environments/ +COPY --link auth-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ +RUN mkdir -p /usr/local/app/dist/migrations + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] diff --git a/auth-service/Dockerfile.demo b/auth-service/Dockerfile.demo index 4926d17e72..7c1acbf224 100644 --- a/auth-service/Dockerfile.demo +++ b/auth-service/Dockerfile.demo @@ -1,55 +1,58 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS authServiceBuilder -WORKDIR /usr/local/auth-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./auth-service/package.json ./ -COPY ./auth-service/tsconfig*.json ./ -COPY ./auth-service/Gulpfile.js ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./auth-service/environments ./environments/. -ADD ./auth-service/src ./src/. -RUN yarn run build:demo - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/auth-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=authServiceBuilder /usr/local/auth-service/yarn.lock ./ -COPY ./auth-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=authServiceBuilder /usr/local/auth-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link auth-service/package.json auth-service/tsconfig*.json auth-service/Gulpfile.mjs yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ +COPY --link auth-service/environments environments/ +COPY --link auth-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:demo + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ +RUN mkdir -p /usr/local/app/dist/migrations + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] diff --git a/auth-service/Gulpfile.js b/auth-service/Gulpfile.mjs similarity index 88% rename from auth-service/Gulpfile.js rename to auth-service/Gulpfile.mjs index 4be1d2ab2c..bc72367a0b 100644 --- a/auth-service/Gulpfile.js +++ b/auth-service/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { return gulp diff --git a/auth-service/package.json b/auth-service/package.json index 23d28adb42..99cab14af7 100644 --- a/auth-service/package.json +++ b/auth-service/package.json @@ -7,15 +7,14 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", "@meeco/cryppo": "^2.0.2", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -75,5 +74,6 @@ "start": "node dist/index.js", "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/auth-service/src/api/account-service.ts b/auth-service/src/api/account-service.ts index 4b51366c4a..5152232042 100644 --- a/auth-service/src/api/account-service.ts +++ b/auth-service/src/api/account-service.ts @@ -1,6 +1,7 @@ -import { IAuthUser } from '@api/auth.interface'; -import { sign, verify } from 'jsonwebtoken'; -import { User } from '@entity/user'; +import { IAuthUser } from './auth.interface.js'; +import pkg from 'jsonwebtoken'; + +import { User } from '../entity/user.js'; import * as util from 'util'; import crypto from 'crypto'; import { DataBaseHelper, Logger, MessageError, MessageResponse, NatsService, ProviderAuthUser, SecretManager, Singleton } from '@guardian/common'; @@ -25,6 +26,8 @@ import { UserRole } from '@guardian/interfaces'; +const { sign, verify } = pkg; + /** * Account service */ diff --git a/auth-service/src/api/meeco-service.ts b/auth-service/src/api/meeco-service.ts index 230d4550d4..19fb0ce8a2 100644 --- a/auth-service/src/api/meeco-service.ts +++ b/auth-service/src/api/meeco-service.ts @@ -1,8 +1,8 @@ import { DataBaseHelper, MessageResponse, NatsService, Singleton, Vc, VerifiableCredential } from '@guardian/common'; import { AuthEvents, ExternalProviders, GenerateUUIDv4 } from '@guardian/interfaces'; -import { MeecoService } from '../meeco/meeco.service'; +import { MeecoService } from '../meeco/meeco.service.js'; import { Logger } from '@nestjs/common'; -import { MeecoIssuerWhitelist } from '@entity/meeco-issuer-whitelist'; +import { MeecoIssuerWhitelist } from '../entity/meeco-issuer-whitelist.js'; const MeecoConfig = { baseUrl: process.env.MEECO_BASE_URL, diff --git a/auth-service/src/api/wallet-service.ts b/auth-service/src/api/wallet-service.ts index 6ea6bc3c91..93329169aa 100644 --- a/auth-service/src/api/wallet-service.ts +++ b/auth-service/src/api/wallet-service.ts @@ -1,7 +1,7 @@ -import { User } from '@entity/user'; +import { User } from '../entity/user.js'; import { DataBaseHelper, Logger, MessageError, MessageResponse, NatsService, Singleton, } from '@guardian/common'; import { GenerateUUIDv4, IGetGlobalApplicationKey, IGetKeyMessage, IGetKeyResponse, ISetGlobalApplicationKey, ISetKeyMessage, WalletEvents } from '@guardian/interfaces'; -import { IVault } from '../vaults'; +import { IVault } from '../vaults/index.js'; /** * Wallet service diff --git a/auth-service/src/app.ts b/auth-service/src/app.ts index 15aab0c812..4c86c0a264 100644 --- a/auth-service/src/app.ts +++ b/auth-service/src/app.ts @@ -1,17 +1,17 @@ -import { AccountService } from '@api/account-service'; -import { WalletService } from '@api/wallet-service'; +import { AccountService } from './api/account-service.js'; +import { WalletService } from './api/wallet-service.js'; import { ApplicationState, COMMON_CONNECTION_CONFIG, DataBaseHelper, LargePayloadContainer, Logger, MessageBrokerChannel, Migration, OldSecretManager, SecretManager } from '@guardian/common'; import { ApplicationStates } from '@guardian/interfaces'; import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; -import { InitializeVault } from './vaults'; -import { ImportKeysFromDatabase } from '@helpers/import-keys-from-database'; +import { InitializeVault } from './vaults/index.js'; +import { ImportKeysFromDatabase } from './helpers/import-keys-from-database.js'; import process from 'process'; import { NestFactory } from '@nestjs/core'; -import { AppModule } from './app.module'; +import { AppModule } from './app.module.js'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; -import { MeecoAuthService } from '@api/meeco-service'; -import { ApplicationEnvironment } from './environment'; +import { MeecoAuthService } from './api/meeco-service.js'; +import { ApplicationEnvironment } from './environment.js'; Promise.all([ Migration({ @@ -47,14 +47,14 @@ Promise.all([ state.updateState(ApplicationStates.INITIALIZING); try { if (!ApplicationEnvironment.demoMode) { - import('./helpers/fixtures').then(async (module) => { + import('./helpers/fixtures.demo.js').then(async (module) => { await module.fixtures(); }); } // Include accounts for demo builds only if (ApplicationEnvironment.demoMode) { - import('./helpers/fixtures.demo').then(async (module) => { + import('./helpers/fixtures.demo.js').then(async (module) => { await module.fixtures(); }); } diff --git a/auth-service/src/config.ts b/auth-service/src/config.ts index b3e587a95a..7a5152a61b 100644 --- a/auth-service/src/config.ts +++ b/auth-service/src/config.ts @@ -1,13 +1,6 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@entity': __dirname + '/entity', - '@helpers': __dirname + '/helpers' -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.auth.${process.env.GUARDIAN_ENV}` : './configs/.env.auth'; diff --git a/auth-service/src/entity/user.ts b/auth-service/src/entity/user.ts index 18dd430a4f..c5f5c4c19f 100644 --- a/auth-service/src/entity/user.ts +++ b/auth-service/src/entity/user.ts @@ -75,6 +75,12 @@ export class User extends BaseEntity implements IUser { @Property({nullable: true}) refreshToken?: string; + /** + * Use fireblocks signing + */ + @Property({nullable: true}) + useFireblocksSigning: boolean; + /** * Set defaults */ diff --git a/auth-service/src/helpers/credentials-validation/bitstring.ts b/auth-service/src/helpers/credentials-validation/bitstring.ts index c93ef720c4..8d82d38a1c 100644 --- a/auth-service/src/helpers/credentials-validation/bitstring.ts +++ b/auth-service/src/helpers/credentials-validation/bitstring.ts @@ -1,4 +1,4 @@ -import * as assert from './assertions'; +import * as assert from './assertions.js'; import { ungzip } from 'pako'; function base64urlDecode(input) { diff --git a/auth-service/src/helpers/credentials-validation/status-list.ts b/auth-service/src/helpers/credentials-validation/status-list.ts index 0d1a0ba81a..44301e263a 100644 --- a/auth-service/src/helpers/credentials-validation/status-list.ts +++ b/auth-service/src/helpers/credentials-validation/status-list.ts @@ -1,4 +1,4 @@ -import { Bitstring } from './bitstring'; +import { Bitstring } from './bitstring.js'; export class StatusList { private readonly bitstring: any; diff --git a/auth-service/src/helpers/fixtures.demo.ts b/auth-service/src/helpers/fixtures.demo.ts index c1f6b2dbcc..b43385d604 100644 --- a/auth-service/src/helpers/fixtures.demo.ts +++ b/auth-service/src/helpers/fixtures.demo.ts @@ -1,5 +1,5 @@ import crypto from 'crypto'; -import { User } from '@entity/user'; +import { User } from '../entity/user.js'; import { UserRole } from '@guardian/interfaces'; import { DataBaseHelper } from '@guardian/common'; diff --git a/auth-service/src/helpers/fixtures.ts b/auth-service/src/helpers/fixtures.ts index 3d77e69292..896f0e8105 100644 --- a/auth-service/src/helpers/fixtures.ts +++ b/auth-service/src/helpers/fixtures.ts @@ -1,5 +1,5 @@ import crypto from 'crypto'; -import { User } from '@entity/user'; +import { User } from '../entity/user.js'; import { UserRole } from '@guardian/interfaces'; import { DataBaseHelper } from '@guardian/common'; diff --git a/auth-service/src/helpers/import-keys-from-database.ts b/auth-service/src/helpers/import-keys-from-database.ts index 3e80591a44..4425d67695 100644 --- a/auth-service/src/helpers/import-keys-from-database.ts +++ b/auth-service/src/helpers/import-keys-from-database.ts @@ -1,6 +1,6 @@ -import { WalletAccount } from '@entity/wallet-account'; +import { WalletAccount } from '../entity/wallet-account.js'; import { DataBaseHelper, Logger } from '@guardian/common'; -import { IVault } from '../vaults'; +import { IVault } from '../vaults/index.js'; /** * Migration function diff --git a/auth-service/src/index.ts b/auth-service/src/index.ts index 11b146661a..dae6021377 100644 --- a/auth-service/src/index.ts +++ b/auth-service/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/auth-service/src/meeco/meeco-api.ts b/auth-service/src/meeco/meeco-api.ts index 80e12ea2d5..ecd8f10153 100644 --- a/auth-service/src/meeco/meeco-api.ts +++ b/auth-service/src/meeco/meeco-api.ts @@ -1,9 +1,9 @@ import axios from 'axios'; import querystring from 'querystring'; -import { IMe } from '../meeco/models/me'; -import { IDEK, IKEK, IKeypair, IPassphraseArtefact } from '../meeco/models/keys'; -import { IPresentationRequest, IPresentationSubmission, IPresentationSubmissions } from './models/presentation-request'; -import { IMeecoSchemaData } from './models/schema'; +import { IMe } from '../meeco/models/me.js'; +import { IDEK, IKEK, IKeypair, IPassphraseArtefact } from '../meeco/models/keys.js'; +import { IPresentationRequest, IPresentationSubmission, IPresentationSubmissions } from './models/presentation-request.js'; +import { IMeecoSchemaData } from './models/schema.js'; import * as jwt from 'jsonwebtoken'; import { VerifiableCredentialStatusListResult } from '@guardian/common'; diff --git a/auth-service/src/meeco/meeco.service.ts b/auth-service/src/meeco/meeco.service.ts index 563448e208..577b31b087 100644 --- a/auth-service/src/meeco/meeco.service.ts +++ b/auth-service/src/meeco/meeco.service.ts @@ -1,12 +1,12 @@ -import { Cryppo, IKey, IMasterEncryptionKey } from '../meeco/cryppo'; -import { IMeecoConfig, MeecoApi } from './meeco-api'; -import { IPassphraseArtefact } from './models/keys'; -import { IMe } from '../meeco/models/me'; -import { IPresentationRequest, IPresentationSubmission, IPresentationSubmissions } from './models/presentation-request'; +import { Cryppo, IKey, IMasterEncryptionKey } from '../meeco/cryppo.js'; +import { IMeecoConfig, MeecoApi } from './meeco-api.js'; +import { IPassphraseArtefact } from './models/keys.js'; +import { IMe } from '../meeco/models/me.js'; +import { IPresentationRequest, IPresentationSubmission, IPresentationSubmissions } from './models/presentation-request.js'; import base64url from 'base64url'; import * as jwt from 'jsonwebtoken'; import { Vc, VerifiableCredential } from '@guardian/common'; -import { StatusList } from '@helpers/credentials-validation/status-list'; +import { StatusList } from '../helpers/credentials-validation/status-list.js'; import nacl from 'tweetnacl'; export class MeecoService { diff --git a/auth-service/src/vaults/index.ts b/auth-service/src/vaults/index.ts index 96570b3bcd..445852648e 100644 --- a/auth-service/src/vaults/index.ts +++ b/auth-service/src/vaults/index.ts @@ -1,3 +1,3 @@ -export * from './vault-providers'; -export { InitializeVault } from './initialize-vault'; -export { IVault } from './vault.interface'; +export * from './vault-providers/index.js'; +export { InitializeVault } from './initialize-vault.js'; +export { IVault } from './vault.interface.js'; diff --git a/auth-service/src/vaults/initialize-vault.ts b/auth-service/src/vaults/initialize-vault.ts index c3db784540..ac2ffcc95f 100644 --- a/auth-service/src/vaults/initialize-vault.ts +++ b/auth-service/src/vaults/initialize-vault.ts @@ -1,5 +1,5 @@ -import { IVault } from './vault.interface'; -import * as vaultProviders from './vault-providers' +import { IVault } from './vault.interface.js'; +import * as vaultProviders from './vault-providers/index.js' import assert from 'assert'; /** diff --git a/auth-service/src/vaults/vault-providers/database.ts b/auth-service/src/vaults/vault-providers/database.ts index 0bced775b1..9d7d7139a0 100644 --- a/auth-service/src/vaults/vault-providers/database.ts +++ b/auth-service/src/vaults/vault-providers/database.ts @@ -1,6 +1,6 @@ -import { IVault } from '../vault.interface'; +import { IVault } from '../vault.interface.js'; import { DataBaseHelper } from '@guardian/common'; -import { WalletAccount } from '@entity/wallet-account'; +import { WalletAccount } from '../../entity/wallet-account.js'; /** * Database vault diff --git a/auth-service/src/vaults/vault-providers/hashicorp.ts b/auth-service/src/vaults/vault-providers/hashicorp.ts index 7e218ed2b9..bb54548e06 100644 --- a/auth-service/src/vaults/vault-providers/hashicorp.ts +++ b/auth-service/src/vaults/vault-providers/hashicorp.ts @@ -1,5 +1,5 @@ import NodeVault from 'node-vault'; -import { IVault } from '../vault.interface'; +import { IVault } from '../vault.interface.js'; import assert from 'assert'; import crypto from 'crypto'; diff --git a/auth-service/src/vaults/vault-providers/index.ts b/auth-service/src/vaults/vault-providers/index.ts index e048b9071d..ed7924c13e 100644 --- a/auth-service/src/vaults/vault-providers/index.ts +++ b/auth-service/src/vaults/vault-providers/index.ts @@ -1,2 +1,2 @@ -export { Hashicorp } from './hashicorp'; -export { Database } from './database'; +export { Hashicorp } from './hashicorp.js'; +export { Database } from './database.js'; diff --git a/auth-service/tsconfig.json b/auth-service/tsconfig.json index 8baba88b8f..4e956a3791 100644 --- a/auth-service/tsconfig.json +++ b/auth-service/tsconfig.json @@ -1,7 +1,6 @@ { "compileOnSave": true, "compilerOptions": { - "skipLibCheck": true, "baseUrl": "./src", "declaration": true, "emitDecoratorMetadata": true, @@ -14,7 +13,7 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", "paths": { @@ -28,7 +27,7 @@ "helpers/*" ] }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/auth-service/tsconfig.production.json b/auth-service/tsconfig.production.json index 7f15453590..1db897eaa6 100644 --- a/auth-service/tsconfig.production.json +++ b/auth-service/tsconfig.production.json @@ -1,11 +1,11 @@ { "compileOnSave": true, "compilerOptions": { - "skipLibCheck": true, "baseUrl": "./src", "declaration": true, "emitDecoratorMetadata": true, "esModuleInterop": true, + "resolveJsonModule": true, "experimentalDecorators": true, "skipLibCheck": true, "inlineSourceMap": false, @@ -14,7 +14,7 @@ "es5", "es6" ], - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", "outDir": "dist/", "paths": { @@ -28,7 +28,7 @@ "helpers/*" ] }, - "target": "es6" + "target": "es2022" }, "exclude": [ "node_modules", diff --git a/common/.dockerignore b/common/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/common/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/common/package.json b/common/package.json index a3ede210dd..28030cb512 100644 --- a/common/package.json +++ b/common/package.json @@ -5,13 +5,13 @@ "@azure/identity": "^3.2.2", "@azure/keyvault-secrets": "^4.7.0", "@google-cloud/secret-manager": "^4.2.2", - "@guardian/interfaces": "^2.23.1", + "@guardian/interfaces": "^2.24.0", "@hashgraph/sdk": "2.34.1", "@mattrglobal/jsonld-signatures-bbs": "^1.1.2", "@meeco/cryppo": "^2.0.2", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/migrations-mongodb": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/migrations-mongodb": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -28,7 +28,7 @@ "ajv-formats": "^2.1.1", "axios": "^1.3.6", "bs58": "^4.0.1", - "bson": "^5.3.0", + "bson": "^6.5.0", "dotenv": "^16.0.0", "exceljs": "^4.4.0", "express": "^4.17.1", @@ -44,7 +44,7 @@ "lodash.set": "^4.3.2", "mathjs": "^10.1.0", "moment": "^2.29.2", - "mongodb": "5.6.0", + "mongodb": "^6.5.0", "nats": "^2.6.1", "node-vault": "^0.9.22", "reflect-metadata": "^0.1.13", @@ -74,8 +74,7 @@ "name": "@guardian/common", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "scripts": { "build": "tsc", @@ -83,9 +82,10 @@ "dev": "tsc -w", "lint": "tslint --config ../tslint.json --project .", "prepack": "npm run build:prod", - "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/common.xml --exit", - "test:local": "mocha tests/**/*.test.js --exit", + "test": "mocha tests/**/*.test.mjs --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/common.xml --exit", + "test:local": "mocha tests/**/*.test.mjs --exit", "test:stability": "mocha tests/stability.test.js" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/common/src/database-modules/database-server.ts b/common/src/database-modules/database-server.ts index 0d0b4a4cde..3580a35d29 100644 --- a/common/src/database-modules/database-server.ts +++ b/common/src/database-modules/database-server.ts @@ -30,18 +30,27 @@ import { Token as TokenCollection, Topic as TopicCollection, VcDocument as VcDocumentCollection, - VcDocument, + VpDocument, VpDocument as VpDocumentCollection, - VpDocument -} from '../entity'; + PolicyCache, + PolicyCacheData, + RetirePool, +} from '../entity/index.js'; import { Binary } from 'bson'; -import { DocumentType, GenerateUUIDv4, IVC, MintTransactionStatus, SchemaEntity, TokenType, TopicType, } from '@guardian/interfaces'; -import { BaseEntity } from '../models'; -import { DataBaseHelper } from '../helpers'; -import { Theme } from '../entity/theme'; -import { GetConditionsPoliciesByCategories } from '../helpers/policy-category'; -import { PolicyTool } from '../entity/tool'; -import { PolicyProperty } from '../entity/policy-property'; +import { + GenerateUUIDv4, + IVC, + MintTransactionStatus, + SchemaEntity, + TokenType, + TopicType, +} from '@guardian/interfaces'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { Theme } from '../entity/theme.js'; +import { GetConditionsPoliciesByCategories } from '../helpers/policy-category.js'; +import { PolicyTool } from '../entity/tool.js'; +import { PolicyProperty } from '../entity/policy-property.js'; /** * Database server @@ -371,6 +380,17 @@ export class DatabaseServer { return item?.hederaAccountKey; } + /** + * Get virtual keys + * @param filters Filters + * @returns Virtual keys + */ + public async getVirtualKeys(filters: any): Promise { + filters.dryRunId = this.dryRun; + filters.dryRunClass = 'VirtualKey'; + return await new DataBaseHelper(DryRun).find(filters); + } + /** * Set Key from Virtual User * @param did @@ -609,6 +629,17 @@ export class DatabaseServer { }); } + /** + * Get block states + * @param policyId Policy identifier + * @returns Block states + */ + public async getBlockStates(policyId: string): Promise { + return await this.find(BlockState, { + policyId + }); + } + /** * Save Block State * @param {string} policyId - policy ID @@ -850,6 +881,17 @@ export class DatabaseServer { return await this.find(AggregateVC, { policyId, blockId, ...filters }); } + /** + * Get aggregate document by policy identifier + * @param policyId Policy identifier + * @returns Aggregate documents + */ + public async getAggregateDocumentsByPolicy( + policyId: string, + ): Promise { + return await this.find(AggregateVC, { policyId }); + } + /** * Remove Aggregate Documents * @param removeMsp @@ -1406,6 +1448,19 @@ export class DatabaseServer { }); } + /** + * Get multi sign documents by document identifiers + * @param documentIds Document identifiers + * @returns Multi sign documents + */ + public async getMultiSignDocumentsByDocumentIds( + documentIds: string[] + ): Promise { + return await this.find(MultiDocuments, { + documentId: { $in: documentIds }, + }); + } + /** * Get MultiSign Statuses by group * @param uuid @@ -1517,6 +1572,19 @@ export class DatabaseServer { }); } + /** + * Get split documents in policy + * @param policyId Policy identifier + * @returns Split documents + */ + public async getSplitDocumentsByPolicy( + policyId: string, + ): Promise { + return await this.find(SplitDocuments, { + policyId + }); + } + /** * Set Residue objects * @param residue @@ -1848,15 +1916,8 @@ export class DatabaseServer { errors.push(mintRequest.error); } wasTransferNeeded ||= mintRequest.wasTransferNeeded; - let token = await this.getToken(mintRequest.tokenId); - if (!token) { - token = await this.getToken(mintRequest.tokenId, true); - } - if (!token) { - continue; - } tokenIds.add(mintRequest.tokenId); - if (token.tokenType === TokenType.NON_FUNGIBLE) { + if (mintRequest.tokenType === TokenType.NON_FUNGIBLE) { const requestSerials = await this.getMintRequestSerials( mintRequest.id ); @@ -1881,15 +1942,15 @@ export class DatabaseServer { ); transferAmount += requestTransferSerials.length; } - } else if (token.tokenType === TokenType.FUNGIBLE) { + } else if (mintRequest.tokenType === TokenType.FUNGIBLE) { const mintRequestTransaction = await this.getMintTransaction({ mintRequestId: mintRequest.id, mintStatus: MintTransactionStatus.SUCCESS, }); if (mintRequestTransaction) { - if (token.decimals > 0) { + if (mintRequest.decimals > 0) { amount += - mintRequest.amount / Math.pow(10, token.decimals); + mintRequest.amount / Math.pow(10, mintRequest.decimals); } else { amount += mintRequest.amount; } @@ -1901,10 +1962,10 @@ export class DatabaseServer { transferStatus: MintTransactionStatus.SUCCESS, }); if (mintRequestTransferTransaction) { - if (token.decimals > 0) { + if (mintRequest.decimals > 0) { transferAmount += mintRequest.amount / - Math.pow(10, token.decimals); + Math.pow(10, mintRequest.decimals); } else { transferAmount += mintRequest.amount; } @@ -1988,6 +2049,127 @@ export class DatabaseServer { //Static + /** + * Get policy caches + * @param filters Filters + * @returns Policy caches + */ + public static async getPolicyCaches(filters?: any): Promise { + return await new DataBaseHelper(PolicyCache).find(filters); + } + + /** + * Save policy cache + * @param entity Entity + * @returns Policy cache + */ + public static async savePolicyCache(entity: any): Promise { + return await new DataBaseHelper(PolicyCache).save(entity); + } + + /** + * Get policy cache + * @param filters Filters + * @returns Policy cache + */ + public static async getPolicyCache(filters: any): Promise { + return await new DataBaseHelper(PolicyCache).findOne(filters); + } + + /** + * Get policy cache data + * @param filters Filters + * @param options Options + * @returns Policy cache data + */ + public static async getPolicyCacheData( + filters?: any, + options?: any + ): Promise { + return await new DataBaseHelper(PolicyCacheData).find(filters, options); + } + + /** + * Save policy cache data + * @param entity Policy cache data + * @returns Policy cache data + */ + public static async savePolicyCacheData( + entity: any + ): Promise { + return await new DataBaseHelper(PolicyCacheData).save(entity); + } + + /** + * Get and count policy cache data + * @param filters Filters + * @param options Options + * @returns Policy cache data and count + */ + public static async getAndCountPolicyCacheData( + filters?: any, + options?: any + ): Promise<[PolicyCacheData[], number]> { + return await new DataBaseHelper(PolicyCacheData).findAndCount( + filters, + options + ); + } + + /** + * Clear policy caches + * @param filters Filters + */ + public static async clearPolicyCaches(filters?: any): Promise { + const policyCaches = await new DataBaseHelper(PolicyCache).find( + filters + ); + if (!policyCaches) { + return; + } + for (const policyCache of policyCaches) { + const cachePolicyId = policyCache.id; + await new DataBaseHelper(PolicyCache).remove(policyCache); + await DatabaseServer.clearPolicyCacheData(cachePolicyId); + } + } + + /** + * Clear policy cache data + * @param cachePolicyId Cache policy id + */ + public static async clearPolicyCacheData(cachePolicyId: string) { + const amount = await new DataBaseHelper(PolicyCacheData).count({ + cachePolicyId, + }); + const naturalCount = Math.floor( + amount / DatabaseServer.DOCUMENTS_HANDLING_CHUNK_SIZE + ); + for (let i = 0; i < naturalCount; i++) { + const items = await new DataBaseHelper(PolicyCacheData).find( + { cachePolicyId }, + { limit: DatabaseServer.DOCUMENTS_HANDLING_CHUNK_SIZE } + ); + await new DataBaseHelper(PolicyCacheData).remove( + items.map((item) => { + item._id = item.newId; + item.id = item.newId.toString(); + return item; + }) + ); + } + const restItems = await new DataBaseHelper(PolicyCacheData).find({ + cachePolicyId, + }); + await new DataBaseHelper(PolicyCacheData).remove( + restItems.map((item) => { + item._id = item.newId; + item.id = item.newId.toString(); + return item; + }) + ); + } + /** * Get schema * @param topicId @@ -2385,7 +2567,7 @@ export class DatabaseServer { username: string, did: string, hederaAccountId: string, - hederaAccountKey: string, + hederaAccountKey?: string, active: boolean = false ): Promise { await new DataBaseHelper(DryRun).save({ @@ -2397,13 +2579,15 @@ export class DatabaseServer { active }); - await new DataBaseHelper(DryRun).save({ - dryRunId: policyId, - dryRunClass: 'VirtualKey', - did, - type: did, - hederaAccountKey - }); + if (hederaAccountKey) { + await new DataBaseHelper(DryRun).save({ + dryRunId: policyId, + dryRunClass: 'VirtualKey', + did, + type: did, + hederaAccountKey + }); + } } /** @@ -2525,53 +2709,6 @@ export class DatabaseServer { return await new DataBaseHelper(DryRun).findAndCount(filters, otherOptions); } - /** - * Get Virtual Documents - * @param policyId - * @param includeDocument - * @param type - * @param pageIndex - * @param pageSize - * - * @returns Documents and count - */ - public static async getDocuments( - policyId: string, - includeDocument: boolean = false, - type?: DocumentType, - pageIndex?: string, - pageSize?: string, - ): Promise<[any[], number]> { - const filters: any = { - $and: [{ - policyId, - }] - } - const otherOptions: any = { - fields: ['id', 'owner'] - }; - if (includeDocument) { - otherOptions.fields.push('documentFileId'); - } - const _pageSize = parseInt(pageSize, 10); - const _pageIndex = parseInt(pageIndex, 10); - if (Number.isInteger(_pageSize) && Number.isInteger(_pageIndex)) { - otherOptions.orderBy = { createDate: 'DESC' }; - otherOptions.limit = _pageSize; - otherOptions.offset = _pageIndex * _pageSize; - } - if (type === DocumentType.VC) { - otherOptions.fields.push('schema'); - filters.$and.push({ schema: { $ne: null } }); - filters.$and.push({ schema: { $nin: ['#UserRole'] } }); - return await new DataBaseHelper(VcDocument).findAndCount(filters, otherOptions); - } else if (type === DocumentType.VP) { - return await new DataBaseHelper(VpDocument).findAndCount(filters, otherOptions); - } else { - throw new Error(`Unknown type: ${type}`); - } - } - /** * Save Virtual Transaction * @param policyId @@ -2804,6 +2941,15 @@ export class DatabaseServer { return await new DataBaseHelper(TokenCollection).findOne(id); } + /** + * Get retire pools + * @param tokenIds Token identifiers + * @returns Retire pools + */ + public static async getRetirePools(tokenIds: string[]): Promise { + return await new DataBaseHelper(RetirePool).find({ tokenIds: { $in: tokenIds } }); + } + /** * Get Contract by ID * @param id diff --git a/common/src/database-modules/index.ts b/common/src/database-modules/index.ts index af8380ede4..c2d9099e2f 100644 --- a/common/src/database-modules/index.ts +++ b/common/src/database-modules/index.ts @@ -1 +1 @@ -export { DatabaseServer } from './database-server'; \ No newline at end of file +export { DatabaseServer } from './database-server.js'; diff --git a/common/src/document-loader/draft-did-loader.ts b/common/src/document-loader/draft-did-loader.ts index e48e69d92c..b14931b6cc 100644 --- a/common/src/document-loader/draft-did-loader.ts +++ b/common/src/document-loader/draft-did-loader.ts @@ -1,6 +1,6 @@ -import { DidURL, DocumentLoader, IDocumentFormat } from '../hedera-modules'; -import { DataBaseHelper } from '../helpers'; -import { DidDocument, DryRun } from '../entity'; +import { DidURL, DocumentLoader, IDocumentFormat } from '../hedera-modules/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { DidDocument, DryRun } from '../entity/index.js'; /** * Dry Run loader diff --git a/common/src/document-loader/draft-schema-context-loader.ts b/common/src/document-loader/draft-schema-context-loader.ts index 67b902082c..d0a6cec351 100644 --- a/common/src/document-loader/draft-schema-context-loader.ts +++ b/common/src/document-loader/draft-schema-context-loader.ts @@ -1,7 +1,7 @@ -import { DocumentLoader, IDocumentFormat } from '../hedera-modules'; -import { DataBaseHelper } from '../helpers'; +import { DocumentLoader, IDocumentFormat } from '../hedera-modules/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; +import { Schema } from '../entity/index.js'; /** * Schema Documents Loader diff --git a/common/src/document-loader/draft-schema-document-loader.ts b/common/src/document-loader/draft-schema-document-loader.ts index 5ba9b51a0f..5576509e7b 100644 --- a/common/src/document-loader/draft-schema-document-loader.ts +++ b/common/src/document-loader/draft-schema-document-loader.ts @@ -1,7 +1,7 @@ import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; -import { DataBaseHelper } from '../helpers'; -import { LocalSchemaDocumentLoader } from './local-schema-document-loader'; +import { Schema } from '../entity/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { LocalSchemaDocumentLoader } from './local-schema-document-loader.js'; /** * Local subject schema loader diff --git a/common/src/document-loader/draft-vc-schema-document-loader.ts b/common/src/document-loader/draft-vc-schema-document-loader.ts index 8278df6ad7..7b21621ef3 100644 --- a/common/src/document-loader/draft-vc-schema-document-loader.ts +++ b/common/src/document-loader/draft-vc-schema-document-loader.ts @@ -1,7 +1,7 @@ import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; -import { DataBaseHelper } from '../helpers'; -import { LocalVcSchemaDocumentLoader } from './local-vc-schema-document-loader'; +import { Schema } from '../entity/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { LocalVcSchemaDocumentLoader } from './local-vc-schema-document-loader.js'; /** * Local VC schema loader diff --git a/common/src/document-loader/index.ts b/common/src/document-loader/index.ts index 7568783f40..369c65941d 100644 --- a/common/src/document-loader/index.ts +++ b/common/src/document-loader/index.ts @@ -1,9 +1,9 @@ -export * from './local-schema-context-loader'; -export * from './local-did-loader'; -export * from './draft-schema-context-loader'; -export * from './local-schema-document-loader'; -export * from './local-vc-schema-document-loader'; -export * from './draft-did-loader'; -export * from './remote-did-loader'; -export * from './draft-schema-document-loader'; -export * from './draft-vc-schema-document-loader'; +export * from './local-schema-context-loader.js'; +export * from './local-did-loader.js'; +export * from './draft-schema-context-loader.js'; +export * from './local-schema-document-loader.js'; +export * from './local-vc-schema-document-loader.js'; +export * from './draft-did-loader.js'; +export * from './remote-did-loader.js'; +export * from './draft-schema-document-loader.js'; +export * from './draft-vc-schema-document-loader.js'; diff --git a/common/src/document-loader/local-did-loader.ts b/common/src/document-loader/local-did-loader.ts index 20ccb56535..3d33b59029 100644 --- a/common/src/document-loader/local-did-loader.ts +++ b/common/src/document-loader/local-did-loader.ts @@ -1,6 +1,6 @@ -import { DataBaseHelper } from '../helpers'; -import { DidDocument } from '../entity'; -import { DidURL, DocumentLoader, IDocumentFormat } from '../hedera-modules'; +import { DataBaseHelper } from '../helpers/index.js'; +import { DidDocument } from '../entity/index.js'; +import { DidURL, DocumentLoader, IDocumentFormat } from '../hedera-modules/index.js'; /** * DID Documents Loader diff --git a/common/src/document-loader/local-schema-context-loader.ts b/common/src/document-loader/local-schema-context-loader.ts index c88f9a6533..e1a4f907ce 100644 --- a/common/src/document-loader/local-schema-context-loader.ts +++ b/common/src/document-loader/local-schema-context-loader.ts @@ -1,7 +1,7 @@ -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; -import { DocumentLoader, IDocumentFormat } from '../hedera-modules'; +import { Schema } from '../entity/index.js'; +import { DocumentLoader, IDocumentFormat } from '../hedera-modules/index.js'; /** * Schema Documents Loader. diff --git a/common/src/document-loader/local-schema-document-loader.ts b/common/src/document-loader/local-schema-document-loader.ts index bb199c7a3e..36dda93b7c 100644 --- a/common/src/document-loader/local-schema-document-loader.ts +++ b/common/src/document-loader/local-schema-document-loader.ts @@ -1,7 +1,7 @@ import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; -import { SchemaLoader } from '../hedera-modules'; -import { DataBaseHelper } from '../helpers'; +import { Schema } from '../entity/index.js'; +import { SchemaLoader } from '../hedera-modules/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; /** * Subject schema loader diff --git a/common/src/document-loader/local-vc-schema-document-loader.ts b/common/src/document-loader/local-vc-schema-document-loader.ts index 18ca757ddc..f59df77724 100644 --- a/common/src/document-loader/local-vc-schema-document-loader.ts +++ b/common/src/document-loader/local-vc-schema-document-loader.ts @@ -1,7 +1,7 @@ import { ISchema } from '@guardian/interfaces'; -import { Schema } from '../entity'; -import { SchemaLoader } from '../hedera-modules'; -import { DataBaseHelper } from '../helpers'; +import { Schema } from '../entity/index.js'; +import { SchemaLoader } from '../hedera-modules/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; /** * VC schema loader diff --git a/common/src/document-loader/remote-did-loader.ts b/common/src/document-loader/remote-did-loader.ts index 1389b62cfd..30b5e276cb 100644 --- a/common/src/document-loader/remote-did-loader.ts +++ b/common/src/document-loader/remote-did-loader.ts @@ -1,5 +1,5 @@ -import { DidURL, DocumentLoader, HederaDid, IDocumentFormat } from '../hedera-modules'; -import { IPFS, Workers } from '../helpers'; +import { DidURL, DocumentLoader, HederaDid, IDocumentFormat } from '../hedera-modules/index.js'; +import { IPFS, Workers } from '../helpers/index.js'; import { WorkerTaskType } from '@guardian/interfaces'; /** diff --git a/common/src/entity/aggregate-documents.ts b/common/src/entity/aggregate-documents.ts index 65fbbe902a..947c1159a6 100644 --- a/common/src/entity/aggregate-documents.ts +++ b/common/src/entity/aggregate-documents.ts @@ -15,8 +15,8 @@ import { AfterCreate, AfterUpdate, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; -import { DataBaseHelper } from '../helpers'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/common/src/entity/approval-document.ts b/common/src/entity/approval-document.ts index 063360a062..0663f5d383 100644 --- a/common/src/entity/approval-document.ts +++ b/common/src/entity/approval-document.ts @@ -15,9 +15,9 @@ import { AfterCreate, AfterUpdate, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/common/src/entity/artifact-chunk.ts b/common/src/entity/artifact-chunk.ts index 6cef8e3cf9..39d3277fba 100644 --- a/common/src/entity/artifact-chunk.ts +++ b/common/src/entity/artifact-chunk.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { Binary } from 'bson'; /** diff --git a/common/src/entity/artifact.ts b/common/src/entity/artifact.ts index 63311dd912..bae186906b 100644 --- a/common/src/entity/artifact.ts +++ b/common/src/entity/artifact.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Enum, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; /** diff --git a/common/src/entity/block-cache.ts b/common/src/entity/block-cache.ts index 3ef50d1683..8638ea5018 100644 --- a/common/src/entity/block-cache.ts +++ b/common/src/entity/block-cache.ts @@ -1,5 +1,5 @@ import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; import { Entity, @@ -10,7 +10,7 @@ import { BeforeUpdate, AfterDelete, } from '@mikro-orm/core'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; /** * Block state diff --git a/common/src/entity/block-state.ts b/common/src/entity/block-state.ts index eb2d4ea9aa..0ad5b5ad46 100644 --- a/common/src/entity/block-state.ts +++ b/common/src/entity/block-state.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Block state diff --git a/common/src/entity/branding.ts b/common/src/entity/branding.ts index 24fe0304ac..dc1283ebd5 100644 --- a/common/src/entity/branding.ts +++ b/common/src/entity/branding.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Branding diff --git a/common/src/entity/contract.ts b/common/src/entity/contract.ts index 896045fdab..7a5c15980c 100644 --- a/common/src/entity/contract.ts +++ b/common/src/entity/contract.ts @@ -1,5 +1,5 @@ import { Entity, Enum, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ContractType, IContract } from '@guardian/interfaces'; /** diff --git a/common/src/entity/did-document.ts b/common/src/entity/did-document.ts index 29836038a2..9dd420c725 100644 --- a/common/src/entity/did-document.ts +++ b/common/src/entity/did-document.ts @@ -6,7 +6,7 @@ import { Enum, BeforeCreate } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * DID document diff --git a/common/src/entity/document-state.ts b/common/src/entity/document-state.ts index 474b6f9ad0..5f7d35c6d0 100644 --- a/common/src/entity/document-state.ts +++ b/common/src/entity/document-state.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Document state diff --git a/common/src/entity/dry-run-files.ts b/common/src/entity/dry-run-files.ts index da9e6d3e6b..eece036cb2 100644 --- a/common/src/entity/dry-run-files.ts +++ b/common/src/entity/dry-run-files.ts @@ -1,7 +1,7 @@ import { AfterCreate, AfterDelete, AfterUpdate, BeforeCreate, Entity, OnLoad, Property } from '@mikro-orm/core'; import { ObjectId } from 'mongodb' -import { BaseEntity } from '../models'; -import { DataBaseHelper } from '../helpers'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; @Entity() diff --git a/common/src/entity/dry-run.ts b/common/src/entity/dry-run.ts index f401a42610..bc8758ebb6 100644 --- a/common/src/entity/dry-run.ts +++ b/common/src/entity/dry-run.ts @@ -1,8 +1,8 @@ import { ApproveStatus, DocumentSignature, DocumentStatus, GenerateUUIDv4, GroupAccessType, GroupRelationshipType, SchemaEntity } from '@guardian/interfaces'; import { Entity, Property, BeforeCreate, BeforeUpdate, OnLoad, AfterDelete, AfterCreate, AfterUpdate } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/common/src/entity/external-document.ts b/common/src/entity/external-document.ts index ca86b651ad..d9250a7565 100644 --- a/common/src/entity/external-document.ts +++ b/common/src/entity/external-document.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Artifact collection diff --git a/common/src/entity/index.ts b/common/src/entity/index.ts index d0a090d255..042b29dcef 100644 --- a/common/src/entity/index.ts +++ b/common/src/entity/index.ts @@ -1,40 +1,42 @@ -export * from './aggregate-documents'; -export * from './approval-document'; -export * from './artifact-chunk'; -export * from './artifact'; -export * from './block-cache'; -export * from './block-state'; -export * from './branding'; -export * from './contract'; -export * from './did-document'; -export * from './document-state'; -export * from './dry-run'; -export * from './external-document'; -export * from './module'; -export * from './multi-documents'; -export * from './multi-policy-transaction'; -export * from './multi-policy'; -export * from './policy-invitations'; -export * from './policy-roles'; -export * from './policy'; -export * from './retire-pool'; -export * from './retire-request'; -export * from './schema'; -export * from './settings'; -export * from './split-documents'; -export * from './suggestions-config'; -export * from './tag-cache'; -export * from './tag'; -export * from './theme'; -export * from './token'; -export * from './tool'; -export * from './topic'; -export * from './vc-document'; -export * from './vp-document'; -export * from './wiper-request'; -export * from './record'; -export * from './policy-category'; -export * from './policy-property'; -export * from './mint-request'; -export * from './mint-transaction'; -export * from './dry-run-files'; +export * from './aggregate-documents.js'; +export * from './approval-document.js'; +export * from './artifact-chunk.js'; +export * from './artifact.js'; +export * from './block-cache.js'; +export * from './block-state.js'; +export * from './branding.js'; +export * from './contract.js'; +export * from './did-document.js'; +export * from './document-state.js'; +export * from './dry-run.js'; +export * from './external-document.js'; +export * from './module.js'; +export * from './multi-documents.js'; +export * from './multi-policy-transaction.js'; +export * from './multi-policy.js'; +export * from './policy-invitations.js'; +export * from './policy-roles.js'; +export * from './policy.js'; +export * from './retire-pool.js'; +export * from './retire-request.js'; +export * from './schema.js'; +export * from './settings.js'; +export * from './split-documents.js'; +export * from './suggestions-config.js'; +export * from './tag-cache.js'; +export * from './tag.js'; +export * from './theme.js'; +export * from './token.js'; +export * from './tool.js'; +export * from './topic.js'; +export * from './vc-document.js'; +export * from './vp-document.js'; +export * from './wiper-request.js'; +export * from './record.js'; +export * from './policy-category.js'; +export * from './policy-property.js'; +export * from './mint-request.js'; +export * from './mint-transaction.js'; +export * from './dry-run-files.js'; +export * from './policy-cache-data.js'; +export * from './policy-cache.js'; diff --git a/common/src/entity/mint-request.ts b/common/src/entity/mint-request.ts index 85492b8627..6f46829e87 100644 --- a/common/src/entity/mint-request.ts +++ b/common/src/entity/mint-request.ts @@ -1,5 +1,6 @@ -import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { Entity, Enum, Property } from '@mikro-orm/core'; +import { BaseEntity } from '../models/index.js'; +import { TokenType } from '@guardian/interfaces'; /** * Mint request @@ -18,6 +19,21 @@ export class MintRequest extends BaseEntity { @Property() tokenId: string; + /** + * Token type + */ + @Enum({ + items: () => TokenType, + nullable: true, + }) + tokenType?: TokenType; + + /** + * Decimals + */ + @Property({ nullable: true, type: 'unknown' }) + decimals?: any + /** * Target account */ diff --git a/common/src/entity/mint-transaction.ts b/common/src/entity/mint-transaction.ts index f73a78eb68..b0ea8083f0 100644 --- a/common/src/entity/mint-transaction.ts +++ b/common/src/entity/mint-transaction.ts @@ -1,5 +1,5 @@ import { Entity, Enum, Index, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { MintTransactionStatus, } from '@guardian/interfaces'; diff --git a/common/src/entity/module.ts b/common/src/entity/module.ts index 39f74a2089..c6d8b17c21 100644 --- a/common/src/entity/module.ts +++ b/common/src/entity/module.ts @@ -1,8 +1,8 @@ -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4, ModuleStatus } from '@guardian/interfaces'; import { AfterDelete, BeforeCreate, BeforeUpdate, Entity, OnLoad, Property } from '@mikro-orm/core'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; /** * PolicyModule collection diff --git a/common/src/entity/multi-documents.ts b/common/src/entity/multi-documents.ts index c043d18b02..71f026a735 100644 --- a/common/src/entity/multi-documents.ts +++ b/common/src/entity/multi-documents.ts @@ -6,10 +6,10 @@ import { Property, AfterDelete, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4, IVC } from '@guardian/interfaces'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; /** * MultiDocuments collection diff --git a/common/src/entity/multi-policy-transaction.ts b/common/src/entity/multi-policy-transaction.ts index b87926a03b..f80bb10cc4 100644 --- a/common/src/entity/multi-policy-transaction.ts +++ b/common/src/entity/multi-policy-transaction.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * MultiPolicy collection diff --git a/common/src/entity/multi-policy.ts b/common/src/entity/multi-policy.ts index d45e3e69bd..33e478b569 100644 --- a/common/src/entity/multi-policy.ts +++ b/common/src/entity/multi-policy.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * MultiPolicy collection diff --git a/common/src/entity/policy-cache-data.ts b/common/src/entity/policy-cache-data.ts new file mode 100644 index 0000000000..4e2b0866fe --- /dev/null +++ b/common/src/entity/policy-cache-data.ts @@ -0,0 +1,1000 @@ +import { GenerateUUIDv4 } from '@guardian/interfaces'; +import { + Entity, + Property, + BeforeCreate, + BeforeUpdate, + OnLoad, + AfterDelete, + AfterCreate, + AfterUpdate, +} from '@mikro-orm/core'; +import { ObjectId } from '@mikro-orm/mongodb'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import ObjGet from 'lodash.get'; +import ObjSet from 'lodash.set'; + +/** + * Policy cache data + */ +@Entity() +export class PolicyCacheData extends BaseEntity { + /** + * Cache collection + */ + @Property() + cacheCollection: string; + + /** + * Cache policy identifier + */ + @Property() + cachePolicyId: string; + + /** + * Old document identifier + */ + @Property() + oldId: string; + + /** + * New document identifier + */ + @Property({ persist: false }) + newId: ObjectId; + + /** + * Hedera Contract Id + */ + @Property({ nullable: true, type: 'unknown' }) + contractId?: any; + + /** + * Token identifiers + */ + @Property({ nullable: true, type: 'unknown' }) + tokenIds?: any; + + /** + * Immediately retire + */ + @Property({ nullable: true, type: 'unknown' }) + immediately?: any; + + /** + * Enabled + */ + @Property({ nullable: true, type: 'unknown' }) + enabled?: any; + + /** + * id + */ + @Property({ nullable: true, type: 'unknown' }) + dryRunId?: string; + + /** + * Class + */ + @Property({ nullable: true, type: 'unknown' }) + dryRunClass?: string; + + /** + * Document owner + */ + @Property({ nullable: true, type: 'unknown' }) + owner?: any; + + /** + * Document hash + */ + @Property({ nullable: true, type: 'unknown' }) + hash?: any; + + /** + * Document instance + */ + @Property({ nullable: true, type: 'unknown' }) + document?: any; + + /** + * Document file id + */ + @Property({ nullable: true, type: 'unknown' }) + documentFileId?: any; + + /** + * Document fields + */ + @Property({ nullable: true, type: 'unknown' }) + documentFields?: any[]; + + /** + * Document status + */ + @Property({ nullable: true, type: 'unknown' }) + status?: any; + + /** + * Document signature + */ + @Property({ nullable: true, type: 'unknown' }) + signature?: any; + + /** + * Document type + */ + @Property({ nullable: true, type: 'unknown' }) + type?: any; + + /** + * Policy id + */ + @Property({ nullable: true, type: 'unknown' }) + policyId?: any; + + /** + * Tag + */ + @Property({ nullable: true, type: 'unknown' }) + tag?: any; + + /** + * Message id + */ + @Property({ nullable: true, type: 'unknown' }) + messageId?: any; + + /** + * Topic id + */ + @Property({ nullable: true, type: 'unknown' }) + topicId?: any; + + /** + * Relationships + */ + @Property({ nullable: true, type: 'unknown' }) + relationships?: any; + + /** + * Option + */ + @Property({ nullable: true, type: 'unknown' }) + option?: any; + + /** + * Comment + */ + @Property({ nullable: true, type: 'unknown' }) + comment?: any; + + /** + * Assign + */ + @Property({ nullable: true, type: 'unknown' }) + assignedTo?: any; + + /** + * Assign + */ + @Property({ nullable: true, type: 'unknown' }) + assignedToGroup?: any; + + /** + * Document hedera status + */ + @Property({ nullable: true, type: 'unknown' }) + hederaStatus?: any; + + /** + * Document processing status + */ + @Property({ nullable: true, type: 'unknown' }) + processingStatus?: any; + + /** + * Document schema + */ + @Property({ nullable: true, type: 'unknown' }) + schema?: any; + + /** + * Hedera Accounts + */ + @Property({ nullable: true, type: 'unknown' }) + accounts?: any; + + /** + * Tokens + */ + @Property({ nullable: true, type: 'unknown' }) + tokens?: any; + + /** + * Topic name + */ + @Property({ nullable: true, type: 'unknown' }) + name?: any; + + /** + * Topic description + */ + @Property({ nullable: true, type: 'unknown' }) + description?: any; + + /** + * Parent + */ + @Property({ nullable: true, type: 'unknown' }) + parent?: any; + + /** + * Policy UUID + */ + @Property({ nullable: true, type: 'unknown' }) + policyUUID?: any; + + /** + * Token id + */ + @Property({ nullable: true, type: 'unknown' }) + tokenId?: any; + + /** + * Token name + */ + @Property({ nullable: true, type: 'unknown' }) + tokenName?: any; + + /** + * Token symbol + */ + @Property({ nullable: true, type: 'unknown' }) + tokenSymbol?: any; + + /** + * Token type + */ + @Property({ nullable: true, type: 'unknown' }) + tokenType?: any; + + /** + * Token decimals + */ + @Property({ nullable: true, type: 'unknown' }) + decimals?: any; + + /** + * Initial supply + */ + @Property({ nullable: true, type: 'unknown' }) + initialSupply?: any; + + /** + * Admin id + */ + @Property({ nullable: true, type: 'unknown' }) + adminId?: any; + + /** + * Change supply + */ + @Property({ nullable: true, type: 'unknown' }) + changeSupply?: any; + + /** + * Enable admin + */ + @Property({ nullable: true, type: 'unknown' }) + enableAdmin?: any; + + /** + * Enable KYC + */ + @Property({ nullable: true, type: 'unknown' }) + enableKYC?: any; + + /** + * Enable freeze + */ + @Property({ nullable: true, type: 'unknown' }) + enableFreeze?: any; + + /** + * Enable wipe + */ + @Property({ nullable: true, type: 'unknown' }) + enableWipe?: any; + + /** + * Setting value + */ + @Property({ nullable: true, type: 'unknown' }) + value?: any; + + /** + * Schema uuid + */ + @Property({ nullable: true, type: 'unknown' }) + uuid?: any; + + /** + * Schema entity + */ + @Property({ nullable: true, type: 'unknown' }) + entity?: any; + + /** + * Context + */ + @Property({ persist: false, type: 'unknown' }) + context?: any; + + /** + * Context file id + */ + @Property({ nullable: true, type: 'unknown' }) + contextFileId?: any; + + /** + * Version + */ + @Property({ nullable: true, type: 'unknown' }) + version?: any; + + /** + * Creator + */ + @Property({ nullable: true, type: 'unknown' }) + creator?: any; + + /** + * Document URL + */ + @Property({ nullable: true, type: 'unknown' }) + documentURL?: any; + + /** + * Context URL + */ + @Property({ nullable: true, type: 'unknown' }) + contextURL?: any; + + /** + * IRI + */ + @Property({ nullable: true, type: 'unknown' }) + iri?: any; + + /** + * Readonly flag + */ + @Property({ nullable: true, type: 'unknown' }) + readonly?: any; + + /** + * Is system schema + */ + @Property({ nullable: true, type: 'unknown' }) + system?: any; + + /** + * Is active + */ + @Property({ nullable: true, type: 'unknown' }) + active?: any; + + /** + * Category. + */ + @Property({ nullable: true, type: 'unknown' }) + category?: any; + + /** + * Policy previous version + */ + @Property({ nullable: true, type: 'unknown' }) + previousVersion?: any; + + /** + * Policy topic description + */ + @Property({ nullable: true, type: 'unknown' }) + topicDescription?: any; + + /** + * Policy config + */ + @Property({ nullable: true, type: 'unknown' }) + config?: any; + + /** + * Config file id + */ + @Property({ nullable: true, type: 'unknown' }) + configFileId?: any; + + /** + * Policy roles + */ + @Property({ nullable: true, type: 'unknown' }) + policyRoles?: any; + + /** + * Policy groups + */ + @Property({ nullable: true, type: 'unknown' }) + policyGroups?: any; + + /** + * Policy topics + */ + @Property({ nullable: true, type: 'unknown' }) + policyTopics?: any; + + /** + * Policy tokens + */ + @Property({ nullable: true, type: 'unknown' }) + policyTokens?: any[]; + + /** + * Policy instance topic id + */ + @Property({ nullable: true, type: 'unknown' }) + instanceTopicId?: any; + + /** + * Policy tag + */ + @Property({ nullable: true, type: 'unknown' }) + policyTag?: any; + + /** + * Policy code version + */ + @Property({ nullable: true, type: 'unknown' }) + codeVersion?: any; + + /** + * Document id + */ + @Property({ nullable: true, type: 'unknown' }) + documentId?: any; + + /** + * State reason + */ + @Property({ nullable: true, type: 'unknown' }) + reason?: any; + + /** + * DID + */ + @Property({ nullable: true, type: 'unknown' }) + did?: any; + + /** + * Block id + */ + @Property({ nullable: true, type: 'unknown' }) + blockId?: any; + + /** + * block state + */ + @Property({ nullable: true, type: 'unknown' }) + blockState?: any; + + /** + * Document approver + */ + @Property({ nullable: true, type: 'unknown' }) + approver?: any; + + /** + * User Role + */ + @Property({ nullable: true, type: 'unknown' }) + role?: any; + + /** + * User username + */ + @Property({ nullable: true, type: 'unknown' }) + username?: any; + + /** + * User Id + */ + @Property({ nullable: true, type: 'unknown' }) + userId?: any; + + /** + * hederaAccountId + */ + @Property({ nullable: true, type: 'unknown' }) + hederaAccountId?: any; + + /** + * hederaAccountKey + */ + @Property({ nullable: true, type: 'unknown' }) + hederaAccountKey?: any; + + /** + * Group Type + */ + @Property({ nullable: true, type: 'unknown' }) + groupRelationshipType?: any; + + /** + * Group Type + */ + @Property({ nullable: true, type: 'unknown' }) + groupAccessType?: any; + + /** + * Group Type + */ + @Property({ nullable: true, type: 'unknown' }) + groupName?: string; + + /** + * User group + */ + @Property({ nullable: true, type: 'unknown' }) + group?: any; + + /** + * Group Label + */ + @Property({ nullable: true, type: 'unknown' }) + groupLabel?: any; + + /** + * Token Map + */ + @Property({ nullable: true, type: 'unknown' }) + tokenMap?: any; + + /** + * Hedera Hash + */ + @Property({ nullable: true, type: 'unknown' }) + messageHash?: any; + + /** + * Message History + */ + @Property({ nullable: true, type: 'unknown' }) + messageIds?: any; + + /** + * Target ID + */ + @Property({ nullable: true, type: 'unknown' }) + target?: any; + + /** + * Target ID (Local) + */ + @Property({ nullable: true, type: 'unknown' }) + localTarget?: any; + + /** + * Operation + */ + @Property({ nullable: true, type: 'unknown' }) + operation?: any; + + /** + * Date + */ + @Property({ nullable: true, type: 'unknown' }) + date?: any; + + /** + * Document uri + */ + @Property({ nullable: true, type: 'unknown' }) + uri?: any; + + /** + * Source document identifier + */ + @Property({ nullable: true, type: 'unknown' }) + sourceDocumentId?: any; + + /** + * Document Topic Id + */ + @Property({ nullable: true, type: 'unknown' }) + documentTopicId?: any; + + /** + * Policy Topic Id + */ + @Property({ nullable: true, type: 'unknown' }) + policyTopicId?: any; + + /** + * Document Message + */ + @Property({ nullable: true, type: 'unknown' }) + documentMessage?: any; + + /** + * Policy Message + */ + @Property({ nullable: true, type: 'unknown' }) + policyMessage?: any; + + /** + * Policy Instance Message + */ + @Property({ nullable: true, type: 'unknown' }) + policyInstanceMessage?: any; + + /** + * Schemas + */ + @Property({ nullable: true, type: 'unknown' }) + schemas?: any; + + /** + * Schema Id + */ + @Property({ nullable: true, type: 'unknown' }) + schemaId?: any; + + /** + * Last Message + */ + @Property({ nullable: true, type: 'unknown' }) + lastMessage?: any; + + /** + * Last Update + */ + @Property({ nullable: true, type: 'unknown' }) + lastUpdate?: any; + + /** + * Token amount + */ + @Property({ nullable: true, type: 'unknown' }) + amount?: any; + + /** + * Token serials + */ + @Property({ nullable: true, type: 'unknown' }) + serials?: any; + + /** + * Verification methods + */ + @Property({ nullable: true, type: 'unknown' }) + verificationMethods?: any; + + /** + * Vp message identifier + */ + @Property({ nullable: true, type: 'unknown' }) + vpMessageId?: any; + + /** + * Secondary vp identifiers + */ + @Property({ nullable: true, type: 'unknown' }) + secondaryVpIds?: any; + + /** + * Start serial + */ + @Property({ nullable: true, type: 'unknown' }) + startSerial?: any; + + /** + * Start transaction + */ + @Property({ nullable: true, type: 'unknown' }) + startTransaction?: any; + + /** + * Is mint needed + */ + @Property({ nullable: true, type: 'unknown' }) + isMintNeeded: any; + + /** + * Is transfer needed + */ + @Property({ nullable: true, type: 'unknown' }) + isTransferNeeded: any; + + /** + * Was transfer needed + */ + @Property({ nullable: true, type: 'unknown' }) + wasTransferNeeded: any; + + /** + * Memo + */ + @Property({ nullable: true, type: 'unknown' }) + memo?: any; + + /** + * Metadata + */ + @Property({ nullable: true, type: 'unknown' }) + metadata?: any; + + /** + * Mint request identifier + */ + @Property({ nullable: true, type: 'unknown' }) + mintRequestId?: any; + + /** + * Mint status + */ + @Property({ nullable: true, type: 'unknown' }) + mintStatus?: any; + + /** + * Transfer status + */ + @Property({ nullable: true, type: 'unknown' }) + transferStatus?: any; + + /** + * Error + */ + @Property({ nullable: true, type: 'unknown' }) + error?: any; + + /** + * Mint date + */ + @Property({ nullable: true, type: 'unknown' }) + processDate?: any; + + /** + * Create document + */ + @BeforeCreate() + async createDocument() { + await new Promise((resolve, reject) => { + try { + if (this.document) { + const fileStream = DataBaseHelper.gridFS.openUploadStream( + GenerateUUIDv4() + ); + this.documentFileId = fileStream.id; + fileStream.write(JSON.stringify(this.document)); + if (this.documentFields) { + const newDocument: any = {}; + for (const field of this.documentFields) { + const fieldValue = ObjGet(this.document, field); + if ( + (typeof fieldValue === 'string' && + fieldValue.length < + (+process.env + .DOCUMENT_CACHE_FIELD_LIMIT || + 100)) || + typeof fieldValue === 'number' + ) { + ObjSet(newDocument, field, fieldValue); + } + } + this.document = newDocument; + } else { + delete this.document; + } + fileStream.end(() => resolve()); + } else { + resolve(); + } + } catch (error) { + reject(error); + } + }); + } + + /** + * Update document + */ + @BeforeUpdate() + async updateDocument() { + if (this.document) { + if (this.documentFileId) { + DataBaseHelper.gridFS + .delete(this.documentFileId) + .catch(console.error); + } + await this.createDocument(); + } + } + + /** + * Load document + */ + @OnLoad() + @AfterUpdate() + @AfterCreate() + async loadDocument() { + if (this.documentFileId) { + const fileStream = DataBaseHelper.gridFS.openDownloadStream( + this.documentFileId + ); + const bufferArray = []; + for await (const data of fileStream) { + bufferArray.push(data); + } + const buffer = Buffer.concat(bufferArray); + this.document = JSON.parse(buffer.toString()); + } + } + + /** + * Delete document + */ + @AfterDelete() + deleteDocument() { + if (this.documentFileId) { + DataBaseHelper.gridFS + .delete(this.documentFileId) + .catch(console.error); + } + } + + /** + * Create context + */ + @BeforeCreate() + async createContext() { + await new Promise((resolve, reject) => { + try { + if (this.context) { + const fileStream = DataBaseHelper.gridFS.openUploadStream( + GenerateUUIDv4() + ); + this.contextFileId = fileStream.id; + fileStream.write(JSON.stringify(this.context)); + fileStream.end(() => resolve()); + } else { + resolve(); + } + } catch (error) { + reject(error); + } + }); + } + + /** + * Update context + */ + @BeforeUpdate() + async updateContext() { + if (this.context) { + if (this.contextFileId) { + DataBaseHelper.gridFS + .delete(this.contextFileId) + .catch(console.error); + } + await this.createContext(); + } + } + + /** + * Load context + */ + @OnLoad() + async loadContext() { + if (this.contextFileId && !this.context) { + const fileStream = DataBaseHelper.gridFS.openDownloadStream( + this.contextFileId + ); + const bufferArray = []; + for await (const data of fileStream) { + bufferArray.push(data); + } + const buffer = Buffer.concat(bufferArray); + this.context = JSON.parse(buffer.toString()); + } + } + + /** + * Delete context + */ + @AfterDelete() + deleteContext() { + if (this.contextFileId) { + DataBaseHelper.gridFS + .delete(this.contextFileId) + .catch(console.error); + } + } + + /** + * Create config + */ + @BeforeCreate() + async createConfig() { + await new Promise((resolve, reject) => { + try { + if (this.config) { + const fileStream = DataBaseHelper.gridFS.openUploadStream( + GenerateUUIDv4() + ); + this.configFileId = fileStream.id; + fileStream.write(JSON.stringify(this.config)); + fileStream.end(() => resolve()); + } else { + resolve(); + } + } catch (error) { + reject(error); + } + }); + } + + /** + * Update config + */ + @BeforeUpdate() + async updateConfig() { + if (this.config) { + if (this.configFileId) { + DataBaseHelper.gridFS + .delete(this.configFileId) + .catch(console.error); + } + await this.createConfig(); + } + } + + /** + * Load config + */ + @OnLoad() + async loadConfig() { + if (this.configFileId && !this.config) { + const fileStream = DataBaseHelper.gridFS.openDownloadStream( + this.configFileId + ); + const bufferArray = []; + for await (const data of fileStream) { + bufferArray.push(data); + } + const buffer = Buffer.concat(bufferArray); + this.config = JSON.parse(buffer.toString()); + } + } + + /** + * Delete context + */ + @AfterDelete() + deleteConfig() { + if (this.configFileId) { + DataBaseHelper.gridFS + .delete(this.configFileId) + .catch(console.error); + } + } + + @OnLoad() + replaceIds() { + if (this.oldId) { + this.newId = this._id; + this.id = this.oldId; + this._id = ObjectId.createFromHexString(this.oldId); + } + } +} diff --git a/common/src/entity/policy-cache.ts b/common/src/entity/policy-cache.ts new file mode 100644 index 0000000000..e7d31e1cae --- /dev/null +++ b/common/src/entity/policy-cache.ts @@ -0,0 +1,39 @@ +import { Entity, Property } from '@mikro-orm/core'; +import { BaseEntity } from '../models/index.js'; + +/** + * Policy cache + */ +@Entity() +export class PolicyCache extends BaseEntity { + + /** + * Policy + */ + @Property({ nullable: true }) + policy?: any; + + /** + * Blocks + */ + @Property({ nullable: true }) + blocks?: any; + + /** + * Users + */ + @Property({ nullable: true }) + users?: any; + + /** + * User topic + */ + @Property({ nullable: true }) + userTopic?: any; + + /** + * User DID + */ + @Property() + userId: string; +} diff --git a/common/src/entity/policy-category.ts b/common/src/entity/policy-category.ts index 119861b6e9..0a9f710f62 100644 --- a/common/src/entity/policy-category.ts +++ b/common/src/entity/policy-category.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { PolicyCategoryType } from '@guardian/interfaces'; /** diff --git a/common/src/entity/policy-invitations.ts b/common/src/entity/policy-invitations.ts index ec437d5c0b..aede9b8b1a 100644 --- a/common/src/entity/policy-invitations.ts +++ b/common/src/entity/policy-invitations.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * PolicyInvitations collection diff --git a/common/src/entity/policy-property.ts b/common/src/entity/policy-property.ts index 165c26696f..cb16c466da 100644 --- a/common/src/entity/policy-property.ts +++ b/common/src/entity/policy-property.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * PolicyProperty collection diff --git a/common/src/entity/policy-roles.ts b/common/src/entity/policy-roles.ts index 02a76dd741..3c590e6f6c 100644 --- a/common/src/entity/policy-roles.ts +++ b/common/src/entity/policy-roles.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GroupAccessType, GroupRelationshipType } from '@guardian/interfaces'; /** diff --git a/common/src/entity/policy.ts b/common/src/entity/policy.ts index 7760c48a70..3affa7d44e 100644 --- a/common/src/entity/policy.ts +++ b/common/src/entity/policy.ts @@ -1,7 +1,7 @@ -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4, PolicyCategoryExport, PolicyType } from '@guardian/interfaces'; import { AfterDelete, BeforeCreate, BeforeUpdate, Entity, OnLoad, Property, Unique } from '@mikro-orm/core'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; /** diff --git a/common/src/entity/record.ts b/common/src/entity/record.ts index 546d344971..5d934a2caa 100644 --- a/common/src/entity/record.ts +++ b/common/src/entity/record.ts @@ -1,8 +1,8 @@ -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; import { AfterDelete, BeforeCreate, BeforeUpdate, Entity, OnLoad, Property } from '@mikro-orm/core'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; /** * Record collection @@ -133,4 +133,4 @@ export class Record extends BaseEntity { .catch(console.error); } } -} \ No newline at end of file +} diff --git a/common/src/entity/retire-pool.ts b/common/src/entity/retire-pool.ts index 295f178364..a579c91496 100644 --- a/common/src/entity/retire-pool.ts +++ b/common/src/entity/retire-pool.ts @@ -1,5 +1,5 @@ import { BeforeCreate, BeforeUpdate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { IRetirePool, RetireTokenPool, TokenType } from '@guardian/interfaces'; /** diff --git a/common/src/entity/retire-request.ts b/common/src/entity/retire-request.ts index 09fed745a9..0a0812e125 100644 --- a/common/src/entity/retire-request.ts +++ b/common/src/entity/retire-request.ts @@ -1,5 +1,5 @@ import { BeforeCreate, BeforeUpdate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { IRetireRequest, RetireTokenRequest, diff --git a/common/src/entity/schema.ts b/common/src/entity/schema.ts index f56c6618a7..be1df8013a 100644 --- a/common/src/entity/schema.ts +++ b/common/src/entity/schema.ts @@ -15,8 +15,8 @@ import { BeforeUpdate, AfterDelete, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; -import { DataBaseHelper, SchemaConverterUtils } from '../helpers'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseHelper, SchemaConverterUtils } from '../helpers/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; /** diff --git a/common/src/entity/settings.ts b/common/src/entity/settings.ts index b068fe67f0..44e07cd5fc 100644 --- a/common/src/entity/settings.ts +++ b/common/src/entity/settings.ts @@ -1,5 +1,5 @@ import { Entity, Property, Unique } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Settings collection diff --git a/common/src/entity/split-documents.ts b/common/src/entity/split-documents.ts index b6f7154c9c..1d289a170f 100644 --- a/common/src/entity/split-documents.ts +++ b/common/src/entity/split-documents.ts @@ -6,9 +6,9 @@ import { BeforeUpdate, AfterDelete, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; /** diff --git a/common/src/entity/suggestions-config.ts b/common/src/entity/suggestions-config.ts index 2539095546..9bdb97bb1a 100644 --- a/common/src/entity/suggestions-config.ts +++ b/common/src/entity/suggestions-config.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { SuggestionsOrderPriority } from '@guardian/interfaces'; /** diff --git a/common/src/entity/tag-cache.ts b/common/src/entity/tag-cache.ts index 86278f195c..800292b36c 100644 --- a/common/src/entity/tag-cache.ts +++ b/common/src/entity/tag-cache.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Tag Cache diff --git a/common/src/entity/tag.ts b/common/src/entity/tag.ts index 4fa4766ddb..2294f1eb35 100644 --- a/common/src/entity/tag.ts +++ b/common/src/entity/tag.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; /** diff --git a/common/src/entity/theme.ts b/common/src/entity/theme.ts index 1550f83211..6b260d0e04 100644 --- a/common/src/entity/theme.ts +++ b/common/src/entity/theme.ts @@ -1,5 +1,5 @@ import { BeforeCreate, Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; /** diff --git a/common/src/entity/token.ts b/common/src/entity/token.ts index 7253d64077..104215084e 100644 --- a/common/src/entity/token.ts +++ b/common/src/entity/token.ts @@ -1,6 +1,6 @@ import { IToken, TokenType } from '@guardian/interfaces'; import { Entity, Property, Unique } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Tokens collection diff --git a/common/src/entity/tool.ts b/common/src/entity/tool.ts index 9842179c27..bba38b736b 100644 --- a/common/src/entity/tool.ts +++ b/common/src/entity/tool.ts @@ -1,8 +1,8 @@ -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { GenerateUUIDv4, ModuleStatus } from '@guardian/interfaces'; import { AfterDelete, BeforeCreate, BeforeUpdate, Entity, OnLoad, Property } from '@mikro-orm/core'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; /** * PolicyTool collection diff --git a/common/src/entity/topic.ts b/common/src/entity/topic.ts index ce3f7e9536..30b781e8e6 100644 --- a/common/src/entity/topic.ts +++ b/common/src/entity/topic.ts @@ -1,6 +1,6 @@ import { TopicType } from '@guardian/interfaces'; import { Entity, Property, Enum, Unique } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Topics collection diff --git a/common/src/entity/vc-document.ts b/common/src/entity/vc-document.ts index e062be1f80..d11d3b056f 100644 --- a/common/src/entity/vc-document.ts +++ b/common/src/entity/vc-document.ts @@ -17,9 +17,9 @@ import { AfterUpdate, AfterCreate, } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/common/src/entity/vp-document.ts b/common/src/entity/vp-document.ts index 6c23fb487e..b732160c00 100644 --- a/common/src/entity/vp-document.ts +++ b/common/src/entity/vp-document.ts @@ -1,8 +1,8 @@ import { DocumentSignature, DocumentStatus, GenerateUUIDv4, IVP, IVPDocument } from '@guardian/interfaces'; import { Entity, Property, Enum, BeforeCreate, BeforeUpdate, OnLoad, AfterDelete, AfterUpdate, AfterCreate } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; import { ObjectId } from '@mikro-orm/mongodb'; -import { DataBaseHelper } from '../helpers'; +import { DataBaseHelper } from '../helpers/index.js'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/common/src/entity/wiper-request.ts b/common/src/entity/wiper-request.ts index baeafd5d9e..28e3078d98 100644 --- a/common/src/entity/wiper-request.ts +++ b/common/src/entity/wiper-request.ts @@ -1,5 +1,5 @@ import { Entity, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../models'; +import { BaseEntity } from '../models/index.js'; /** * Wiper request diff --git a/common/src/hedera-modules/document-loader/document-loader-default.ts b/common/src/hedera-modules/document-loader/document-loader-default.ts index dd907637b5..f14e0c22eb 100644 --- a/common/src/hedera-modules/document-loader/document-loader-default.ts +++ b/common/src/hedera-modules/document-loader/document-loader-default.ts @@ -1,8 +1,8 @@ import didContexts from '@transmute/did-context'; import credentialsContexts from '@transmute/credentials-context'; import securityContexts from '@transmute/security-context'; -import { IDocumentFormat } from './document-format'; -import { DocumentLoader } from './document-loader'; +import { IDocumentFormat } from './document-format.js'; +import { DocumentLoader } from './document-loader.js'; /** * Default Documents Loader diff --git a/common/src/hedera-modules/document-loader/document-loader-function.ts b/common/src/hedera-modules/document-loader/document-loader-function.ts index b42c207256..f6bc23ce79 100644 --- a/common/src/hedera-modules/document-loader/document-loader-function.ts +++ b/common/src/hedera-modules/document-loader/document-loader-function.ts @@ -1,4 +1,4 @@ -import { IDocumentFormat } from './document-format'; +import { IDocumentFormat } from './document-format.js'; /** * Document loader function interface diff --git a/common/src/hedera-modules/document-loader/document-loader.ts b/common/src/hedera-modules/document-loader/document-loader.ts index a1e8c45b49..60a6fa19b6 100644 --- a/common/src/hedera-modules/document-loader/document-loader.ts +++ b/common/src/hedera-modules/document-loader/document-loader.ts @@ -1,5 +1,5 @@ -import { IDocumentFormat } from './document-format'; -import { DocumentLoaderFunction } from './document-loader-function'; +import { IDocumentFormat } from './document-format.js'; +import { DocumentLoaderFunction } from './document-loader-function.js'; /** * Documents Loader diff --git a/common/src/hedera-modules/document-loader/index.ts b/common/src/hedera-modules/document-loader/index.ts index e87fb07b9c..8cefa6dfe2 100644 --- a/common/src/hedera-modules/document-loader/index.ts +++ b/common/src/hedera-modules/document-loader/index.ts @@ -1,5 +1,5 @@ -export { IDocumentFormat } from './document-format'; -export { DefaultDocumentLoader } from './document-loader-default'; -export { DocumentLoaderFunction } from './document-loader-function'; -export { DocumentLoader } from './document-loader'; -export { SchemaLoader, SchemaLoaderFunction } from './schema-loader'; \ No newline at end of file +export { IDocumentFormat } from './document-format.js'; +export { DefaultDocumentLoader } from './document-loader-default.js'; +export { DocumentLoaderFunction } from './document-loader-function.js'; +export { DocumentLoader } from './document-loader.js'; +export { SchemaLoader, SchemaLoaderFunction } from './schema-loader.js'; diff --git a/common/src/hedera-modules/index.ts b/common/src/hedera-modules/index.ts index 9b34ca9822..1f9012a678 100644 --- a/common/src/hedera-modules/index.ts +++ b/common/src/hedera-modules/index.ts @@ -1,11 +1,13 @@ -export { timeout } from './utils'; -export * from './document-loader'; -export * from './vcjs'; -export * from './message'; -export { Environment } from './environment'; -export { TransactionLogger, TransactionLogLvl } from './transaction-logger'; -export { TopicHelper } from './topic-helper'; -export { TopicConfig } from './topic'; -export { Hashing } from './hashing'; -export { MessageMemo } from './memo-mappings/message-memo'; -export { TopicMemo } from './memo-mappings/topic-memo'; \ No newline at end of file +export { timeout } from './utils.js'; + +export * from './document-loader/index.js'; +export * from './vcjs/index.js'; +export * from './message/index.js'; + +export { Environment } from './environment.js'; +export { TransactionLogger, TransactionLogLvl } from './transaction-logger.js'; +export { TopicHelper } from './topic-helper.js'; +export { TopicConfig } from './topic.js'; +export { Hashing } from './hashing.js'; +export { MessageMemo } from './memo-mappings/message-memo.js'; +export { TopicMemo } from './memo-mappings/topic-memo.js'; diff --git a/common/src/hedera-modules/memo-mappings/message-memo.ts b/common/src/hedera-modules/memo-mappings/message-memo.ts index 86a3d9f6bb..b57c830712 100644 --- a/common/src/hedera-modules/memo-mappings/message-memo.ts +++ b/common/src/hedera-modules/memo-mappings/message-memo.ts @@ -1,7 +1,7 @@ import { TopicType } from '@guardian/interfaces'; -import { MessageType } from '../message/message-type'; -import { MessageAction } from '../message/message-action'; -import { MemoMap } from './memo-map'; +import { MessageType } from '../message/message-type.js'; +import { MessageAction } from '../message/message-action.js'; +import { MemoMap } from './memo-map.js'; /** * Memo message map diff --git a/common/src/hedera-modules/memo-mappings/topic-memo.ts b/common/src/hedera-modules/memo-mappings/topic-memo.ts index 56d7dc3741..6e1877ab4d 100644 --- a/common/src/hedera-modules/memo-mappings/topic-memo.ts +++ b/common/src/hedera-modules/memo-mappings/topic-memo.ts @@ -1,5 +1,5 @@ import { TopicType } from '@guardian/interfaces'; -import { MemoMap } from './memo-map'; +import { MemoMap } from './memo-map.js'; /** * Topic memo map diff --git a/common/src/hedera-modules/message/contract-message.ts b/common/src/hedera-modules/message/contract-message.ts index 852e989983..e99b4c525f 100644 --- a/common/src/hedera-modules/message/contract-message.ts +++ b/common/src/hedera-modules/message/contract-message.ts @@ -1,10 +1,10 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { ContractMessageBody } from './message-body.interface'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { ContractMessageBody } from './message-body.interface.js'; import { ContractType } from '@guardian/interfaces'; -import { Contract } from '../../entity'; +import { Contract } from '../../entity/index.js'; /** * Contract message diff --git a/common/src/hedera-modules/message/did-message.ts b/common/src/hedera-modules/message/did-message.ts index fe7b6466ee..c27667f50c 100644 --- a/common/src/hedera-modules/message/did-message.ts +++ b/common/src/hedera-modules/message/did-message.ts @@ -1,11 +1,11 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { DidMessageBody } from './message-body.interface'; -import { Hashing } from '../hashing'; -import { IPFS } from '../../helpers'; -import { CommonDidDocument } from '../vcjs'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { DidMessageBody } from './message-body.interface.js'; +import { Hashing } from '../hashing.js'; +import { IPFS } from '../../helpers/index.js'; +import { CommonDidDocument } from '../vcjs/index.js'; /** * DID message diff --git a/common/src/hedera-modules/message/index.ts b/common/src/hedera-modules/message/index.ts index 2666d852a9..567f088b02 100644 --- a/common/src/hedera-modules/message/index.ts +++ b/common/src/hedera-modules/message/index.ts @@ -1,19 +1,19 @@ -export { Message, MessageStatus } from './message'; -export { DIDMessage } from './did-message'; -export { SchemaMessage } from './schema-message'; -export { VCMessage } from './vc-message'; -export { MessageType } from './message-type'; -export { MessageAction } from './message-action'; -export { MessageServer } from './message-server'; -export { PolicyMessage } from './policy-message'; -export { UrlType } from './url.interface'; -export { TopicMessage } from './topic-message'; -export { VPMessage } from './vp-message'; -export { RegistrationMessage } from './registration-message'; -export { TokenMessage } from './token-message'; -export { SynchronizationMessage } from './synchronization-message'; -export { ModuleMessage } from './module-message'; -export { TagMessage } from './tag-message'; -export { RoleMessage } from './role-message'; -export { ToolMessage } from './tool-message'; -export { ContractMessage } from './contract-message'; \ No newline at end of file +export { Message, MessageStatus } from './message.js'; +export { DIDMessage } from './did-message.js'; +export { SchemaMessage } from './schema-message.js'; +export { VCMessage } from './vc-message.js'; +export { MessageType } from './message-type.js'; +export { MessageAction } from './message-action.js'; +export { MessageServer } from './message-server.js'; +export { PolicyMessage } from './policy-message.js'; +export { UrlType } from './url.interface.js'; +export { TopicMessage } from './topic-message.js'; +export { VPMessage } from './vp-message.js'; +export { RegistrationMessage } from './registration-message.js'; +export { TokenMessage } from './token-message.js'; +export { SynchronizationMessage } from './synchronization-message.js'; +export { ModuleMessage } from './module-message.js'; +export { TagMessage } from './tag-message.js'; +export { RoleMessage } from './role-message.js'; +export { ToolMessage } from './tool-message.js'; +export { ContractMessage } from './contract-message.js'; diff --git a/common/src/hedera-modules/message/message-body.interface.ts b/common/src/hedera-modules/message/message-body.interface.ts index ffa3b4f030..941fad2129 100644 --- a/common/src/hedera-modules/message/message-body.interface.ts +++ b/common/src/hedera-modules/message/message-body.interface.ts @@ -1,7 +1,7 @@ import { ContractType } from '@guardian/interfaces'; -import { MessageStatus } from './message'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; +import { MessageStatus } from './message.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; /** * Message body diff --git a/common/src/hedera-modules/message/message-server.ts b/common/src/hedera-modules/message/message-server.ts index 372e86ae7e..4a766443e2 100644 --- a/common/src/hedera-modules/message/message-server.ts +++ b/common/src/hedera-modules/message/message-server.ts @@ -1,30 +1,26 @@ -import { - AccountId, - PrivateKey, - TopicId, -} from '@hashgraph/sdk'; -import { GenerateUUIDv4, WorkerTaskType } from '@guardian/interfaces'; -import { IPFS, Logger, Workers } from '../../helpers'; -import { TransactionLogger } from '../transaction-logger'; -import { Environment } from '../environment'; -import { MessageMemo } from '../memo-mappings/message-memo'; -import { DatabaseServer } from '../../database-modules'; -import { TopicConfig } from '../topic'; -import { Message } from './message'; -import { MessageType } from './message-type'; -import { MessageAction } from './message-action'; -import { VCMessage } from './vc-message'; -import { DIDMessage } from './did-message'; -import { PolicyMessage } from './policy-message'; -import { SchemaMessage } from './schema-message'; -import { VPMessage } from './vp-message'; -import { RegistrationMessage } from './registration-message'; -import { TopicMessage } from './topic-message'; -import { TokenMessage } from './token-message'; -import { ModuleMessage } from './module-message'; -import { TagMessage } from './tag-message'; -import { ToolMessage } from './tool-message'; -import { RoleMessage } from './role-message'; +import { AccountId, PrivateKey, TopicId, } from '@hashgraph/sdk'; +import { GenerateUUIDv4, ISignOptions, SignType, WorkerTaskType } from '@guardian/interfaces'; +import { IPFS, Logger, Workers } from '../../helpers/index.js'; +import { TransactionLogger } from '../transaction-logger.js'; +import { Environment } from '../environment.js'; +import { MessageMemo } from '../memo-mappings/message-memo.js'; +import { DatabaseServer } from '../../database-modules/index.js'; +import { TopicConfig } from '../topic.js'; +import { Message } from './message.js'; +import { MessageType } from './message-type.js'; +import { MessageAction } from './message-action.js'; +import { VCMessage } from './vc-message.js'; +import { DIDMessage } from './did-message.js'; +import { PolicyMessage } from './policy-message.js'; +import { SchemaMessage } from './schema-message.js'; +import { VPMessage } from './vp-message.js'; +import { RegistrationMessage } from './registration-message.js'; +import { TopicMessage } from './topic-message.js'; +import { TokenMessage } from './token-message.js'; +import { ModuleMessage } from './module-message.js'; +import { TagMessage } from './tag-message.js'; +import { ToolMessage } from './tool-message.js'; +import { RoleMessage } from './role-message.js'; /** * Message server @@ -58,13 +54,20 @@ export class MessageServer { */ private readonly clientOptions: any; + /** + * Sign options + * @private + */ + private readonly signOptions: ISignOptions; + constructor( operatorId: string | AccountId | null, operatorKey: string | PrivateKey | null, + signOptions: ISignOptions = {signType: SignType.INTERNAL}, dryRun: string = null ) { - this.clientOptions = { operatorId, operatorKey, dryRun }; + this.signOptions = signOptions; this.dryRun = dryRun || null; } @@ -226,6 +229,7 @@ export class MessageServer { if (!this.topicId) { throw new Error('Topic is not set'); } + message.setLang(MessageServer.lang); const time = await this.messageStartLog('Hedera'); const buffer = message.toMessage(); @@ -239,6 +243,7 @@ export class MessageServer { network: Environment.network, localNodeAddress: Environment.localNodeAddress, localNodeProtocol: Environment.localNodeProtocol, + signOptions: this.signOptions, memo: memo || MessageMemo.getMessageMemo(message), dryRun: this.dryRun, } diff --git a/common/src/hedera-modules/message/message.ts b/common/src/hedera-modules/message/message.ts index 6a49606e98..6e2c9ae6c1 100644 --- a/common/src/hedera-modules/message/message.ts +++ b/common/src/hedera-modules/message/message.ts @@ -1,10 +1,10 @@ import { TopicId } from '@hashgraph/sdk'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { MessageBody } from './message-body.interface'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { MessageBody } from './message-body.interface.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { Hashing } from '../hashing'; +import { Hashing } from '../hashing.js'; /** * Message status diff --git a/common/src/hedera-modules/message/module-message.ts b/common/src/hedera-modules/message/module-message.ts index 07e6b892b9..a6bcce4e3e 100644 --- a/common/src/hedera-modules/message/module-message.ts +++ b/common/src/hedera-modules/message/module-message.ts @@ -1,10 +1,10 @@ -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { PolicyModule } from '../../entity'; -import { ModuleMessageBody } from './message-body.interface'; -import { IPFS } from '../../helpers'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { PolicyModule } from '../../entity/index.js'; +import { ModuleMessageBody } from './message-body.interface.js'; +import { IPFS } from '../../helpers/index.js'; /** * Module message diff --git a/common/src/hedera-modules/message/policy-message.ts b/common/src/hedera-modules/message/policy-message.ts index 560a7b6dca..c1ab3d63c4 100644 --- a/common/src/hedera-modules/message/policy-message.ts +++ b/common/src/hedera-modules/message/policy-message.ts @@ -1,10 +1,10 @@ -import { Policy } from '../../entity'; -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { PolicyMessageBody } from './message-body.interface'; -import { IPFS } from '../../helpers'; +import { Policy } from '../../entity/index.js'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { PolicyMessageBody } from './message-body.interface.js'; +import { IPFS } from '../../helpers/index.js'; /** * Policy message diff --git a/common/src/hedera-modules/message/registration-message.ts b/common/src/hedera-modules/message/registration-message.ts index c6d76123d3..3c5645dc52 100644 --- a/common/src/hedera-modules/message/registration-message.ts +++ b/common/src/hedera-modules/message/registration-message.ts @@ -1,8 +1,8 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { RegistrationMessageBody } from './message-body.interface'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { RegistrationMessageBody } from './message-body.interface.js'; /** * Registration message @@ -15,11 +15,11 @@ export class RegistrationMessage extends Message { /** * Topic ID */ - public topicId: string; + declare public topicId: string; /** * Language */ - public lang: string; + declare public lang: string; /** * Attributes */ diff --git a/common/src/hedera-modules/message/role-message.ts b/common/src/hedera-modules/message/role-message.ts index f99d874c33..11ec63eef3 100644 --- a/common/src/hedera-modules/message/role-message.ts +++ b/common/src/hedera-modules/message/role-message.ts @@ -1,7 +1,7 @@ -import { MessageAction } from './message-action'; -import { RoleMessageBody } from './message-body.interface'; -import { MessageType } from './message-type'; -import { VCMessage } from './vc-message'; +import { MessageAction } from './message-action.js'; +import { RoleMessageBody } from './message-body.interface.js'; +import { MessageType } from './message-type.js'; +import { VCMessage } from './vc-message.js'; /** * Role message diff --git a/common/src/hedera-modules/message/schema-message.ts b/common/src/hedera-modules/message/schema-message.ts index 9a9b7e31a3..f630378b7e 100644 --- a/common/src/hedera-modules/message/schema-message.ts +++ b/common/src/hedera-modules/message/schema-message.ts @@ -1,9 +1,9 @@ -import { Schema } from '../../entity'; -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { SchemaMessageBody } from './message-body.interface'; +import { Schema } from '../../entity/index.js'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { SchemaMessageBody } from './message-body.interface.js'; /** * Schema message diff --git a/common/src/hedera-modules/message/synchronization-message.ts b/common/src/hedera-modules/message/synchronization-message.ts index e7e330b4e6..b9e833f32a 100644 --- a/common/src/hedera-modules/message/synchronization-message.ts +++ b/common/src/hedera-modules/message/synchronization-message.ts @@ -1,9 +1,9 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { SynchronizationMessageBody } from './message-body.interface'; -import { MultiPolicy } from '../../entity'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { SynchronizationMessageBody } from './message-body.interface.js'; +import { MultiPolicy } from '../../entity/index.js'; /** * Synchronization message @@ -12,7 +12,7 @@ export class SynchronizationMessage extends Message { /** * Language */ - public lang: string; + declare public lang: string; /** * User DID */ diff --git a/common/src/hedera-modules/message/tag-message.ts b/common/src/hedera-modules/message/tag-message.ts index 0f58d4ecc3..7e3446cc94 100644 --- a/common/src/hedera-modules/message/tag-message.ts +++ b/common/src/hedera-modules/message/tag-message.ts @@ -1,9 +1,9 @@ -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { TagMessageBody } from './message-body.interface'; -import { Tag } from '../../entity'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { TagMessageBody } from './message-body.interface.js'; +import { Tag } from '../../entity/index.js'; /** * Tag message diff --git a/common/src/hedera-modules/message/token-message.ts b/common/src/hedera-modules/message/token-message.ts index 90cd8cde78..bb6fb3fa9d 100644 --- a/common/src/hedera-modules/message/token-message.ts +++ b/common/src/hedera-modules/message/token-message.ts @@ -1,8 +1,8 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { TokenMessageBody } from './message-body.interface'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { TokenMessageBody } from './message-body.interface.js'; /** * Token message diff --git a/common/src/hedera-modules/message/tool-message.ts b/common/src/hedera-modules/message/tool-message.ts index e28537172e..eef173b04f 100644 --- a/common/src/hedera-modules/message/tool-message.ts +++ b/common/src/hedera-modules/message/tool-message.ts @@ -1,10 +1,10 @@ -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { ToolMessageBody } from './message-body.interface'; -import { IPFS } from '../../helpers'; -import { PolicyTool } from '../../entity/tool'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { ToolMessageBody } from './message-body.interface.js'; +import { IPFS } from '../../helpers/index.js'; +import { PolicyTool } from '../../entity/tool.js'; /** * Tool message diff --git a/common/src/hedera-modules/message/topic-message.ts b/common/src/hedera-modules/message/topic-message.ts index 77f0de7f3f..0629676bb5 100644 --- a/common/src/hedera-modules/message/topic-message.ts +++ b/common/src/hedera-modules/message/topic-message.ts @@ -1,8 +1,8 @@ -import { Message } from './message'; -import { IURL } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { TopicMessageBody } from './message-body.interface'; +import { Message } from './message.js'; +import { IURL } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { TopicMessageBody } from './message-body.interface.js'; /** * Topic message diff --git a/common/src/hedera-modules/message/vc-message.ts b/common/src/hedera-modules/message/vc-message.ts index bd9251a36f..a4e7e22e5f 100644 --- a/common/src/hedera-modules/message/vc-message.ts +++ b/common/src/hedera-modules/message/vc-message.ts @@ -1,10 +1,10 @@ -import { VcDocument } from './../vcjs/vc-document'; -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { VcMessageBody } from './message-body.interface'; -import { Hashing } from '../hashing'; +import { VcDocument } from './../vcjs/vc-document.js'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { VcMessageBody } from './message-body.interface.js'; +import { Hashing } from '../hashing.js'; import { SignatureType } from '@guardian/interfaces'; import { bytesToUtf8, @@ -13,8 +13,8 @@ import { encryptWithKeyDerivedFromString, utf8ToBytes, } from '@meeco/cryppo'; -import { SerializationFormat } from '@meeco/cryppo/dist/src/serialization-versions'; -import { IPFS } from '../../helpers'; +import { SerializationFormat } from '@meeco/cryppo/dist/src/serialization-versions.js'; +import { IPFS } from '../../helpers/index.js'; /** * VC message diff --git a/common/src/hedera-modules/message/vp-message.ts b/common/src/hedera-modules/message/vp-message.ts index 999a228424..87f2daea1d 100644 --- a/common/src/hedera-modules/message/vp-message.ts +++ b/common/src/hedera-modules/message/vp-message.ts @@ -1,11 +1,11 @@ -import { VpDocument } from '../vcjs/vp-document'; -import { Message } from './message'; -import { IURL, UrlType } from './url.interface'; -import { MessageAction } from './message-action'; -import { MessageType } from './message-type'; -import { VpMessageBody } from './message-body.interface'; -import { Hashing } from '../hashing'; -import { IPFS } from '../../helpers'; +import { VpDocument } from '../vcjs/vp-document.js'; +import { Message } from './message.js'; +import { IURL, UrlType } from './url.interface.js'; +import { MessageAction } from './message-action.js'; +import { MessageType } from './message-type.js'; +import { VpMessageBody } from './message-body.interface.js'; +import { Hashing } from '../hashing.js'; +import { IPFS } from '../../helpers/index.js'; /** * VP message diff --git a/common/src/hedera-modules/topic-helper.ts b/common/src/hedera-modules/topic-helper.ts index 950b6527e0..83568f49bb 100644 --- a/common/src/hedera-modules/topic-helper.ts +++ b/common/src/hedera-modules/topic-helper.ts @@ -1,7 +1,7 @@ -import { TopicType, WorkerTaskType } from '@guardian/interfaces'; -import { TopicConfig, MessageAction, MessageServer, TopicMessage } from '.'; -import { TopicMemo } from './memo-mappings/topic-memo'; -import { Workers } from '../helpers'; +import { ISignOptions, TopicType, WorkerTaskType } from '@guardian/interfaces'; +import { MessageAction, MessageServer, TopicConfig, TopicMessage } from './index.js'; +import { TopicMemo } from './memo-mappings/topic-memo.js'; +import { Workers } from '../helpers/index.js'; /** * Topic Helper @@ -18,6 +18,8 @@ export class TopicHelper { */ private hederaAccountKey: string; + private readonly signOptions: ISignOptions; + /** * Dry-run * @private @@ -27,11 +29,13 @@ export class TopicHelper { constructor( operatorId: string, operatorKey: string, + signOptions: ISignOptions, dryRun: string = null ) { this.dryRun = dryRun || null; this.hederaAccountId = operatorId; this.hederaAccountKey = operatorKey; + this.signOptions = signOptions; } /** @@ -148,7 +152,7 @@ export class TopicHelper { */ // tslint:disable-next-line:completed-docs public async oneWayLink(topic: TopicConfig, parent: TopicConfig, rationale: string) { - const messageServer = new MessageServer(this.hederaAccountId, this.hederaAccountKey, this.dryRun); + const messageServer = new MessageServer(this.hederaAccountId, this.hederaAccountKey, this.signOptions, this.dryRun); const message1 = new TopicMessage(MessageAction.CreateTopic); message1.setDocument({ @@ -173,7 +177,7 @@ export class TopicHelper { * @param rationale */ public async twoWayLink(topic: TopicConfig, parent: TopicConfig, rationale: string) { - const messageServer = new MessageServer(this.hederaAccountId, this.hederaAccountKey, this.dryRun); + const messageServer = new MessageServer(this.hederaAccountId, this.hederaAccountKey, this.signOptions, this.dryRun); const message1 = new TopicMessage(MessageAction.CreateTopic); message1.setDocument({ diff --git a/common/src/hedera-modules/topic.ts b/common/src/hedera-modules/topic.ts index 796c25c1d2..23c14e8feb 100644 --- a/common/src/hedera-modules/topic.ts +++ b/common/src/hedera-modules/topic.ts @@ -1,6 +1,6 @@ -import { Topic } from '../entity'; +import { Topic } from '../entity/index.js'; import { TopicType } from '@guardian/interfaces'; -import { KeyType, Wallet } from '../helpers'; +import { KeyType, Wallet } from '../helpers/index.js'; /** * Topic Config diff --git a/common/src/hedera-modules/transaction-logger.ts b/common/src/hedera-modules/transaction-logger.ts index 44989df548..5b7678a768 100644 --- a/common/src/hedera-modules/transaction-logger.ts +++ b/common/src/hedera-modules/transaction-logger.ts @@ -1,10 +1,10 @@ import { GenerateUUIDv4, WorkerTaskType } from '@guardian/interfaces'; -import { DatabaseServer } from '../database-modules'; -import { Logger, RunFunctionAsync, Workers } from '../helpers'; -import { MessageResponse } from '../models'; -import { Singleton } from '../decorators/singleton'; -import { NatsService } from '../mq'; -import { SecretManager } from '../secret-manager'; +import { DatabaseServer } from '../database-modules/index.js'; +import { Logger, RunFunctionAsync, Workers } from '../helpers/index.js'; +import { MessageResponse } from '../models/index.js'; +import { Singleton } from '../decorators/singleton.js'; +import { NatsService } from '../mq/index.js'; +import { SecretManager } from '../secret-manager/index.js'; /** * Transaction log level diff --git a/common/src/hedera-modules/vcjs/did-document.ts b/common/src/hedera-modules/vcjs/did-document.ts index fa4a0c9cab..e5ab3413a4 100644 --- a/common/src/hedera-modules/vcjs/did-document.ts +++ b/common/src/hedera-modules/vcjs/did-document.ts @@ -1,6 +1,6 @@ import { PrivateKey, PublicKey, TopicId } from '@hashgraph/sdk'; -import { Environment } from '../environment'; -import { Hashing } from '../hashing'; +import { Environment } from '../environment.js'; +import { Hashing } from '../hashing.js'; import { IVerificationMethod, IDidDocument } from '@guardian/interfaces'; import { Bls12381G2KeyPair } from '@mattrglobal/jsonld-signatures-bbs'; diff --git a/common/src/hedera-modules/vcjs/did/common-did-document.ts b/common/src/hedera-modules/vcjs/did/common-did-document.ts index 1ad1a3043e..b738b49224 100644 --- a/common/src/hedera-modules/vcjs/did/common-did-document.ts +++ b/common/src/hedera-modules/vcjs/did/common-did-document.ts @@ -1,11 +1,11 @@ -import { DidDocumentProperties } from './types/did-document-properties'; -import { DocumentContext } from './components/document-context'; -import { CommonDid } from './common-did'; -import { HederaDid } from './hedera-did'; -import { VerificationMethod } from './components/verification-method'; -import { Hashing } from '../../hashing'; -import { DocumentService } from './components/document-service'; -import { IDidDocument } from './types/did-document'; +import { DidDocumentProperties } from './types/did-document-properties.js'; +import { DocumentContext } from './components/document-context.js'; +import { CommonDid } from './common-did.js'; +import { HederaDid } from './hedera-did.js'; +import { VerificationMethod } from './components/verification-method.js'; +import { Hashing } from '../../hashing.js'; +import { DocumentService } from './components/document-service.js'; +import { IDidDocument } from './types/did-document.js'; /** * Did document base @@ -451,4 +451,4 @@ export class CommonDidDocument { return false; } } -} \ No newline at end of file +} diff --git a/common/src/hedera-modules/vcjs/did/common-did.ts b/common/src/hedera-modules/vcjs/did/common-did.ts index f1235d677d..994d48a485 100644 --- a/common/src/hedera-modules/vcjs/did/common-did.ts +++ b/common/src/hedera-modules/vcjs/did/common-did.ts @@ -1,4 +1,4 @@ -import { IDidComponents } from './types/did-components'; +import { IDidComponents } from './types/did-components.js'; /** * DID base @@ -127,4 +127,4 @@ export class CommonDid { } return true; } -} \ No newline at end of file +} diff --git a/common/src/hedera-modules/vcjs/did/components/document-service.ts b/common/src/hedera-modules/vcjs/did/components/document-service.ts index 7aa5f26037..17d82505bb 100644 --- a/common/src/hedera-modules/vcjs/did/components/document-service.ts +++ b/common/src/hedera-modules/vcjs/did/components/document-service.ts @@ -1,5 +1,5 @@ -import { IService } from '../types/did-document'; -import { ServiceProperties } from '../types/service-properties'; +import { IService } from '../types/did-document.js'; +import { ServiceProperties } from '../types/service-properties.js'; /** * Did document service diff --git a/common/src/hedera-modules/vcjs/did/components/hedera-bbs-method.ts b/common/src/hedera-modules/vcjs/did/components/hedera-bbs-method.ts index 6210a2b1e0..18c2cfa710 100644 --- a/common/src/hedera-modules/vcjs/did/components/hedera-bbs-method.ts +++ b/common/src/hedera-modules/vcjs/did/components/hedera-bbs-method.ts @@ -1,6 +1,6 @@ import { PrivateKey } from '@hashgraph/sdk'; import { Bls12381G2KeyPair } from '@mattrglobal/jsonld-signatures-bbs'; -import { VerificationMethod } from './verification-method'; +import { VerificationMethod } from './verification-method.js'; /** * DID document method (Bls12381G2Key2020) diff --git a/common/src/hedera-modules/vcjs/did/components/hedera-ed25519-method.ts b/common/src/hedera-modules/vcjs/did/components/hedera-ed25519-method.ts index 71a43f5091..c01313b5c8 100644 --- a/common/src/hedera-modules/vcjs/did/components/hedera-ed25519-method.ts +++ b/common/src/hedera-modules/vcjs/did/components/hedera-ed25519-method.ts @@ -1,6 +1,6 @@ import { PrivateKey } from '@hashgraph/sdk'; -import { Hashing } from '../../../hashing'; -import { VerificationMethod } from './verification-method'; +import { Hashing } from '../../../hashing.js'; +import { VerificationMethod } from './verification-method.js'; /** * DID document method (Ed25519VerificationKey2018) diff --git a/common/src/hedera-modules/vcjs/did/components/verification-method.ts b/common/src/hedera-modules/vcjs/did/components/verification-method.ts index f41ad321b3..7d1f4305fc 100644 --- a/common/src/hedera-modules/vcjs/did/components/verification-method.ts +++ b/common/src/hedera-modules/vcjs/did/components/verification-method.ts @@ -1,5 +1,5 @@ -import { IVerificationMethod } from '../types/did-document'; -import { VerificationMethodProperties } from '../types/verification-method-properties'; +import { IVerificationMethod } from '../types/did-document.js'; +import { VerificationMethodProperties } from '../types/verification-method-properties.js'; /** * Did document method @@ -297,4 +297,4 @@ export class VerificationMethod { } return result; } -} \ No newline at end of file +} diff --git a/common/src/hedera-modules/vcjs/did/hedera-did-document.ts b/common/src/hedera-modules/vcjs/did/hedera-did-document.ts index 801086b42c..80e79c3722 100644 --- a/common/src/hedera-modules/vcjs/did/hedera-did-document.ts +++ b/common/src/hedera-modules/vcjs/did/hedera-did-document.ts @@ -1,10 +1,10 @@ import { PrivateKey, TopicId } from '@hashgraph/sdk'; -import { DocumentContext } from './components/document-context'; -import { HederaDid } from './hedera-did'; -import { CommonDidDocument } from './common-did-document'; -import { HederaEd25519Method } from './components/hedera-ed25519-method'; -import { HederaBBSMethod } from './components/hedera-bbs-method'; -import { IDidDocument } from './types/did-document'; +import { DocumentContext } from './components/document-context.js'; +import { HederaDid } from './hedera-did.js'; +import { CommonDidDocument } from './common-did-document.js'; +import { HederaEd25519Method } from './components/hedera-ed25519-method.js'; +import { HederaBBSMethod } from './components/hedera-bbs-method.js'; +import { IDidDocument } from './types/did-document.js'; /** * Hedera DID document diff --git a/common/src/hedera-modules/vcjs/did/hedera-did.ts b/common/src/hedera-modules/vcjs/did/hedera-did.ts index fbdf4f16d9..5de949b633 100644 --- a/common/src/hedera-modules/vcjs/did/hedera-did.ts +++ b/common/src/hedera-modules/vcjs/did/hedera-did.ts @@ -1,7 +1,7 @@ import { PrivateKey, PublicKey, TopicId } from '@hashgraph/sdk'; -import { Hashing } from '../../hashing'; -import { CommonDid } from './common-did'; -import { HederaDidComponents } from './types/did-components'; +import { Hashing } from '../../hashing.js'; +import { CommonDid } from './common-did.js'; +import { HederaDidComponents } from './types/did-components.js'; /** * Hedera DID diff --git a/common/src/hedera-modules/vcjs/did/index.ts b/common/src/hedera-modules/vcjs/did/index.ts index 208773aa75..1038b46a39 100644 --- a/common/src/hedera-modules/vcjs/did/index.ts +++ b/common/src/hedera-modules/vcjs/did/index.ts @@ -1,14 +1,14 @@ -export * from './common-did'; -export * from './common-did-document'; -export * from './hedera-did'; -export * from './hedera-did-document'; -export * from './types/did-document'; -export * from './types/did-document-properties'; -export * from './types/service-properties'; -export * from './types/verification-method-properties'; -export * from './components/did-url'; -export * from './components/document-context'; -export * from './components/document-service'; -export * from './components/hedera-bbs-method'; -export * from './components/hedera-ed25519-method'; -export * from './components/verification-method'; \ No newline at end of file +export * from './common-did.js'; +export * from './common-did-document.js'; +export * from './hedera-did.js'; +export * from './hedera-did-document.js'; +export * from './types/did-document.js'; +export * from './types/did-document-properties.js'; +export * from './types/service-properties.js'; +export * from './types/verification-method-properties.js'; +export * from './components/did-url.js'; +export * from './components/document-context.js'; +export * from './components/document-service.js'; +export * from './components/hedera-bbs-method.js'; +export * from './components/hedera-ed25519-method.js'; +export * from './components/verification-method.js'; diff --git a/common/src/hedera-modules/vcjs/index.ts b/common/src/hedera-modules/vcjs/index.ts index 4d7f52f4ae..c59798bfc8 100644 --- a/common/src/hedera-modules/vcjs/index.ts +++ b/common/src/hedera-modules/vcjs/index.ts @@ -1,6 +1,6 @@ -export { VcDocument as VcDocumentDefinition } from './vc-document'; -export { VpDocument as VpDocumentDefinition } from './vp-document'; -export { VcSubject } from './vc-subject'; -export { VCJS } from './vcjs'; -export * from './did/index'; -export * from './did-document'; \ No newline at end of file +export { VcDocument as VcDocumentDefinition } from './vc-document.js'; +export { VpDocument as VpDocumentDefinition } from './vp-document.js'; +export { VcSubject } from './vc-subject.js'; +export { VCJS } from './vcjs.js'; +export * from './did/index.js'; +export * from './did-document.js'; diff --git a/common/src/hedera-modules/vcjs/vc-document.ts b/common/src/hedera-modules/vcjs/vc-document.ts index a787a7525b..300c9ffe64 100644 --- a/common/src/hedera-modules/vcjs/vc-document.ts +++ b/common/src/hedera-modules/vcjs/vc-document.ts @@ -1,10 +1,10 @@ import { Timestamp } from '@hashgraph/sdk'; -import { Hashing } from '../hashing'; -import { TimestampUtils } from '../timestamp-utils'; +import { Hashing } from '../hashing.js'; +import { TimestampUtils } from '../timestamp-utils.js'; import { IVC, SignatureType } from '@guardian/interfaces'; -import { Issuer } from './issuer'; -import { VcSubject } from './vc-subject'; -import { CommonDidDocument } from './did'; +import { Issuer } from './issuer.js'; +import { VcSubject } from './vc-subject.js'; +import { CommonDidDocument } from './did/index.js'; /** * VC document diff --git a/common/src/hedera-modules/vcjs/vcjs.ts b/common/src/hedera-modules/vcjs/vcjs.ts index 6bf6af2df1..621fc9de8b 100644 --- a/common/src/hedera-modules/vcjs/vcjs.ts +++ b/common/src/hedera-modules/vcjs/vcjs.ts @@ -5,20 +5,22 @@ import { Ed25519Signature2018, Ed25519VerificationKey2018 } from '@transmute/ed2 import { PrivateKey } from '@hashgraph/sdk'; import { CheckResult } from '@transmute/jsonld-schema'; import { GenerateUUIDv4, ICredentialSubject, IVC, SignatureType } from '@guardian/interfaces'; -import { VcDocument } from './vc-document'; -import { VpDocument } from './vp-document'; -import { VcSubject } from './vc-subject'; -import { TimestampUtils } from '../timestamp-utils'; -import { DocumentLoaderFunction } from '../document-loader/document-loader-function'; -import { DocumentLoader } from '../document-loader/document-loader'; -import { SchemaLoader, SchemaLoaderFunction } from '../document-loader/schema-loader'; -import { Issuer } from './issuer'; +import { VcDocument } from './vc-document.js'; +import { VpDocument } from './vp-document.js'; +import { VcSubject } from './vc-subject.js'; +import { TimestampUtils } from '../timestamp-utils.js'; +import { DocumentLoaderFunction } from '../document-loader/document-loader-function.js'; +import { DocumentLoader } from '../document-loader/document-loader.js'; +import { SchemaLoader, SchemaLoaderFunction } from '../document-loader/schema-loader.js'; +import { Issuer } from './issuer.js'; import axios from 'axios'; import { BbsBlsSignature2020, BbsBlsSignatureProof2020, Bls12381G2KeyPair, KeyPairOptions } from '@mattrglobal/jsonld-signatures-bbs'; -import { IPFS } from '../../helpers'; -import { verify, purposes } from 'jsonld-signatures'; -import { CommonDidDocument, HederaBBSMethod, HederaDidDocument, HederaEd25519Method } from './did'; -import { BBSDidRootKey, DidRootKey } from './did-document'; +import { IPFS } from '../../helpers/index.js'; +import { CommonDidDocument, HederaBBSMethod, HederaDidDocument, HederaEd25519Method } from './did/index.js'; +import { BBSDidRootKey, DidRootKey } from './did-document.js'; + +import * as pkg from 'jsonld-signatures'; +const { verify, purposes } = pkg; /** * Suite interface diff --git a/common/src/hedera-modules/vcjs/vp-document.ts b/common/src/hedera-modules/vcjs/vp-document.ts index 9e959e8de3..8eb23200ce 100644 --- a/common/src/hedera-modules/vcjs/vp-document.ts +++ b/common/src/hedera-modules/vcjs/vp-document.ts @@ -1,10 +1,10 @@ -import { Hashing } from '../hashing'; +import { Hashing } from '../hashing.js'; import { IVP } from '@guardian/interfaces'; -import { VcDocument } from './vc-document'; -import { Issuer } from './issuer'; -import { TimestampUtils } from '../timestamp-utils'; +import { VcDocument } from './vc-document.js'; +import { Issuer } from './issuer.js'; +import { TimestampUtils } from '../timestamp-utils.js'; import { Timestamp } from '@hashgraph/sdk'; -import { CommonDidDocument } from './did'; +import { CommonDidDocument } from './did/index.js'; /** * VP document diff --git a/common/src/helpers/application-state.ts b/common/src/helpers/application-state.ts index 4d9d5c0e16..e584f9aaaf 100644 --- a/common/src/helpers/application-state.ts +++ b/common/src/helpers/application-state.ts @@ -1,5 +1,5 @@ -import { Singleton } from '../decorators/singleton'; -import { NatsService } from '../mq'; +import { Singleton } from '../decorators/singleton.js'; +import { NatsService } from '../mq/index.js'; import { ApplicationStates, GenerateUUIDv4, MessageAPI } from '@guardian/interfaces'; /** diff --git a/common/src/helpers/common-variables.ts b/common/src/helpers/common-variables.ts index 3965fb8d6c..792276717e 100644 --- a/common/src/helpers/common-variables.ts +++ b/common/src/helpers/common-variables.ts @@ -1,4 +1,4 @@ -import { Singleton } from '../decorators/singleton'; +import { Singleton } from '../decorators/singleton.js'; /** * Common variables diff --git a/common/src/helpers/db-helper.ts b/common/src/helpers/db-helper.ts index 6abf1e2e63..7bb2625bf3 100644 --- a/common/src/helpers/db-helper.ts +++ b/common/src/helpers/db-helper.ts @@ -1,14 +1,14 @@ -import { MikroORM, UseRequestContext, wrap } from '@mikro-orm/core'; +import { MikroORM, CreateRequestContext, wrap } from '@mikro-orm/core'; import { MongoDriver, MongoEntityManager, MongoEntityRepository, ObjectId } from '@mikro-orm/mongodb'; -import { BaseEntity } from '../models'; -import { DataBaseNamingStrategy } from './db-naming-strategy'; +import { BaseEntity } from '../models/index.js'; +import { DataBaseNamingStrategy } from './db-naming-strategy.js'; import { GridFSBucket } from 'mongodb'; /** * Common connection config */ export const COMMON_CONNECTION_CONFIG: any = { - type: 'mongo', + driver: MongoDriver, namingStrategy: DataBaseNamingStrategy, dbName: (process.env.GUARDIAN_ENV || (process.env.HEDERA_NET !== process.env.PREUSED_HEDERA_NET)) ? `${process.env.GUARDIAN_ENV}_${process.env.HEDERA_NET}_${process.env.DB_DATABASE}` : @@ -88,7 +88,7 @@ export class DataBaseHelper { * @param filters filters * @returns Count */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async delete(filters: any | string | ObjectId): Promise { return await this._em.nativeDelete(this.entityClass, filters); } @@ -97,7 +97,7 @@ export class DataBaseHelper { * Remove entities or entity * @param entity Entities or entity */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async remove(entity: T | T[]): Promise { if (Array.isArray(entity)) { for (const element of entity) { @@ -137,7 +137,7 @@ export class DataBaseHelper { * @param pipeline Pipeline * @returns Result */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async aggregate(pipeline: any[]): Promise { const aggregateEntities = await this._em.aggregate( this.entityClass, @@ -169,7 +169,7 @@ export class DataBaseHelper { * @param options Options * @returns Entities and count */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async findAndCount(filters: any | string | ObjectId, options?: any): Promise<[T[], number]> { return await this._em.findAndCount(this.entityClass, filters?.where || filters, options); } @@ -180,7 +180,7 @@ export class DataBaseHelper { * @param options Options * @returns Count */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async count(filters?: any | string | ObjectId, options?: any): Promise { return await this._em.count(this.entityClass, filters?.where || filters, options); } @@ -191,7 +191,7 @@ export class DataBaseHelper { * @param options Options * @returns Entities */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async find(filters?: any | string | ObjectId, options?: any): Promise { return await this._em.getRepository(this.entityClass).find(filters?.where || filters || {}, options); } @@ -201,7 +201,7 @@ export class DataBaseHelper { * @param options Options * @returns Entities */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async findAll(options?: any): Promise { return await this._em.getRepository(this.entityClass).findAll(options); } @@ -212,7 +212,7 @@ export class DataBaseHelper { * @param options Options * @returns Entity */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async findOne(filter: any | string | ObjectId, options: any = {}): Promise { return await this._em.getRepository(this.entityClass).findOne(filter?.where || filter, options); } @@ -230,7 +230,7 @@ export class DataBaseHelper { * @returns Entities */ public async save(entites: any[]): Promise; - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async save( entity: any, filter?: any @@ -246,7 +246,7 @@ export class DataBaseHelper { const repository = this._em.getRepository(this.entityClass); if (!entity.id && !entity._id && !filter) { const e = repository.create(Object.assign({}, entity)); - await repository.persistAndFlush(e); + await this._em.persistAndFlush(e); return e; } @@ -257,13 +257,16 @@ export class DataBaseHelper { entity[systemFileField] = entityToUpdateOrCreate[systemFileField]; } }); - wrap(entityToUpdateOrCreate).assign({ ...entity, updateDate: new Date() }, { mergeObjects: false }); + wrap(entityToUpdateOrCreate).assign({ ...entity, updateDate: new Date() }, { merge: false }); } else { entityToUpdateOrCreate = repository.create({ ...entity }); - await repository.persist(entityToUpdateOrCreate); + this._em.persist(entityToUpdateOrCreate); } - await repository.flush(); - return entityToUpdateOrCreate; + + await this._em.flush(); + await this._em.persistAndFlush(entityToUpdateOrCreate); + + return entityToUpdateOrCreate; } /** @@ -278,7 +281,7 @@ export class DataBaseHelper { * @param entities Entities */ public async update(entities: any[]): Promise; - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async update( entity: any | any[], filter?: any @@ -303,9 +306,9 @@ export class DataBaseHelper { entity[systemFileField] = entityToUpdate[systemFileField]; } }); - wrap(entityToUpdate).assign({ ...entity, updateDate: new Date() }, { mergeObjects: false }); + wrap(entityToUpdate).assign({ ...entity, updateDate: new Date() }, { mergeObjectProperties: false }); } - await repository.flush(); + await this._em.flush(); return entitiesToUpdate.length === 1 ? entitiesToUpdate[0] : entitiesToUpdate; @@ -316,7 +319,7 @@ export class DataBaseHelper { * @param data Data * @param amount Amount */ - @UseRequestContext(() => DataBaseHelper.orm) + @CreateRequestContext(() => DataBaseHelper.orm) public async createMuchData(data: any, amount: number): Promise { const repository: MongoEntityRepository = this._em.getRepository(this.entityClass); delete data.id; diff --git a/common/src/helpers/index.ts b/common/src/helpers/index.ts index 025e667d53..9f19792ca0 100644 --- a/common/src/helpers/index.ts +++ b/common/src/helpers/index.ts @@ -1,25 +1,25 @@ -export * from './application-state'; -export * from './common-variables'; -export * from './common.module'; -export * from './db-helper'; -export * from './db-naming-strategy'; -export * from './do-nothing'; -export * from './ipfs'; -export * from './logger.module'; -export * from './logger'; -export * from './migration'; -export * from './notification.service'; -export * from './notification.helper'; -export * from './run-function-async'; -export * from './schema-converter-utils'; -export * from './schemas-to-context'; -export * from './service-requests-base'; -export * from './settings-container'; -export * from './users'; -export * from './utils'; -export * from './validate-configuration'; -export * from './vc-helper'; -export * from './wallet'; -export * from './workers'; -export * from './policy-category'; -export * from './policy-property'; \ No newline at end of file +export * from './application-state.js'; +export * from './common-variables.js'; +export * from './common.module.js'; +export * from './db-helper.js'; +export * from './db-naming-strategy.js'; +export * from './do-nothing.js'; +export * from './ipfs.js'; +export * from './logger.module.js'; +export * from './logger.js'; +export * from './migration.js'; +export * from './notification.service.js'; +export * from './notification.helper.js'; +export * from './run-function-async.js'; +export * from './schema-converter-utils.js'; +export * from './schemas-to-context.js'; +export * from './service-requests-base.js'; +export * from './settings-container.js'; +export * from './users.js'; +export * from './utils.js'; +export * from './validate-configuration.js'; +export * from './vc-helper.js'; +export * from './wallet.js'; +export * from './workers.js'; +export * from './policy-category.js'; +export * from './policy-property.js'; diff --git a/common/src/helpers/ipfs.ts b/common/src/helpers/ipfs.ts index 8a47560a88..e73422f5db 100644 --- a/common/src/helpers/ipfs.ts +++ b/common/src/helpers/ipfs.ts @@ -1,6 +1,6 @@ import { MessageAPI, WorkerTaskType } from '@guardian/interfaces'; -import { Workers } from './workers'; -import { MessageBrokerChannel } from '../mq'; +import { Workers } from './workers.js'; +import { MessageBrokerChannel } from '../mq/index.js'; /** * IPFS service diff --git a/common/src/helpers/logger.ts b/common/src/helpers/logger.ts index 01d0594f2d..87b14c3771 100644 --- a/common/src/helpers/logger.ts +++ b/common/src/helpers/logger.ts @@ -1,6 +1,6 @@ import { ApplicationStates, GenerateUUIDv4, ILog, IPageParameters, LogType, MessageAPI } from '@guardian/interfaces'; -import { Singleton } from '../decorators/singleton'; -import { NatsService } from '../mq'; +import { Singleton } from '../decorators/singleton.js'; +import { NatsService } from '../mq/index.js'; import { createLogger, Logger as WinstonLogger, format } from 'winston'; import Transport from 'winston-transport'; diff --git a/common/src/helpers/migration.ts b/common/src/helpers/migration.ts index b48df89b55..f9682e1e8d 100644 --- a/common/src/helpers/migration.ts +++ b/common/src/helpers/migration.ts @@ -1,12 +1,17 @@ import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; +import { Migrator } from '@mikro-orm/migrations-mongodb'; /** * Define migration process * @param initConfig Config */ export async function Migration(initConfig: any, migrations?: string[]) { - const orm = await MikroORM.init(initConfig); + const orm = await MikroORM.init({ + ...initConfig, + extensions: [Migrator], + }); + const migrator = orm.getMigrator(); const executedMigrations = await migrator.getExecutedMigrations(); const executeOldMigrations = async (name: string) => { @@ -21,4 +26,4 @@ export async function Migration(initConfig: any, migrations?: string[]) { } await migrator.up(); return orm; -}; \ No newline at end of file +}; diff --git a/common/src/helpers/notification.helper.ts b/common/src/helpers/notification.helper.ts index 5f744a71e8..9fde42fc3d 100644 --- a/common/src/helpers/notification.helper.ts +++ b/common/src/helpers/notification.helper.ts @@ -3,8 +3,8 @@ import { NotificationType, TaskAction, } from '@guardian/interfaces'; -import { NotificationService } from './notification.service'; -import { CommonVariables } from './common-variables'; +import { NotificationService } from './notification.service.js'; +import { CommonVariables } from './common-variables.js'; export class NotificationHelper { /** diff --git a/common/src/helpers/notification.service.ts b/common/src/helpers/notification.service.ts index 1aac181d22..81d3c68566 100644 --- a/common/src/helpers/notification.service.ts +++ b/common/src/helpers/notification.service.ts @@ -4,7 +4,7 @@ import { NotifyAPI, } from '@guardian/interfaces'; import { Injectable } from '@nestjs/common'; -import { CommonVariables } from './common-variables'; +import { CommonVariables } from './common-variables.js'; import { Client, ClientProxy, Transport } from '@nestjs/microservices'; /** diff --git a/common/src/helpers/policy-category.ts b/common/src/helpers/policy-category.ts index 2f5ba85224..6f1e1f5e65 100644 --- a/common/src/helpers/policy-category.ts +++ b/common/src/helpers/policy-category.ts @@ -1,5 +1,5 @@ -import { PolicyCategory } from '../entity'; -import { DataBaseHelper } from './db-helper'; +import { PolicyCategory } from '../entity/index.js'; +import { DataBaseHelper } from './db-helper.js'; export function GetGroupedCategories(categories: PolicyCategory[]) { const groupedCategories = categories.reduce((result, item: PolicyCategory) => { @@ -30,4 +30,4 @@ export async function GetConditionsPoliciesByCategories(categoryIds: string[], t } return conditions; -}; \ No newline at end of file +}; diff --git a/common/src/helpers/policy-property.ts b/common/src/helpers/policy-property.ts index 57b68500b4..b40bcb937d 100644 --- a/common/src/helpers/policy-property.ts +++ b/common/src/helpers/policy-property.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import { PolicyProperty } from '../entity/policy-property'; +import { PolicyProperty } from '../entity/policy-property.js'; export async function GetPropertiesFromFile(filePath: string): Promise { try { @@ -24,4 +24,4 @@ export async function GetPropertiesFromFile(filePath: string): Promise { + if (user.useFireblocksSigning) { + const signData = JSON.parse(await this.getKey(user.walletToken, KeyType.FIREBLOCKS_KEY, user.did)) as any; + if (signData) { + return { + signType: SignType.FIREBLOCKS, + data: { + apiKey: signData.fireBlocksApiKey, + privateKey: signData.fireBlocksPrivateiKey, + assetId: signData.fireBlocksAssetId, + vaultId: signData.fireBlocksVaultId + }, + } + } + } + return { + signType: SignType.INTERNAL + } + } } diff --git a/common/src/helpers/workers.ts b/common/src/helpers/workers.ts index 9380bc1a99..3cd398e37b 100644 --- a/common/src/helpers/workers.ts +++ b/common/src/helpers/workers.ts @@ -1,7 +1,7 @@ -import { Singleton } from '../decorators/singleton'; +import { Singleton } from '../decorators/singleton.js'; import { GenerateUUIDv4, HederaResponseCode, IActiveTask, ITask, TimeoutError, WorkerEvents, } from '@guardian/interfaces'; -import { Environment } from '../hedera-modules'; -import { NatsService } from '../mq'; +import { Environment } from '../hedera-modules/index.js'; +import { NatsService } from '../mq/index.js'; export const NON_RETRYABLE_HEDERA_ERRORS = [ // Insufficient type errors diff --git a/common/src/import-export/index.ts b/common/src/import-export/index.ts index b754bb5a51..869adf7371 100644 --- a/common/src/import-export/index.ts +++ b/common/src/import-export/index.ts @@ -1,7 +1,7 @@ -export * from './module'; -export * from './policy'; -export * from './schema'; -export * from './tool'; -export * from './theme'; -export * from './record'; -export * from './utils'; \ No newline at end of file +export * from './module.js'; +export * from './policy.js'; +export * from './schema.js'; +export * from './tool.js'; +export * from './theme.js'; +export * from './record.js'; +export * from './utils.js'; diff --git a/common/src/import-export/module.ts b/common/src/import-export/module.ts index 2c77b59253..7648a5942a 100644 --- a/common/src/import-export/module.ts +++ b/common/src/import-export/module.ts @@ -1,7 +1,7 @@ import JSZip from 'jszip'; -import { PolicyModule, Schema, Tag } from '../entity'; -import { DataBaseHelper } from '../helpers'; -import { DatabaseServer } from '../database-modules'; +import { PolicyModule, Schema, Tag } from '../entity/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { DatabaseServer } from '../database-modules/index.js'; /** * Module components @@ -126,4 +126,4 @@ export class ModuleImportExport { return { module, tags, schemas }; } -} \ No newline at end of file +} diff --git a/common/src/import-export/policy.ts b/common/src/import-export/policy.ts index 447d7867ab..e830d19dbd 100644 --- a/common/src/import-export/policy.ts +++ b/common/src/import-export/policy.ts @@ -1,8 +1,8 @@ import JSZip from 'jszip'; -import { Artifact, Policy, PolicyCategory, PolicyTool, Schema, Tag, Token } from '../entity'; -import { DataBaseHelper } from '../helpers'; -import { DatabaseServer } from '../database-modules'; -import { ImportExportUtils } from './utils'; +import { Artifact, Policy, PolicyCategory, PolicyTool, Schema, Tag, Token } from '../entity/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { DatabaseServer } from '../database-modules/index.js'; +import { ImportExportUtils } from './utils.js'; import { PolicyCategoryExport } from '@guardian/interfaces'; interface IArtifact { @@ -105,6 +105,30 @@ export class PolicyImportExport { return { policy, tokens, schemas, tools, artifacts, tags }; } + /** + * Load policy components (deep find) + * @param policy policy + * + * @returns components + */ + public static async loadAllSchemas(policy: Policy) { + const components = await PolicyImportExport.loadPolicyComponents(policy); + const toolsMap = new Set(); + for (const tool of components.tools) { + toolsMap.add(tool.messageId); + if (Array.isArray(tool.tools)) { + for (const subTool of tool.tools) { + toolsMap.add(subTool.messageId); + } + } + } + const tools = await new DataBaseHelper(PolicyTool).find({ messageId: { $in: Array.from(toolsMap) } }); + const toolsTopicMap = tools.map((t) => t.topicId); + const toolSchemas = await DatabaseServer.getSchemas({ topicId: { $in: toolsTopicMap } }); + const schemas = components.schemas; + return { schemas, tools, toolSchemas }; + } + /** * Generate Zip File * @param policy policy to pack @@ -207,32 +231,28 @@ export class PolicyImportExport { throw new Error('Zip file is not a policy'); } const policyString = await content.files[PolicyImportExport.policyFileName].async('string'); - const tokensStringArray = await Promise.all(Object.entries(content.files) - .filter(file => !file[1].dir) - .filter(file => /^tokens\/.+/.test(file[0])) - .map(file => file[1].async('string'))); - - const schemasStringArray = await Promise.all(Object.entries(content.files) - .filter(file => !file[1].dir) - .filter(file => /^schem[a,e]s\/.+/.test(file[0])) - .map(file => file[1].async('string'))); - - const toolsStringArray = await Promise.all(Object.entries(content.files) - .filter(file => !file[1].dir) - .filter(file => /^tools\/.+/.test(file[0])) - .map(file => file[1].async('string'))); - - const metaDataFile = (Object.entries(content.files) - .find(file => file[0] === 'artifacts/metadata.json')); + const policy = JSON.parse(policyString); + + const fileEntries = Object.entries(content.files).filter(file => !file[1].dir); + const [tokensStringArray, schemasStringArray, toolsStringArray, tagsStringArray] = await Promise.all([ + Promise.all(fileEntries.filter(file => /^tokens\/.+/.test(file[0])).map(file => file[1].async('string'))), + Promise.all(fileEntries.filter(file => /^schem[a,e]s\/.+/.test(file[0])).map(file => file[1].async('string'))), + Promise.all(fileEntries.filter(file => /^tools\/.+/.test(file[0])).map(file => file[1].async('string'))), + Promise.all(fileEntries.filter(file => /^tags\/.+/.test(file[0])).map(file => file[1].async('string'))) + ]); + + const tokens = tokensStringArray.map(item => JSON.parse(item)); + const schemas = schemasStringArray.map(item => JSON.parse(item)); + const tools = toolsStringArray.map(item => JSON.parse(item)); + const tags = tagsStringArray.map(item => JSON.parse(item)); + + const metaDataFile = (Object.entries(content.files).find(file => file[0] === 'artifacts/metadata.json')); const metaDataString = metaDataFile && await metaDataFile[1].async('string') || '[]'; const metaDataBody: any[] = JSON.parse(metaDataString); let artifacts: any; if (includeArtifactsData) { - const data = Object.entries(content.files) - .filter(file => !file[1].dir) - .filter(file => /^artifacts\/.+/.test(file[0]) && file[0] !== 'artifacts/metadata.json') - .map(async file => { + const data = fileEntries.filter(file => /^artifacts\/.+/.test(file[0]) && file[0] !== 'artifacts/metadata.json').map(async file => { const uuid = file[0].split('/')[1]; const artifactMetaData = metaDataBody.find(item => item.uuid === uuid); return { @@ -254,31 +274,13 @@ export class PolicyImportExport { }); } - const tagsStringArray = await Promise.all(Object.entries(content.files) - .filter(file => !file[1].dir) - .filter(file => /^tags\/.+/.test(file[0])) - .map(file => file[1].async('string'))); - - const policy = JSON.parse(policyString); - const tokens = tokensStringArray.map(item => JSON.parse(item)); - const schemas = schemasStringArray.map(item => JSON.parse(item)); - const tools = toolsStringArray.map(item => JSON.parse(item)); - const tags = tagsStringArray.map(item => JSON.parse(item)); - if (policy.categoriesExport?.length) { const allCategories = await DatabaseServer.getPolicyCategories(); policy.categories = PolicyImportExport.parsePolicyCategories(policy, allCategories); policy.categoriesExport = []; } - return { - policy, - tokens, - schemas, - artifacts, - tags, - tools - }; + return { policy, tokens, schemas, artifacts, tags, tools }; } /** @@ -328,4 +330,4 @@ export class PolicyImportExport { return policyCategoryIds; } -} \ No newline at end of file +} diff --git a/common/src/import-export/record.ts b/common/src/import-export/record.ts index 6954dc8d91..4a5749308d 100644 --- a/common/src/import-export/record.ts +++ b/common/src/import-export/record.ts @@ -1,6 +1,6 @@ import JSZip from 'jszip'; -import { Record } from '../entity'; -import { DatabaseServer } from '../database-modules'; +import { Record } from '../entity/index.js'; +import { DatabaseServer } from '../database-modules/index.js'; /** * Record result @@ -342,4 +342,4 @@ export class RecordImportExport { time: now }; } -} \ No newline at end of file +} diff --git a/common/src/import-export/schema.ts b/common/src/import-export/schema.ts index 3fb682846b..20e72d121f 100644 --- a/common/src/import-export/schema.ts +++ b/common/src/import-export/schema.ts @@ -1,5 +1,5 @@ import JSZip from 'jszip'; -import { Tag } from '../entity'; +import { Tag } from '../entity/index.js'; import { ISchema } from '@guardian/interfaces'; /** @@ -57,4 +57,4 @@ export class SchemaImportExport { return { schemas, tags }; } -} \ No newline at end of file +} diff --git a/common/src/import-export/theme.ts b/common/src/import-export/theme.ts index e26af3321d..5ab4b52ff9 100644 --- a/common/src/import-export/theme.ts +++ b/common/src/import-export/theme.ts @@ -1,5 +1,5 @@ import JSZip from 'jszip'; -import { Theme } from '../entity'; +import { Theme } from '../entity/index.js'; /** * Theme components @@ -75,4 +75,4 @@ export class ThemeImportExport { const theme = JSON.parse(themeString); return { theme }; } -} \ No newline at end of file +} diff --git a/common/src/import-export/tool.ts b/common/src/import-export/tool.ts index ec62502117..54a827bf0d 100644 --- a/common/src/import-export/tool.ts +++ b/common/src/import-export/tool.ts @@ -1,8 +1,8 @@ import JSZip from 'jszip'; -import { PolicyTool, Schema, Tag } from '../entity'; -import { DataBaseHelper } from '../helpers'; -import { DatabaseServer } from '../database-modules'; -import { ImportExportUtils } from './utils'; +import { PolicyTool, Schema, Tag } from '../entity/index.js'; +import { DataBaseHelper } from '../helpers/index.js'; +import { DatabaseServer } from '../database-modules/index.js'; +import { ImportExportUtils } from './utils.js'; /** * Tool components @@ -144,4 +144,4 @@ export class ToolImportExport { const tools = toolsStringArray.map(item => JSON.parse(item)); return { tool, tags, schemas, tools }; } -} \ No newline at end of file +} diff --git a/common/src/import-export/utils.ts b/common/src/import-export/utils.ts index 43abe6f807..86252e681c 100644 --- a/common/src/import-export/utils.ts +++ b/common/src/import-export/utils.ts @@ -1,5 +1,5 @@ import { BlockType } from '@guardian/interfaces'; -import { SchemaFields, TokenFields } from '../helpers'; +import { SchemaFields, TokenFields } from '../helpers/index.js'; interface IBlockConfig { blockType: string; @@ -132,4 +132,4 @@ export class ImportExportUtils { const map = finder(obj, new Set()); return Array.from(map); } -} \ No newline at end of file +} diff --git a/common/src/index.ts b/common/src/index.ts index 40630b9c6f..9ad2044e96 100644 --- a/common/src/index.ts +++ b/common/src/index.ts @@ -1,15 +1,17 @@ import 'reflect-metadata'; -import * as ent from './entity'; -export * from './models'; -export * from './decorators/singleton'; -export * from './helpers'; -export * from './mq'; -export * from './interfaces'; -export * from './entity'; -export * from './document-loader'; -export * from './hedera-modules'; -export * from './database-modules'; -export * from './secret-manager'; -export * from './import-export'; -export * from './xlsx'; + +import * as ent from './entity/index.js'; +export * from './models/index.js'; +export * from './decorators/singleton.js'; +export * from './helpers/index.js'; +export * from './mq/index.js'; +export * from './interfaces/index.js'; +export * from './entity/index.js'; +export * from './document-loader/index.js'; +export * from './hedera-modules/index.js'; +export * from './database-modules/index.js'; +export * from './secret-manager/index.js'; +export * from './import-export/index.js'; +export * from './xlsx/index.js'; + export const entities = Object.values(ent); diff --git a/common/src/interfaces/auth.interface.ts b/common/src/interfaces/auth.interface.ts index 25f19607f9..ebaf732be4 100644 --- a/common/src/interfaces/auth.interface.ts +++ b/common/src/interfaces/auth.interface.ts @@ -34,6 +34,10 @@ export interface IAuthUser { * Wallet token */ walletToken?: string; + /** + * Use fireblocks signing + */ + useFireblocksSigning: boolean; } /** diff --git a/common/src/interfaces/index.ts b/common/src/interfaces/index.ts index 32d8f4d4b1..077cf93d73 100644 --- a/common/src/interfaces/index.ts +++ b/common/src/interfaces/index.ts @@ -1,2 +1,2 @@ -export * from './auth.interface' -export * from './providers/meeco' +export * from './auth.interface.js' +export * from './providers/meeco.js' diff --git a/common/src/models/index.ts b/common/src/models/index.ts index eb6a68b38f..457733f1b4 100644 --- a/common/src/models/index.ts +++ b/common/src/models/index.ts @@ -1,2 +1,2 @@ -export * from './base-entity'; -export * from './message-response'; \ No newline at end of file +export * from './base-entity.js'; +export * from './message-response.js'; diff --git a/common/src/mq/external-channel.ts b/common/src/mq/external-channel.ts index f994083d15..0a9d54f6f2 100644 --- a/common/src/mq/external-channel.ts +++ b/common/src/mq/external-channel.ts @@ -1,5 +1,5 @@ -import { MessageBrokerChannel } from './message-broker-channel'; -import { Singleton } from '../decorators/singleton'; +import { MessageBrokerChannel } from './message-broker-channel.js'; +import { Singleton } from '../decorators/singleton.js'; /** * External event channel diff --git a/common/src/mq/index.ts b/common/src/mq/index.ts index 75afc0fa21..b6af9a53aa 100644 --- a/common/src/mq/index.ts +++ b/common/src/mq/index.ts @@ -1,6 +1,6 @@ -export * from './message-broker-channel' -export * from './external-channel' -export * from './nats-service' -export * from './large-payload-container' -export * from './zip-codec' -export * from './serialization' +export * from './message-broker-channel.js' +export * from './external-channel.js' +export * from './nats-service.js' +export * from './large-payload-container.js' +export * from './zip-codec.js' +export * from './serialization.js' diff --git a/common/src/mq/large-payload-container.ts b/common/src/mq/large-payload-container.ts index aab2713e04..78f1ac0030 100644 --- a/common/src/mq/large-payload-container.ts +++ b/common/src/mq/large-payload-container.ts @@ -1,7 +1,7 @@ import express from 'express' import { hostname } from 'os'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { Singleton } from '../decorators/singleton'; +import { Singleton } from '../decorators/singleton.js'; /** * Large objects container diff --git a/common/src/mq/message-broker-channel.ts b/common/src/mq/message-broker-channel.ts index 6e0ddfcb03..215e51ec81 100644 --- a/common/src/mq/message-broker-channel.ts +++ b/common/src/mq/message-broker-channel.ts @@ -1,8 +1,8 @@ import assert from 'assert'; import { Subscription, NatsConnection, StringCodec, connect, headers } from 'nats'; -import { IMessageResponse, MessageError } from '../models'; +import { IMessageResponse, MessageError } from '../models/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { ZipCodec } from './zip-codec'; +import { ZipCodec } from './zip-codec.js'; const MQ_TIMEOUT = 300000; /** diff --git a/common/src/mq/nats-service.ts b/common/src/mq/nats-service.ts index 3277fe5564..4ec592c242 100644 --- a/common/src/mq/nats-service.ts +++ b/common/src/mq/nats-service.ts @@ -1,6 +1,6 @@ import { NatsConnection, headers, Subscription } from 'nats'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { ZipCodec } from './zip-codec'; +import { ZipCodec } from './zip-codec.js'; /** * Nats service @@ -44,7 +44,7 @@ export abstract class NatsService { throw new Error('Connection must set first'); } this.connection.subscribe(this.replySubject, { - callback: async (error, msg) => {; + callback: async (error, msg) => { if (!error) { const messageId = msg.headers.get('messageId'); const fn = this.responseCallbacksMap.get(messageId); diff --git a/common/src/mq/zip-codec.ts b/common/src/mq/zip-codec.ts index 57fd80fa7e..c35699de7a 100644 --- a/common/src/mq/zip-codec.ts +++ b/common/src/mq/zip-codec.ts @@ -1,7 +1,7 @@ import { ErrorCode, JSONCodec, NatsError } from 'nats'; // import util from 'util'; // import { gzip, unzip } from 'zlib'; -import { LargePayloadContainer } from './large-payload-container'; +import { LargePayloadContainer } from './large-payload-container.js'; import axios from 'axios'; /** diff --git a/common/src/secret-manager/aws-secret-manager.test.ts b/common/src/secret-manager/aws-secret-manager.test.ts index 9a52aa14be..5e87b495d6 100644 --- a/common/src/secret-manager/aws-secret-manager.test.ts +++ b/common/src/secret-manager/aws-secret-manager.test.ts @@ -1,6 +1,6 @@ -import { AwsSecretManager } from './aws/aws-secret-manager'; -import { SecretManager } from './secret-manager'; -import { SecretManagerType } from './secret-manager-config'; +import { AwsSecretManager } from './aws/aws-secret-manager.js'; +import { SecretManager } from './secret-manager.js'; +import { SecretManagerType } from './secret-manager-config.js'; process.env.AWS_REGION = 'eu-central-1'; diff --git a/common/src/secret-manager/aws/aws-secret-manager-configs.ts b/common/src/secret-manager/aws/aws-secret-manager-configs.ts index d4cff372c7..2281a8d717 100644 --- a/common/src/secret-manager/aws/aws-secret-manager-configs.ts +++ b/common/src/secret-manager/aws/aws-secret-manager-configs.ts @@ -1,4 +1,4 @@ -import { SecretManagerConfigsBase } from '../secret-manager-config-base'; +import { SecretManagerConfigsBase } from '../secret-manager-config-base.js'; /** * Interface for AWS Secret Manager configs @@ -25,4 +25,4 @@ export class AwsSecretManagerConfigs implements SecretManagerConfigsBase { region: process.env.AWS_REGION, } as IAwsSecretManagerConfigs; } -} \ No newline at end of file +} diff --git a/common/src/secret-manager/aws/aws-secret-manager.ts b/common/src/secret-manager/aws/aws-secret-manager.ts index e37d1a819c..1cf742a77b 100644 --- a/common/src/secret-manager/aws/aws-secret-manager.ts +++ b/common/src/secret-manager/aws/aws-secret-manager.ts @@ -1,6 +1,6 @@ import { SecretsManagerClient, GetSecretValueCommand, CreateSecretCommand, UpdateSecretCommand } from '@aws-sdk/client-secrets-manager'; -import { SecretManagerBase } from '../secret-manager-base'; -import { IAwsSecretManagerConfigs } from './aws-secret-manager-configs'; +import { SecretManagerBase } from '../secret-manager-base.js'; +import { IAwsSecretManagerConfigs } from './aws-secret-manager-configs.js'; /** * This class is responsible for managing secrets in AWS Secret Manager diff --git a/common/src/secret-manager/azure/azure-secret-manager-configs.ts b/common/src/secret-manager/azure/azure-secret-manager-configs.ts index cc5652274b..d5c547302d 100644 --- a/common/src/secret-manager/azure/azure-secret-manager-configs.ts +++ b/common/src/secret-manager/azure/azure-secret-manager-configs.ts @@ -1,4 +1,4 @@ -import { SecretManagerConfigsBase } from '../secret-manager-config-base'; +import { SecretManagerConfigsBase } from '../secret-manager-config-base.js'; /** * Interface for Azure Secret Manager configs @@ -25,4 +25,4 @@ export class AzureSecretManagerConfigs implements SecretManagerConfigsBase { vaultName: process.env.AZURE_VAULT_NAME, } as IAzureSecretManagerConfigs; } -} \ No newline at end of file +} diff --git a/common/src/secret-manager/azure/azure-secret-manager.ts b/common/src/secret-manager/azure/azure-secret-manager.ts index d045f2f156..7cf69935ba 100644 --- a/common/src/secret-manager/azure/azure-secret-manager.ts +++ b/common/src/secret-manager/azure/azure-secret-manager.ts @@ -1,7 +1,7 @@ import { DefaultAzureCredential } from '@azure/identity'; import { SecretClient } from '@azure/keyvault-secrets'; -import { SecretManagerBase } from '../secret-manager-base'; -import { IAzureSecretManagerConfigs } from './azure-secret-manager-configs'; +import { SecretManagerBase } from '../secret-manager-base.js'; +import { IAzureSecretManagerConfigs } from './azure-secret-manager-configs.js'; /** * This class is responsible for managing secrets in Azure Secret Manager diff --git a/common/src/secret-manager/gcp/gcp-secret-manager-configs.ts b/common/src/secret-manager/gcp/gcp-secret-manager-configs.ts index 2606e4149d..35ecbb3686 100644 --- a/common/src/secret-manager/gcp/gcp-secret-manager-configs.ts +++ b/common/src/secret-manager/gcp/gcp-secret-manager-configs.ts @@ -1,4 +1,4 @@ -import { SecretManagerConfigsBase } from '../secret-manager-config-base'; +import { SecretManagerConfigsBase } from '../secret-manager-config-base.js'; /** * Interface for GCP Secret Manager configs @@ -25,4 +25,4 @@ export class GcpSecretManagerConfigs implements SecretManagerConfigsBase { projectId: process.env.GCP_PROJECT_ID, } as IGcpSecretManagerConfigs; } -} \ No newline at end of file +} diff --git a/common/src/secret-manager/gcp/gcp-secret-manager.ts b/common/src/secret-manager/gcp/gcp-secret-manager.ts index e3e6db7f26..a293b96859 100644 --- a/common/src/secret-manager/gcp/gcp-secret-manager.ts +++ b/common/src/secret-manager/gcp/gcp-secret-manager.ts @@ -1,6 +1,6 @@ import { SecretManagerServiceClient } from '@google-cloud/secret-manager'; -import { SecretManagerBase } from '../secret-manager-base'; -import { IGcpSecretManagerConfigs } from './gcp-secret-manager-configs'; +import { SecretManagerBase } from '../secret-manager-base.js'; +import { IGcpSecretManagerConfigs } from './gcp-secret-manager-configs.js'; /** * This class is responsible for managing secrets in AWS Secret Manager @@ -145,4 +145,4 @@ export class GcpSecretManager implements SecretManagerBase { throw ex; } } -} \ No newline at end of file +} diff --git a/common/src/secret-manager/hashicorp/hcp-vault-secret-manager-configs.ts b/common/src/secret-manager/hashicorp/hcp-vault-secret-manager-configs.ts index c8db180500..4a8d6501be 100644 --- a/common/src/secret-manager/hashicorp/hcp-vault-secret-manager-configs.ts +++ b/common/src/secret-manager/hashicorp/hcp-vault-secret-manager-configs.ts @@ -1,4 +1,4 @@ -import { SecretManagerConfigsBase } from '../secret-manager-config-base'; +import { SecretManagerConfigsBase } from '../secret-manager-config-base.js'; import * as fs from 'fs' import * as path from 'path'; diff --git a/common/src/secret-manager/hashicorp/hcp-vault-secret-manager.ts b/common/src/secret-manager/hashicorp/hcp-vault-secret-manager.ts index 4d016e1198..7a936a58ad 100644 --- a/common/src/secret-manager/hashicorp/hcp-vault-secret-manager.ts +++ b/common/src/secret-manager/hashicorp/hcp-vault-secret-manager.ts @@ -1,6 +1,6 @@ import NodeVault from 'node-vault' -import { SecretManagerBase } from '../secret-manager-base'; -import { ApproleCrential, IHcpVaultSecretManagerConfigs } from './hcp-vault-secret-manager-configs'; +import { SecretManagerBase } from '../secret-manager-base.js'; +import { ApproleCrential, IHcpVaultSecretManagerConfigs } from './hcp-vault-secret-manager-configs.js'; /** * This class is responsible for managing secrets in Hashicorp Vault diff --git a/common/src/secret-manager/index.ts b/common/src/secret-manager/index.ts index 3dde6c08f5..8f8eea5ec0 100644 --- a/common/src/secret-manager/index.ts +++ b/common/src/secret-manager/index.ts @@ -1,5 +1,5 @@ -export * from './secret-manager-base'; -export * from './secret-manager-config-base'; -export * from './secret-manager'; -export * from './secret-manager-config'; -export * from './old-style/old-secret-manager' +export * from './secret-manager-base.js'; +export * from './secret-manager-config-base.js'; +export * from './secret-manager.js'; +export * from './secret-manager-config.js'; +export * from './old-style/old-secret-manager.js' diff --git a/common/src/secret-manager/migrations/migrations.ts b/common/src/secret-manager/migrations/migrations.ts index f50e4cdd55..2890502a87 100644 --- a/common/src/secret-manager/migrations/migrations.ts +++ b/common/src/secret-manager/migrations/migrations.ts @@ -1,12 +1,12 @@ import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; -import { DataBaseHelper, DataBaseNamingStrategy } from '../../helpers'; -import { WalletAccount } from './vault-account'; +import { DataBaseHelper, DataBaseNamingStrategy } from '../../helpers/index.js'; +import { WalletAccount } from './vault-account.js'; import * as dotenv from 'dotenv'; import * as path from 'path'; -import { SecretManager } from '../secret-manager'; -import { Wallet } from '../../wallet'; -import { SecretManagerType } from '../secret-manager-config'; +import { SecretManager } from '../secret-manager.js'; +import { Wallet } from '../../wallet/index.js'; +import { SecretManagerType } from '../secret-manager-config.js'; import { exit } from 'process'; const globalEnvPath = path.join(process.cwd(), '../.env') @@ -15,8 +15,8 @@ const guardianEnvPath = path.join(process.cwd(), '../guardian-service/.env') const workerEnvPath = path.join(process.cwd(), '../worker-service/.env') // const authCertsPath = path.join('../auth-service/tls/vault/client') -const guardianCertsPath = path.join('../guardian-service/tls/vault/client') -const workerCertsPath = path.join('../worker-service/tls/vault/client') +const guardianCertsPath = path.join('../guardian-service/tls/vault/client.js') +const workerCertsPath = path.join('../worker-service/tls/vault/client.js') /** * Set common configs for Vault @@ -119,8 +119,8 @@ async function writeWallet(token, type, key, value) { * migrate */ async function migrate() { - const db = await MikroORM.init({ - type: 'mongo', + const db = await MikroORM.init({ + driver: MongoDriver, namingStrategy: DataBaseNamingStrategy, dbName: 'auth_db', clientUrl:`mongodb://localhost:27017`, @@ -130,7 +130,7 @@ async function migrate() { driverOptions: { useUnifiedTopology: true }, - ensureIndexes: true + ensureIndexes: true, }) DataBaseHelper.orm = db; diff --git a/common/src/secret-manager/migrations/vault-account.ts b/common/src/secret-manager/migrations/vault-account.ts index f45529a3c5..7490288587 100644 --- a/common/src/secret-manager/migrations/vault-account.ts +++ b/common/src/secret-manager/migrations/vault-account.ts @@ -1,6 +1,6 @@ import { Entity, Property } from '@mikro-orm/core'; import { IWalletAccount } from '@guardian/interfaces'; -import { BaseEntity } from '../../models'; +import { BaseEntity } from '../../models/index.js'; /** * Wallet collection diff --git a/common/src/secret-manager/old-style/old-secret-manager.ts b/common/src/secret-manager/old-style/old-secret-manager.ts index 5af246a1d4..ccecc4f270 100644 --- a/common/src/secret-manager/old-style/old-secret-manager.ts +++ b/common/src/secret-manager/old-style/old-secret-manager.ts @@ -1,8 +1,8 @@ -import { SecretManagerBase } from '../secret-manager-base'; -import { NatsService } from '../../mq'; +import { SecretManagerBase } from '../secret-manager-base.js'; +import { NatsService } from '../../mq/index.js'; import { GenerateUUIDv4, IGetKeyResponse, WalletEvents } from '@guardian/interfaces'; -import { Singleton } from '../../decorators/singleton'; -import { timeout } from '../../hedera-modules'; +import { Singleton } from '../../decorators/singleton.js'; +import { timeout } from '../../hedera-modules/index.js'; /** * Old secret manager implementation diff --git a/common/src/secret-manager/secret-manager-config-base.ts b/common/src/secret-manager/secret-manager-config-base.ts index f07954773a..319a83d3e5 100644 --- a/common/src/secret-manager/secret-manager-config-base.ts +++ b/common/src/secret-manager/secret-manager-config-base.ts @@ -1,7 +1,7 @@ -import { IAwsSecretManagerConfigs } from './aws/aws-secret-manager-configs' -import { IAzureSecretManagerConfigs } from './azure/azure-secret-manager-configs'; -import { IGcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs'; -import { IHcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs' +import { IAwsSecretManagerConfigs } from './aws/aws-secret-manager-configs.js' +import { IAzureSecretManagerConfigs } from './azure/azure-secret-manager-configs.js'; +import { IGcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs.js'; +import { IHcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs.js' /** * Interface for secret manager configs @@ -20,4 +20,4 @@ export abstract class SecretManagerConfigsBase { static getConfigs(): ISecretManagerConfigs { return } -} \ No newline at end of file +} diff --git a/common/src/secret-manager/secret-manager-config.ts b/common/src/secret-manager/secret-manager-config.ts index 20d2025de6..949243cfd0 100644 --- a/common/src/secret-manager/secret-manager-config.ts +++ b/common/src/secret-manager/secret-manager-config.ts @@ -1,8 +1,8 @@ -import { AwsSecretManagerConfigs } from './aws/aws-secret-manager-configs' -import { AzureSecretManagerConfigs } from './azure/azure-secret-manager-configs' -import { GcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs' -import { HcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs' -import { ISecretManagerConfigs } from './secret-manager-config-base' +import { AwsSecretManagerConfigs } from './aws/aws-secret-manager-configs.js' +import { AzureSecretManagerConfigs } from './azure/azure-secret-manager-configs.js' +import { GcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs.js' +import { HcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs.js' +import { ISecretManagerConfigs } from './secret-manager-config-base.js' /** * Enum for secret manager types diff --git a/common/src/secret-manager/secret-manager.test.ts b/common/src/secret-manager/secret-manager.test.ts index 62480c2703..c7566a04f5 100644 --- a/common/src/secret-manager/secret-manager.test.ts +++ b/common/src/secret-manager/secret-manager.test.ts @@ -1,17 +1,17 @@ import * as dotenv from 'dotenv'; import * as path from 'path'; -import { SecretManager } from './secret-manager'; -import { SecretManagerBase } from './secret-manager-base'; +import { SecretManager } from './secret-manager.js'; +import { SecretManagerBase } from './secret-manager-base.js'; const authEnvPath = path.join(process.cwd(), '../auth-service/.env') const guardianEnvPath = path.join(process.cwd(), '../guardian-service/.env') const policyEnvPath = path.join(process.cwd(), '../policy-service/.env') const workerEnvPath = path.join(process.cwd(), '../worker-service/.env') -const authCertsPath = path.join('../auth-service/tls/vault/client') -const guardianCertsPath = path.join('../guardian-service/tls/vault/client') -const policyCertsPath = path.join('../policy-service/tls/vault/client') -const workerCertsPath = path.join('../worker-service/tls/vault/client') +const authCertsPath = path.join('../auth-service/tls/vault/client/index.js') +const guardianCertsPath = path.join('../guardian-service/tls/vault/client/index.js') +const policyCertsPath = path.join('../policy-service/tls/vault/client/index.js') +const workerCertsPath = path.join('../worker-service/tls/vault/client/index.js') let secretManager: SecretManagerBase; diff --git a/common/src/secret-manager/secret-manager.ts b/common/src/secret-manager/secret-manager.ts index c3d5e6488e..866f4f5c51 100644 --- a/common/src/secret-manager/secret-manager.ts +++ b/common/src/secret-manager/secret-manager.ts @@ -1,14 +1,14 @@ -import { HcpVaultSecretManager } from './hashicorp/hcp-vault-secret-manager'; -import { SecretManagerConfigs, SecretManagerType } from './secret-manager-config'; -import { SecretManagerBase } from './secret-manager-base'; -import { AwsSecretManager } from './aws/aws-secret-manager'; -import { IHcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs'; -import { IAwsSecretManagerConfigs } from './aws/aws-secret-manager-configs'; -import { OldSecretManager } from './old-style/old-secret-manager'; -import { AzureSecretManager } from './azure/azure-secret-manager'; -import { IAzureSecretManagerConfigs } from './azure/azure-secret-manager-configs'; -import { IGcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs'; -import { GcpSecretManager } from './gcp/gcp-secret-manager'; +import { HcpVaultSecretManager } from './hashicorp/hcp-vault-secret-manager.js'; +import { SecretManagerConfigs, SecretManagerType } from './secret-manager-config.js'; +import { SecretManagerBase } from './secret-manager-base.js'; +import { AwsSecretManager } from './aws/aws-secret-manager.js'; +import { IHcpVaultSecretManagerConfigs } from './hashicorp/hcp-vault-secret-manager-configs.js'; +import { IAwsSecretManagerConfigs } from './aws/aws-secret-manager-configs.js'; +import { OldSecretManager } from './old-style/old-secret-manager.js'; +import { AzureSecretManager } from './azure/azure-secret-manager.js'; +import { IAzureSecretManagerConfigs } from './azure/azure-secret-manager-configs.js'; +import { IGcpSecretManagerConfigs } from './gcp/gcp-secret-manager-configs.js'; +import { GcpSecretManager } from './gcp/gcp-secret-manager.js'; /** * Class to get secret manager diff --git a/common/src/wallet/index.ts b/common/src/wallet/index.ts index ba36523bd5..691ec230ee 100644 --- a/common/src/wallet/index.ts +++ b/common/src/wallet/index.ts @@ -1 +1 @@ -export * from './wallet' \ No newline at end of file +export * from './wallet.js' diff --git a/common/src/wallet/wallet-aws.test.ts b/common/src/wallet/wallet-aws.test.ts index 3b3550aefd..3024caea45 100644 --- a/common/src/wallet/wallet-aws.test.ts +++ b/common/src/wallet/wallet-aws.test.ts @@ -1,5 +1,5 @@ -import { Wallet } from './wallet'; -import { SecretManagerType } from '../secret-manager'; +import { Wallet } from './wallet.js'; +import { SecretManagerType } from '../secret-manager/index.js'; process.env.AWS_REGION = 'eu-central-1' @@ -23,4 +23,4 @@ async function test_wallet() { await test_wallet_by_guardian() } -test_wallet() \ No newline at end of file +test_wallet() diff --git a/common/src/wallet/wallet.test.ts b/common/src/wallet/wallet.test.ts index 525cfcc7a4..f95ccd95de 100644 --- a/common/src/wallet/wallet.test.ts +++ b/common/src/wallet/wallet.test.ts @@ -1,10 +1,10 @@ -import { Wallet } from './wallet'; +import { Wallet } from './wallet.js'; import * as dotenv from 'dotenv'; import * as path from 'path'; const guardianEnvPath = path.join(process.cwd(), '../guardian-service/.env') -const guardianCertsPath = path.join('../guardian-service/tls/vault/client') +const guardianCertsPath = path.join('../guardian-service/tls/vault/client/index.js') /** * Set Vault TLS options @@ -39,4 +39,4 @@ async function test_wallet() { await test_wallet_by_guardian() } -test_wallet() \ No newline at end of file +test_wallet() diff --git a/common/src/wallet/wallet.ts b/common/src/wallet/wallet.ts index 9d7d945618..96f4890750 100644 --- a/common/src/wallet/wallet.ts +++ b/common/src/wallet/wallet.ts @@ -1,8 +1,8 @@ -import { SecretManager, SecretManagerBase, SecretManagerType } from '../secret-manager'; +import { SecretManager, SecretManagerBase, SecretManagerType } from '../secret-manager/index.js'; import crypto from 'crypto'; import * as bs58 from 'bs58'; -import { AzureSecretManager } from '../secret-manager/azure/azure-secret-manager'; -import { GcpSecretManager } from '../secret-manager/gcp/gcp-secret-manager'; +import { AzureSecretManager } from '../secret-manager/azure/azure-secret-manager.js'; +import { GcpSecretManager } from '../secret-manager/gcp/gcp-secret-manager.js'; /** * Class to manage wallet by Secret Manager Resources diff --git a/common/src/xlsx/generate-blocks.ts b/common/src/xlsx/generate-blocks.ts index e89ae42f68..9b4f37f1f0 100644 --- a/common/src/xlsx/generate-blocks.ts +++ b/common/src/xlsx/generate-blocks.ts @@ -1,10 +1,10 @@ import { BlockType, GenerateUUIDv4, SchemaEntity } from '@guardian/interfaces'; -import { XlsxResult } from './models/xlsx-result'; -import { PolicyTool } from '../entity'; -import { IBlock } from './interfaces/block-interface'; -import { XlsxSchema } from './models/xlsx-schema'; -import { Expression } from './models/expression'; -import { TagIndexer } from './models/tag-indexer'; +import { XlsxResult } from './models/xlsx-result.js'; +import { PolicyTool } from '../entity/index.js'; +import { IBlock } from './interfaces/block-interface.js'; +import { XlsxSchema } from './models/xlsx-schema.js'; +import { Expression } from './models/expression.js'; +import { TagIndexer } from './models/tag-indexer.js'; import * as formulajs from '@formulajs/formulajs' /** @@ -375,4 +375,4 @@ export class GenerateBlocks { return body; } -} \ No newline at end of file +} diff --git a/common/src/xlsx/index.ts b/common/src/xlsx/index.ts index ddc28fb9c6..78715ab821 100644 --- a/common/src/xlsx/index.ts +++ b/common/src/xlsx/index.ts @@ -1,18 +1,18 @@ -export * from './interfaces/cache.interface'; -export * from './interfaces/error.interface'; -export * from './interfaces/link.interface'; -export * from './interfaces/row-field.interface'; -export * from './interfaces/tool.interface'; -export * from './interfaces/block-interface'; -export * from './models/dictionary'; -export * from './models/schema-condition'; -export * from './models/sheet-name'; -export * from './models/table-header'; -export * from './models/table'; -export * from './models/value-converters'; -export * from './models/workbook'; -export * from './models/xlsx-result'; -export * from './generate-blocks'; -export * from './json-to-xlsx'; -export * from './xlsx-to-json'; \ No newline at end of file +export * from './interfaces/cache.interface.js'; +export * from './interfaces/error.interface.js'; +export * from './interfaces/link.interface.js'; +export * from './interfaces/row-field.interface.js'; +export * from './interfaces/tool.interface.js'; +export * from './interfaces/block-interface.js'; +export * from './models/dictionary.js'; +export * from './models/schema-condition.js'; +export * from './models/sheet-name.js'; +export * from './models/table-header.js'; +export * from './models/table.js'; +export * from './models/value-converters.js'; +export * from './models/workbook.js'; +export * from './models/xlsx-result.js'; +export * from './generate-blocks.js'; +export * from './json-to-xlsx.js'; +export * from './xlsx-to-json.js'; diff --git a/common/src/xlsx/json-to-xlsx.ts b/common/src/xlsx/json-to-xlsx.ts index 711734128c..39fd289f54 100644 --- a/common/src/xlsx/json-to-xlsx.ts +++ b/common/src/xlsx/json-to-xlsx.ts @@ -1,13 +1,13 @@ -import { Dictionary, FieldTypes } from './models/dictionary'; -import { anyToXlsx, examplesToXlsx, booleanToXlsx, entityToXlsx, fontToXlsx, stringToXlsx, typeToXlsx, unitToXlsx, valueToFormula } from './models/value-converters'; -import { Hyperlink, Range, Workbook, Worksheet } from './models/workbook'; -import { Table } from './models/table'; +import { Dictionary, FieldTypes } from './models/dictionary.js'; +import { anyToXlsx, examplesToXlsx, booleanToXlsx, entityToXlsx, fontToXlsx, stringToXlsx, typeToXlsx, unitToXlsx, valueToFormula } from './models/value-converters.js'; +import { Hyperlink, Range, Workbook, Worksheet } from './models/workbook.js'; +import { Table } from './models/table.js'; import { ISchema, Schema, SchemaCondition, SchemaField } from '@guardian/interfaces'; -import { PolicyTool } from '../entity'; -import { IRowField } from './interfaces/row-field.interface'; -import { SheetName } from './models/sheet-name'; -import { XlsxEnum } from './models/xlsx-enum'; -import { EnumTable } from './models/enum-table'; +import { PolicyTool } from '../entity/index.js'; +import { IRowField } from './interfaces/row-field.interface.js'; +import { SheetName } from './models/sheet-name.js'; +import { XlsxEnum } from './models/xlsx-enum.js'; +import { EnumTable } from './models/enum-table.js'; export class JsonToXlsx { public static async generate( @@ -278,7 +278,7 @@ export class JsonToXlsx { .getCell(table.getCol(Dictionary.ANSWER), row) .setList2(_enum.getData()); } else { - throw new Error(`Enum (field.path) not found.`); + throw new Error(`Enum ('${worksheet.name}', ${field.name}, '${field.description}', ${field.path}) not found.`); } } if (type && !field.isRef) { @@ -429,4 +429,4 @@ export class JsonToXlsx { return row; } -} \ No newline at end of file +} diff --git a/common/src/xlsx/models/enum-table.ts b/common/src/xlsx/models/enum-table.ts index 7688183d2f..c49ac17e72 100644 --- a/common/src/xlsx/models/enum-table.ts +++ b/common/src/xlsx/models/enum-table.ts @@ -1,7 +1,7 @@ import ExcelJS from 'exceljs'; -import { Dictionary } from './dictionary'; -import { IPoint } from './workbook'; -import { TableHeader } from './table-header'; +import { Dictionary } from './dictionary.js'; +import { IPoint } from './workbook.js'; +import { TableHeader } from './table-header.js'; export class EnumTable { private readonly _headers: Map; @@ -168,4 +168,4 @@ export class EnumTable { public isHeader(value: string): boolean { return this._headers.has(value); } -} \ No newline at end of file +} diff --git a/common/src/xlsx/models/table.ts b/common/src/xlsx/models/table.ts index 8f9b6840ec..b4156bad7f 100644 --- a/common/src/xlsx/models/table.ts +++ b/common/src/xlsx/models/table.ts @@ -1,7 +1,7 @@ import ExcelJS, { Border } from 'exceljs'; -import { Dictionary } from './dictionary'; -import { IPoint } from './workbook'; -import { TableHeader } from './table-header'; +import { Dictionary } from './dictionary.js'; +import { IPoint } from './workbook.js'; +import { TableHeader } from './table-header.js'; const color = (rgb: string): any => { return { @@ -317,4 +317,4 @@ export class Table { public isFieldHeader(value: string): boolean { return this._fieldHeaders.has(value); } -} \ No newline at end of file +} diff --git a/common/src/xlsx/models/tag-indexer.ts b/common/src/xlsx/models/tag-indexer.ts index 4960b0c074..ced0559b21 100644 --- a/common/src/xlsx/models/tag-indexer.ts +++ b/common/src/xlsx/models/tag-indexer.ts @@ -1,6 +1,6 @@ import { BlockType } from '@guardian/interfaces'; -import { PolicyTool } from '../../entity'; -import { XlsxSchema } from './xlsx-schema'; +import { PolicyTool } from '../../entity/index.js'; +import { XlsxSchema } from './xlsx-schema.js'; export class TagIndexer { private index: number; diff --git a/common/src/xlsx/models/value-converters.ts b/common/src/xlsx/models/value-converters.ts index e882e42827..6124b12795 100644 --- a/common/src/xlsx/models/value-converters.ts +++ b/common/src/xlsx/models/value-converters.ts @@ -1,5 +1,5 @@ import { DocumentGenerator, SchemaEntity, SchemaField } from '@guardian/interfaces'; -import { FieldTypes, IFieldTypes } from './dictionary'; +import { FieldTypes, IFieldTypes } from './dictionary.js'; export function entityToXlsx(entity: SchemaEntity): string { if (entity === SchemaEntity.VC) { @@ -157,4 +157,4 @@ export function valueToFormula(value: any): any { return value.toString(); } return value; -} \ No newline at end of file +} diff --git a/common/src/xlsx/models/xlsx-enum.ts b/common/src/xlsx/models/xlsx-enum.ts index 8a9bbd7bf9..40876be800 100644 --- a/common/src/xlsx/models/xlsx-enum.ts +++ b/common/src/xlsx/models/xlsx-enum.ts @@ -1,5 +1,5 @@ import { GenerateUUIDv4, Schema, SchemaField } from '@guardian/interfaces'; -import { Range, Worksheet } from './workbook'; +import { Range, Worksheet } from './workbook.js'; export class XlsxEnum { public readonly id: string; @@ -87,4 +87,4 @@ export class XlsxEnum { const range = `'${this.sheetName}'!${start.address}:${end.address}`; return range; } -} \ No newline at end of file +} diff --git a/common/src/xlsx/models/xlsx-result.ts b/common/src/xlsx/models/xlsx-result.ts index 3a73eaa4b5..eb239906ff 100644 --- a/common/src/xlsx/models/xlsx-result.ts +++ b/common/src/xlsx/models/xlsx-result.ts @@ -1,12 +1,12 @@ -import { Hyperlink, Worksheet } from './workbook'; +import { Hyperlink, Worksheet } from './workbook.js'; import { ISchema, Schema, SchemaCondition, SchemaField } from '@guardian/interfaces'; -import { XlsxError } from '../interfaces/error.interface'; -import { Policy, PolicyTool } from '../../entity'; -import { ISchemaCache } from '../interfaces/cache.interface'; -import { ITool } from '../interfaces/tool.interface'; -import { ILink } from '../interfaces/link.interface'; -import { XlsxEnum } from './xlsx-enum'; -import { XlsxSchema, XlsxTool } from './xlsx-schema'; +import { XlsxError } from '../interfaces/error.interface.js'; +import { Policy, PolicyTool } from '../../entity/index.js'; +import { ISchemaCache } from '../interfaces/cache.interface.js'; +import { ITool } from '../interfaces/tool.interface.js'; +import { ILink } from '../interfaces/link.interface.js'; +import { XlsxEnum } from './xlsx-enum.js'; +import { XlsxSchema, XlsxTool } from './xlsx-schema.js'; export class XlsxResult { private _policy: Policy; diff --git a/common/src/xlsx/models/xlsx-schema.ts b/common/src/xlsx/models/xlsx-schema.ts index 9effecc18f..4acf1e35d8 100644 --- a/common/src/xlsx/models/xlsx-schema.ts +++ b/common/src/xlsx/models/xlsx-schema.ts @@ -1,6 +1,6 @@ import { Schema, SchemaCategory, SchemaCondition, SchemaEntity, SchemaField, SchemaHelper } from '@guardian/interfaces'; -import { Worksheet } from './workbook'; -import { XlsxExpressions } from './xlsx-expressions'; +import { Worksheet } from './workbook.js'; +import { XlsxExpressions } from './xlsx-expressions.js'; export class XlsxSchema { public readonly worksheet: Worksheet; diff --git a/common/src/xlsx/xlsx-to-json.ts b/common/src/xlsx/xlsx-to-json.ts index 526dc35d5f..adb1fd09b7 100644 --- a/common/src/xlsx/xlsx-to-json.ts +++ b/common/src/xlsx/xlsx-to-json.ts @@ -1,15 +1,15 @@ -import { Workbook, Worksheet } from './models/workbook'; -import { Dictionary, FieldTypes, IFieldTypes } from './models/dictionary'; -import { xlsxToArray, xlsxToBoolean, xlsxToEntity, xlsxToFont, xlsxToUnit } from './models/value-converters'; -import { Table } from './models/table'; +import { Workbook, Worksheet } from './models/workbook.js'; +import { Dictionary, FieldTypes, IFieldTypes } from './models/dictionary.js'; +import { xlsxToArray, xlsxToBoolean, xlsxToEntity, xlsxToFont, xlsxToUnit } from './models/value-converters.js'; +import { Table } from './models/table.js'; import * as mathjs from 'mathjs'; -import { XlsxSchemaConditions } from './models/schema-condition'; +import { XlsxSchemaConditions } from './models/schema-condition.js'; import { SchemaCategory, SchemaEntity, SchemaField } from '@guardian/interfaces'; -import { XlsxResult } from './models/xlsx-result'; -import { XlsxEnum } from './models/xlsx-enum'; -import { EnumTable } from './models/enum-table'; -import { XlsxSchema, XlsxTool } from './models/xlsx-schema'; -import { XlsxExpressions } from './models/xlsx-expressions'; +import { XlsxResult } from './models/xlsx-result.js'; +import { XlsxEnum } from './models/xlsx-enum.js'; +import { EnumTable } from './models/enum-table.js'; +import { XlsxSchema, XlsxTool } from './models/xlsx-schema.js'; +import { XlsxExpressions } from './models/xlsx-expressions.js'; export class XlsxToJson { public static async parse(buffer: Buffer): Promise { diff --git a/common/tests/unit-tests/dump/did_document.js b/common/tests/unit-tests/dump/did_document.mjs similarity index 99% rename from common/tests/unit-tests/dump/did_document.js rename to common/tests/unit-tests/dump/did_document.mjs index 85c9dba935..fe00c85832 100644 --- a/common/tests/unit-tests/dump/did_document.js +++ b/common/tests/unit-tests/dump/did_document.mjs @@ -1,6 +1,6 @@ 'use strict'; -module.exports.did_document = [{ +export const did_document = [{ '_id': { '$oid': '6169b4428c3fb50013b24aa5' }, @@ -155,4 +155,4 @@ module.exports.did_document = [{ 'updateDate': { '$date': '2021-10-18T20:38:11.898Z' } -}]; \ No newline at end of file +}]; diff --git a/common/tests/unit-tests/dump/vc_document.js b/common/tests/unit-tests/dump/vc_document.mjs similarity index 99% rename from common/tests/unit-tests/dump/vc_document.js rename to common/tests/unit-tests/dump/vc_document.mjs index 07156ac1d9..bcbb941444 100644 --- a/common/tests/unit-tests/dump/vc_document.js +++ b/common/tests/unit-tests/dump/vc_document.mjs @@ -1,6 +1,6 @@ 'use strict'; -module.exports.vc_document = [{ +export const vc_document = [{ '_id': { '$oid': '6169b4428c3fb50013b24aa3' }, diff --git a/common/tests/unit-tests/dump/vp_document.js b/common/tests/unit-tests/dump/vp_document.mjs similarity index 99% rename from common/tests/unit-tests/dump/vp_document.js rename to common/tests/unit-tests/dump/vp_document.mjs index cc1a87f65d..5b33540662 100644 --- a/common/tests/unit-tests/dump/vp_document.js +++ b/common/tests/unit-tests/dump/vp_document.mjs @@ -1,6 +1,6 @@ 'use strict'; -module.exports.vp_document = [{ +export const vp_document = [{ '_id': { '$oid': '6169b4d38c3fb50013b24ab0' }, diff --git a/common/tests/unit-tests/hedera-modules/message/did-message.test.js b/common/tests/unit-tests/hedera-modules/message/did-message.test.mjs similarity index 77% rename from common/tests/unit-tests/hedera-modules/message/did-message.test.js rename to common/tests/unit-tests/hedera-modules/message/did-message.test.mjs index 7cfc2fba64..11639cb911 100644 --- a/common/tests/unit-tests/hedera-modules/message/did-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/did-message.test.mjs @@ -1,16 +1,11 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - DIDMessage -} = require('../../../../dist/hedera-modules/message/did-message'); +import { DIDMessage } from '../../../../dist/hedera-modules/message/did-message.js'; +import { DIDDocument } from '../../../../dist/hedera-modules/vcjs/did-document.js'; -const { - DIDDocument -} = require('../../../../dist/hedera-modules/vcjs/did-document'); - -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; describe('DIDMessage', function () { const testDidMessage = { @@ -51,4 +46,4 @@ describe('DIDMessage', function () { assert.deepEqual(didMessageByTestJson.getUrl(), { cid: testDidMessage.cid, url: testDidMessage.url }); assert.exists(didMessageByTestMessage.toMessageObject()); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/message.test.js b/common/tests/unit-tests/hedera-modules/message/message.test.mjs similarity index 68% rename from common/tests/unit-tests/hedera-modules/message/message.test.js rename to common/tests/unit-tests/hedera-modules/message/message.test.mjs index ab3e823b43..59c86cb42d 100644 --- a/common/tests/unit-tests/hedera-modules/message/message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/message.test.mjs @@ -1,13 +1,11 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - Message -} = require('../../../../dist/hedera-modules/message/message'); +import { Message } from '../../../../dist/hedera-modules/message/message.js'; -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { UrlType } = require('../../../../dist/hedera-modules/message/url.interface'); +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { UrlType } from '../../../../dist/hedera-modules/message/url.interface.js'; describe('Message', function () { @@ -38,4 +36,4 @@ describe('Message', function () { assert.exists(messageToMessage); assert.equal(messageToMessage.status, MessageStatus.REVOKE); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/policy-message.test.js b/common/tests/unit-tests/hedera-modules/message/policy-message.test.mjs similarity index 81% rename from common/tests/unit-tests/hedera-modules/message/policy-message.test.js rename to common/tests/unit-tests/hedera-modules/message/policy-message.test.mjs index 76ed511307..2ed276076f 100644 --- a/common/tests/unit-tests/hedera-modules/message/policy-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/policy-message.test.mjs @@ -1,13 +1,11 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - PolicyMessage -} = require('../../../../dist/hedera-modules/message/policy-message'); +import { PolicyMessage } from '../../../../dist/hedera-modules/message/policy-message.js'; -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); -const { UrlType } = require('../../../../dist/hedera-modules/message/url.interface'); +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; +import { UrlType } from '../../../../dist/hedera-modules/message/url.interface.js'; describe('PolicyMessage', function () { @@ -56,4 +54,4 @@ describe('PolicyMessage', function () { assert.equal(policyMessageByTestJSON.getDocumentUrl(UrlType.cid), testPolicyMessage.cid); assert.equal(policyMessageByTestJSON.getDocumentUrl(UrlType.url), testPolicyMessage.url); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/schema-message.test.js b/common/tests/unit-tests/hedera-modules/message/schema-message.test.mjs similarity index 85% rename from common/tests/unit-tests/hedera-modules/message/schema-message.test.js rename to common/tests/unit-tests/hedera-modules/message/schema-message.test.mjs index 31bfe51c58..e5a6476d9e 100644 --- a/common/tests/unit-tests/hedera-modules/message/schema-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/schema-message.test.mjs @@ -1,12 +1,11 @@ -const { expect, assert } = require('chai'); +import { expect, assert } from 'chai'; -const { - SchemaMessage -} = require('../../../../dist/hedera-modules/message/schema-message'); -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); -const { UrlType } = require('../../../../dist/hedera-modules/message/url.interface'); +import { SchemaMessage } from '../../../../dist/hedera-modules/message/schema-message.js'; + +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; +import { UrlType } from '../../../../dist/hedera-modules/message/url.interface.js'; describe('SchemaMessage', function () { @@ -70,4 +69,4 @@ describe('SchemaMessage', function () { assert.equal(schemaMessageByTestJSON.getDocumentUrl(UrlType.url), testSchemaMessage.document_url); assert.exists(schemaMessageByTestJSON.toMessageObject()); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/topic-message.test.js b/common/tests/unit-tests/hedera-modules/message/topic-message.test.mjs similarity index 76% rename from common/tests/unit-tests/hedera-modules/message/topic-message.test.js rename to common/tests/unit-tests/hedera-modules/message/topic-message.test.mjs index ed471f4aad..bc8ebb9a36 100644 --- a/common/tests/unit-tests/hedera-modules/message/topic-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/topic-message.test.mjs @@ -1,11 +1,10 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - TopicMessage -} = require('../../../../dist/hedera-modules/message/topic-message'); -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); +import { TopicMessage } from '../../../../dist/hedera-modules/message/topic-message.js'; + +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; describe('TopicMessage', function () { @@ -43,4 +42,4 @@ describe('TopicMessage', function () { assert.exists(topicMessageByTestJSON); assert.deepEqual(topicMessageByTestMessage.getUrl(), []); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/vc-message.test.js b/common/tests/unit-tests/hedera-modules/message/vc-message.test.mjs similarity index 77% rename from common/tests/unit-tests/hedera-modules/message/vc-message.test.js rename to common/tests/unit-tests/hedera-modules/message/vc-message.test.mjs index 7a342c8229..80d04f6e16 100644 --- a/common/tests/unit-tests/hedera-modules/message/vc-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/vc-message.test.mjs @@ -1,16 +1,14 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - VCMessage -} = require('../../../../dist/hedera-modules/message/vc-message'); -const { - VcDocument -} = require('../../../../dist/hedera-modules/vcjs/vc-document'); -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); -const { UrlType } = require('../../../../dist/hedera-modules/message/url.interface'); -const { vc_document } = require('../../dump/vc_document'); +import { VCMessage } from '../../../../dist/hedera-modules/message/vc-message.js'; +import { VcDocument } from '../../../../dist/hedera-modules/vcjs/vc-document.js'; + +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; +import { UrlType } from '../../../../dist/hedera-modules/message/url.interface.js'; + +import { vc_document } from '../../dump/vc_document.mjs'; describe('VCMessage', function () { @@ -62,4 +60,4 @@ describe('VCMessage', function () { assert.equal(vcMessageByTestJSON.getDocumentUrl(UrlType.url), testVCMessage.url); assert.exists(vcMessageByTestJSON.toMessageObject()); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/message/vp-message.test.js b/common/tests/unit-tests/hedera-modules/message/vp-message.test.mjs similarity index 77% rename from common/tests/unit-tests/hedera-modules/message/vp-message.test.js rename to common/tests/unit-tests/hedera-modules/message/vp-message.test.mjs index 4120077fc8..96e2c21b23 100644 --- a/common/tests/unit-tests/hedera-modules/message/vp-message.test.js +++ b/common/tests/unit-tests/hedera-modules/message/vp-message.test.mjs @@ -1,16 +1,14 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - VPMessage -} = require('../../../../dist/hedera-modules/message/vp-message'); -const { - VpDocument -} = require('../../../../dist/hedera-modules/vcjs/vp-document'); -const { MessageStatus } = require('../../../../dist/hedera-modules/message/message'); -const { MessageType } = require('../../../../dist/hedera-modules/message/message-type'); -const { MessageAction } = require('../../../../dist/hedera-modules/message/message-action'); -const { UrlType } = require('../../../../dist/hedera-modules/message/url.interface'); -const { vp_document } = require('../../dump/vp_document'); +import { VPMessage } from '../../../../dist/hedera-modules/message/vp-message.js'; +import { VpDocument } from '../../../../dist/hedera-modules/vcjs/vp-document.js'; + +import { MessageStatus } from '../../../../dist/hedera-modules/message/message.js'; +import { MessageType } from '../../../../dist/hedera-modules/message/message-type.js'; +import { MessageAction } from '../../../../dist/hedera-modules/message/message-action.js'; +import { UrlType } from '../../../../dist/hedera-modules/message/url.interface.js'; + +import { vp_document } from '../../dump/vp_document.mjs'; describe('VPMessage', function () { @@ -62,4 +60,4 @@ describe('VPMessage', function () { assert.equal(vpMessageByTestJSON.getDocumentUrl(UrlType.url), testVPMessage.url); assert.exists(vpMessageByTestJSON.toMessageObject()); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/utils.test.js b/common/tests/unit-tests/hedera-modules/utils.test.mjs similarity index 57% rename from common/tests/unit-tests/hedera-modules/utils.test.js rename to common/tests/unit-tests/hedera-modules/utils.test.mjs index 96eb920ad7..3c20a07d7b 100644 --- a/common/tests/unit-tests/hedera-modules/utils.test.js +++ b/common/tests/unit-tests/hedera-modules/utils.test.mjs @@ -1,7 +1,6 @@ -const { - timeout -} = require('../../../dist/hedera-modules/utils'); -const { expect, assert } = require('chai'); +import { assert } from 'chai'; + +import { timeout } from '../../../dist/hedera-modules/utils.js'; describe('HederaUtils', function () { diff --git a/common/tests/unit-tests/hedera-modules/vcjs/did-document.test.js b/common/tests/unit-tests/hedera-modules/vcjs/did-document.test.mjs similarity index 96% rename from common/tests/unit-tests/hedera-modules/vcjs/did-document.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/did-document.test.mjs index a5b32b1ced..fbf2b501fe 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/did-document.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/did-document.test.mjs @@ -1,13 +1,9 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; +import { PrivateKey } from '@hashgraph/sdk'; -const { - DidRootKey, - DIDDocument, - DidDocumentBase -} = require('../../../../dist/hedera-modules/vcjs/did-document'); +import { DidRootKey, DIDDocument, DidDocumentBase } from '../../../../dist/hedera-modules/vcjs/did-document.js'; -const { PrivateKey } = require("@hashgraph/sdk"); -const { did_document } = require('../../dump/did_document'); +import { did_document } from '../../dump/did_document.mjs'; describe('DidDocuments', function () { const topicId = "0.0.34195177"; @@ -126,4 +122,4 @@ describe('DidDocuments', function () { // assert.equal(createdDidDocumentFromTestDid.getDid(), createdDidDocument.getDid()); // assert.exists(createdDidDocumentFromTestDid.getDocument()); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/vcjs/issuer.test.js b/common/tests/unit-tests/hedera-modules/vcjs/issuer.test.mjs similarity index 86% rename from common/tests/unit-tests/hedera-modules/vcjs/issuer.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/issuer.test.mjs index 07cd0bda3c..426a742431 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/issuer.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/issuer.test.mjs @@ -1,8 +1,6 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - Issuer -} = require('../../../../dist/hedera-modules/vcjs/issuer'); +import { Issuer } from '../../../../dist/hedera-modules/vcjs/issuer.js'; describe('Issuer', function () { const rootObj = { @@ -27,4 +25,4 @@ describe('Issuer', function () { assert.equal(issuer.toJSON(), rootJSON); assert.deepEqual(Issuer.fromJson(rootJSON), issuer); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.js b/common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.mjs similarity index 88% rename from common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.mjs index d167800a4c..ab4a860d9d 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/vc-document.test.mjs @@ -1,15 +1,10 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - VcDocument -} = require('../../../../dist/hedera-modules/vcjs/vc-document'); -const { - VcSubject -} = require('../../../../dist/hedera-modules/vcjs/vc-subject'); -const { vc_document } = require('../../dump/vc_document'); -const { - Issuer -} = require('../../../../dist/hedera-modules/vcjs/issuer'); +import { VcDocument } from '../../../../dist/hedera-modules/vcjs/vc-document.js'; +import { VcSubject } from '../../../../dist/hedera-modules/vcjs/vc-subject.js'; +import { Issuer } from '../../../../dist/hedera-modules/vcjs/issuer.js'; + +import { vc_document } from '../../dump/vc_document.mjs'; describe('VcDocument', function () { @@ -66,4 +61,4 @@ describe('VcDocument', function () { vcDocument.addCredentialSubjects(testCSs.map((testCS) => VcSubject.fromJsonTree(testCS))); assert.deepEqual(vcDocument.toJsonTree(), testVcDocument); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.js b/common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.mjs similarity index 81% rename from common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.mjs index dea73f97c4..ea438bcf94 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/vc-subject.test.mjs @@ -1,9 +1,8 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - VcSubject -} = require('../../../../dist/hedera-modules/vcjs/vc-subject'); -const { vc_document } = require('../../dump/vc_document'); +import { VcSubject } from '../../../../dist/hedera-modules/vcjs/vc-subject.js'; + +import { vc_document } from '../../dump/vc_document.mjs'; describe('VcSubject', function () { const testCS = vc_document[0].document.credentialSubject[0]; @@ -26,4 +25,4 @@ describe('VcSubject', function () { assert.deepEqual(VcSubject.create(testCS).toJsonTree(), testCS); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.js b/common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.mjs similarity index 96% rename from common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.mjs index b36d180017..d490f9d3f2 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/vcjs.test.mjs @@ -1,28 +1,15 @@ -const { expect, assert } = require('chai'); -const { - VCJS -} = require('../../../../dist/hedera-modules/vcjs/vcjs'); -const { - DefaultDocumentLoader -} = require('../../../../dist/hedera-modules/document-loader/document-loader-default'); -const { - DIDDocument -} = require('../../../../dist/hedera-modules/vcjs/did-document'); -const { - LocalSchemaContextLoader -} = require('../../../../dist/document-loader/local-schema-context-loader'); -const { - LocalSchemaDocumentLoader -} = require('../../../../dist/document-loader/local-schema-document-loader'); -const { - LocalVcSchemaDocumentLoader -} = require('../../../../dist/document-loader/local-vc-schema-document-loader'); -const { - LocalDidLoader -} = require('../../../../dist/document-loader/local-did-loader'); -const { PrivateKey } = require("@hashgraph/sdk"); - -const { vc_document } = require('../../dump/vc_document'); +import { assert } from 'chai'; +import { PrivateKey } from '@hashgraph/sdk'; + +import { VCJS } from '../../../../dist/hedera-modules/vcjs/vcjs.js'; +import { DefaultDocumentLoader } from '../../../../dist/hedera-modules/document-loader/document-loader-default.js'; +import { DIDDocument } from '../../../../dist/hedera-modules/vcjs/did-document.js'; +import { LocalSchemaContextLoader } from '../../../../dist/document-loader/local-schema-context-loader.js'; +import { LocalSchemaDocumentLoader } from '../../../../dist/document-loader/local-schema-document-loader.js'; +import { LocalVcSchemaDocumentLoader } from '../../../../dist/document-loader/local-vc-schema-document-loader.js'; +import { LocalDidLoader } from '../../../../dist/document-loader/local-did-loader.js'; + +import { vc_document } from '../../dump/vc_document.mjs'; describe('VCJS', function () { const actualVcDocument = vc_document.find(document => document.hash === '9s7b1eW2gkZEd64SAidCci3UmXQgfZt2w6ajiKdPdHa9'); @@ -551,4 +538,4 @@ describe('VCJS', function () { ); assert.exists(testVp); }); -}); \ No newline at end of file +}); diff --git a/common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.js b/common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.mjs similarity index 90% rename from common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.js rename to common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.mjs index 7fc99fb189..cdc6776067 100644 --- a/common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.js +++ b/common/tests/unit-tests/hedera-modules/vcjs/vp-document.test.mjs @@ -1,12 +1,9 @@ -const { expect, assert } = require('chai'); +import { assert } from 'chai'; -const { - VpDocument -} = require('../../../../dist/hedera-modules/vcjs/vp-document'); -const { - VcDocument -} = require('../../../../dist/hedera-modules/vcjs/vc-document'); -const { vp_document } = require('../../dump/vp_document'); +import { VpDocument } from '../../../../dist/hedera-modules/vcjs/vp-document.js'; +import { VcDocument } from '../../../../dist/hedera-modules/vcjs/vc-document.js'; + +import { vp_document } from '../../dump/vp_document.mjs'; describe('VpDocument', function () { @@ -60,4 +57,4 @@ describe('VpDocument', function () { vpDocument.proofFromJson(testVpDocumentThird); assert.deepEqual(vpDocument.getProof(), testVpDocumentThird.proof); }); -}); \ No newline at end of file +}); diff --git a/common/tsconfig.json b/common/tsconfig.json index ec49e23c6b..563f8e1906 100644 --- a/common/tsconfig.json +++ b/common/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "dom", "es5", diff --git a/common/tsconfig.production.json b/common/tsconfig.production.json index fbcc1b6e1f..1e1a9905e6 100644 --- a/common/tsconfig.production.json +++ b/common/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "dom", "es5", diff --git a/configs/.env..guardian.system b/configs/.env..guardian.system index 2d88778950..aa39c01a95 100644 --- a/configs/.env..guardian.system +++ b/configs/.env..guardian.system @@ -134,3 +134,7 @@ ACCESS_TOKEN_UPDATE_INTERVAL=60000 REFRESH_TOKEN_UPDATE_INTERVAL=31536000000 OPENAI_API_KEY=... + +#CACHE +HOST_CACHE='cache' +PORT_CACHE='6379' diff --git a/configs/.env.develop.guardian.system b/configs/.env.develop.guardian.system index 18132d985e..81df513c08 100644 --- a/configs/.env.develop.guardian.system +++ b/configs/.env.develop.guardian.system @@ -135,3 +135,7 @@ ACCESS_TOKEN_UPDATE_INTERVAL=60000 REFRESH_TOKEN_UPDATE_INTERVAL=31536000000 OPENAI_API_KEY=... + +#CACHE +HOST_CACHE='cache' +PORT_CACHE='6379' diff --git a/configs/.env.template.guardian.system b/configs/.env.template.guardian.system index aa5bfeb22c..51bb960e0f 100644 --- a/configs/.env.template.guardian.system +++ b/configs/.env.template.guardian.system @@ -150,3 +150,7 @@ MEECO_PRESENTATION_DEFINITION_ID="832e996c-**********-9d170fa381a8" ACCESS_TOKEN_UPDATE_INTERVAL=60000 REFRESH_TOKEN_UPDATE_INTERVAL=31536000000 + +#CACHE +HOST_CACHE='cache' +PORT_CACHE='6379' diff --git a/configs/.env_SSV b/configs/.env_SSV index e81d48cf36..a910f03570 100644 --- a/configs/.env_SSV +++ b/configs/.env_SSV @@ -32,3 +32,7 @@ EXTERNAL_DOCUMENTS_SCHEDULER="0 0 * * *" # worker-service WORKER_1_SERVICE_CHANNEL="worker.1" WORKER_2_SERVICE_CHANNEL="worker.2" + +#CACHE +HOST_CACHE='cache' +PORT_CACHE='6379' diff --git a/contracts/retire/RetireCommon.sol b/contracts/retire/RetireCommon.sol index d3d8847ca4..bd4b53a3de 100644 --- a/contracts/retire/RetireCommon.sol +++ b/contracts/retire/RetireCommon.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.11; pragma experimental ABIEncoderV2; import "../wipe/Wipe.sol"; -import "../safe-hts-precompile/SafeViewHTS.sol"; import "../hts-precompile/IHederaTokenService.sol"; import "./access/RetireAccess.sol"; import "./storage/RetirePoolStorage.sol"; @@ -12,7 +11,6 @@ import "./storage/RetireRequestStorage.sol"; abstract contract RetireCommon is RetirePoolStorage, RetireRequestStorage, - SafeViewHTS, RetireAccess { event Retire(address, RetireTokenRequest[]); diff --git a/contracts/retire/RetireImplementation.sol b/contracts/retire/RetireImplementation.sol index 34f5a6d8fb..fa8f6a75d9 100644 --- a/contracts/retire/RetireImplementation.sol +++ b/contracts/retire/RetireImplementation.sol @@ -127,6 +127,8 @@ abstract contract RetireImplementation is RetireCommon { usr, tokens[i].serials ); + } else { + revert('UNSUPPORTED_TOKEN_TYPE'); } } emit Retire(usr, tokens); @@ -141,8 +143,6 @@ abstract contract RetireImplementation is RetireCommon { require(RetireCommon(this).retireCheck(tokens), "RETIRE_CHECK"); address[] memory tokenAddresses = new address[](tokens.length); for (uint256 i = 0; i < tokens.length; i++) { - // Validate for max int64 - require(tokens[i].serials.length < 9223372036854775807); tokenAddresses[i] = tokens[i].token; } (, bool immediately) = RetireCommon(this).getPool(tokenAddresses); @@ -170,12 +170,15 @@ abstract contract RetireImplementation is RetireCommon { internal returns (int64) { - int64 count = 0; int32 tokenType = safeGetTokenType(opt.token); + int64 count; if (tokenType == 0) { count = opt.count; - } else if (tokenType == 1) { + } else if (tokenType == 1){ count = int64(int256(opt.serials.length)); + require(count <= 10, 'NFTS_LIMIT'); + } else { + revert('UNSUPPORTED_TOKEN_TYPE'); } return count; } diff --git a/contracts/retire/retire-double-token/RetireDoubleTokenPoolStorage.sol b/contracts/retire/retire-double-token/RetireDoubleTokenPoolStorage.sol index ba2dfcaea8..26ee08e71e 100644 --- a/contracts/retire/retire-double-token/RetireDoubleTokenPoolStorage.sol +++ b/contracts/retire/retire-double-token/RetireDoubleTokenPoolStorage.sol @@ -38,6 +38,7 @@ contract RetireDoubleTokenPoolStorage is RetirePoolStorage { override role(OWNER) { + super.setPool(tokens, immediately); address base = tokens[0].token; address opposite = tokens[1].token; int64 baseCount = tokens[0].count; diff --git a/contracts/retire/retire-single-token/RetireSingleTokenPoolStorage.sol b/contracts/retire/retire-single-token/RetireSingleTokenPoolStorage.sol index 8c9ed994bc..3f5094b434 100644 --- a/contracts/retire/retire-single-token/RetireSingleTokenPoolStorage.sol +++ b/contracts/retire/retire-single-token/RetireSingleTokenPoolStorage.sol @@ -38,6 +38,7 @@ contract RetireSingleTokenPoolStorage is RetirePoolStorage { override role(OWNER) { + super.setPool(tokens, immediately); address base = tokens[0].token; int64 baseCount = tokens[0].count; if (poolPos[base] > 0) { diff --git a/contracts/retire/storage/RetirePoolStorage.sol b/contracts/retire/storage/RetirePoolStorage.sol index efc79c4f86..5fcf8b10a4 100644 --- a/contracts/retire/storage/RetirePoolStorage.sol +++ b/contracts/retire/storage/RetirePoolStorage.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.11; pragma experimental ABIEncoderV2; import "../../access/Access.sol"; +import "../../safe-hts-precompile/SafeViewHTS.sol"; -abstract contract RetirePoolStorage is Access { +abstract contract RetirePoolStorage is Access, SafeViewHTS { struct RetireTokenPool { address token; int64 count; @@ -16,11 +17,22 @@ abstract contract RetirePoolStorage is Access { virtual returns (RetireTokenPool[] memory, bool); - function setPool(RetireTokenPool[] memory tokens, bool immediately) + function setPool(RetireTokenPool[] memory tokens, bool) public - virtual; + virtual + role(OWNER) + { + for(uint256 i = 0; i < tokens.length; i++) { + int32 tokenType = safeGetTokenType(tokens[i].token); + if (tokenType == 1) { + require(tokens[i].count <= 10, 'NFTS_LIMIT'); + } else if (tokenType != 0){ + revert('UNSUPPORTED_TOKEN_TYPE'); + } + } + } function unsetPool(address[] memory tokens) public virtual; function getPools(uint8) public view virtual returns (bytes memory); -} \ No newline at end of file +} diff --git a/dev.js b/dev.mjs similarity index 84% rename from dev.js rename to dev.mjs index a4f35b0784..02e9229172 100644 --- a/dev.js +++ b/dev.mjs @@ -1,6 +1,5 @@ -const execSync = require('child_process').execSync; -const spaw = require('child_process').spawn; -const fs = require('fs'); +import { execSync, spawn } from 'child_process'; +import fs from 'fs'; (async () => { await execSync(`yarn`, { stdio: 'inherit', shell: true }); @@ -19,7 +18,7 @@ const fs = require('fs'); await new Promise((resolve) => { log('Watching changes...'); - const child = spaw('yarn', ['--cwd', folder, 'dev'], { shell: true }); + const child = spawn('yarn', ['--cwd', folder, 'dev'], { shell: true }); child.stdout.on('data', log); child.stderr.on('data', log); @@ -45,4 +44,4 @@ const fs = require('fs'); "ipfs-client", "topic-viewer" ].map(project => buildAndWatch(project, project === "frontend"))); -})(); \ No newline at end of file +})(); diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 12baea4cd0..a8671c4754 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -8,6 +8,13 @@ services: - 27017 ports: - 27017:27017 + cache: + image: registry.redict.io/redict + restart: always + expose: + - 6379 + ports: + - "6379:6379" ipfs-node: image: ipfs/kubo:v0.26.0 ports: @@ -33,7 +40,7 @@ services: - ./:/app - ~/.npm/:/root/.npm restart: "no" - command: 'node dev.js' + command: 'node dev.mjs' logger-service: image: guardian-development @@ -86,6 +93,7 @@ services: - 3002:3002 depends_on: - dev-tools + - cache - mongo - message-broker - guardian-service diff --git a/docker-compose.yml b/docker-compose.yml index 2962de2737..9d09ae59de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,14 @@ services: depends_on: - mongo + cache: + image: registry.redict.io/redict + restart: always + expose: + - 6379 + ports: + - "6379:6379" + ipfs-node: image: ipfs/kubo:v0.26.0 ports: @@ -61,6 +69,7 @@ services: build: context: . dockerfile: ./notification-service/Dockerfile + init: true depends_on: - message-broker environment: @@ -74,6 +83,7 @@ services: build: context: . dockerfile: ./logger-service/Dockerfile + init: true depends_on: - message-broker environment: @@ -89,6 +99,7 @@ services: build: context: . dockerfile: ./worker-service/Dockerfile + init: true depends_on: ipfs-node: condition: service_healthy @@ -110,6 +121,7 @@ services: build: context: . dockerfile: ./auth-service/Dockerfile.demo + init: true ports: - '5005:5005' volumes: @@ -132,11 +144,13 @@ services: build: context: . dockerfile: ./api-gateway/Dockerfile.demo + init: true expose: - 3002 - 6555 depends_on: - mongo + - cache - message-broker - guardian-service - auth-service @@ -152,6 +166,7 @@ services: build: context: . dockerfile: ./ai-service/Dockerfile + init: true expose: - 3013 depends_on: @@ -171,6 +186,7 @@ services: build: context: . dockerfile: ./policy-service/Dockerfile + init: true ports: - "5006:5006" depends_on: @@ -193,6 +209,7 @@ services: build: context: . dockerfile: ./guardian-service/Dockerfile + init: true ports: - "5007:5007" volumes: @@ -215,8 +232,7 @@ services: build: context: . dockerfile: application-events/Dockerfile - expose: - - 3012 + init: true ports: - "3012:3012" depends_on: @@ -225,21 +241,25 @@ services: - guardian-service - auth-service - logger-service + expose: + - 3012 mrv-sender: build: context: . dockerfile: ./mrv-sender/Dockerfile + init: true + ports: + - "5008:5008" expose: - 3003 - 5008 - ports: - - "5008:5008" topic-viewer: build: context: . dockerfile: ./topic-viewer/Dockerfile + init: true expose: - 3006 - 5009 @@ -250,6 +270,7 @@ services: build: context: . dockerfile: ./web-proxy/Dockerfile + init: true ports: - "3000:80" depends_on: diff --git a/docker-composeRIL.yml b/docker-composeRIL.yml index 0fbe8c4d83..f55657d170 100644 --- a/docker-composeRIL.yml +++ b/docker-composeRIL.yml @@ -20,6 +20,14 @@ services: depends_on: - mongo + cache: + image: registry.redict.io/redict + restart: always + expose: + - 6379 + ports: + - "6379:6379" + ipfs-node: image: ipfs/kubo:v0.22.0 ports: @@ -141,6 +149,7 @@ services: - 6555 depends_on: - mongo + - cache - message-broker - guardian-service - auth-service diff --git a/docker-compose_SSV.yml b/docker-compose_SSV.yml index 322ea271e6..482abc03a0 100644 --- a/docker-compose_SSV.yml +++ b/docker-compose_SSV.yml @@ -7,6 +7,14 @@ services: expose: - 27017 + cache: + image: registry.redict.io/redict + restart: always + expose: + - 6379 + ports: + - "6379:6379" + mongo-express: image: mongo-express:1.0.0-alpha.4 expose: @@ -139,6 +147,7 @@ services: - 3002 depends_on: - mongo + - cache - message-broker - guardian-service - auth-service diff --git a/docs/.gitbook/assets/0 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/0 (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..9cb09d3045 Binary files /dev/null and b/docs/.gitbook/assets/0 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/0 (1) (1) (1) (1).png b/docs/.gitbook/assets/0 (1) (1) (1) (1).png index 9cb09d3045..005f784fe9 100644 Binary files a/docs/.gitbook/assets/0 (1) (1) (1) (1).png and b/docs/.gitbook/assets/0 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/0 (1) (1) (1).png b/docs/.gitbook/assets/0 (1) (1) (1).png index 005f784fe9..2353a305a3 100644 Binary files a/docs/.gitbook/assets/0 (1) (1) (1).png and b/docs/.gitbook/assets/0 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/0 (1) (1).png b/docs/.gitbook/assets/0 (1) (1).png index 2353a305a3..249147ab38 100644 Binary files a/docs/.gitbook/assets/0 (1) (1).png and b/docs/.gitbook/assets/0 (1) (1).png differ diff --git a/docs/.gitbook/assets/0 (1).png b/docs/.gitbook/assets/0 (1).png index 249147ab38..330b81ffa8 100644 Binary files a/docs/.gitbook/assets/0 (1).png and b/docs/.gitbook/assets/0 (1).png differ diff --git a/docs/.gitbook/assets/0.png b/docs/.gitbook/assets/0.png index 330b81ffa8..250acc4325 100644 Binary files a/docs/.gitbook/assets/0.png and b/docs/.gitbook/assets/0.png differ diff --git a/docs/.gitbook/assets/1 (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/1 (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..18283aeb35 Binary files /dev/null and b/docs/.gitbook/assets/1 (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/1 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/1 (1) (1) (1) (1) (1).png index 18283aeb35..be65027b29 100644 Binary files a/docs/.gitbook/assets/1 (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/1 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/1 (1) (1) (1) (1).png b/docs/.gitbook/assets/1 (1) (1) (1) (1).png index be65027b29..08a491b680 100644 Binary files a/docs/.gitbook/assets/1 (1) (1) (1) (1).png and b/docs/.gitbook/assets/1 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/1 (1) (1) (1).png b/docs/.gitbook/assets/1 (1) (1) (1).png index 08a491b680..59f0b15164 100644 Binary files a/docs/.gitbook/assets/1 (1) (1) (1).png and b/docs/.gitbook/assets/1 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/1 (1) (1).png b/docs/.gitbook/assets/1 (1) (1).png index 59f0b15164..50582760f7 100644 Binary files a/docs/.gitbook/assets/1 (1) (1).png and b/docs/.gitbook/assets/1 (1) (1).png differ diff --git a/docs/.gitbook/assets/1 (1).png b/docs/.gitbook/assets/1 (1).png index 50582760f7..fb2e06318b 100644 Binary files a/docs/.gitbook/assets/1 (1).png and b/docs/.gitbook/assets/1 (1).png differ diff --git a/docs/.gitbook/assets/1.png b/docs/.gitbook/assets/1.png index fb2e06318b..80f5045186 100644 Binary files a/docs/.gitbook/assets/1.png and b/docs/.gitbook/assets/1.png differ diff --git a/docs/.gitbook/assets/2 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/2 (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..5cf2a4dd49 Binary files /dev/null and b/docs/.gitbook/assets/2 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/2 (1) (1) (1) (1).png b/docs/.gitbook/assets/2 (1) (1) (1) (1).png index 5cf2a4dd49..27ad7d378c 100644 Binary files a/docs/.gitbook/assets/2 (1) (1) (1) (1).png and b/docs/.gitbook/assets/2 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/2 (1) (1) (1).png b/docs/.gitbook/assets/2 (1) (1) (1).png index 27ad7d378c..cd4d124a8c 100644 Binary files a/docs/.gitbook/assets/2 (1) (1) (1).png and b/docs/.gitbook/assets/2 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/2 (1) (1).png b/docs/.gitbook/assets/2 (1) (1).png index cd4d124a8c..085f8e6551 100644 Binary files a/docs/.gitbook/assets/2 (1) (1).png and b/docs/.gitbook/assets/2 (1) (1).png differ diff --git a/docs/.gitbook/assets/2 (1).png b/docs/.gitbook/assets/2 (1).png index 085f8e6551..e45fa653f0 100644 Binary files a/docs/.gitbook/assets/2 (1).png and b/docs/.gitbook/assets/2 (1).png differ diff --git a/docs/.gitbook/assets/2.png b/docs/.gitbook/assets/2.png index e45fa653f0..0f79835520 100644 Binary files a/docs/.gitbook/assets/2.png and b/docs/.gitbook/assets/2.png differ diff --git a/docs/.gitbook/assets/3 (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/3 (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..61ba944fdd Binary files /dev/null and b/docs/.gitbook/assets/3 (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/3 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/3 (1) (1) (1) (1) (1).png index 61ba944fdd..529a820423 100644 Binary files a/docs/.gitbook/assets/3 (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/3 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/3 (1) (1) (1) (1).png b/docs/.gitbook/assets/3 (1) (1) (1) (1).png index 529a820423..f69785d8bb 100644 Binary files a/docs/.gitbook/assets/3 (1) (1) (1) (1).png and b/docs/.gitbook/assets/3 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/3 (1) (1) (1).png b/docs/.gitbook/assets/3 (1) (1) (1).png index f69785d8bb..46a5470151 100644 Binary files a/docs/.gitbook/assets/3 (1) (1) (1).png and b/docs/.gitbook/assets/3 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/3 (1) (1).png b/docs/.gitbook/assets/3 (1) (1).png index 46a5470151..661629cb46 100644 Binary files a/docs/.gitbook/assets/3 (1) (1).png and b/docs/.gitbook/assets/3 (1) (1).png differ diff --git a/docs/.gitbook/assets/3 (1).png b/docs/.gitbook/assets/3 (1).png index 661629cb46..9bbb9f4c63 100644 Binary files a/docs/.gitbook/assets/3 (1).png and b/docs/.gitbook/assets/3 (1).png differ diff --git a/docs/.gitbook/assets/3.png b/docs/.gitbook/assets/3.png index 9bbb9f4c63..9ed35042de 100644 Binary files a/docs/.gitbook/assets/3.png and b/docs/.gitbook/assets/3.png differ diff --git a/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..3e35cf3ea1 Binary files /dev/null and b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1).png index 3e35cf3ea1..ab0bac4778 100644 Binary files a/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1).png index ab0bac4778..d084797ac1 100644 Binary files a/docs/.gitbook/assets/4 (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/4 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1) (1) (1) (1).png b/docs/.gitbook/assets/4 (1) (1) (1) (1).png index d084797ac1..4ed041bba6 100644 Binary files a/docs/.gitbook/assets/4 (1) (1) (1) (1).png and b/docs/.gitbook/assets/4 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1) (1) (1).png b/docs/.gitbook/assets/4 (1) (1) (1).png index 4ed041bba6..df2d520907 100644 Binary files a/docs/.gitbook/assets/4 (1) (1) (1).png and b/docs/.gitbook/assets/4 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1) (1).png b/docs/.gitbook/assets/4 (1) (1).png index df2d520907..58263b38f9 100644 Binary files a/docs/.gitbook/assets/4 (1) (1).png and b/docs/.gitbook/assets/4 (1) (1).png differ diff --git a/docs/.gitbook/assets/4 (1).png b/docs/.gitbook/assets/4 (1).png index 58263b38f9..b9f3c30e2b 100644 Binary files a/docs/.gitbook/assets/4 (1).png and b/docs/.gitbook/assets/4 (1).png differ diff --git a/docs/.gitbook/assets/4.png b/docs/.gitbook/assets/4.png index b9f3c30e2b..e7a6b806d2 100644 Binary files a/docs/.gitbook/assets/4.png and b/docs/.gitbook/assets/4.png differ diff --git a/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..8c2ff12172 Binary files /dev/null and b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png index 8c2ff12172..466c6c67f3 100644 Binary files a/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1).png index 466c6c67f3..5fa02c03c6 100644 Binary files a/docs/.gitbook/assets/5 (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/5 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1) (1) (1) (1).png b/docs/.gitbook/assets/5 (1) (1) (1) (1).png index 5fa02c03c6..0c21569d5b 100644 Binary files a/docs/.gitbook/assets/5 (1) (1) (1) (1).png and b/docs/.gitbook/assets/5 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1) (1) (1).png b/docs/.gitbook/assets/5 (1) (1) (1).png index 0c21569d5b..494e567a68 100644 Binary files a/docs/.gitbook/assets/5 (1) (1) (1).png and b/docs/.gitbook/assets/5 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1) (1).png b/docs/.gitbook/assets/5 (1) (1).png index 494e567a68..fd570e81e9 100644 Binary files a/docs/.gitbook/assets/5 (1) (1).png and b/docs/.gitbook/assets/5 (1) (1).png differ diff --git a/docs/.gitbook/assets/5 (1).png b/docs/.gitbook/assets/5 (1).png index fd570e81e9..b0d62a4409 100644 Binary files a/docs/.gitbook/assets/5 (1).png and b/docs/.gitbook/assets/5 (1).png differ diff --git a/docs/.gitbook/assets/5.png b/docs/.gitbook/assets/5.png index b0d62a4409..339584a1b5 100644 Binary files a/docs/.gitbook/assets/5.png and b/docs/.gitbook/assets/5.png differ diff --git a/docs/.gitbook/assets/6 (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/6 (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..73658433d8 Binary files /dev/null and b/docs/.gitbook/assets/6 (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/6 (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/6 (1) (1) (1) (1) (1).png index 73658433d8..aadd0c2aa9 100644 Binary files a/docs/.gitbook/assets/6 (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/6 (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/6 (1) (1) (1) (1).png b/docs/.gitbook/assets/6 (1) (1) (1) (1).png index aadd0c2aa9..5648b9c87b 100644 Binary files a/docs/.gitbook/assets/6 (1) (1) (1) (1).png and b/docs/.gitbook/assets/6 (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/6 (1) (1) (1).png b/docs/.gitbook/assets/6 (1) (1) (1).png index 5648b9c87b..eaced7bb33 100644 Binary files a/docs/.gitbook/assets/6 (1) (1) (1).png and b/docs/.gitbook/assets/6 (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/6 (1) (1).png b/docs/.gitbook/assets/6 (1) (1).png index eaced7bb33..cb04eb3f7e 100644 Binary files a/docs/.gitbook/assets/6 (1) (1).png and b/docs/.gitbook/assets/6 (1) (1).png differ diff --git a/docs/.gitbook/assets/6 (1).png b/docs/.gitbook/assets/6 (1).png index cb04eb3f7e..99ed751613 100644 Binary files a/docs/.gitbook/assets/6 (1).png and b/docs/.gitbook/assets/6 (1).png differ diff --git a/docs/.gitbook/assets/6.png b/docs/.gitbook/assets/6.png index 99ed751613..bf25d35809 100644 Binary files a/docs/.gitbook/assets/6.png and b/docs/.gitbook/assets/6.png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..64dcbfce4a Binary files /dev/null and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 64dcbfce4a..fd487e4449 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index fd487e4449..f215c151a7 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index f215c151a7..e40832f472 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index e40832f472..f9e2ba27c1 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index f9e2ba27c1..33409f86c1 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 33409f86c1..5e9d4c646e 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 5e9d4c646e..bf2fded8de 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index bf2fded8de..7831536a6b 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 7831536a6b..125594f5bf 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 125594f5bf..8bbc766be5 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 8bbc766be5..15e1d7a135 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 15e1d7a135..f5dd83b397 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index f5dd83b397..424e1766a0 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 424e1766a0..dc800439cd 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index dc800439cd..401e85023b 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 401e85023b..df14f02f7c 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png index df14f02f7c..962f491b30 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png index 962f491b30..00dbcf6b0d 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png index 00dbcf6b0d..9fab550b02 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1) (1).png index 9fab550b02..d2057dcfc2 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1) (1).png index d2057dcfc2..40c124f8b0 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1).png index 40c124f8b0..5d6f7d6428 100644 Binary files a/docs/.gitbook/assets/image (1) (1) (1).png and b/docs/.gitbook/assets/image (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1) (1).png b/docs/.gitbook/assets/image (1) (1).png index 5d6f7d6428..ae454578e4 100644 Binary files a/docs/.gitbook/assets/image (1) (1).png and b/docs/.gitbook/assets/image (1) (1).png differ diff --git a/docs/.gitbook/assets/image (1).png b/docs/.gitbook/assets/image (1).png index ae454578e4..557a2754a1 100644 Binary files a/docs/.gitbook/assets/image (1).png and b/docs/.gitbook/assets/image (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..4260e5b162 Binary files /dev/null and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 4260e5b162..41c3c47af3 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 41c3c47af3..93de69b997 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 93de69b997..777d27b21a 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 777d27b21a..bf9251d588 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1).png index bf9251d588..39fc7ec887 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png index 39fc7ec887..984db4055f 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png index 984db4055f..41a81cdc51 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png index 41a81cdc51..47ab466995 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1) (1).png index 47ab466995..351d368365 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1) (1).png index 351d368365..1bcfd9a270 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1) (1).png b/docs/.gitbook/assets/image (10) (1) (1).png index 1bcfd9a270..2ac8f438c5 100644 Binary files a/docs/.gitbook/assets/image (10) (1) (1).png and b/docs/.gitbook/assets/image (10) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (10) (1).png b/docs/.gitbook/assets/image (10) (1).png index 2ac8f438c5..94ab5810b7 100644 Binary files a/docs/.gitbook/assets/image (10) (1).png and b/docs/.gitbook/assets/image (10) (1).png differ diff --git a/docs/.gitbook/assets/image (10).png b/docs/.gitbook/assets/image (10).png index 94ab5810b7..2013bf91bc 100644 Binary files a/docs/.gitbook/assets/image (10).png and b/docs/.gitbook/assets/image (10).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..19019ed11a Binary files /dev/null and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 19019ed11a..787f7ce1e3 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png index 787f7ce1e3..4bfd771e5d 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png index 4bfd771e5d..c7d944a1de 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png index c7d944a1de..283b6c276f 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png index 283b6c276f..045792cd80 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1) (1).png index 045792cd80..c7615bbbf7 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1) (1).png index c7615bbbf7..1d391c21d3 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1) (1).png b/docs/.gitbook/assets/image (11) (1) (1).png index 1d391c21d3..b1a623fbaa 100644 Binary files a/docs/.gitbook/assets/image (11) (1) (1).png and b/docs/.gitbook/assets/image (11) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (11) (1).png b/docs/.gitbook/assets/image (11) (1).png index b1a623fbaa..0e0a6305ba 100644 Binary files a/docs/.gitbook/assets/image (11) (1).png and b/docs/.gitbook/assets/image (11) (1).png differ diff --git a/docs/.gitbook/assets/image (11).png b/docs/.gitbook/assets/image (11).png index 0e0a6305ba..092d777e42 100644 Binary files a/docs/.gitbook/assets/image (11).png and b/docs/.gitbook/assets/image (11).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..7e161ae7be Binary files /dev/null and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 7e161ae7be..303850328f 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1).png index 303850328f..30b4fd43c2 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1).png index 30b4fd43c2..9f136160ae 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png index 9f136160ae..4edad9a54a 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png index 4edad9a54a..01e8c0157a 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1) (1).png index 01e8c0157a..90df1d8838 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1) (1).png index 90df1d8838..592884881f 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1) (1).png b/docs/.gitbook/assets/image (12) (1) (1).png index 592884881f..00fc8daa21 100644 Binary files a/docs/.gitbook/assets/image (12) (1) (1).png and b/docs/.gitbook/assets/image (12) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (12) (1).png b/docs/.gitbook/assets/image (12) (1).png index 00fc8daa21..b0365fd592 100644 Binary files a/docs/.gitbook/assets/image (12) (1).png and b/docs/.gitbook/assets/image (12) (1).png differ diff --git a/docs/.gitbook/assets/image (12).png b/docs/.gitbook/assets/image (12).png index b0365fd592..1db09af514 100644 Binary files a/docs/.gitbook/assets/image (12).png and b/docs/.gitbook/assets/image (12).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..889345de7c Binary files /dev/null and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 889345de7c..d94187074c 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index d94187074c..5de97963e8 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 5de97963e8..3e92f1dbdb 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1).png index 3e92f1dbdb..ca2cb0ac38 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1).png index ca2cb0ac38..8d25c49940 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png index 8d25c49940..191f3dcf27 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png index 191f3dcf27..884562bfb0 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1) (1).png index 884562bfb0..1b1165ec89 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1) (1).png index 1b1165ec89..469ed3d32b 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1) (1).png b/docs/.gitbook/assets/image (13) (1) (1).png index 469ed3d32b..7f8f602934 100644 Binary files a/docs/.gitbook/assets/image (13) (1) (1).png and b/docs/.gitbook/assets/image (13) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (13) (1).png b/docs/.gitbook/assets/image (13) (1).png index 7f8f602934..37d5bf026f 100644 Binary files a/docs/.gitbook/assets/image (13) (1).png and b/docs/.gitbook/assets/image (13) (1).png differ diff --git a/docs/.gitbook/assets/image (13).png b/docs/.gitbook/assets/image (13).png index 37d5bf026f..902766ec96 100644 Binary files a/docs/.gitbook/assets/image (13).png and b/docs/.gitbook/assets/image (13).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..6012d60546 Binary files /dev/null and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 6012d60546..83a0615acf 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 83a0615acf..0d4a591548 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1).png index 0d4a591548..5b7d7b1684 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1).png index 5b7d7b1684..2af06c2acb 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png index 2af06c2acb..35b3e6f7bd 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png index 35b3e6f7bd..e215af5689 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1) (1).png index e215af5689..80b8d2cbad 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1) (1).png index 80b8d2cbad..07b8bc4b98 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1) (1).png b/docs/.gitbook/assets/image (14) (1) (1).png index 07b8bc4b98..d50129fe40 100644 Binary files a/docs/.gitbook/assets/image (14) (1) (1).png and b/docs/.gitbook/assets/image (14) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (14) (1).png b/docs/.gitbook/assets/image (14) (1).png index d50129fe40..0f7a893fc7 100644 Binary files a/docs/.gitbook/assets/image (14) (1).png and b/docs/.gitbook/assets/image (14) (1).png differ diff --git a/docs/.gitbook/assets/image (14).png b/docs/.gitbook/assets/image (14).png index 0f7a893fc7..215ec468b4 100644 Binary files a/docs/.gitbook/assets/image (14).png and b/docs/.gitbook/assets/image (14).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..6c274aedd7 Binary files /dev/null and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 6c274aedd7..0a8ae15fb6 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1).png index 0a8ae15fb6..1e2c6aca11 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png index 1e2c6aca11..2a1cb6d73d 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png index 2a1cb6d73d..5841bd1cb6 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png index 5841bd1cb6..c54abd6f99 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1) (1).png index c54abd6f99..8747726a89 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1) (1).png index 8747726a89..5becb92bd2 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1) (1).png b/docs/.gitbook/assets/image (15) (1) (1).png index 5becb92bd2..6be86e264f 100644 Binary files a/docs/.gitbook/assets/image (15) (1) (1).png and b/docs/.gitbook/assets/image (15) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (15) (1).png b/docs/.gitbook/assets/image (15) (1).png index 6be86e264f..3214cd8217 100644 Binary files a/docs/.gitbook/assets/image (15) (1).png and b/docs/.gitbook/assets/image (15) (1).png differ diff --git a/docs/.gitbook/assets/image (15).png b/docs/.gitbook/assets/image (15).png index 3214cd8217..b06244a85d 100644 Binary files a/docs/.gitbook/assets/image (15).png and b/docs/.gitbook/assets/image (15).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..a58d81b67f Binary files /dev/null and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a58d81b67f..2343a4f01c 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1).png index 2343a4f01c..5b7d7b1684 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1).png index 5b7d7b1684..31bb4bd6bc 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png index 31bb4bd6bc..b81ff6d1b9 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1) (1).png index b81ff6d1b9..92611a632a 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1) (1).png index 92611a632a..21580a41c7 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1) (1).png b/docs/.gitbook/assets/image (16) (1) (1).png index 21580a41c7..d43dc4ef78 100644 Binary files a/docs/.gitbook/assets/image (16) (1) (1).png and b/docs/.gitbook/assets/image (16) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (16) (1).png b/docs/.gitbook/assets/image (16) (1).png index d43dc4ef78..d9fd3d031a 100644 Binary files a/docs/.gitbook/assets/image (16) (1).png and b/docs/.gitbook/assets/image (16) (1).png differ diff --git a/docs/.gitbook/assets/image (16).png b/docs/.gitbook/assets/image (16).png index d9fd3d031a..8d4fb36b09 100644 Binary files a/docs/.gitbook/assets/image (16).png and b/docs/.gitbook/assets/image (16).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..224d756bae Binary files /dev/null and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1).png index 224d756bae..ab67751035 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1).png index ab67751035..8f0ea73e31 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1).png index 8f0ea73e31..321cd0a373 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png index 321cd0a373..7e6a0ea397 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1) (1).png index 7e6a0ea397..66c8fe51d1 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1) (1).png index 66c8fe51d1..10b31dfeab 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1) (1).png b/docs/.gitbook/assets/image (17) (1) (1).png index 10b31dfeab..69c34eb328 100644 Binary files a/docs/.gitbook/assets/image (17) (1) (1).png and b/docs/.gitbook/assets/image (17) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (17) (1).png b/docs/.gitbook/assets/image (17) (1).png index 69c34eb328..dd72c6f492 100644 Binary files a/docs/.gitbook/assets/image (17) (1).png and b/docs/.gitbook/assets/image (17) (1).png differ diff --git a/docs/.gitbook/assets/image (17).png b/docs/.gitbook/assets/image (17).png index dd72c6f492..8978233fa2 100644 Binary files a/docs/.gitbook/assets/image (17).png and b/docs/.gitbook/assets/image (17).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..c22c541248 Binary files /dev/null and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1).png index c22c541248..6261b08fac 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1).png index 6261b08fac..17aabc4241 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1).png index 17aabc4241..36d8a27655 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1).png index 36d8a27655..e380b09073 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1) (1).png index e380b09073..f5ed75ba4a 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1) (1).png index f5ed75ba4a..3b1559909d 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1) (1).png b/docs/.gitbook/assets/image (18) (1) (1).png index 3b1559909d..3f811938f0 100644 Binary files a/docs/.gitbook/assets/image (18) (1) (1).png and b/docs/.gitbook/assets/image (18) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (18) (1).png b/docs/.gitbook/assets/image (18) (1).png index 3f811938f0..eccd197118 100644 Binary files a/docs/.gitbook/assets/image (18) (1).png and b/docs/.gitbook/assets/image (18) (1).png differ diff --git a/docs/.gitbook/assets/image (18).png b/docs/.gitbook/assets/image (18).png index eccd197118..5d3e666250 100644 Binary files a/docs/.gitbook/assets/image (18).png and b/docs/.gitbook/assets/image (18).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..20f09e8a5b Binary files /dev/null and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1).png index 20f09e8a5b..8e79871b54 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1).png index 8e79871b54..e2176af57a 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1).png index e2176af57a..8a262f55ee 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1).png index 8a262f55ee..3cefe952d1 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1) (1).png index 3cefe952d1..dab58b339a 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1) (1).png index dab58b339a..c98bc0d193 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1) (1).png b/docs/.gitbook/assets/image (19) (1) (1).png index c98bc0d193..05913f0588 100644 Binary files a/docs/.gitbook/assets/image (19) (1) (1).png and b/docs/.gitbook/assets/image (19) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (19) (1).png b/docs/.gitbook/assets/image (19) (1).png index 05913f0588..75c45ec804 100644 Binary files a/docs/.gitbook/assets/image (19) (1).png and b/docs/.gitbook/assets/image (19) (1).png differ diff --git a/docs/.gitbook/assets/image (19).png b/docs/.gitbook/assets/image (19).png index 75c45ec804..c987358cdb 100644 Binary files a/docs/.gitbook/assets/image (19).png and b/docs/.gitbook/assets/image (19).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..75381204f2 Binary files /dev/null and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 75381204f2..9fc0c8426e 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 9fc0c8426e..00b72f5662 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 00b72f5662..003d493bc5 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 003d493bc5..6dbe4b9004 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 6dbe4b9004..600c763d47 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 600c763d47..fa3093c027 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index fa3093c027..165ea0128f 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 165ea0128f..a5ac75df9e 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a5ac75df9e..15e1d7a135 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 15e1d7a135..e902436b66 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index e902436b66..db8e8487be 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index db8e8487be..ba57f9d76b 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png index ba57f9d76b..3bb0367973 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png index 3bb0367973..2620dcfb7d 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png index 2620dcfb7d..7c8b624c1c 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png index 7c8b624c1c..ddceb5a332 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1) (1).png index ddceb5a332..e114d28ddd 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1) (1).png index e114d28ddd..a4af865679 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1).png index a4af865679..20393e47d1 100644 Binary files a/docs/.gitbook/assets/image (2) (1) (1).png and b/docs/.gitbook/assets/image (2) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (2) (1).png b/docs/.gitbook/assets/image (2) (1).png index 20393e47d1..eae7c8adfb 100644 Binary files a/docs/.gitbook/assets/image (2) (1).png and b/docs/.gitbook/assets/image (2) (1).png differ diff --git a/docs/.gitbook/assets/image (2).png b/docs/.gitbook/assets/image (2).png index eae7c8adfb..b25cf7a64e 100644 Binary files a/docs/.gitbook/assets/image (2).png and b/docs/.gitbook/assets/image (2).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..b1fdc88123 Binary files /dev/null and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1).png index b1fdc88123..4251798577 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1).png index 4251798577..737d3e9d74 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1).png index 737d3e9d74..f1c6b8e2b9 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1).png index f1c6b8e2b9..19dab6ad3b 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1) (1).png index 19dab6ad3b..1d3c3581de 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1) (1).png index 1d3c3581de..58bab52f95 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1) (1).png b/docs/.gitbook/assets/image (20) (1) (1).png index 58bab52f95..05913f0588 100644 Binary files a/docs/.gitbook/assets/image (20) (1) (1).png and b/docs/.gitbook/assets/image (20) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (20) (1).png b/docs/.gitbook/assets/image (20) (1).png index 05913f0588..5fa710fa1c 100644 Binary files a/docs/.gitbook/assets/image (20) (1).png and b/docs/.gitbook/assets/image (20) (1).png differ diff --git a/docs/.gitbook/assets/image (20).png b/docs/.gitbook/assets/image (20).png index 5fa710fa1c..ad2706b8c6 100644 Binary files a/docs/.gitbook/assets/image (20).png and b/docs/.gitbook/assets/image (20).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..aa9fe0a1f2 Binary files /dev/null and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1).png index aa9fe0a1f2..bae1670849 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1).png index bae1670849..0a8a52140f 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1).png index 0a8a52140f..0ea13eebf6 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1).png index 0ea13eebf6..3c6c856f15 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1) (1).png index 3c6c856f15..d4f5b663ea 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1) (1).png index d4f5b663ea..9dcf3bc40c 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1) (1).png b/docs/.gitbook/assets/image (21) (1) (1).png index 9dcf3bc40c..5d75b04a5f 100644 Binary files a/docs/.gitbook/assets/image (21) (1) (1).png and b/docs/.gitbook/assets/image (21) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (21) (1).png b/docs/.gitbook/assets/image (21) (1).png index 5d75b04a5f..1ed6c1a5d8 100644 Binary files a/docs/.gitbook/assets/image (21) (1).png and b/docs/.gitbook/assets/image (21) (1).png differ diff --git a/docs/.gitbook/assets/image (21).png b/docs/.gitbook/assets/image (21).png index 1ed6c1a5d8..e6c54ecaf4 100644 Binary files a/docs/.gitbook/assets/image (21).png and b/docs/.gitbook/assets/image (21).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..7eef7bc3bb Binary files /dev/null and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1).png index 7eef7bc3bb..bb474a8943 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1).png index bb474a8943..910ae7c838 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1).png index 910ae7c838..f80ea8a2af 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1).png index f80ea8a2af..b1015bccae 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1) (1).png index b1015bccae..7458f0ebc0 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1) (1).png index 7458f0ebc0..5615d3685f 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1) (1).png b/docs/.gitbook/assets/image (22) (1) (1).png index 5615d3685f..f73fec4945 100644 Binary files a/docs/.gitbook/assets/image (22) (1) (1).png and b/docs/.gitbook/assets/image (22) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (22) (1).png b/docs/.gitbook/assets/image (22) (1).png index f73fec4945..e661d5b9c5 100644 Binary files a/docs/.gitbook/assets/image (22) (1).png and b/docs/.gitbook/assets/image (22) (1).png differ diff --git a/docs/.gitbook/assets/image (22).png b/docs/.gitbook/assets/image (22).png index e661d5b9c5..41dabc8321 100644 Binary files a/docs/.gitbook/assets/image (22).png and b/docs/.gitbook/assets/image (22).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..876dfc0641 Binary files /dev/null and b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1).png index 876dfc0641..b98f7bf255 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1).png index b98f7bf255..a6d9a080e4 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1).png index a6d9a080e4..d11af7136c 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1) (1).png index d11af7136c..c6708b815f 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1) (1).png index c6708b815f..7d16abc476 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1) (1).png b/docs/.gitbook/assets/image (23) (1) (1).png index 7d16abc476..c4a439e16e 100644 Binary files a/docs/.gitbook/assets/image (23) (1) (1).png and b/docs/.gitbook/assets/image (23) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (23) (1).png b/docs/.gitbook/assets/image (23) (1).png index c4a439e16e..eb162ee823 100644 Binary files a/docs/.gitbook/assets/image (23) (1).png and b/docs/.gitbook/assets/image (23) (1).png differ diff --git a/docs/.gitbook/assets/image (23).png b/docs/.gitbook/assets/image (23).png index eb162ee823..995f8eae66 100644 Binary files a/docs/.gitbook/assets/image (23).png and b/docs/.gitbook/assets/image (23).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..5559c36c54 Binary files /dev/null and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1).png index 5559c36c54..18f8ae8509 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1).png index 18f8ae8509..dd61290ff3 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1).png index dd61290ff3..de0be0f821 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1).png index de0be0f821..8a415246e2 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1) (1).png index 8a415246e2..8f93783d39 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1) (1).png index 8f93783d39..9a28920b6d 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1) (1).png b/docs/.gitbook/assets/image (24) (1) (1).png index 9a28920b6d..e27fae5a72 100644 Binary files a/docs/.gitbook/assets/image (24) (1) (1).png and b/docs/.gitbook/assets/image (24) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (24) (1).png b/docs/.gitbook/assets/image (24) (1).png index e27fae5a72..5d6f7d6428 100644 Binary files a/docs/.gitbook/assets/image (24) (1).png and b/docs/.gitbook/assets/image (24) (1).png differ diff --git a/docs/.gitbook/assets/image (24).png b/docs/.gitbook/assets/image (24).png index 5d6f7d6428..7cbadaa3bc 100644 Binary files a/docs/.gitbook/assets/image (24).png and b/docs/.gitbook/assets/image (24).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..689d07fef5 Binary files /dev/null and b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1).png index 689d07fef5..8c9f3aa61c 100644 Binary files a/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1).png index 8c9f3aa61c..0da7af9828 100644 Binary files a/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (25) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1) (1) (1).png index 0da7af9828..2731635f91 100644 Binary files a/docs/.gitbook/assets/image (25) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (25) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1) (1).png index 2731635f91..a245a07938 100644 Binary files a/docs/.gitbook/assets/image (25) (1) (1) (1).png and b/docs/.gitbook/assets/image (25) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1) (1).png b/docs/.gitbook/assets/image (25) (1) (1).png index a245a07938..13a1690405 100644 Binary files a/docs/.gitbook/assets/image (25) (1) (1).png and b/docs/.gitbook/assets/image (25) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (25) (1).png b/docs/.gitbook/assets/image (25) (1).png index 13a1690405..5600aedd18 100644 Binary files a/docs/.gitbook/assets/image (25) (1).png and b/docs/.gitbook/assets/image (25) (1).png differ diff --git a/docs/.gitbook/assets/image (25).png b/docs/.gitbook/assets/image (25).png index 5600aedd18..83fdeaf37c 100644 Binary files a/docs/.gitbook/assets/image (25).png and b/docs/.gitbook/assets/image (25).png differ diff --git a/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..66508feb26 Binary files /dev/null and b/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1).png index 66508feb26..9f898a81a9 100644 Binary files a/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (26) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (26) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (26) (1) (1) (1) (1).png index 9f898a81a9..83c4dbe283 100644 Binary files a/docs/.gitbook/assets/image (26) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (26) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (26) (1) (1) (1).png b/docs/.gitbook/assets/image (26) (1) (1) (1).png index 83c4dbe283..d6c522a2eb 100644 Binary files a/docs/.gitbook/assets/image (26) (1) (1) (1).png and b/docs/.gitbook/assets/image (26) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (26) (1) (1).png b/docs/.gitbook/assets/image (26) (1) (1).png index d6c522a2eb..ebf503a6cb 100644 Binary files a/docs/.gitbook/assets/image (26) (1) (1).png and b/docs/.gitbook/assets/image (26) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (26) (1).png b/docs/.gitbook/assets/image (26) (1).png index ebf503a6cb..298da14f91 100644 Binary files a/docs/.gitbook/assets/image (26) (1).png and b/docs/.gitbook/assets/image (26) (1).png differ diff --git a/docs/.gitbook/assets/image (26).png b/docs/.gitbook/assets/image (26).png index 298da14f91..5df0984dc1 100644 Binary files a/docs/.gitbook/assets/image (26).png and b/docs/.gitbook/assets/image (26).png differ diff --git a/docs/.gitbook/assets/image (27) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (27) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..ade9ae13a4 Binary files /dev/null and b/docs/.gitbook/assets/image (27) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (27) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (27) (1) (1) (1) (1).png index ade9ae13a4..d7341b2c91 100644 Binary files a/docs/.gitbook/assets/image (27) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (27) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (27) (1) (1) (1).png b/docs/.gitbook/assets/image (27) (1) (1) (1).png index d7341b2c91..6e5f14d145 100644 Binary files a/docs/.gitbook/assets/image (27) (1) (1) (1).png and b/docs/.gitbook/assets/image (27) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (27) (1) (1).png b/docs/.gitbook/assets/image (27) (1) (1).png index 6e5f14d145..bc1a73983a 100644 Binary files a/docs/.gitbook/assets/image (27) (1) (1).png and b/docs/.gitbook/assets/image (27) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (27) (1).png b/docs/.gitbook/assets/image (27) (1).png index bc1a73983a..dc8a4463aa 100644 Binary files a/docs/.gitbook/assets/image (27) (1).png and b/docs/.gitbook/assets/image (27) (1).png differ diff --git a/docs/.gitbook/assets/image (27).png b/docs/.gitbook/assets/image (27).png index dc8a4463aa..457bd0f115 100644 Binary files a/docs/.gitbook/assets/image (27).png and b/docs/.gitbook/assets/image (27).png differ diff --git a/docs/.gitbook/assets/image (28) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (28) (1) (1) (1) (1).png new file mode 100644 index 0000000000..e683bcfad2 Binary files /dev/null and b/docs/.gitbook/assets/image (28) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (28) (1) (1) (1).png b/docs/.gitbook/assets/image (28) (1) (1) (1).png index e683bcfad2..a7be2db5b3 100644 Binary files a/docs/.gitbook/assets/image (28) (1) (1) (1).png and b/docs/.gitbook/assets/image (28) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (28) (1) (1).png b/docs/.gitbook/assets/image (28) (1) (1).png index a7be2db5b3..949d08d0c8 100644 Binary files a/docs/.gitbook/assets/image (28) (1) (1).png and b/docs/.gitbook/assets/image (28) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (28) (1).png b/docs/.gitbook/assets/image (28) (1).png index 949d08d0c8..5d773f51bd 100644 Binary files a/docs/.gitbook/assets/image (28) (1).png and b/docs/.gitbook/assets/image (28) (1).png differ diff --git a/docs/.gitbook/assets/image (28).png b/docs/.gitbook/assets/image (28).png index 5d773f51bd..49092dbf69 100644 Binary files a/docs/.gitbook/assets/image (28).png and b/docs/.gitbook/assets/image (28).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..ade9ae13a4 Binary files /dev/null and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index ade9ae13a4..ecebc76904 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index ecebc76904..13eea5a6ff 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 13eea5a6ff..2f623aff02 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 2f623aff02..734d730eba 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 734d730eba..7802b32b61 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 7802b32b61..fc06579210 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index fc06579210..6922c1ab59 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 6922c1ab59..0fa910aa12 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 0fa910aa12..24a4ee2b87 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 24a4ee2b87..48bb733f71 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 48bb733f71..6eb026900c 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 6eb026900c..f13482f011 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png index f13482f011..b7dcfd374f 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png index b7dcfd374f..1b07ee2ae6 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png index 1b07ee2ae6..18a0ec08ce 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png index 18a0ec08ce..cceb71af63 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1) (1).png index cceb71af63..fa8d279c2d 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1) (1).png index fa8d279c2d..68adf0ddac 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1) (1).png b/docs/.gitbook/assets/image (3) (1) (1).png index 68adf0ddac..26d101c0ff 100644 Binary files a/docs/.gitbook/assets/image (3) (1) (1).png and b/docs/.gitbook/assets/image (3) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (3) (1).png b/docs/.gitbook/assets/image (3) (1).png index 26d101c0ff..2fcf6e82b5 100644 Binary files a/docs/.gitbook/assets/image (3) (1).png and b/docs/.gitbook/assets/image (3) (1).png differ diff --git a/docs/.gitbook/assets/image (3).png b/docs/.gitbook/assets/image (3).png index 2fcf6e82b5..35a19d9810 100644 Binary files a/docs/.gitbook/assets/image (3).png and b/docs/.gitbook/assets/image (3).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..a3104c901a Binary files /dev/null and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a3104c901a..2a8cb2b6c6 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 2a8cb2b6c6..516fbdf12b 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 516fbdf12b..c98f9b2510 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index c98f9b2510..c9bac87ba7 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index c9bac87ba7..a7eb0f2070 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a7eb0f2070..f4a6551096 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index f4a6551096..256ec6229a 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 256ec6229a..e2f66df572 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index e2f66df572..0a1cdbd779 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png index 0a1cdbd779..5de7b397c9 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png index 5de7b397c9..717669fd7a 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png index 717669fd7a..6b23ce8c9b 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png index 6b23ce8c9b..d110e99002 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1) (1).png index d110e99002..6f893bfcf0 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1) (1).png index 6f893bfcf0..2e72c0d4e6 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1) (1).png b/docs/.gitbook/assets/image (4) (1) (1).png index 2e72c0d4e6..a2a22a0a82 100644 Binary files a/docs/.gitbook/assets/image (4) (1) (1).png and b/docs/.gitbook/assets/image (4) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (4) (1).png b/docs/.gitbook/assets/image (4) (1).png index a2a22a0a82..78915c7f6e 100644 Binary files a/docs/.gitbook/assets/image (4) (1).png and b/docs/.gitbook/assets/image (4) (1).png differ diff --git a/docs/.gitbook/assets/image (4).png b/docs/.gitbook/assets/image (4).png index 78915c7f6e..ff359e89cf 100644 Binary files a/docs/.gitbook/assets/image (4).png and b/docs/.gitbook/assets/image (4).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..8f2ac4204c Binary files /dev/null and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 8f2ac4204c..9f4f68ee19 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 9f4f68ee19..3e62b79545 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 3e62b79545..cbfa38ad80 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index cbfa38ad80..312e257bfb 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 312e257bfb..a93bf2eb41 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a93bf2eb41..321ae9e296 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 321ae9e296..ec4f469ece 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png index ec4f469ece..5de7b397c9 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png index 5de7b397c9..7bc8c43d4e 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png index 7bc8c43d4e..890d47406e 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png index 890d47406e..5ede63683c 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1) (1).png index 5ede63683c..938b112bec 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1) (1).png index 938b112bec..4c52175077 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1) (1).png b/docs/.gitbook/assets/image (5) (1) (1).png index 4c52175077..c6954eab4d 100644 Binary files a/docs/.gitbook/assets/image (5) (1) (1).png and b/docs/.gitbook/assets/image (5) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (5) (1).png b/docs/.gitbook/assets/image (5) (1).png index c6954eab4d..df8f143606 100644 Binary files a/docs/.gitbook/assets/image (5) (1).png and b/docs/.gitbook/assets/image (5) (1).png differ diff --git a/docs/.gitbook/assets/image (5).png b/docs/.gitbook/assets/image (5).png index df8f143606..3ab3c756e4 100644 Binary files a/docs/.gitbook/assets/image (5).png and b/docs/.gitbook/assets/image (5).png differ diff --git a/docs/.gitbook/assets/image (587).png b/docs/.gitbook/assets/image (587).png new file mode 100644 index 0000000000..ed09a3b83e Binary files /dev/null and b/docs/.gitbook/assets/image (587).png differ diff --git a/docs/.gitbook/assets/image (588).png b/docs/.gitbook/assets/image (588).png new file mode 100644 index 0000000000..ed09a3b83e Binary files /dev/null and b/docs/.gitbook/assets/image (588).png differ diff --git a/docs/.gitbook/assets/image (589).png b/docs/.gitbook/assets/image (589).png new file mode 100644 index 0000000000..11bb12bc30 Binary files /dev/null and b/docs/.gitbook/assets/image (589).png differ diff --git a/docs/.gitbook/assets/image (590).png b/docs/.gitbook/assets/image (590).png new file mode 100644 index 0000000000..25e11766ca Binary files /dev/null and b/docs/.gitbook/assets/image (590).png differ diff --git a/docs/.gitbook/assets/image (591).png b/docs/.gitbook/assets/image (591).png new file mode 100644 index 0000000000..f72a0a683e Binary files /dev/null and b/docs/.gitbook/assets/image (591).png differ diff --git a/docs/.gitbook/assets/image (592).png b/docs/.gitbook/assets/image (592).png new file mode 100644 index 0000000000..0faec8917b Binary files /dev/null and b/docs/.gitbook/assets/image (592).png differ diff --git a/docs/.gitbook/assets/image (593).png b/docs/.gitbook/assets/image (593).png new file mode 100644 index 0000000000..3e92494e78 Binary files /dev/null and b/docs/.gitbook/assets/image (593).png differ diff --git a/docs/.gitbook/assets/image (594).png b/docs/.gitbook/assets/image (594).png new file mode 100644 index 0000000000..3e92494e78 Binary files /dev/null and b/docs/.gitbook/assets/image (594).png differ diff --git a/docs/.gitbook/assets/image (595).png b/docs/.gitbook/assets/image (595).png new file mode 100644 index 0000000000..c37510e9d4 Binary files /dev/null and b/docs/.gitbook/assets/image (595).png differ diff --git a/docs/.gitbook/assets/image (596).png b/docs/.gitbook/assets/image (596).png new file mode 100644 index 0000000000..eec86a55f3 Binary files /dev/null and b/docs/.gitbook/assets/image (596).png differ diff --git a/docs/.gitbook/assets/image (597).png b/docs/.gitbook/assets/image (597).png new file mode 100644 index 0000000000..2110181d74 Binary files /dev/null and b/docs/.gitbook/assets/image (597).png differ diff --git a/docs/.gitbook/assets/image (598).png b/docs/.gitbook/assets/image (598).png new file mode 100644 index 0000000000..f3cf7dd925 Binary files /dev/null and b/docs/.gitbook/assets/image (598).png differ diff --git a/docs/.gitbook/assets/image (599).png b/docs/.gitbook/assets/image (599).png new file mode 100644 index 0000000000..8173123f1b Binary files /dev/null and b/docs/.gitbook/assets/image (599).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..deb83004f2 Binary files /dev/null and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index deb83004f2..a520be4d62 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index a520be4d62..0482b79d28 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 0482b79d28..cceb01b44c 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index cceb01b44c..cf1ad696cb 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index cf1ad696cb..068123ac5e 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 068123ac5e..1d6030a283 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 1d6030a283..5c5eb5d7c4 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png index 5c5eb5d7c4..86a001dbb8 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png index 86a001dbb8..0814763be9 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png index 0814763be9..e2ded72a20 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png index e2ded72a20..e5af6173e1 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1) (1).png index e5af6173e1..c28c9ea26e 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1) (1).png index c28c9ea26e..3aae40c63a 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1) (1).png b/docs/.gitbook/assets/image (6) (1) (1).png index 3aae40c63a..c7202e8c87 100644 Binary files a/docs/.gitbook/assets/image (6) (1) (1).png and b/docs/.gitbook/assets/image (6) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (6) (1).png b/docs/.gitbook/assets/image (6) (1).png index c7202e8c87..b228c8735f 100644 Binary files a/docs/.gitbook/assets/image (6) (1).png and b/docs/.gitbook/assets/image (6) (1).png differ diff --git a/docs/.gitbook/assets/image (6).png b/docs/.gitbook/assets/image (6).png index b228c8735f..f04cfe2d00 100644 Binary files a/docs/.gitbook/assets/image (6).png and b/docs/.gitbook/assets/image (6).png differ diff --git a/docs/.gitbook/assets/image (600).png b/docs/.gitbook/assets/image (600).png new file mode 100644 index 0000000000..8173123f1b Binary files /dev/null and b/docs/.gitbook/assets/image (600).png differ diff --git a/docs/.gitbook/assets/image (601).png b/docs/.gitbook/assets/image (601).png new file mode 100644 index 0000000000..b3de8124e3 Binary files /dev/null and b/docs/.gitbook/assets/image (601).png differ diff --git a/docs/.gitbook/assets/image (602).png b/docs/.gitbook/assets/image (602).png new file mode 100644 index 0000000000..f09b0e8899 Binary files /dev/null and b/docs/.gitbook/assets/image (602).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..fb6f48768f Binary files /dev/null and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index fb6f48768f..b96b872c04 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index b96b872c04..db3a31549d 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index db3a31549d..328dbe5d28 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 328dbe5d28..1d6030a283 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 1d6030a283..2dc002a320 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png index 2dc002a320..121cc176f0 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png index 121cc176f0..63c54419f0 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png index 63c54419f0..2a1e2eabaa 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png index 2a1e2eabaa..c3a6c6c817 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1) (1).png index c3a6c6c817..14944e8ce3 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1) (1).png index 14944e8ce3..30a3386f81 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1) (1).png b/docs/.gitbook/assets/image (7) (1) (1).png index 30a3386f81..ae9e55f417 100644 Binary files a/docs/.gitbook/assets/image (7) (1) (1).png and b/docs/.gitbook/assets/image (7) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (7) (1).png b/docs/.gitbook/assets/image (7) (1).png index ae9e55f417..a39af09fbc 100644 Binary files a/docs/.gitbook/assets/image (7) (1).png and b/docs/.gitbook/assets/image (7) (1).png differ diff --git a/docs/.gitbook/assets/image (7).png b/docs/.gitbook/assets/image (7).png index a39af09fbc..65b6282099 100644 Binary files a/docs/.gitbook/assets/image (7).png and b/docs/.gitbook/assets/image (7).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..cf5ee54e0f Binary files /dev/null and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index cf5ee54e0f..8a89d2ce97 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 8a89d2ce97..4cb77e5122 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 4cb77e5122..7ce0689f19 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png index 7ce0689f19..e3f0d5ca6d 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png index e3f0d5ca6d..763b7c022c 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png index 763b7c022c..7cbe9caf87 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png index 7cbe9caf87..a97ed89c48 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1) (1).png index a97ed89c48..5301501a82 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1) (1).png index 5301501a82..c62172bd83 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1) (1).png b/docs/.gitbook/assets/image (8) (1) (1).png index c62172bd83..c7122d3e43 100644 Binary files a/docs/.gitbook/assets/image (8) (1) (1).png and b/docs/.gitbook/assets/image (8) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (8) (1).png b/docs/.gitbook/assets/image (8) (1).png index c7122d3e43..a39af09fbc 100644 Binary files a/docs/.gitbook/assets/image (8) (1).png and b/docs/.gitbook/assets/image (8) (1).png differ diff --git a/docs/.gitbook/assets/image (8).png b/docs/.gitbook/assets/image (8).png index a39af09fbc..9082930fbe 100644 Binary files a/docs/.gitbook/assets/image (8).png and b/docs/.gitbook/assets/image (8).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 0000000000..0fcfa15665 Binary files /dev/null and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 0fcfa15665..61f6923bd1 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 61f6923bd1..cbc960c157 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index cbc960c157..0c5c5e9b8f 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png index 0c5c5e9b8f..0009e7ef1a 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png index 0009e7ef1a..cb0a3e109e 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png index cb0a3e109e..7b58c3ba8c 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png index 7b58c3ba8c..b3f426c81a 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png index b3f426c81a..3a442d27c7 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1) (1).png index 3a442d27c7..fc1a4d4786 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1) (1).png index fc1a4d4786..c62172bd83 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1) (1).png b/docs/.gitbook/assets/image (9) (1) (1).png index c62172bd83..641af999b0 100644 Binary files a/docs/.gitbook/assets/image (9) (1) (1).png and b/docs/.gitbook/assets/image (9) (1) (1).png differ diff --git a/docs/.gitbook/assets/image (9) (1).png b/docs/.gitbook/assets/image (9) (1).png index 641af999b0..aac3ecdc2f 100644 Binary files a/docs/.gitbook/assets/image (9) (1).png and b/docs/.gitbook/assets/image (9) (1).png differ diff --git a/docs/.gitbook/assets/image (9).png b/docs/.gitbook/assets/image (9).png index aac3ecdc2f..27e275ebce 100644 Binary files a/docs/.gitbook/assets/image (9).png and b/docs/.gitbook/assets/image (9).png differ diff --git a/docs/.gitbook/assets/image.png b/docs/.gitbook/assets/image.png index 49092dbf69..2c45093094 100644 Binary files a/docs/.gitbook/assets/image.png and b/docs/.gitbook/assets/image.png differ diff --git a/docs/.gitbook/assets/swagger (1) (1) (1) (1).yaml b/docs/.gitbook/assets/swagger (1) (1) (1) (1).yaml new file mode 100644 index 0000000000..26784dd621 --- /dev/null +++ b/docs/.gitbook/assets/swagger (1) (1) (1) (1).yaml @@ -0,0 +1,12210 @@ +openapi: 3.0.0 +paths: + /accounts/session: + get: + operationId: AccountApi_getSession + summary: Returns current session of the user. + description: Returns current user session. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_0 + - accounts + security: + - bearer: [] + /accounts/register: + post: + operationId: AccountApi_register + summary: Registers a new user account. + description: Object that contain username, password and role (optional) fields. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/login: + post: + operationId: AccountApi_login + summary: Logs user into the system. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/access-token: + post: + operationId: AccountApi_getAccessToken + summary: Returns access token. + description: Returns access token. + parameters: [] + responses: + '200': + description: Successful operation. + tags: *ref_0 + /accounts: + get: + operationId: AccountApi_getAllAccounts + summary: Returns a list of users, excluding Standard Registry and Auditors. + description: >- + Returns all users except those with roles Standard Registry and Auditor. + Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries: + get: + operationId: AccountApi_getStandatdRegistries + summary: Returns all Standard Registries. + description: Returns all Standard Registries. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries/aggregated: + get: + operationId: AccountApi_getAggregatedStandardRegistries + summary: Returns all Standard Registries aggregated with polices and vcDocuments. + description: Returns all Standard Registries aggregated with polices and vcDocuments + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AggregatedDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/balance: + get: + operationId: AccountApi_getBalance + summary: Returns user's Hedera account balance. + description: Requests current Hedera account balance. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/BalanceResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /analytics/search/policies: + post: + operationId: AnalyticsApi_searchPolicies + summary: Search policies. + description: >- + Search policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + policyId: '000000000000000000000000' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_1 + - analytics + security: + - bearerAuth: [] + /analytics/compare/policies: + post: + operationId: AnalyticsApi_comparePolicies + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ComparePoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules: + post: + operationId: AnalyticsApi_compareModules + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareModulesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas: + post: + operationId: AnalyticsApi_compareSchemas + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareSchemasDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents: + post: + operationId: AnalyticsApi_compareDocuments + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools: + post: + operationId: AnalyticsApi_compareTools + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareToolsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/policies/export: + post: + operationId: AnalyticsApi_comparePoliciesExport + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules/export: + post: + operationId: AnalyticsApi_compareModulesExport + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas/export: + post: + operationId: AnalyticsApi_compareSchemasExport + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents/export: + post: + operationId: AnalyticsApi_compareDocumentsExport + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools/export: + post: + operationId: AnalyticsApi_compareToolsExport + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/search/blocks: + post: + operationId: AnalyticsApi_searchBlocks + summary: Search same blocks. + description: >- + Search same blocks. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + uuid: '' + config: {} + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /artifacts: + get: + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{parentId}: + post: + operationId: ArtifactApi_uploadArtifacts + summary: Upload artifact. + description: Upload artifact. For users with the Standard Registry role only. + parameters: + - name: parentId + required: true + in: path + description: Parent ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ArtifactDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - artifacts + security: + - bearerAuth: [] + /artifacts/{artifactId}: + delete: + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /contracts: + get: + operationId: ContractsApi_getContracts + summary: Return a list of all contracts. + description: Returns all contracts. + parameters: + - name: type + required: false + in: query + description: Contract type + example: RETIRE + schema: + enum: + - WIPE + - RETIRE + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Contracts. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_2 + - contracts + security: + - bearer: [] + post: + operationId: ContractsApi_createContract + summary: Create contract. + description: >- + Create smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + responses: + '201': + description: Created contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/import: + post: + operationId: ContractsApi_importContract + summary: Import contract. + description: >- + Import smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contractId: + type: string + description: Hedera Identifier + example: 0.0.1 + description: + type: string + required: + - contractId + responses: + '200': + description: Imported contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/{contractId}/permissions: + get: + operationId: ContractsApi_contractPermissions + summary: Get contract permissions. + description: >- + Get smart-contract permissions. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Contract permissions. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/{contractId}: + delete: + operationId: ContractsApi_removeContract + summary: Remove contract. + description: >- + Remove smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests: + get: + operationId: ContractsApi_getWipeRequests + summary: Return a list of all wipe requests. + description: >- + Returns all wipe requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WiperRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests/enable: + post: + operationId: ContractsApi_enableWipeRequests + summary: Enable wipe requests. + description: >- + Enable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests/disable: + post: + operationId: ContractsApi_disableWipeRequests + summary: Disable wipe requests. + description: >- + Disable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveWipeRequest + summary: Approve wipe request. + description: >- + Approve wipe contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests/{requestId}/reject: + delete: + operationId: ContractsApi_rejectWipeRequest + summary: Reject wipe request. + description: >- + Reject wipe contract request. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: ban + required: false + in: query + description: Reject and ban + schema: + type: boolean + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests: + delete: + operationId: ContractsApi_clearWipeRequests + summary: Clear wipe requests. + description: >- + Clear wipe contract requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_wipeAddAdmin + summary: Add wipe admin. + description: >- + Add wipe contract admin. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/manager/{hederaId}: + post: + operationId: ContractsApi_wipeAddManager + summary: Add wipe manager. + description: >- + Add wipe contract manager. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveManager + summary: Remove wipe manager. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/wiper/{hederaId}: + post: + operationId: ContractsApi_wipeAddWiper + summary: Add wipe wiper. + description: >- + Add wipe contract wiper. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveWiper + summary: Remove wipe wiper. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/pools/sync: + post: + operationId: ContractsApi_retireSyncPools + summary: Sync retire pools. + description: >- + Sync retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Sync date. + content: + application/json: + schema: + $ref: '#/components/schemas/Date' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests: + get: + operationId: ContractsApi_getRetireRequests + summary: Return a list of all retire requests. + description: Returns all retire requests. + parameters: + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetireRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools: + get: + operationId: ContractsApi_getRetirePools + summary: Return a list of all retire pools. + description: Returns all retire pools. + parameters: + - name: tokens + required: false + in: query + description: Tokens + example: 0.0.1,0.0.2,0.0.3 + schema: + type: string + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/requests: + delete: + operationId: ContractsApi_clearRetireRequests + summary: Clear retire requests. + description: >- + Clear retire contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/pools: + delete: + operationId: ContractsApi_clearRetirePools + summary: Clear retire pools. + description: >- + Clear retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + post: + operationId: ContractsApi_setRetirePool + summary: Set retire pool. + description: >- + Set retire contract pool. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools/{poolId}: + delete: + operationId: ContractsApi_unsetRetirePool + summary: Unset retire pool. + description: >- + Unset retire contract pool. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: poolId + required: false + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}: + delete: + operationId: ContractsApi_unsetRetireRequest + summary: Unset retire request. + description: >- + Unset retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: false + in: path + description: Request Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools/{poolId}/retire: + post: + operationId: ContractsApi_retire + summary: Retire tokens. + description: Retire tokens. + parameters: + - name: poolId + required: false + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetireRequestTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveRetire + summary: Approve retire request. + description: >- + Approve retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}/cancel: + delete: + operationId: ContractsApi_cancelRetireRequest + summary: Cancel retire request. + description: Cancel retire contract request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_retireAddAdmin + summary: Add retire admin. + description: >- + Add retire contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_retireRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire: + get: + operationId: ContractsApi_getRetireVCs + summary: Return a list of all retire vcs. + description: Returns all retire vcs. + parameters: + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /demo/registered-users: + get: + operationId: DemoApi_registeredUsers + summary: Returns list of registered users. + description: Returns list of registered users. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredUsersDTO' + tags: + - demo + /demo/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/HederaAccount' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /demo/push/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + summary: Generates a new Hedera account with a random private key. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /external: + post: + tags: + - external + description: Sends data from an external source. + summary: Sends data from an external source. + requestBody: + description: Object that contains a VC Document. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalData' + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file: + post: + operationId: IpfsApi_postFile + summary: Add file from ipfs. + description: Add file from ipfs. + parameters: [] + responses: + '201': + description: '' + tags: + - ipfs + security: + - bearerAuth: [] + /ipfs/file/{cid}: + get: + tags: + - ipfs + description: Get file from ipfs. + summary: Get file from ipfs. + parameters: + - in: path + name: cid + schema: + type: string + required: true + description: File CID. + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + binary/octet-stream: + schema: + type: string + format: binary + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs: + post: + tags: + - logs + description: Returns logs. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + description: Log filters. + content: + application/json: + schema: + $ref: '#/components/schemas/LogFilters' + summary: Returns logs. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + totalCount: + type: number + logs: + $ref: '#/components/schemas/Log' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs/attributes: + get: + tags: + - logs + description: Returns logs attributes. For users with the Standard Registry role only. + parameters: + - in: query + name: name + schema: + type: string + description: Part of name. + - in: query + name: existingAttributes + schema: + type: array + items: + type: string + description: Attributes to exclude. + security: + - bearerAuth: [] + summary: Returns logs attributes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/key: + get: + tags: + - maps + description: Returns map api key. + security: + - bearerAuth: [] + summary: Returns map api key. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/sh: + get: + operationId: MapApi_getSentinelKey + parameters: [] + responses: + '200': + description: '' + tags: + - map + /metrics: + get: + operationId: MetricsApi_getMetrics + parameters: [] + responses: + '200': + description: '' + tags: + - metrics + /modules: + get: + tags: + - modules + description: >- + Returns all modules. Only users with the Standard Registry and Installer + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all modules. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - modules + description: >- + Creates a new module. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/schemas: + get: + operationId: ModulesApi_getModuleSchemas + parameters: [] + responses: + '200': + description: '' + tags: &ref_3 + - modules + post: + operationId: ModulesApi_postSchemas + parameters: [] + responses: + '201': + description: '' + tags: *ref_3 + /modules/{uuid}: + get: + tags: + - modules + description: >- + Retrieves module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Retrieves module configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - modules + description: >- + Updates module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates module configuration. + parameters: + - in: path + name: uuid + description: Selected module ID. + required: true + schema: + type: string + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - modules + description: >- + Deletes the module with the provided module ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Module ID. + security: + - bearerAuth: [] + summary: Deletes the module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/menu: + get: + tags: + - modules + description: >- + Returns modules menu. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of modules. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/file: + get: + tags: + - modules + description: >- + Returns a zip file containing the published module and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: >- + Return module and its artifacts in a zip file format for the specified + module. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/message: + get: + tags: + - modules + description: >- + Returns the Hedera message ID for the specified module published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: Imports new module from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new module from a zip file. + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message/preview: + post: + tags: + - modules + description: >- + Previews the module from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Module preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file/preview: + post: + tags: + - modules + description: >- + Previews the module from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Module preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/publish: + put: + tags: + - modules + description: >- + Publishes the module with the specified (internal) module ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Publishes the module onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/validate: + post: + tags: + - modules + description: >- + Validates selected module. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tools: + post: + operationId: ToolsApi_createNewTool + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_4 + - tools + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getTools + summary: Return a list of all tools. + description: >- + Returns all tools. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: false + in: query + description: The numbers of items to return + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + schema: + type: number + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push: + post: + operationId: ToolsApi_createNewToolAsync + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}: + delete: + operationId: ToolsApi_deleteTool + summary: >- + Deletes the tool with the provided tool ID. Only users with the Standard + Registry role are allowed to make the request. + description: Deletes the tool. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getToolById + summary: Retrieves tool configuration. + description: >- + Retrieves tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + put: + operationId: ToolsApi_updateTool + summary: Updates tool configuration. + description: >- + Updates tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/publish: + put: + operationId: ToolsApi_publishTool + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/push/publish: + put: + operationId: ToolsApi_publishToolAsync + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/validate: + post: + operationId: ToolsApi_validateTool + summary: Validates selected tool. + description: >- + Validates selected tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/export/file: + get: + operationId: ToolsApi_toolExportFile + summary: >- + Return tool and its artifacts in a zip file format for the specified + tool. + description: >- + Returns a zip file containing the published tool and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. Response zip file. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/export/message: + get: + operationId: ToolsApi_toolExportMessage + summary: Return Heder message ID for the specified published tool. + description: >- + Returns the Hedera message ID for the specified tool published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/message/preview: + post: + operationId: ToolsApi_toolImportMessagePreview + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/message: + post: + operationId: ToolsApi_toolImportMessage + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/file/preview: + post: + operationId: ToolsApi_toolImportFilePreview + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/file: + post: + operationId: ToolsApi_toolImportFile + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push/import/file: + post: + operationId: ToolsApi_toolImportFileAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push/import/message: + post: + operationId: ToolsApi_toolImportMessageAsync + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/menu/all: + get: + operationId: ToolsApi_getMenu + summary: Return a list of tools. + description: >- + Returns tools menu. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /profiles/{username}: + get: + operationId: ProfileApi_getProfile + summary: Returns user account info. + description: >- + Returns user account information. For users with the Standard Registry + role it also returns address book and VC document information. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the information + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_5 + - profiles + security: + - bearerAuth: [] + - bearer: [] + put: + operationId: ProfileApi_setUserProfile + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Created. + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/push/{username}: + put: + operationId: ProfileApi_setUserProfileAsync + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/{username}/balance: + get: + operationId: ProfileApi_getUserBalance + summary: Returns user's Hedera account balance. + description: >- + Requests Hedera account balance. Only users with the Installer role are + allowed to make the request. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the balance. + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/restore/{username}: + put: + operationId: ProfileApi_restoreUserProfile + summary: Restore user data (policy, DID documents, VC documents). + description: Restore user data (policy, DID documents, VC documents). + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/restore/topics/{username}: + put: + operationId: ProfileApi_restoreTopic + summary: List of available recovery topics. + description: List of available recovery topics. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/did-document/validate: + post: + operationId: ProfileApi_validateDidDocument + summary: Validate DID document format. + description: Validate DID document format. + parameters: [] + requestBody: + required: true + description: DID Document. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/did-keys/validate: + post: + operationId: ProfileApi_validateDidKeys + summary: Validate DID document keys. + description: Validate DID document keys. + parameters: [] + requestBody: + required: true + description: DID Document and keys. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentWithKeyDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidKeyStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /policies: + get: + tags: + - policies + description: >- + Returns all policies. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all policies. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/migrate-data: + post: + operationId: PolicyApi_migrateData + summary: Migrate policy data. + description: >- + Migrate policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '200': + description: Errors while migration. + content: + application/json: + schema: + type: array + items: + type: object + properties: + error: + type: string + id: + type: string + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_6 + - policies + security: + - bearerAuth: [] + /policies/push/migrate-data: + post: + operationId: PolicyApi_migrateDataAsync + summary: Migrate policy data asynchronous. + description: >- + Migrate policy data asynchronous. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '202': + description: Created task. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + /policies/push: + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}: + post: + operationId: PolicyApi_updatePolicyAsync + summary: '' + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + delete: + operationId: PolicyApi_deletePolicyAsync + parameters: [] + responses: + '202': + description: '' + tags: *ref_6 + security: + - bearerAuth: [] + /policies/{policyId}: + get: + tags: + - policies + description: >- + Retrieves policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves policy configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - policies + description: >- + Updates policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates policy configuration. + parameters: + - in: path + name: policyId + description: Selected policy ID. + required: true + schema: + type: string + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + summary: Publishes the policy onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + security: + - bearerAuth: [] + summary: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run: + put: + tags: + - policies + description: >- + Run policy without making any persistent changes or executing + transaction. Only users with the Standard Registry role are allowed to + make the request. + security: + - bearerAuth: [] + summary: Dry Run policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/discontinue: + put: + operationId: PolicyApi_discontinuePolicy + summary: Discontunue policy. + description: >- + Discontunue policy. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Discontinue details. + content: + application/json: + schema: + type: object + properties: + date: + type: date + responses: + '200': + description: Policies. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/draft: + put: + tags: + - policies + description: >- + Return policy to editing. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Return policy to editing. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/validate: + post: + tags: + - policies + description: >- + Validates selected policy. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/navigation: + get: + operationId: PolicyApi_getPolicyNavigation + summary: Returns a policy navigation. + description: Returns a policy navigation. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/groups: + get: + tags: + - policies + description: Returns a list of groups the user is a member of. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Returns a list of groups the user is a member of. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + uuid: + type: string + role: + type: string + groupLabel: + type: string + groupName: + type: string + active: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Makes the selected group active. if UUID is not set then returns the + user to the default state. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Makes the selected group active. + requestBody: + description: Selected group. + required: true + content: + application/json: + schema: + type: object + properties: + uuid: + type: string + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/documents: + get: + operationId: PolicyApi_getPolicyDocuments + summary: Get policy documents. + description: >- + Get policy documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: Page size. + schema: + type: number + - name: pageIndex + required: true + in: query + description: Page index. + schema: + type: number + - name: type + required: true + in: query + description: Document type. + schema: + enum: + - VC + - VP + type: string + - name: includeDocument + required: true + in: query + description: Include document field. + schema: + type: boolean + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Documents. + headers: + X-Total-Count: + description: Total documents count. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks: + get: + tags: + - policies + description: >- + Returns data from the root policy block. Only users with the Standard + Registry and Installer role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves data for the policy root block. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlock' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/blocks/{uuid}: + get: + tags: + - policies + description: >- + Requests block data. Only users with a role that described in block are + allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Requests block data. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Sends data to the specified block. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tagName}/blocks: + post: + operationId: PolicyApi_setBlocksByTagName + summary: Sends data to the specified block. + description: Sends data to the specified block. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + get: + operationId: PolicyApi_getBlocksByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/tag/{tagName}: + get: + operationId: PolicyApi_getBlockByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks/{uuid}/parents: + get: + operationId: PolicyApi_getBlockParents + parameters: [] + responses: + '200': + description: '' + tags: *ref_6 + /policies/{policyId}/export/file: + get: + tags: + - policies + description: >- + Returns a zip file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: >- + Return policy and its artifacts in a zip file format for the specified + policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/message: + get: + tags: + - policies + description: >- + Returns the Hedera message ID for the specified policy published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/xlsx: + get: + operationId: PolicyApi_getPolicyExportXlsx + summary: >- + Return policy and its artifacts in a xlsx file format for the specified + policy. + description: >- + Returns a xlsx file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Policy preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Previews the policy from IPFS without loading it into the local DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from a zip file. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file/preview: + post: + tags: + - policies + description: >- + Previews the policy from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Policy preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsx + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/push/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsxAsync + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/import/xlsx/preview: + post: + operationId: PolicyApi_importPolicyFromXlsxPreview + summary: Policy preview from a xlsx file. + description: >- + Previews the policy from a xlsx file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/blocks/about: + get: + operationId: PolicyApi_getBlockAbout + parameters: [] + responses: + '200': + description: '' + tags: *ref_6 + /policies/{policyId}/dry-run/users: + get: + tags: + - policies + description: >- + Returns all virtual users. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all virtual users. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/user: + post: + tags: + - policies + description: >- + Create a new virtual account. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Create a new virtual account. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/login: + post: + tags: + - policies + description: >- + Logs virtual user into the system. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Logs virtual user into the system. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Virtual user + required: true + content: + application/json: + schema: + type: object + properties: + did: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/restart: + post: + tags: + - policies + description: >- + Restarts the execution of the policy. Clear data in database. Only users + with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Restarts the execution of the policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/transactions: + get: + tags: + - policies + description: >- + Returns lists of virtual transactions. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual transactions. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + hederaAccountId: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/artifacts: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + owner: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/ipfs: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + documentURL: + type: string + document: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/multiple: + post: + tags: + - policies + description: >- + Creates a link between the current policy and the main policy. Or + creates a group making the current policy the main one. + security: + - bearerAuth: [] + summary: Creates Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Multi policy config. + required: true + content: + application/json: + schema: + type: object + required: + - mainPolicyTopicId + - synchronizationTopicId + properties: + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: Requests Multi policy config. + security: + - bearerAuth: [] + summary: Requests Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/methodologies/categories: + get: + operationId: PolicyApi_getPolicyCategoriesAsync + summary: Get all categories + description: Get all categories + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyCategoryDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + /policies/methodologies/search: + post: + operationId: PolicyApi_getPoliciesByCategory + summary: Get filtered policies + description: Get policies by categories and text + parameters: [] + requestBody: + required: true + description: Filters + content: + application/json: + schema: + type: string + examples: + Filter1: + value: + categoryIds: + - '000000000000000000000001' + - '000000000000000000000002' + text: abc + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + /schema/{schemaId}: + get: + tags: + - schema + description: Returns schema by schema ID. + security: + - bearerAuth: [] + summary: Returns schema by schema ID. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schema/{schemaId}/parents: + get: + operationId: SingleSchemaApi_getSchemaParents + summary: Returns all parent schemas. + description: Returns all parent schemas. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_7 + - schema + security: + - bearerAuth: [] + /schema/{schemaId}/tree: + get: + operationId: SingleSchemaApi_getSchemaTree + summary: Returns schema tree. + description: Returns schema tree. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + name: + type: string + type: + type: string + children: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /schemas: + get: + tags: + - schemas + description: Returns all schemas. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Create new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: Returns all schemas by topicId. + security: + - bearerAuth: [] + summary: Returns all schemas by topicId. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/type/{schemaType}: + get: + operationId: SchemaApi_getSchemaByType + summary: Finds the schema using the json document type. + description: Finds the schema using the json document type. + parameters: + - name: schemaType + required: true + in: path + description: Type + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_8 + - schemas + security: + - bearerAuth: [] + /schemas/list/all: + get: + operationId: SchemaApi_getAll + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas/list/sub: + get: + operationId: SchemaApi_getSub + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: category + required: false + in: query + description: Schema category + schema: + type: string + - name: topicId + required: false + in: query + description: Topic Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas/push/copy: + post: + operationId: SchemaApi_copySchemaAsync + summary: Copy schema. + description: >- + Copy schema. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Object that contains a valid schema. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearer: [] + - bearerAuth: [] + /schemas/push/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Create new schema. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/file/preview: + post: + tags: + - schemas + description: >- + Previews the schema from a zip file. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from a zip file. + requestBody: + description: A zip file containing the schema to be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/message: + post: + tags: + - schemas + description: >- + Returns Hedera message IDs of the published schemas, these messages + contain IPFS CIDs of these schema files. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: List Hedera message IDs of published schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportSchema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/file: + post: + tags: + - schemas + description: >- + Returns schema files for the schemas. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return zip file with schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{username}: + post: + tags: + - schemas + description: >- + Creates new system schema. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Creates new system schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: >- + Returns all system schemas by username. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all system schemas by username. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set. + examples: + pageIndex: + summary: Example of a pageIndex. + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The number of items to return. + examples: + pageSize: + summary: Example of a pageSize. + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total number of items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}/active: + put: + tags: + - schemas + description: >- + Makes the selected scheme active. Other schemes of the same type become + inactive. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/entity/{schemaEntity}: + get: + tags: + - schemas + description: Finds the schema using the schema type. + parameters: + - in: path + name: schemaEntity + schema: + type: string + enum: + - STANDARD_REGISTRY + - USER + - POLICY + - MINT_TOKEN + - WIPE_TOKEN + - MINT_NFTOKEN + required: true + description: schema type. + security: + - bearerAuth: [] + summary: Returns schema by schema type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/xlsx: + get: + operationId: SchemaApi_getPolicyExportXlsx + summary: Return schemas in a xlsx file format for the specified policy. + description: >- + Returns a xlsx file containing schemas. Only users with the Standard + Registry role are allowed to make the request. + parameters: + - name: schemaId + required: true + in: path + description: Schema ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsx + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/push/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsxAsync + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/import/xlsx/preview: + post: + operationId: SchemaApi_importPolicyFromXlsxPreview + summary: Previews the schema from a xlsx file. + description: >- + Previews the schema from a xlsx file. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/export/template: + get: + operationId: SchemaApi_exportTemplate + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /settings: + get: + tags: + - settings + description: >- + Returns current settings. For users with the Standard Registry role + only. + security: + - bearerAuth: [] + summary: Returns current settings. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - settings + description: Set settings. For users with the Standard Registry role only. + security: + - bearerAuth: [] + summary: Set settings. + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + /settings/environment: + get: + tags: + - settings + description: Returns current environment name. + security: + - bearerAuth: [] + summary: Returns current environment name. + responses: + '200': + description: Successful operation. + content: + text/plain: + schema: + type: string + example: testnet + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /settings/about: + get: + operationId: SettingsApi_getAbout + parameters: [] + responses: + '200': + description: '' + tags: + - settings + /tags: + post: + operationId: TagsApi_setTags + parameters: [] + responses: + '201': + description: '' + tags: + - tags + /tags/search: + post: + tags: + - tags + description: Search tags. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + oneOf: + - type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + target: + type: string + - type: object + required: + - entity + - targets + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + targets: + type: array + items: + type: string + examples: + Single: + value: + entity: PolicyDocument + target: targetId1 + Multiple: + value: + entity: PolicyDocument + targets: + - targetId1 + - targetId2 + summary: Search tags. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + description: a (targetId, Tags) map. `targetId1` is an example key + properties: + targetId1: + $ref: '#/components/schemas/TagMap' + additionalProperties: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/{uuid}: + delete: + tags: + - tags + description: Delete tag. + security: + - bearerAuth: [] + summary: Delete tag. + parameters: + - in: path + name: uuid + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: Tag identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/synchronization: + post: + tags: + - tags + description: synchronization. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: targetId + summary: synchronization. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas: + get: + tags: + - tags + description: Returns all schema. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tags + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}: + delete: + tags: + - tags + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Delete the schema. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - tags + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}/publish: + put: + tags: + - tags + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/published: + get: + tags: + - tags + description: Return a list of all published schemas. + security: + - bearerAuth: [] + summary: Return a list of all published schemas. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tasks/{taskId}: + get: + tags: + - tasks + description: Returns task statuses by Id. + security: + - bearerAuth: [] + summary: Returns task statuses. + parameters: + - in: path + name: taskId + schema: + type: string + required: true + description: Task ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskStatus' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens: + get: + tags: + - tokens + description: >- + Returns all tokens. For the Standard Registry role it returns only the + list of tokens, for other users it also returns token balances as well + as the KYC, Freeze, and Association statuses. Not allowed for the + Auditor role. + security: + - bearerAuth: [] + summary: Return a list of tokens. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push: + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}: + delete: + operationId: TokensApi_deleteTokenAsync + parameters: [] + responses: + '202': + description: '' + tags: &ref_9 + - tokens + /tokens/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associate the user with the provided Hedera token. + responses: + '202': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Disassociates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/info: + get: + tags: + - tokens + description: >- + Returns user information for the selected token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/serials: + get: + operationId: TokensApi_getTokenSerials + summary: Return token serials. + description: Returns token serials of current user. + parameters: + - name: tokenId + required: true + in: path + description: Token identifier + example: 0.0.1 + schema: + type: string + responses: + '200': + description: Token serials. + content: + application/json: + schema: + type: array + items: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearer: [] + /themes: + get: + tags: + - themes + description: Returns all themes. + security: + - bearerAuth: [] + summary: Return a list of all themes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - themes + description: Creates a new theme. + security: + - bearerAuth: [] + summary: Creates a new theme. + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}: + put: + tags: + - themes + description: Updates theme configuration for the specified theme ID. + summary: Updates theme configuration. + parameters: + - in: path + name: themeId + description: Selected theme ID. + required: true + schema: + type: string + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - themes + description: Deletes the theme with the provided theme ID. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Theme ID. + security: + - bearerAuth: [] + summary: Deletes the theme. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/import/file: + post: + tags: + - themes + description: Imports new theme from the provided zip file into the local DB. + security: + - bearerAuth: [] + summary: Imports new theme from a zip file. + requestBody: + description: A zip file that contains the theme to be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}/export/file: + get: + tags: + - themes + description: Returns a zip file containing the theme. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Selected theme ID. + security: + - bearerAuth: [] + summary: Returns a zip file containing the theme. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains: + get: + tags: + - trustchains + description: >- + Requests all VP documents. Only users with the Auditor role are allowed + to make the request. + security: + - bearerAuth: [] + summary: Returns a list of all VP documents. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + - in: query + name: policyId + schema: + type: string + description: Selected policy ID. + - in: query + name: policyOwner + schema: + type: string + description: Selected Standard Registry (DID). + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VerifiablePresentation' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains/{hash}: + get: + tags: + - trustchains + description: >- + Builds and returns a trustchain, from the VP to the root VC document. + Only users with the Auditor role are allowed to make the request. + parameters: + - in: path + name: hash + schema: + type: string + required: true + description: Hash or ID of a VP document. + security: + - bearerAuth: [] + summary: Returns a trustchain for a VP document. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TrustChains' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/policy: + post: + tags: + - wizard + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '201': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyId: + type: string + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/push/policy: + post: + operationId: WizardApi_setPolicyAsync + summary: Creates a new policy. + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + saveState: + type: boolean + wizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - wizard + /wizard/{policyId}/config: + post: + tags: + - wizard + description: >- + Get policy config by wizard. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier. + security: + - bearerAuth: [] + summary: Get policy config. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyConfig: + $ref: '#/components/schemas/PolicyConfig' + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /branding: + post: + operationId: BrandingApi_setBranding + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_10 + - branding + security: + - bearer: [] + get: + operationId: BrandingApi_getBranding + parameters: [] + responses: + '200': + description: '' + tags: *ref_10 + /suggestions: + post: + operationId: SuggestionsApi_policySuggestions + summary: Get next and nested suggested block types + description: >- + Get next and nested suggested block types. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsInputDTO' + responses: + '200': + description: >- + Successful operation. Suggested next and nested block types + respectively. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsOutputDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_11 + - suggestions + security: + - bearer: [] + - bearerAuth: [] + /suggestions/config: + post: + operationId: SuggestionsApi_setPolicySuggestionsConfig + summary: Set suggestions config + description: >- + Set suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + responses: + '201': + description: Successful operation. Response setted suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_11 + security: + - bearer: [] + - bearerAuth: [] + get: + operationId: SuggestionsApi_getPolicySuggestionsConfig + summary: Get suggestions config + description: >- + Get suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. Response suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_11 + security: + - bearer: [] + - bearerAuth: [] + /notifications: + get: + operationId: NotificationsApi_getAllNotifications + summary: Get all notifications + description: Returns all notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications and count. + headers: + X-Total-Count: + description: Count of notifications + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_12 + - notifications + security: + - bearer: [] + - bearerAuth: [] + /notifications/new: + get: + operationId: NotificationsApi_getNewNotifications + summary: Get new notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns new notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/progresses: + get: + operationId: NotificationsApi_getProgresses + summary: Get progresses + description: Returns progresses. + parameters: [] + responses: + '200': + description: Successful operation. Returns progresses. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProgressDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/read/all: + post: + operationId: NotificationsApi_readAll + summary: Read all notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/delete/{notificationId}: + delete: + operationId: NotificationsApi_delete + summary: Delete notifications up to this point + description: Returns deleted notifications count. + parameters: + - name: notificationId + required: true + in: path + schema: + type: string + responses: + '200': + description: Successful operation. Returns deleted notifications count. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /projects/search: + post: + operationId: ProjectsAPI_projectSearch + summary: Search projects + description: Search projects by filters + parameters: [] + requestBody: + required: true + description: The question of choosing a methodology + content: + application/json: + schema: + type: string + examples: + q: + value: >- + What methodology can I use for production of electricity using + renewable energy technologies? + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProjectDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_13 + - projects + /projects/compare/documents: + post: + operationId: ProjectsAPI_compareDocuments + summary: Compare documents. + description: Compare documents. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + /projects/properties: + get: + operationId: ProjectsAPI_getPolicyProperties + summary: Get all properties + description: Get all properties + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PropertiesDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + /record/{policyId}/status: + get: + operationId: RecordApi_getRecordStatus + summary: Get recording or running status. + description: >- + Get recording or running status. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RecordStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_14 + - record + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/start: + post: + operationId: RecordApi_startRecord + summary: Start recording. + description: >- + Start recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/stop: + post: + operationId: RecordApi_stopRecord + summary: Stop recording. + description: >- + Stop recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/actions: + get: + operationId: RecordApi_getRecordActions + summary: Get recorded actions. + description: >- + Get recorded actions. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecordActionDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/start: + post: + operationId: RecordApi_runRecord + summary: Run record from a zip file. + description: >- + Run record from a zip file. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A zip file containing record to be run. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/stop: + post: + operationId: RecordApi_stopRunning + summary: Stop running. + description: >- + Stop running. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/results: + get: + operationId: RecordApi_getRecordResults + summary: Get running results. + description: >- + Get running results. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningResultDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/details: + get: + operationId: RecordApi_getRecordDetails + summary: Get running details. + description: >- + Get running details. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningDetailsDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/fast-forward: + post: + operationId: RecordApi_fastForward + summary: Fast Forward. + description: >- + Fast Forward. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/retry: + post: + operationId: RecordApi_retryStep + summary: Retry step. + description: >- + Retry step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/skip: + post: + operationId: RecordApi_skipStep + summary: Skip step. + description: >- + Skip step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /ai-suggestions/ask: + get: + operationId: AISuggestionsAPI_getAIAnswer + summary: Get methodology suggestion + description: Returns AI response to the current question + parameters: + - name: q + required: true + in: path + description: The question of choosing a methodology + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_15 + - ai-suggestions + /ai-suggestions/rebuild-vector: + put: + operationId: AISuggestionsAPI_rebuildVector + summary: Rebuild AI vector + description: Rebuilds vector based on policy data in the DB + parameters: [] + responses: + '200': + description: '' + tags: *ref_15 + /schemas/type/{type}: + get: + tags: + - schemas + description: Finds the schema using the json document type. + parameters: + - in: path + name: type + schema: + type: string + required: true + description: JSON type. + security: + - bearerAuth: [] + summary: Returns schema by type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}: + get: + tags: + - policies + description: >- + Requests block ID from a policy by tag. Only users with the Standard + Registry and Installer roles are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + summary: Requests block ID from a policy by tag. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + id: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}/blocks: + post: + tags: + - policies + description: Sends data to the specified block. + security: + - bearerAuth: [] + summary: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + security: + - bearerAuth: [] + summary: Requests block data. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/: + post: + tags: + - ipfs + description: Add file to ipfs. + summary: Add file to ipfs. + requestBody: + description: Data array of file. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + application/json: + schema: + description: CID of added file. + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{policyId}: + post: + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact: + get: + deprecated: true + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{policyId}: + post: + deprecated: true + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{artifactId}: + delete: + deprecated: true + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/: + post: + tags: + - tags + description: Creates new tag. + security: + - bearerAuth: [] + summary: Creates new tag. + requestBody: + description: Object that contains tag information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +info: + title: Guardian + description: >- + The Guardian is a modular open-source solution that includes best-in-class + identity management and decentralized ledger technology (DLT) libraries. At + the heart of the Guardian solution is a sophisticated Policy Workflow Engine + (PWE) that enables applications to offer a requirements-based tokenization + implementation. + version: 2.21.1 + contact: + name: API developer + url: https://envisionblockchain.com + email: info@envisionblockchain.com + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +tags: [] +servers: + - url: /api/v1 + description: version 1.0 +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + AccountsResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + did: + type: string + required: + - username + - role + - did + InternalServerErrorDTO: + type: object + properties: + code: + type: number + message: + type: string + required: + - code + - message + RegisterUserDTO: + type: object + properties: + username: + type: string + password: + type: string + password_confirmation: + type: string + role: + type: string + required: + - username + - password + - password_confirmation + - role + AccountsSessionResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + accessToken: + type: string + required: + - username + - role + - accessToken + LoginUserDTO: + type: object + properties: + username: + type: string + password: + type: string + required: + - username + - password + CredentialSubjectDTO: + type: object + properties: + geography: + type: string + law: + type: string + tags: + type: string + ISIC: + type: string + '@context': + type: array + items: + type: string + id: + type: string + type: + type: string + required: + - geography + - law + - tags + - ISIC + - '@context' + - id + - type + ProofDTO: + type: object + properties: + type: + type: string + created: + format: date-time + type: string + verificationMethod: + type: string + proofPurpose: + type: string + jws: + type: string + required: + - type + - created + - verificationMethod + - proofPurpose + - jws + VcDocumentDTO: + type: object + properties: + id: + type: string + type: + type: array + items: + type: string + issuer: + type: string + issuanceDate: + format: date-time + type: string + '@context': + type: array + items: + type: string + credentialSubject: + $ref: '#/components/schemas/CredentialSubjectDTO' + proof: + $ref: '#/components/schemas/ProofDTO' + required: + - id + - type + - issuer + - issuanceDate + - '@context' + - credentialSubject + - proof + PolicyDTO: + type: object + properties: + _id: + type: string + createDate: + format: date-time + type: string + uuid: + type: string + name: + type: string + description: + type: string + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + policyTag: + type: string + codeVersion: + type: string + userRoles: + type: array + items: + type: string + userGroups: + type: array + items: + type: string + userRole: + type: string + userGroup: + type: string + id: + type: string + required: + - _id + - createDate + - uuid + - name + - description + - status + - creator + - owner + - topicId + - policyTag + - codeVersion + - userRoles + - userGroups + - userRole + - userGroup + - id + AggregatedDTOItem: + type: object + properties: + did: + type: string + hederaAccountId: + type: string + vcDocument: + $ref: '#/components/schemas/VcDocumentDTO' + policies: + $ref: '#/components/schemas/PolicyDTO' + required: + - did + - hederaAccountId + - vcDocument + - policies + UserDTO: + type: object + properties: + username: + type: string + did: + type: string + required: + - username + - did + BalanceResponseDTO: + type: object + properties: + balance: + type: number + unit: + type: string + user: + $ref: '#/components/schemas/UserDTO' + required: + - balance + - unit + - user + FilterSearchPoliciesDTO: + type: object + properties: + policyId: + type: string + required: + - policyId + SearchPoliciesDTO: + type: object + properties: + target: + type: object + result: + type: object + required: + - target + - result + FilterPoliciesDTO: + type: object + properties: + policyId1: + type: string + policyId2: + type: string + policyIds: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - policyId1 + - policyId2 + - policyIds + - eventsLvl + - propLvl + - childrenLvl + - idLvl + ComparePoliciesDTO: + type: object + properties: + blocks: + type: object + groups: + type: object + left: + type: object + right: + type: object + roles: + type: object + tokens: + type: object + topics: + type: object + total: + type: object + required: + - blocks + - groups + - left + - right + - roles + - tokens + - topics + - total + FilterModulesDTO: + type: object + properties: + moduleId1: + type: string + moduleId2: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - moduleId1 + - moduleId2 + - eventsLvl + - propLvl + - childrenLvl + - idLvl + CompareModulesDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + FilterSchemasDTO: + type: object + properties: + schemaId1: + type: string + schemaId2: + type: string + idLvl: + type: number + required: + - schemaId1 + - schemaId2 + - idLvl + CompareSchemasDTO: + type: object + properties: + fields: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - fields + - left + - right + - total + FilterDocumentsDTO: + type: object + properties: + documentId1: + type: string + documentId2: + type: string + documentIds: + type: string + required: + - documentId1 + - documentId2 + - documentIds + CompareDocumentsDTO: + type: object + properties: + documents: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - documents + - left + - right + - total + FilterToolsDTO: + type: object + properties: + toolId1: + type: string + toolId2: + type: string + toolIds: + type: string + required: + - toolId1 + - toolId2 + - toolIds + CompareToolsDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + ArtifactDTOItem: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + required: + - id + - name + - uuid + - extention + - type + ContractDTO: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + permissions: + type: number + topicId: + type: string + type: + type: string + enum: + - WIPE + - RETIRE + syncRequestsDate: + format: date-time + type: string + syncPoolsDate: + format: date-time + type: string + lastSyncEventTimeStamp: + type: string + wipeContractIds: + type: array + items: + type: string + required: + - id + - contractId + - description + - owner + - permissions + - topicId + - type + - syncRequestsDate + - syncPoolsDate + - lastSyncEventTimeStamp + - wipeContractIds + WiperRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + user: + type: string + required: + - id + - contractId + - user + RetireRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + user: + type: string + required: + - id + - contractId + - tokens + - tokenIds + - user + Date: + type: object + properties: {} + RetirePoolDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + contract: + type: string + count: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + immediately: + type: boolean + enabled: + type: boolean + required: + - id + - contractId + - tokens + - tokenIds + - immediately + - enabled + RetirePoolTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + required: + - token + - count + RetireRequestTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: string + required: + - token + - count + - serials + ProfileDTO: + type: object + properties: + username: + type: string + nullable: false + role: + type: string + nullable: false + did: + type: string + nullable: true + parent: + type: string + nullable: true + hederaAccountId: + type: string + nullable: true + confirmed: + type: boolean + nullable: true + failed: + type: boolean + nullable: true + topicId: + type: string + nullable: true + parentTopicId: + type: string + nullable: true + didDocument: + type: object + nullable: true + vcDocument: + type: object + nullable: true + required: + - username + - role + SubjectDTO: + type: object + properties: + '@context': + nullable: true + type: array + items: + type: string + id: + type: string + nullable: true + type: + type: string + nullable: true + required: + - '@context' + DidDocumentDTO: + type: object + properties: + id: + type: string + nullable: false + context: + nullable: true + type: array + items: + type: string + alsoKnownAs: + nullable: true + type: array + items: + type: string + controller: + nullable: true + type: array + items: + type: string + verificationMethod: + nullable: true + type: array + items: + type: object + authentication: + nullable: true + type: array + items: + type: object + assertionMethod: + nullable: true + type: array + items: + type: object + keyAgreement: + nullable: true + type: array + items: + type: object + capabilityInvocation: + nullable: true + type: array + items: + type: object + capabilityDelegation: + nullable: true + type: array + items: + type: object + service: + nullable: true + type: array + items: + type: object + required: + - id + - context + - alsoKnownAs + - controller + - verificationMethod + - authentication + - assertionMethod + - keyAgreement + - capabilityInvocation + - capabilityDelegation + - service + DidKeyDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + required: + - id + - key + CredentialsDTO: + type: object + properties: + entity: + type: string + nullable: false + hederaAccountId: + type: string + nullable: false + hederaAccountKey: + type: string + nullable: false + parent: + type: string + nullable: true + vcDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/SubjectDTO' + didDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + didKeys: + nullable: true + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - entity + - hederaAccountId + - hederaAccountKey + TaskDTO: + type: object + properties: + taskId: + type: string + expectation: + type: number + required: + - taskId + - expectation + DidDocumentStatusDTO: + type: object + properties: + valid: + type: boolean + nullable: false + error: + type: string + nullable: true + didDocument: + type: object + nullable: false + required: + - valid + - error + - didDocument + DidDocumentWithKeyDTO: + type: object + properties: + document: + nullable: false + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + keys: + nullable: false + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - document + - keys + DidKeyStatusDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + valid: + type: boolean + nullable: false + required: + - id + - key + - valid + MigrationConfigPoliciesDTO: + type: object + properties: + src: + type: string + dst: + type: string + required: + - src + - dst + MigrationConfigDTO: + type: object + properties: + policies: + $ref: '#/components/schemas/MigrationConfigPoliciesDTO' + vcs: + type: array + items: + type: string + vps: + type: array + items: + type: string + schemas: + type: object + groups: + type: object + roles: + type: object + required: + - policies + - vcs + - vps + - schemas + - groups + - roles + PolicyCategoryDTO: + type: object + properties: + id: + type: string + name: + type: string + type: + type: string + required: + - id + - name + - type + SchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + entity: + type: string + document: + type: string + uuid: + type: string + iri: + type: string + hash: + type: string + status: + type: string + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - entity + - document + - uuid + - iri + - hash + - status + - topicId + - version + - owner + - messageId + VersionSchemaDTO: + type: object + properties: + version: + type: string + required: + - version + MessageSchemaDTO: + type: object + properties: + messageId: + type: string + required: + - messageId + ExportSchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - version + - owner + - messageId + SystemSchemaDTO: + type: object + properties: + name: + type: string + entity: + type: string + required: + - name + - entity + SettingsDTO: + type: object + properties: + ipfsStorageApiKey: + type: string + operatorId: + type: string + operatorKey: + type: string + required: + - ipfsStorageApiKey + - operatorId + - operatorKey + SuggestionsInputDTO: + type: object + properties: + blockType: + type: string + children: + nullable: true + type: array + items: + type: object + required: + - blockType + - children + SuggestionsOutputDTO: + type: object + properties: + next: + type: string + nested: + type: string + required: + - next + - nested + SuggestionsConfigItemDTO: + type: object + properties: + id: + type: string + type: + type: string + enum: + - Policy + - Module + index: + type: number + required: + - id + - type + - index + SuggestionsConfigDTO: + type: object + properties: + items: + $ref: '#/components/schemas/SuggestionsConfigItemDTO' + required: + - items + NotificationDTO: + type: object + properties: + title: + type: string + message: + type: string + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + action: + type: string + enum: + - POLICY_CONFIGURATION + - POLICY_VIEW + - POLICIES_PAGE + - SCHEMAS_PAGE + - TOKENS_PAGE + - PROFILE_PAGE + result: + type: object + read: + type: boolean + old: + type: boolean + required: + - title + - message + - type + - action + - result + - read + - old + ProgressDTO: + type: object + properties: + action: + type: string + message: + type: string + progress: + type: number + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + taskId: + type: string + required: + - action + - message + - progress + - type + - taskId + ProjectDTO: + type: object + properties: + id: + type: string + policyId: + type: string + policyName: + type: string + registered: + type: string + title: + type: string + companyName: + type: string + sectoralScope: + type: string + required: + - id + - policyId + - policyName + - registered + - title + - companyName + - sectoralScope + PropertiesDTO: + type: object + properties: + id: + type: string + title: + type: string + value: + type: string + required: + - id + - title + - value + RecordStatusDTO: + type: object + properties: + type: + type: string + policyId: + type: string + uuid: + type: string + status: + type: string + required: + - type + - policyId + - uuid + - status + Object: + type: object + properties: {} + RecordActionDTO: + type: object + properties: + uuid: + type: string + policyId: + type: string + method: + type: string + action: + type: string + time: + type: string + user: + type: string + target: + type: string + required: + - uuid + - policyId + - method + - action + - time + - user + - target + ResultInfoDTO: + type: object + properties: + tokens: + type: number + documents: + type: number + required: + - tokens + - documents + ResultDocumentDTO: + type: object + properties: + type: + type: string + schema: + type: string + rate: + type: string + documents: + type: object + required: + - type + - schema + - rate + - documents + RunningResultDTO: + type: object + properties: + info: + $ref: '#/components/schemas/ResultInfoDTO' + total: + type: number + documents: + $ref: '#/components/schemas/ResultDocumentDTO' + required: + - info + - total + - documents + RunningDetailsDTO: + type: object + properties: + left: + type: object + right: + type: object + total: + type: number + documents: + type: object + required: + - left + - right + - total + - documents + ToolDTO: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + required: + - id + - uuid + - name + - description + - config + - status + - creator + - owner + - topicId + - messageId + - codeVersion + - createDate + RegisteredUsersDTO: + type: object + properties: + username: + type: string + did: + type: string + parent: + type: string + role: + type: string + policyRoles: + type: array + items: + type: string + required: + - username + - did + - parent + - role + - policyRoles + Credentials: + type: object + required: + - username + - password + properties: + username: + type: string + password: + type: string + Account: + type: object + required: + - username + - role + properties: + username: + type: string + role: + type: string + did: + type: string + Session: + type: object + required: + - username + - role + - accessToken + properties: + username: + type: string + role: + type: string + accessToken: + type: string + User: + type: object + required: + - username + - role + properties: + confirmed: + type: string + failed: + type: string + username: + type: string + role: + type: string + hederaAccountId: + type: string + hederaAccountKey: + type: string + did: + type: string + didDocument: + type: object + vcDocument: + type: object + parent: + type: string + topicId: + type: string + Schema: + type: object + required: + - id + - name + - description + - entity + - document + properties: + id: + type: string + iri: + type: string + uuid: + type: string + name: + type: string + description: + type: string + entity: + type: string + hash: + type: string + status: + type: string + document: + oneOf: + - type: string + - type: object + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + ImportSchema: + type: object + required: + - schemes + properties: + schemes: + type: array + items: + type: object + required: + - document + - entity + - name + - uuid + properties: + document: + type: string + entity: + type: string + hash: + type: string + name: + type: string + uuid: + type: string + ExportSchema: + type: object + required: + - ids + properties: + name: + type: string + version: + type: string + messageId: + type: string + Token: + type: object + required: + - changeSupply + - decimals + - enableAdmin + - enableKYC + - enableFreeze + - enableWipe + - initialSupply + - tokenName + - tokenSymbol + - tokenType + properties: + changeSupply: + type: boolean + decimals: + type: string + enableAdmin: + type: boolean + enableFreeze: + type: boolean + enableKYC: + type: boolean + enableWipe: + type: boolean + initialSupply: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + TokenInfo: + type: object + required: + - id + - tokenId + - tokenName + - tokenSymbol + - tokenType + - decimals + - associated + - balance + - frozen + - kyc + properties: + id: + type: string + tokenId: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + decimals: + type: string + associated: + type: boolean + balance: + type: string + frozen: + type: boolean + kyc: + type: boolean + enableAdmin: + type: boolean + enableKYC: + type: boolean + enableFreeze: + type: boolean + enableWipe: + type: boolean + PolicyConfig: + type: object + required: + - name + - version + - description + - topicDescription + - config + - topicId + - policyTag + properties: + id: + type: string + uuid: + type: string + name: + type: string + version: + type: string + description: + type: string + topicDescription: + type: string + config: + type: object + status: + type: string + owner: + type: string + policyRoles: + type: array + items: + type: string + topicId: + type: string + policyTag: + type: string + policyTopics: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + type: + type: string + static: + type: boolean + TrustChains: + type: object + required: + - chain + - userMap + properties: + chain: + type: array + items: + type: object + required: + - id + - type + - tag + - label + - schema + - owner + - document + properties: + id: + type: string + type: + type: string + tag: + type: string + label: + type: string + schema: + type: string + owner: + type: string + document: + type: object + userMap: + type: array + items: + type: object + required: + - did + - username + properties: + did: + type: string + username: + type: string + VerifiablePresentation: + type: object + required: + - hash + - id + - policyId + - signature + - status + - tag + - type + - updateDate + - createDate + - owner + - document + properties: + hash: + type: string + id: + type: string + policyId: + type: string + signature: + type: string + status: + type: string + tag: + type: string + type: + type: string + updateDate: + type: string + createDate: + type: string + owner: + type: string + document: + type: object + PublishPolicy: + type: object + required: + - errors + - isValid + - policies + properties: + errors: + type: array + items: + type: object + isValid: + type: boolean + policies: + type: array + items: + type: object + ValidatePolicy: + type: object + required: + - config + - results + properties: + config: + type: object + results: + type: object + PolicyBlock: + type: object + required: + - id + - blockType + - isActive + - uiMetaData + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + blocks: + type: array + items: + type: object + PolicyBlockData: + type: object + required: + - id + - isActive + - uiMetaData + - data + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + data: + type: object + fields: + type: array + items: + type: object + index: + type: number + roles: + type: array + items: + type: string + blocks: + type: array + items: + $ref: '#/components/schemas/PolicyBlock' + ExportPolicy: + type: object + required: + - name + - version + - messageId + properties: + name: + type: string + version: + type: string + tokens: + type: string + PreviewPolicy: + type: object + required: + - policy + - schemas + - tokens + properties: + policy: + type: object + schemas: + type: array + items: + type: object + tokens: + type: array + items: + type: object + Error: + type: object + required: + - code + - message + properties: + code: + type: number + message: + type: string + ExternalData: + type: object + required: + - owner + - policyTag + - document + properties: + owner: + type: string + policyTag: + type: string + document: + type: object + HederaAccount: + type: object + required: + - id + - key + properties: + id: + type: string + key: + type: string + CommonSettings: + type: object + properties: + operatorId: + type: string + operatorKey: + type: string + nftApiKey: + deprecated: true + type: string + ipfsStorageApiKey: + type: string + LogFilters: + type: object + properties: + type: + type: string + startDate: + type: string + endDate: + type: string + attributes: + type: array + items: + type: string + message: + type: string + pageSize: + type: number + pageIndex: + type: number + sortDirection: + type: string + enum: + - ASC + - DESC + Log: + type: object + properties: + type: + type: string + datetime: + type: string + message: + type: string + attributes: + type: array + items: + type: string + Task: + type: object + properties: + taskId: + type: string + expectation: + type: number + TaskStatus: + type: object + properties: + date: + type: string + name: + type: string + statuses: + type: array + items: + type: object + properties: + type: + type: string + message: + type: string + result: + type: object + error: + type: object + Artifact: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + MultiPolicyConfig: + type: object + properties: + id: + type: string + uuid: + type: string + owner: + type: string + type: + type: string + instanceTopicId: + type: string + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + policyOwner: + type: string + user: + type: string + Contract: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + isOwnerCreator: + type: string + status: + type: string + RetireRequest: + type: object + properties: + id: + type: string + contractId: + type: string + baseTokenId: + type: string + owner: + type: string + oppositeTokenId: + type: string + baseTokenCount: + type: number + oppositeTokenCount: + type: number + Module: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + type: + type: string + PreviewModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + ExportModule: + type: object + properties: + uuid: + type: string + name: + type: string + description: + type: string + messageId: + type: string + owner: + type: string + PublishModule: + type: object + properties: + errors: + type: object + isValid: + type: boolean + module: + $ref: '#/components/schemas/Module' + ValidateModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + results: + type: object + Tag: + type: object + required: + - name + - entity + - localTarget + properties: + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Tag label + description: + type: string + example: Description + owner: + type: string + example: did + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: '0000000000.000000000' + localTarget: + type: string + example: db id + status: + type: string + enum: + - Draft + - Published + - History + example: Published + operation: + type: string + enum: + - Create + - Delete + example: Create + date: + type: string + example: '1900-01-01T00:00:00.000Z' + topicId: + type: string + example: 0.0.0000000 + messageId: + type: string + example: '0000000000.000000000' + policyId: + type: string + example: db id + uri: + type: string + example: document uri + document: + type: object + TagMap: + type: object + required: + - entity + - target + - refreshDate + - tags + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: db id + refreshDate: + type: string + example: '1900-01-01T00:00:00.000Z' + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + Theme: + type: object + required: + - uuid + - name + - rules + properties: + id: + type: string + example: db id + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Theme name + rules: + type: array + items: + type: object + required: + - text + - background + - border + - shape + - borderWidth + - filterType + - filterValue + properties: + description: + type: string + example: description + text: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + background: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + border: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + shape: + type: string + enum: + - '0' + - '1' + - '2' + - '3' + - '4' + - '5' + example: '0' + borderWidth: + type: string + enum: + - 0px + - 1px + - 2px + - 3px + - 4px + - 5px + - 6px + - 7px + example: 2px + filterType: + type: string + enum: + - type + - api + - role + example: type + filterValue: + oneOf: + - type: string + - type: array + items: + type: string + example: + - type + WizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean diff --git a/docs/.gitbook/assets/swagger (1) (1) (1).yaml b/docs/.gitbook/assets/swagger (1) (1) (1).yaml new file mode 100644 index 0000000000..26784dd621 --- /dev/null +++ b/docs/.gitbook/assets/swagger (1) (1) (1).yaml @@ -0,0 +1,12210 @@ +openapi: 3.0.0 +paths: + /accounts/session: + get: + operationId: AccountApi_getSession + summary: Returns current session of the user. + description: Returns current user session. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_0 + - accounts + security: + - bearer: [] + /accounts/register: + post: + operationId: AccountApi_register + summary: Registers a new user account. + description: Object that contain username, password and role (optional) fields. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/login: + post: + operationId: AccountApi_login + summary: Logs user into the system. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/access-token: + post: + operationId: AccountApi_getAccessToken + summary: Returns access token. + description: Returns access token. + parameters: [] + responses: + '200': + description: Successful operation. + tags: *ref_0 + /accounts: + get: + operationId: AccountApi_getAllAccounts + summary: Returns a list of users, excluding Standard Registry and Auditors. + description: >- + Returns all users except those with roles Standard Registry and Auditor. + Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries: + get: + operationId: AccountApi_getStandatdRegistries + summary: Returns all Standard Registries. + description: Returns all Standard Registries. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries/aggregated: + get: + operationId: AccountApi_getAggregatedStandardRegistries + summary: Returns all Standard Registries aggregated with polices and vcDocuments. + description: Returns all Standard Registries aggregated with polices and vcDocuments + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AggregatedDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/balance: + get: + operationId: AccountApi_getBalance + summary: Returns user's Hedera account balance. + description: Requests current Hedera account balance. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/BalanceResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /analytics/search/policies: + post: + operationId: AnalyticsApi_searchPolicies + summary: Search policies. + description: >- + Search policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + policyId: '000000000000000000000000' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_1 + - analytics + security: + - bearerAuth: [] + /analytics/compare/policies: + post: + operationId: AnalyticsApi_comparePolicies + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ComparePoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules: + post: + operationId: AnalyticsApi_compareModules + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareModulesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas: + post: + operationId: AnalyticsApi_compareSchemas + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareSchemasDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents: + post: + operationId: AnalyticsApi_compareDocuments + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools: + post: + operationId: AnalyticsApi_compareTools + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareToolsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/policies/export: + post: + operationId: AnalyticsApi_comparePoliciesExport + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules/export: + post: + operationId: AnalyticsApi_compareModulesExport + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas/export: + post: + operationId: AnalyticsApi_compareSchemasExport + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents/export: + post: + operationId: AnalyticsApi_compareDocumentsExport + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools/export: + post: + operationId: AnalyticsApi_compareToolsExport + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/search/blocks: + post: + operationId: AnalyticsApi_searchBlocks + summary: Search same blocks. + description: >- + Search same blocks. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + uuid: '' + config: {} + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /artifacts: + get: + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{parentId}: + post: + operationId: ArtifactApi_uploadArtifacts + summary: Upload artifact. + description: Upload artifact. For users with the Standard Registry role only. + parameters: + - name: parentId + required: true + in: path + description: Parent ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ArtifactDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - artifacts + security: + - bearerAuth: [] + /artifacts/{artifactId}: + delete: + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /contracts: + get: + operationId: ContractsApi_getContracts + summary: Return a list of all contracts. + description: Returns all contracts. + parameters: + - name: type + required: false + in: query + description: Contract type + example: RETIRE + schema: + enum: + - WIPE + - RETIRE + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Contracts. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_2 + - contracts + security: + - bearer: [] + post: + operationId: ContractsApi_createContract + summary: Create contract. + description: >- + Create smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + responses: + '201': + description: Created contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/import: + post: + operationId: ContractsApi_importContract + summary: Import contract. + description: >- + Import smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contractId: + type: string + description: Hedera Identifier + example: 0.0.1 + description: + type: string + required: + - contractId + responses: + '200': + description: Imported contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/{contractId}/permissions: + get: + operationId: ContractsApi_contractPermissions + summary: Get contract permissions. + description: >- + Get smart-contract permissions. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Contract permissions. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/{contractId}: + delete: + operationId: ContractsApi_removeContract + summary: Remove contract. + description: >- + Remove smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests: + get: + operationId: ContractsApi_getWipeRequests + summary: Return a list of all wipe requests. + description: >- + Returns all wipe requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WiperRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests/enable: + post: + operationId: ContractsApi_enableWipeRequests + summary: Enable wipe requests. + description: >- + Enable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests/disable: + post: + operationId: ContractsApi_disableWipeRequests + summary: Disable wipe requests. + description: >- + Disable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveWipeRequest + summary: Approve wipe request. + description: >- + Approve wipe contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/requests/{requestId}/reject: + delete: + operationId: ContractsApi_rejectWipeRequest + summary: Reject wipe request. + description: >- + Reject wipe contract request. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: ban + required: false + in: query + description: Reject and ban + schema: + type: boolean + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/requests: + delete: + operationId: ContractsApi_clearWipeRequests + summary: Clear wipe requests. + description: >- + Clear wipe contract requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_wipeAddAdmin + summary: Add wipe admin. + description: >- + Add wipe contract admin. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/manager/{hederaId}: + post: + operationId: ContractsApi_wipeAddManager + summary: Add wipe manager. + description: >- + Add wipe contract manager. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveManager + summary: Remove wipe manager. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/wipe/{contractId}/wiper/{hederaId}: + post: + operationId: ContractsApi_wipeAddWiper + summary: Add wipe wiper. + description: >- + Add wipe contract wiper. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_wipeRemoveWiper + summary: Remove wipe wiper. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/pools/sync: + post: + operationId: ContractsApi_retireSyncPools + summary: Sync retire pools. + description: >- + Sync retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Sync date. + content: + application/json: + schema: + $ref: '#/components/schemas/Date' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests: + get: + operationId: ContractsApi_getRetireRequests + summary: Return a list of all retire requests. + description: Returns all retire requests. + parameters: + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetireRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools: + get: + operationId: ContractsApi_getRetirePools + summary: Return a list of all retire pools. + description: Returns all retire pools. + parameters: + - name: tokens + required: false + in: query + description: Tokens + example: 0.0.1,0.0.2,0.0.3 + schema: + type: string + - name: contractId + required: false + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/requests: + delete: + operationId: ContractsApi_clearRetireRequests + summary: Clear retire requests. + description: >- + Clear retire contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/pools: + delete: + operationId: ContractsApi_clearRetirePools + summary: Clear retire pools. + description: >- + Clear retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + post: + operationId: ContractsApi_setRetirePool + summary: Set retire pool. + description: >- + Set retire contract pool. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: false + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools/{poolId}: + delete: + operationId: ContractsApi_unsetRetirePool + summary: Unset retire pool. + description: >- + Unset retire contract pool. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: poolId + required: false + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}: + delete: + operationId: ContractsApi_unsetRetireRequest + summary: Unset retire request. + description: >- + Unset retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: false + in: path + description: Request Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/pools/{poolId}/retire: + post: + operationId: ContractsApi_retire + summary: Retire tokens. + description: Retire tokens. + parameters: + - name: poolId + required: false + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetireRequestTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveRetire + summary: Approve retire request. + description: >- + Approve retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/requests/{requestId}/cancel: + delete: + operationId: ContractsApi_cancelRetireRequest + summary: Cancel retire request. + description: Cancel retire contract request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_retireAddAdmin + summary: Add retire admin. + description: >- + Add retire contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + delete: + operationId: ContractsApi_retireRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /contracts/retire: + get: + operationId: ContractsApi_getRetireVCs + summary: Return a list of all retire vcs. + description: Returns all retire vcs. + parameters: + - name: pageSize + required: false + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearer: [] + /demo/registered-users: + get: + operationId: DemoApi_registeredUsers + summary: Returns list of registered users. + description: Returns list of registered users. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredUsersDTO' + tags: + - demo + /demo/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/HederaAccount' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /demo/push/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + summary: Generates a new Hedera account with a random private key. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /external: + post: + tags: + - external + description: Sends data from an external source. + summary: Sends data from an external source. + requestBody: + description: Object that contains a VC Document. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalData' + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file: + post: + operationId: IpfsApi_postFile + summary: Add file from ipfs. + description: Add file from ipfs. + parameters: [] + responses: + '201': + description: '' + tags: + - ipfs + security: + - bearerAuth: [] + /ipfs/file/{cid}: + get: + tags: + - ipfs + description: Get file from ipfs. + summary: Get file from ipfs. + parameters: + - in: path + name: cid + schema: + type: string + required: true + description: File CID. + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + binary/octet-stream: + schema: + type: string + format: binary + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs: + post: + tags: + - logs + description: Returns logs. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + description: Log filters. + content: + application/json: + schema: + $ref: '#/components/schemas/LogFilters' + summary: Returns logs. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + totalCount: + type: number + logs: + $ref: '#/components/schemas/Log' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs/attributes: + get: + tags: + - logs + description: Returns logs attributes. For users with the Standard Registry role only. + parameters: + - in: query + name: name + schema: + type: string + description: Part of name. + - in: query + name: existingAttributes + schema: + type: array + items: + type: string + description: Attributes to exclude. + security: + - bearerAuth: [] + summary: Returns logs attributes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/key: + get: + tags: + - maps + description: Returns map api key. + security: + - bearerAuth: [] + summary: Returns map api key. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/sh: + get: + operationId: MapApi_getSentinelKey + parameters: [] + responses: + '200': + description: '' + tags: + - map + /metrics: + get: + operationId: MetricsApi_getMetrics + parameters: [] + responses: + '200': + description: '' + tags: + - metrics + /modules: + get: + tags: + - modules + description: >- + Returns all modules. Only users with the Standard Registry and Installer + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all modules. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - modules + description: >- + Creates a new module. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/schemas: + get: + operationId: ModulesApi_getModuleSchemas + parameters: [] + responses: + '200': + description: '' + tags: &ref_3 + - modules + post: + operationId: ModulesApi_postSchemas + parameters: [] + responses: + '201': + description: '' + tags: *ref_3 + /modules/{uuid}: + get: + tags: + - modules + description: >- + Retrieves module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Retrieves module configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - modules + description: >- + Updates module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates module configuration. + parameters: + - in: path + name: uuid + description: Selected module ID. + required: true + schema: + type: string + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - modules + description: >- + Deletes the module with the provided module ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Module ID. + security: + - bearerAuth: [] + summary: Deletes the module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/menu: + get: + tags: + - modules + description: >- + Returns modules menu. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of modules. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/file: + get: + tags: + - modules + description: >- + Returns a zip file containing the published module and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: >- + Return module and its artifacts in a zip file format for the specified + module. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/message: + get: + tags: + - modules + description: >- + Returns the Hedera message ID for the specified module published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: Imports new module from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new module from a zip file. + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message/preview: + post: + tags: + - modules + description: >- + Previews the module from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Module preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file/preview: + post: + tags: + - modules + description: >- + Previews the module from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Module preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/publish: + put: + tags: + - modules + description: >- + Publishes the module with the specified (internal) module ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Publishes the module onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/validate: + post: + tags: + - modules + description: >- + Validates selected module. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tools: + post: + operationId: ToolsApi_createNewTool + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_4 + - tools + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getTools + summary: Return a list of all tools. + description: >- + Returns all tools. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: false + in: query + description: The numbers of items to return + schema: + type: number + - name: pageIndex + required: false + in: query + description: >- + The number of pages to skip before starting to collect the result + set + schema: + type: number + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push: + post: + operationId: ToolsApi_createNewToolAsync + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}: + delete: + operationId: ToolsApi_deleteTool + summary: >- + Deletes the tool with the provided tool ID. Only users with the Standard + Registry role are allowed to make the request. + description: Deletes the tool. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getToolById + summary: Retrieves tool configuration. + description: >- + Retrieves tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + put: + operationId: ToolsApi_updateTool + summary: Updates tool configuration. + description: >- + Updates tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/publish: + put: + operationId: ToolsApi_publishTool + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/push/publish: + put: + operationId: ToolsApi_publishToolAsync + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/validate: + post: + operationId: ToolsApi_validateTool + summary: Validates selected tool. + description: >- + Validates selected tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/export/file: + get: + operationId: ToolsApi_toolExportFile + summary: >- + Return tool and its artifacts in a zip file format for the specified + tool. + description: >- + Returns a zip file containing the published tool and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. Response zip file. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/{id}/export/message: + get: + operationId: ToolsApi_toolExportMessage + summary: Return Heder message ID for the specified published tool. + description: >- + Returns the Hedera message ID for the specified tool published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/message/preview: + post: + operationId: ToolsApi_toolImportMessagePreview + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/message: + post: + operationId: ToolsApi_toolImportMessage + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/file/preview: + post: + operationId: ToolsApi_toolImportFilePreview + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/import/file: + post: + operationId: ToolsApi_toolImportFile + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push/import/file: + post: + operationId: ToolsApi_toolImportFileAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/push/import/message: + post: + operationId: ToolsApi_toolImportMessageAsync + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /tools/menu/all: + get: + operationId: ToolsApi_getMenu + summary: Return a list of tools. + description: >- + Returns tools menu. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_4 + security: + - bearerAuth: [] + /profiles/{username}: + get: + operationId: ProfileApi_getProfile + summary: Returns user account info. + description: >- + Returns user account information. For users with the Standard Registry + role it also returns address book and VC document information. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the information + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_5 + - profiles + security: + - bearerAuth: [] + - bearer: [] + put: + operationId: ProfileApi_setUserProfile + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Created. + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/push/{username}: + put: + operationId: ProfileApi_setUserProfileAsync + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/{username}/balance: + get: + operationId: ProfileApi_getUserBalance + summary: Returns user's Hedera account balance. + description: >- + Requests Hedera account balance. Only users with the Installer role are + allowed to make the request. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the balance. + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/restore/{username}: + put: + operationId: ProfileApi_restoreUserProfile + summary: Restore user data (policy, DID documents, VC documents). + description: Restore user data (policy, DID documents, VC documents). + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/restore/topics/{username}: + put: + operationId: ProfileApi_restoreTopic + summary: List of available recovery topics. + description: List of available recovery topics. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/did-document/validate: + post: + operationId: ProfileApi_validateDidDocument + summary: Validate DID document format. + description: Validate DID document format. + parameters: [] + requestBody: + required: true + description: DID Document. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /profiles/did-keys/validate: + post: + operationId: ProfileApi_validateDidKeys + summary: Validate DID document keys. + description: Validate DID document keys. + parameters: [] + requestBody: + required: true + description: DID Document and keys. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentWithKeyDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidKeyStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + - bearer: [] + /policies: + get: + tags: + - policies + description: >- + Returns all policies. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all policies. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/migrate-data: + post: + operationId: PolicyApi_migrateData + summary: Migrate policy data. + description: >- + Migrate policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '200': + description: Errors while migration. + content: + application/json: + schema: + type: array + items: + type: object + properties: + error: + type: string + id: + type: string + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_6 + - policies + security: + - bearerAuth: [] + /policies/push/migrate-data: + post: + operationId: PolicyApi_migrateDataAsync + summary: Migrate policy data asynchronous. + description: >- + Migrate policy data asynchronous. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '202': + description: Created task. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + /policies/push: + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}: + post: + operationId: PolicyApi_updatePolicyAsync + summary: '' + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + delete: + operationId: PolicyApi_deletePolicyAsync + parameters: [] + responses: + '202': + description: '' + tags: *ref_6 + security: + - bearerAuth: [] + /policies/{policyId}: + get: + tags: + - policies + description: >- + Retrieves policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves policy configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - policies + description: >- + Updates policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates policy configuration. + parameters: + - in: path + name: policyId + description: Selected policy ID. + required: true + schema: + type: string + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + summary: Publishes the policy onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + security: + - bearerAuth: [] + summary: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run: + put: + tags: + - policies + description: >- + Run policy without making any persistent changes or executing + transaction. Only users with the Standard Registry role are allowed to + make the request. + security: + - bearerAuth: [] + summary: Dry Run policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/discontinue: + put: + operationId: PolicyApi_discontinuePolicy + summary: Discontunue policy. + description: >- + Discontunue policy. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Discontinue details. + content: + application/json: + schema: + type: object + properties: + date: + type: date + responses: + '200': + description: Policies. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/draft: + put: + tags: + - policies + description: >- + Return policy to editing. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Return policy to editing. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/validate: + post: + tags: + - policies + description: >- + Validates selected policy. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/navigation: + get: + operationId: PolicyApi_getPolicyNavigation + summary: Returns a policy navigation. + description: Returns a policy navigation. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/groups: + get: + tags: + - policies + description: Returns a list of groups the user is a member of. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Returns a list of groups the user is a member of. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + uuid: + type: string + role: + type: string + groupLabel: + type: string + groupName: + type: string + active: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Makes the selected group active. if UUID is not set then returns the + user to the default state. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Makes the selected group active. + requestBody: + description: Selected group. + required: true + content: + application/json: + schema: + type: object + properties: + uuid: + type: string + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/documents: + get: + operationId: PolicyApi_getPolicyDocuments + summary: Get policy documents. + description: >- + Get policy documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: Page size. + schema: + type: number + - name: pageIndex + required: true + in: query + description: Page index. + schema: + type: number + - name: type + required: true + in: query + description: Document type. + schema: + enum: + - VC + - VP + type: string + - name: includeDocument + required: true + in: query + description: Include document field. + schema: + type: boolean + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Documents. + headers: + X-Total-Count: + description: Total documents count. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks: + get: + tags: + - policies + description: >- + Returns data from the root policy block. Only users with the Standard + Registry and Installer role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves data for the policy root block. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlock' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/blocks/{uuid}: + get: + tags: + - policies + description: >- + Requests block data. Only users with a role that described in block are + allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Requests block data. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Sends data to the specified block. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tagName}/blocks: + post: + operationId: PolicyApi_setBlocksByTagName + summary: Sends data to the specified block. + description: Sends data to the specified block. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + get: + operationId: PolicyApi_getBlocksByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/tag/{tagName}: + get: + operationId: PolicyApi_getBlockByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks/{uuid}/parents: + get: + operationId: PolicyApi_getBlockParents + parameters: [] + responses: + '200': + description: '' + tags: *ref_6 + /policies/{policyId}/export/file: + get: + tags: + - policies + description: >- + Returns a zip file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: >- + Return policy and its artifacts in a zip file format for the specified + policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/message: + get: + tags: + - policies + description: >- + Returns the Hedera message ID for the specified policy published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/xlsx: + get: + operationId: PolicyApi_getPolicyExportXlsx + summary: >- + Return policy and its artifacts in a xlsx file format for the specified + policy. + description: >- + Returns a xlsx file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Policy preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Previews the policy from IPFS without loading it into the local DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from a zip file. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file/preview: + post: + tags: + - policies + description: >- + Previews the policy from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Policy preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsx + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/push/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsxAsync + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/import/xlsx/preview: + post: + operationId: PolicyApi_importPolicyFromXlsxPreview + summary: Policy preview from a xlsx file. + description: >- + Previews the policy from a xlsx file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearer: [] + /policies/blocks/about: + get: + operationId: PolicyApi_getBlockAbout + parameters: [] + responses: + '200': + description: '' + tags: *ref_6 + /policies/{policyId}/dry-run/users: + get: + tags: + - policies + description: >- + Returns all virtual users. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all virtual users. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/user: + post: + tags: + - policies + description: >- + Create a new virtual account. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Create a new virtual account. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/login: + post: + tags: + - policies + description: >- + Logs virtual user into the system. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Logs virtual user into the system. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Virtual user + required: true + content: + application/json: + schema: + type: object + properties: + did: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/restart: + post: + tags: + - policies + description: >- + Restarts the execution of the policy. Clear data in database. Only users + with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Restarts the execution of the policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/transactions: + get: + tags: + - policies + description: >- + Returns lists of virtual transactions. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual transactions. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + hederaAccountId: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/artifacts: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + owner: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/ipfs: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + documentURL: + type: string + document: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/multiple: + post: + tags: + - policies + description: >- + Creates a link between the current policy and the main policy. Or + creates a group making the current policy the main one. + security: + - bearerAuth: [] + summary: Creates Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Multi policy config. + required: true + content: + application/json: + schema: + type: object + required: + - mainPolicyTopicId + - synchronizationTopicId + properties: + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: Requests Multi policy config. + security: + - bearerAuth: [] + summary: Requests Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/methodologies/categories: + get: + operationId: PolicyApi_getPolicyCategoriesAsync + summary: Get all categories + description: Get all categories + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyCategoryDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + /policies/methodologies/search: + post: + operationId: PolicyApi_getPoliciesByCategory + summary: Get filtered policies + description: Get policies by categories and text + parameters: [] + requestBody: + required: true + description: Filters + content: + application/json: + schema: + type: string + examples: + Filter1: + value: + categoryIds: + - '000000000000000000000001' + - '000000000000000000000002' + text: abc + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + /schema/{schemaId}: + get: + tags: + - schema + description: Returns schema by schema ID. + security: + - bearerAuth: [] + summary: Returns schema by schema ID. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schema/{schemaId}/parents: + get: + operationId: SingleSchemaApi_getSchemaParents + summary: Returns all parent schemas. + description: Returns all parent schemas. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_7 + - schema + security: + - bearerAuth: [] + /schema/{schemaId}/tree: + get: + operationId: SingleSchemaApi_getSchemaTree + summary: Returns schema tree. + description: Returns schema tree. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + name: + type: string + type: + type: string + children: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /schemas: + get: + tags: + - schemas + description: Returns all schemas. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Create new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: Returns all schemas by topicId. + security: + - bearerAuth: [] + summary: Returns all schemas by topicId. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/type/{schemaType}: + get: + operationId: SchemaApi_getSchemaByType + summary: Finds the schema using the json document type. + description: Finds the schema using the json document type. + parameters: + - name: schemaType + required: true + in: path + description: Type + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_8 + - schemas + security: + - bearerAuth: [] + /schemas/list/all: + get: + operationId: SchemaApi_getAll + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas/list/sub: + get: + operationId: SchemaApi_getSub + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: category + required: false + in: query + description: Schema category + schema: + type: string + - name: topicId + required: false + in: query + description: Topic Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas/push/copy: + post: + operationId: SchemaApi_copySchemaAsync + summary: Copy schema. + description: >- + Copy schema. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Object that contains a valid schema. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearer: [] + - bearerAuth: [] + /schemas/push/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Create new schema. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/file/preview: + post: + tags: + - schemas + description: >- + Previews the schema from a zip file. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from a zip file. + requestBody: + description: A zip file containing the schema to be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/message: + post: + tags: + - schemas + description: >- + Returns Hedera message IDs of the published schemas, these messages + contain IPFS CIDs of these schema files. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: List Hedera message IDs of published schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportSchema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/file: + post: + tags: + - schemas + description: >- + Returns schema files for the schemas. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return zip file with schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{username}: + post: + tags: + - schemas + description: >- + Creates new system schema. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Creates new system schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: >- + Returns all system schemas by username. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all system schemas by username. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set. + examples: + pageIndex: + summary: Example of a pageIndex. + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The number of items to return. + examples: + pageSize: + summary: Example of a pageSize. + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total number of items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}/active: + put: + tags: + - schemas + description: >- + Makes the selected scheme active. Other schemes of the same type become + inactive. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/entity/{schemaEntity}: + get: + tags: + - schemas + description: Finds the schema using the schema type. + parameters: + - in: path + name: schemaEntity + schema: + type: string + enum: + - STANDARD_REGISTRY + - USER + - POLICY + - MINT_TOKEN + - WIPE_TOKEN + - MINT_NFTOKEN + required: true + description: schema type. + security: + - bearerAuth: [] + summary: Returns schema by schema type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/xlsx: + get: + operationId: SchemaApi_getPolicyExportXlsx + summary: Return schemas in a xlsx file format for the specified policy. + description: >- + Returns a xlsx file containing schemas. Only users with the Standard + Registry role are allowed to make the request. + parameters: + - name: schemaId + required: true + in: path + description: Schema ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsx + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/push/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsxAsync + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/import/xlsx/preview: + post: + operationId: SchemaApi_importPolicyFromXlsxPreview + summary: Previews the schema from a xlsx file. + description: >- + Previews the schema from a xlsx file. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /schemas/export/template: + get: + operationId: SchemaApi_exportTemplate + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + - bearer: [] + /settings: + get: + tags: + - settings + description: >- + Returns current settings. For users with the Standard Registry role + only. + security: + - bearerAuth: [] + summary: Returns current settings. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - settings + description: Set settings. For users with the Standard Registry role only. + security: + - bearerAuth: [] + summary: Set settings. + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + /settings/environment: + get: + tags: + - settings + description: Returns current environment name. + security: + - bearerAuth: [] + summary: Returns current environment name. + responses: + '200': + description: Successful operation. + content: + text/plain: + schema: + type: string + example: testnet + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /settings/about: + get: + operationId: SettingsApi_getAbout + parameters: [] + responses: + '200': + description: '' + tags: + - settings + /tags: + post: + operationId: TagsApi_setTags + parameters: [] + responses: + '201': + description: '' + tags: + - tags + /tags/search: + post: + tags: + - tags + description: Search tags. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + oneOf: + - type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + target: + type: string + - type: object + required: + - entity + - targets + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + targets: + type: array + items: + type: string + examples: + Single: + value: + entity: PolicyDocument + target: targetId1 + Multiple: + value: + entity: PolicyDocument + targets: + - targetId1 + - targetId2 + summary: Search tags. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + description: a (targetId, Tags) map. `targetId1` is an example key + properties: + targetId1: + $ref: '#/components/schemas/TagMap' + additionalProperties: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/{uuid}: + delete: + tags: + - tags + description: Delete tag. + security: + - bearerAuth: [] + summary: Delete tag. + parameters: + - in: path + name: uuid + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: Tag identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/synchronization: + post: + tags: + - tags + description: synchronization. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: targetId + summary: synchronization. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas: + get: + tags: + - tags + description: Returns all schema. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tags + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}: + delete: + tags: + - tags + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Delete the schema. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - tags + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}/publish: + put: + tags: + - tags + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/published: + get: + tags: + - tags + description: Return a list of all published schemas. + security: + - bearerAuth: [] + summary: Return a list of all published schemas. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tasks/{taskId}: + get: + tags: + - tasks + description: Returns task statuses by Id. + security: + - bearerAuth: [] + summary: Returns task statuses. + parameters: + - in: path + name: taskId + schema: + type: string + required: true + description: Task ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskStatus' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens: + get: + tags: + - tokens + description: >- + Returns all tokens. For the Standard Registry role it returns only the + list of tokens, for other users it also returns token balances as well + as the KYC, Freeze, and Association statuses. Not allowed for the + Auditor role. + security: + - bearerAuth: [] + summary: Return a list of tokens. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push: + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}: + delete: + operationId: TokensApi_deleteTokenAsync + parameters: [] + responses: + '202': + description: '' + tags: &ref_9 + - tokens + /tokens/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associate the user with the provided Hedera token. + responses: + '202': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Disassociates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/info: + get: + tags: + - tokens + description: >- + Returns user information for the selected token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/serials: + get: + operationId: TokensApi_getTokenSerials + summary: Return token serials. + description: Returns token serials of current user. + parameters: + - name: tokenId + required: true + in: path + description: Token identifier + example: 0.0.1 + schema: + type: string + responses: + '200': + description: Token serials. + content: + application/json: + schema: + type: array + items: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearer: [] + /themes: + get: + tags: + - themes + description: Returns all themes. + security: + - bearerAuth: [] + summary: Return a list of all themes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - themes + description: Creates a new theme. + security: + - bearerAuth: [] + summary: Creates a new theme. + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}: + put: + tags: + - themes + description: Updates theme configuration for the specified theme ID. + summary: Updates theme configuration. + parameters: + - in: path + name: themeId + description: Selected theme ID. + required: true + schema: + type: string + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - themes + description: Deletes the theme with the provided theme ID. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Theme ID. + security: + - bearerAuth: [] + summary: Deletes the theme. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/import/file: + post: + tags: + - themes + description: Imports new theme from the provided zip file into the local DB. + security: + - bearerAuth: [] + summary: Imports new theme from a zip file. + requestBody: + description: A zip file that contains the theme to be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}/export/file: + get: + tags: + - themes + description: Returns a zip file containing the theme. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Selected theme ID. + security: + - bearerAuth: [] + summary: Returns a zip file containing the theme. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains: + get: + tags: + - trustchains + description: >- + Requests all VP documents. Only users with the Auditor role are allowed + to make the request. + security: + - bearerAuth: [] + summary: Returns a list of all VP documents. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + - in: query + name: policyId + schema: + type: string + description: Selected policy ID. + - in: query + name: policyOwner + schema: + type: string + description: Selected Standard Registry (DID). + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VerifiablePresentation' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains/{hash}: + get: + tags: + - trustchains + description: >- + Builds and returns a trustchain, from the VP to the root VC document. + Only users with the Auditor role are allowed to make the request. + parameters: + - in: path + name: hash + schema: + type: string + required: true + description: Hash or ID of a VP document. + security: + - bearerAuth: [] + summary: Returns a trustchain for a VP document. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TrustChains' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/policy: + post: + tags: + - wizard + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '201': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyId: + type: string + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/push/policy: + post: + operationId: WizardApi_setPolicyAsync + summary: Creates a new policy. + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + saveState: + type: boolean + wizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - wizard + /wizard/{policyId}/config: + post: + tags: + - wizard + description: >- + Get policy config by wizard. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier. + security: + - bearerAuth: [] + summary: Get policy config. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyConfig: + $ref: '#/components/schemas/PolicyConfig' + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /branding: + post: + operationId: BrandingApi_setBranding + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_10 + - branding + security: + - bearer: [] + get: + operationId: BrandingApi_getBranding + parameters: [] + responses: + '200': + description: '' + tags: *ref_10 + /suggestions: + post: + operationId: SuggestionsApi_policySuggestions + summary: Get next and nested suggested block types + description: >- + Get next and nested suggested block types. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsInputDTO' + responses: + '200': + description: >- + Successful operation. Suggested next and nested block types + respectively. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsOutputDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_11 + - suggestions + security: + - bearer: [] + - bearerAuth: [] + /suggestions/config: + post: + operationId: SuggestionsApi_setPolicySuggestionsConfig + summary: Set suggestions config + description: >- + Set suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + responses: + '201': + description: Successful operation. Response setted suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_11 + security: + - bearer: [] + - bearerAuth: [] + get: + operationId: SuggestionsApi_getPolicySuggestionsConfig + summary: Get suggestions config + description: >- + Get suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. Response suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_11 + security: + - bearer: [] + - bearerAuth: [] + /notifications: + get: + operationId: NotificationsApi_getAllNotifications + summary: Get all notifications + description: Returns all notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications and count. + headers: + X-Total-Count: + description: Count of notifications + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_12 + - notifications + security: + - bearer: [] + - bearerAuth: [] + /notifications/new: + get: + operationId: NotificationsApi_getNewNotifications + summary: Get new notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns new notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/progresses: + get: + operationId: NotificationsApi_getProgresses + summary: Get progresses + description: Returns progresses. + parameters: [] + responses: + '200': + description: Successful operation. Returns progresses. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProgressDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/read/all: + post: + operationId: NotificationsApi_readAll + summary: Read all notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /notifications/delete/{notificationId}: + delete: + operationId: NotificationsApi_delete + summary: Delete notifications up to this point + description: Returns deleted notifications count. + parameters: + - name: notificationId + required: true + in: path + schema: + type: string + responses: + '200': + description: Successful operation. Returns deleted notifications count. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearer: [] + - bearerAuth: [] + /projects/search: + post: + operationId: ProjectsAPI_projectSearch + summary: Search projects + description: Search projects by filters + parameters: [] + requestBody: + required: true + description: The question of choosing a methodology + content: + application/json: + schema: + type: string + examples: + q: + value: >- + What methodology can I use for production of electricity using + renewable energy technologies? + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProjectDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_13 + - projects + /projects/compare/documents: + post: + operationId: ProjectsAPI_compareDocuments + summary: Compare documents. + description: Compare documents. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + /projects/properties: + get: + operationId: ProjectsAPI_getPolicyProperties + summary: Get all properties + description: Get all properties + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PropertiesDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + /record/{policyId}/status: + get: + operationId: RecordApi_getRecordStatus + summary: Get recording or running status. + description: >- + Get recording or running status. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RecordStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_14 + - record + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/start: + post: + operationId: RecordApi_startRecord + summary: Start recording. + description: >- + Start recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/stop: + post: + operationId: RecordApi_stopRecord + summary: Stop recording. + description: >- + Stop recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/recording/actions: + get: + operationId: RecordApi_getRecordActions + summary: Get recorded actions. + description: >- + Get recorded actions. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecordActionDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/start: + post: + operationId: RecordApi_runRecord + summary: Run record from a zip file. + description: >- + Run record from a zip file. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A zip file containing record to be run. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/stop: + post: + operationId: RecordApi_stopRunning + summary: Stop running. + description: >- + Stop running. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/results: + get: + operationId: RecordApi_getRecordResults + summary: Get running results. + description: >- + Get running results. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningResultDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/details: + get: + operationId: RecordApi_getRecordDetails + summary: Get running details. + description: >- + Get running details. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningDetailsDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/fast-forward: + post: + operationId: RecordApi_fastForward + summary: Fast Forward. + description: >- + Fast Forward. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/retry: + post: + operationId: RecordApi_retryStep + summary: Retry step. + description: >- + Retry step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /record/{policyId}/running/skip: + post: + operationId: RecordApi_skipStep + summary: Skip step. + description: >- + Skip step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + security: + - bearerAuth: [] + - bearer: [] + /ai-suggestions/ask: + get: + operationId: AISuggestionsAPI_getAIAnswer + summary: Get methodology suggestion + description: Returns AI response to the current question + parameters: + - name: q + required: true + in: path + description: The question of choosing a methodology + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_15 + - ai-suggestions + /ai-suggestions/rebuild-vector: + put: + operationId: AISuggestionsAPI_rebuildVector + summary: Rebuild AI vector + description: Rebuilds vector based on policy data in the DB + parameters: [] + responses: + '200': + description: '' + tags: *ref_15 + /schemas/type/{type}: + get: + tags: + - schemas + description: Finds the schema using the json document type. + parameters: + - in: path + name: type + schema: + type: string + required: true + description: JSON type. + security: + - bearerAuth: [] + summary: Returns schema by type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}: + get: + tags: + - policies + description: >- + Requests block ID from a policy by tag. Only users with the Standard + Registry and Installer roles are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + summary: Requests block ID from a policy by tag. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + id: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}/blocks: + post: + tags: + - policies + description: Sends data to the specified block. + security: + - bearerAuth: [] + summary: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + security: + - bearerAuth: [] + summary: Requests block data. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/: + post: + tags: + - ipfs + description: Add file to ipfs. + summary: Add file to ipfs. + requestBody: + description: Data array of file. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + application/json: + schema: + description: CID of added file. + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{policyId}: + post: + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact: + get: + deprecated: true + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{policyId}: + post: + deprecated: true + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{artifactId}: + delete: + deprecated: true + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/: + post: + tags: + - tags + description: Creates new tag. + security: + - bearerAuth: [] + summary: Creates new tag. + requestBody: + description: Object that contains tag information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +info: + title: Guardian + description: >- + The Guardian is a modular open-source solution that includes best-in-class + identity management and decentralized ledger technology (DLT) libraries. At + the heart of the Guardian solution is a sophisticated Policy Workflow Engine + (PWE) that enables applications to offer a requirements-based tokenization + implementation. + version: 2.21.1 + contact: + name: API developer + url: https://envisionblockchain.com + email: info@envisionblockchain.com + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +tags: [] +servers: + - url: /api/v1 + description: version 1.0 +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + AccountsResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + did: + type: string + required: + - username + - role + - did + InternalServerErrorDTO: + type: object + properties: + code: + type: number + message: + type: string + required: + - code + - message + RegisterUserDTO: + type: object + properties: + username: + type: string + password: + type: string + password_confirmation: + type: string + role: + type: string + required: + - username + - password + - password_confirmation + - role + AccountsSessionResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + accessToken: + type: string + required: + - username + - role + - accessToken + LoginUserDTO: + type: object + properties: + username: + type: string + password: + type: string + required: + - username + - password + CredentialSubjectDTO: + type: object + properties: + geography: + type: string + law: + type: string + tags: + type: string + ISIC: + type: string + '@context': + type: array + items: + type: string + id: + type: string + type: + type: string + required: + - geography + - law + - tags + - ISIC + - '@context' + - id + - type + ProofDTO: + type: object + properties: + type: + type: string + created: + format: date-time + type: string + verificationMethod: + type: string + proofPurpose: + type: string + jws: + type: string + required: + - type + - created + - verificationMethod + - proofPurpose + - jws + VcDocumentDTO: + type: object + properties: + id: + type: string + type: + type: array + items: + type: string + issuer: + type: string + issuanceDate: + format: date-time + type: string + '@context': + type: array + items: + type: string + credentialSubject: + $ref: '#/components/schemas/CredentialSubjectDTO' + proof: + $ref: '#/components/schemas/ProofDTO' + required: + - id + - type + - issuer + - issuanceDate + - '@context' + - credentialSubject + - proof + PolicyDTO: + type: object + properties: + _id: + type: string + createDate: + format: date-time + type: string + uuid: + type: string + name: + type: string + description: + type: string + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + policyTag: + type: string + codeVersion: + type: string + userRoles: + type: array + items: + type: string + userGroups: + type: array + items: + type: string + userRole: + type: string + userGroup: + type: string + id: + type: string + required: + - _id + - createDate + - uuid + - name + - description + - status + - creator + - owner + - topicId + - policyTag + - codeVersion + - userRoles + - userGroups + - userRole + - userGroup + - id + AggregatedDTOItem: + type: object + properties: + did: + type: string + hederaAccountId: + type: string + vcDocument: + $ref: '#/components/schemas/VcDocumentDTO' + policies: + $ref: '#/components/schemas/PolicyDTO' + required: + - did + - hederaAccountId + - vcDocument + - policies + UserDTO: + type: object + properties: + username: + type: string + did: + type: string + required: + - username + - did + BalanceResponseDTO: + type: object + properties: + balance: + type: number + unit: + type: string + user: + $ref: '#/components/schemas/UserDTO' + required: + - balance + - unit + - user + FilterSearchPoliciesDTO: + type: object + properties: + policyId: + type: string + required: + - policyId + SearchPoliciesDTO: + type: object + properties: + target: + type: object + result: + type: object + required: + - target + - result + FilterPoliciesDTO: + type: object + properties: + policyId1: + type: string + policyId2: + type: string + policyIds: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - policyId1 + - policyId2 + - policyIds + - eventsLvl + - propLvl + - childrenLvl + - idLvl + ComparePoliciesDTO: + type: object + properties: + blocks: + type: object + groups: + type: object + left: + type: object + right: + type: object + roles: + type: object + tokens: + type: object + topics: + type: object + total: + type: object + required: + - blocks + - groups + - left + - right + - roles + - tokens + - topics + - total + FilterModulesDTO: + type: object + properties: + moduleId1: + type: string + moduleId2: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - moduleId1 + - moduleId2 + - eventsLvl + - propLvl + - childrenLvl + - idLvl + CompareModulesDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + FilterSchemasDTO: + type: object + properties: + schemaId1: + type: string + schemaId2: + type: string + idLvl: + type: number + required: + - schemaId1 + - schemaId2 + - idLvl + CompareSchemasDTO: + type: object + properties: + fields: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - fields + - left + - right + - total + FilterDocumentsDTO: + type: object + properties: + documentId1: + type: string + documentId2: + type: string + documentIds: + type: string + required: + - documentId1 + - documentId2 + - documentIds + CompareDocumentsDTO: + type: object + properties: + documents: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - documents + - left + - right + - total + FilterToolsDTO: + type: object + properties: + toolId1: + type: string + toolId2: + type: string + toolIds: + type: string + required: + - toolId1 + - toolId2 + - toolIds + CompareToolsDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + ArtifactDTOItem: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + required: + - id + - name + - uuid + - extention + - type + ContractDTO: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + permissions: + type: number + topicId: + type: string + type: + type: string + enum: + - WIPE + - RETIRE + syncRequestsDate: + format: date-time + type: string + syncPoolsDate: + format: date-time + type: string + lastSyncEventTimeStamp: + type: string + wipeContractIds: + type: array + items: + type: string + required: + - id + - contractId + - description + - owner + - permissions + - topicId + - type + - syncRequestsDate + - syncPoolsDate + - lastSyncEventTimeStamp + - wipeContractIds + WiperRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + user: + type: string + required: + - id + - contractId + - user + RetireRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + user: + type: string + required: + - id + - contractId + - tokens + - tokenIds + - user + Date: + type: object + properties: {} + RetirePoolDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + contract: + type: string + count: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + immediately: + type: boolean + enabled: + type: boolean + required: + - id + - contractId + - tokens + - tokenIds + - immediately + - enabled + RetirePoolTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + required: + - token + - count + RetireRequestTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: string + required: + - token + - count + - serials + ProfileDTO: + type: object + properties: + username: + type: string + nullable: false + role: + type: string + nullable: false + did: + type: string + nullable: true + parent: + type: string + nullable: true + hederaAccountId: + type: string + nullable: true + confirmed: + type: boolean + nullable: true + failed: + type: boolean + nullable: true + topicId: + type: string + nullable: true + parentTopicId: + type: string + nullable: true + didDocument: + type: object + nullable: true + vcDocument: + type: object + nullable: true + required: + - username + - role + SubjectDTO: + type: object + properties: + '@context': + nullable: true + type: array + items: + type: string + id: + type: string + nullable: true + type: + type: string + nullable: true + required: + - '@context' + DidDocumentDTO: + type: object + properties: + id: + type: string + nullable: false + context: + nullable: true + type: array + items: + type: string + alsoKnownAs: + nullable: true + type: array + items: + type: string + controller: + nullable: true + type: array + items: + type: string + verificationMethod: + nullable: true + type: array + items: + type: object + authentication: + nullable: true + type: array + items: + type: object + assertionMethod: + nullable: true + type: array + items: + type: object + keyAgreement: + nullable: true + type: array + items: + type: object + capabilityInvocation: + nullable: true + type: array + items: + type: object + capabilityDelegation: + nullable: true + type: array + items: + type: object + service: + nullable: true + type: array + items: + type: object + required: + - id + - context + - alsoKnownAs + - controller + - verificationMethod + - authentication + - assertionMethod + - keyAgreement + - capabilityInvocation + - capabilityDelegation + - service + DidKeyDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + required: + - id + - key + CredentialsDTO: + type: object + properties: + entity: + type: string + nullable: false + hederaAccountId: + type: string + nullable: false + hederaAccountKey: + type: string + nullable: false + parent: + type: string + nullable: true + vcDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/SubjectDTO' + didDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + didKeys: + nullable: true + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - entity + - hederaAccountId + - hederaAccountKey + TaskDTO: + type: object + properties: + taskId: + type: string + expectation: + type: number + required: + - taskId + - expectation + DidDocumentStatusDTO: + type: object + properties: + valid: + type: boolean + nullable: false + error: + type: string + nullable: true + didDocument: + type: object + nullable: false + required: + - valid + - error + - didDocument + DidDocumentWithKeyDTO: + type: object + properties: + document: + nullable: false + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + keys: + nullable: false + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - document + - keys + DidKeyStatusDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + valid: + type: boolean + nullable: false + required: + - id + - key + - valid + MigrationConfigPoliciesDTO: + type: object + properties: + src: + type: string + dst: + type: string + required: + - src + - dst + MigrationConfigDTO: + type: object + properties: + policies: + $ref: '#/components/schemas/MigrationConfigPoliciesDTO' + vcs: + type: array + items: + type: string + vps: + type: array + items: + type: string + schemas: + type: object + groups: + type: object + roles: + type: object + required: + - policies + - vcs + - vps + - schemas + - groups + - roles + PolicyCategoryDTO: + type: object + properties: + id: + type: string + name: + type: string + type: + type: string + required: + - id + - name + - type + SchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + entity: + type: string + document: + type: string + uuid: + type: string + iri: + type: string + hash: + type: string + status: + type: string + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - entity + - document + - uuid + - iri + - hash + - status + - topicId + - version + - owner + - messageId + VersionSchemaDTO: + type: object + properties: + version: + type: string + required: + - version + MessageSchemaDTO: + type: object + properties: + messageId: + type: string + required: + - messageId + ExportSchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - version + - owner + - messageId + SystemSchemaDTO: + type: object + properties: + name: + type: string + entity: + type: string + required: + - name + - entity + SettingsDTO: + type: object + properties: + ipfsStorageApiKey: + type: string + operatorId: + type: string + operatorKey: + type: string + required: + - ipfsStorageApiKey + - operatorId + - operatorKey + SuggestionsInputDTO: + type: object + properties: + blockType: + type: string + children: + nullable: true + type: array + items: + type: object + required: + - blockType + - children + SuggestionsOutputDTO: + type: object + properties: + next: + type: string + nested: + type: string + required: + - next + - nested + SuggestionsConfigItemDTO: + type: object + properties: + id: + type: string + type: + type: string + enum: + - Policy + - Module + index: + type: number + required: + - id + - type + - index + SuggestionsConfigDTO: + type: object + properties: + items: + $ref: '#/components/schemas/SuggestionsConfigItemDTO' + required: + - items + NotificationDTO: + type: object + properties: + title: + type: string + message: + type: string + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + action: + type: string + enum: + - POLICY_CONFIGURATION + - POLICY_VIEW + - POLICIES_PAGE + - SCHEMAS_PAGE + - TOKENS_PAGE + - PROFILE_PAGE + result: + type: object + read: + type: boolean + old: + type: boolean + required: + - title + - message + - type + - action + - result + - read + - old + ProgressDTO: + type: object + properties: + action: + type: string + message: + type: string + progress: + type: number + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + taskId: + type: string + required: + - action + - message + - progress + - type + - taskId + ProjectDTO: + type: object + properties: + id: + type: string + policyId: + type: string + policyName: + type: string + registered: + type: string + title: + type: string + companyName: + type: string + sectoralScope: + type: string + required: + - id + - policyId + - policyName + - registered + - title + - companyName + - sectoralScope + PropertiesDTO: + type: object + properties: + id: + type: string + title: + type: string + value: + type: string + required: + - id + - title + - value + RecordStatusDTO: + type: object + properties: + type: + type: string + policyId: + type: string + uuid: + type: string + status: + type: string + required: + - type + - policyId + - uuid + - status + Object: + type: object + properties: {} + RecordActionDTO: + type: object + properties: + uuid: + type: string + policyId: + type: string + method: + type: string + action: + type: string + time: + type: string + user: + type: string + target: + type: string + required: + - uuid + - policyId + - method + - action + - time + - user + - target + ResultInfoDTO: + type: object + properties: + tokens: + type: number + documents: + type: number + required: + - tokens + - documents + ResultDocumentDTO: + type: object + properties: + type: + type: string + schema: + type: string + rate: + type: string + documents: + type: object + required: + - type + - schema + - rate + - documents + RunningResultDTO: + type: object + properties: + info: + $ref: '#/components/schemas/ResultInfoDTO' + total: + type: number + documents: + $ref: '#/components/schemas/ResultDocumentDTO' + required: + - info + - total + - documents + RunningDetailsDTO: + type: object + properties: + left: + type: object + right: + type: object + total: + type: number + documents: + type: object + required: + - left + - right + - total + - documents + ToolDTO: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + required: + - id + - uuid + - name + - description + - config + - status + - creator + - owner + - topicId + - messageId + - codeVersion + - createDate + RegisteredUsersDTO: + type: object + properties: + username: + type: string + did: + type: string + parent: + type: string + role: + type: string + policyRoles: + type: array + items: + type: string + required: + - username + - did + - parent + - role + - policyRoles + Credentials: + type: object + required: + - username + - password + properties: + username: + type: string + password: + type: string + Account: + type: object + required: + - username + - role + properties: + username: + type: string + role: + type: string + did: + type: string + Session: + type: object + required: + - username + - role + - accessToken + properties: + username: + type: string + role: + type: string + accessToken: + type: string + User: + type: object + required: + - username + - role + properties: + confirmed: + type: string + failed: + type: string + username: + type: string + role: + type: string + hederaAccountId: + type: string + hederaAccountKey: + type: string + did: + type: string + didDocument: + type: object + vcDocument: + type: object + parent: + type: string + topicId: + type: string + Schema: + type: object + required: + - id + - name + - description + - entity + - document + properties: + id: + type: string + iri: + type: string + uuid: + type: string + name: + type: string + description: + type: string + entity: + type: string + hash: + type: string + status: + type: string + document: + oneOf: + - type: string + - type: object + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + ImportSchema: + type: object + required: + - schemes + properties: + schemes: + type: array + items: + type: object + required: + - document + - entity + - name + - uuid + properties: + document: + type: string + entity: + type: string + hash: + type: string + name: + type: string + uuid: + type: string + ExportSchema: + type: object + required: + - ids + properties: + name: + type: string + version: + type: string + messageId: + type: string + Token: + type: object + required: + - changeSupply + - decimals + - enableAdmin + - enableKYC + - enableFreeze + - enableWipe + - initialSupply + - tokenName + - tokenSymbol + - tokenType + properties: + changeSupply: + type: boolean + decimals: + type: string + enableAdmin: + type: boolean + enableFreeze: + type: boolean + enableKYC: + type: boolean + enableWipe: + type: boolean + initialSupply: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + TokenInfo: + type: object + required: + - id + - tokenId + - tokenName + - tokenSymbol + - tokenType + - decimals + - associated + - balance + - frozen + - kyc + properties: + id: + type: string + tokenId: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + decimals: + type: string + associated: + type: boolean + balance: + type: string + frozen: + type: boolean + kyc: + type: boolean + enableAdmin: + type: boolean + enableKYC: + type: boolean + enableFreeze: + type: boolean + enableWipe: + type: boolean + PolicyConfig: + type: object + required: + - name + - version + - description + - topicDescription + - config + - topicId + - policyTag + properties: + id: + type: string + uuid: + type: string + name: + type: string + version: + type: string + description: + type: string + topicDescription: + type: string + config: + type: object + status: + type: string + owner: + type: string + policyRoles: + type: array + items: + type: string + topicId: + type: string + policyTag: + type: string + policyTopics: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + type: + type: string + static: + type: boolean + TrustChains: + type: object + required: + - chain + - userMap + properties: + chain: + type: array + items: + type: object + required: + - id + - type + - tag + - label + - schema + - owner + - document + properties: + id: + type: string + type: + type: string + tag: + type: string + label: + type: string + schema: + type: string + owner: + type: string + document: + type: object + userMap: + type: array + items: + type: object + required: + - did + - username + properties: + did: + type: string + username: + type: string + VerifiablePresentation: + type: object + required: + - hash + - id + - policyId + - signature + - status + - tag + - type + - updateDate + - createDate + - owner + - document + properties: + hash: + type: string + id: + type: string + policyId: + type: string + signature: + type: string + status: + type: string + tag: + type: string + type: + type: string + updateDate: + type: string + createDate: + type: string + owner: + type: string + document: + type: object + PublishPolicy: + type: object + required: + - errors + - isValid + - policies + properties: + errors: + type: array + items: + type: object + isValid: + type: boolean + policies: + type: array + items: + type: object + ValidatePolicy: + type: object + required: + - config + - results + properties: + config: + type: object + results: + type: object + PolicyBlock: + type: object + required: + - id + - blockType + - isActive + - uiMetaData + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + blocks: + type: array + items: + type: object + PolicyBlockData: + type: object + required: + - id + - isActive + - uiMetaData + - data + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + data: + type: object + fields: + type: array + items: + type: object + index: + type: number + roles: + type: array + items: + type: string + blocks: + type: array + items: + $ref: '#/components/schemas/PolicyBlock' + ExportPolicy: + type: object + required: + - name + - version + - messageId + properties: + name: + type: string + version: + type: string + tokens: + type: string + PreviewPolicy: + type: object + required: + - policy + - schemas + - tokens + properties: + policy: + type: object + schemas: + type: array + items: + type: object + tokens: + type: array + items: + type: object + Error: + type: object + required: + - code + - message + properties: + code: + type: number + message: + type: string + ExternalData: + type: object + required: + - owner + - policyTag + - document + properties: + owner: + type: string + policyTag: + type: string + document: + type: object + HederaAccount: + type: object + required: + - id + - key + properties: + id: + type: string + key: + type: string + CommonSettings: + type: object + properties: + operatorId: + type: string + operatorKey: + type: string + nftApiKey: + deprecated: true + type: string + ipfsStorageApiKey: + type: string + LogFilters: + type: object + properties: + type: + type: string + startDate: + type: string + endDate: + type: string + attributes: + type: array + items: + type: string + message: + type: string + pageSize: + type: number + pageIndex: + type: number + sortDirection: + type: string + enum: + - ASC + - DESC + Log: + type: object + properties: + type: + type: string + datetime: + type: string + message: + type: string + attributes: + type: array + items: + type: string + Task: + type: object + properties: + taskId: + type: string + expectation: + type: number + TaskStatus: + type: object + properties: + date: + type: string + name: + type: string + statuses: + type: array + items: + type: object + properties: + type: + type: string + message: + type: string + result: + type: object + error: + type: object + Artifact: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + MultiPolicyConfig: + type: object + properties: + id: + type: string + uuid: + type: string + owner: + type: string + type: + type: string + instanceTopicId: + type: string + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + policyOwner: + type: string + user: + type: string + Contract: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + isOwnerCreator: + type: string + status: + type: string + RetireRequest: + type: object + properties: + id: + type: string + contractId: + type: string + baseTokenId: + type: string + owner: + type: string + oppositeTokenId: + type: string + baseTokenCount: + type: number + oppositeTokenCount: + type: number + Module: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + type: + type: string + PreviewModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + ExportModule: + type: object + properties: + uuid: + type: string + name: + type: string + description: + type: string + messageId: + type: string + owner: + type: string + PublishModule: + type: object + properties: + errors: + type: object + isValid: + type: boolean + module: + $ref: '#/components/schemas/Module' + ValidateModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + results: + type: object + Tag: + type: object + required: + - name + - entity + - localTarget + properties: + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Tag label + description: + type: string + example: Description + owner: + type: string + example: did + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: '0000000000.000000000' + localTarget: + type: string + example: db id + status: + type: string + enum: + - Draft + - Published + - History + example: Published + operation: + type: string + enum: + - Create + - Delete + example: Create + date: + type: string + example: '1900-01-01T00:00:00.000Z' + topicId: + type: string + example: 0.0.0000000 + messageId: + type: string + example: '0000000000.000000000' + policyId: + type: string + example: db id + uri: + type: string + example: document uri + document: + type: object + TagMap: + type: object + required: + - entity + - target + - refreshDate + - tags + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: db id + refreshDate: + type: string + example: '1900-01-01T00:00:00.000Z' + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + Theme: + type: object + required: + - uuid + - name + - rules + properties: + id: + type: string + example: db id + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Theme name + rules: + type: array + items: + type: object + required: + - text + - background + - border + - shape + - borderWidth + - filterType + - filterValue + properties: + description: + type: string + example: description + text: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + background: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + border: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + shape: + type: string + enum: + - '0' + - '1' + - '2' + - '3' + - '4' + - '5' + example: '0' + borderWidth: + type: string + enum: + - 0px + - 1px + - 2px + - 3px + - 4px + - 5px + - 6px + - 7px + example: 2px + filterType: + type: string + enum: + - type + - api + - role + example: type + filterValue: + oneOf: + - type: string + - type: array + items: + type: string + example: + - type + WizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean diff --git a/docs/.gitbook/assets/swagger (1).yaml b/docs/.gitbook/assets/swagger (1).yaml index 26784dd621..a9d9ddc8cb 100644 --- a/docs/.gitbook/assets/swagger (1).yaml +++ b/docs/.gitbook/assets/swagger (1).yaml @@ -1,12210 +1,12667 @@ -openapi: 3.0.0 -paths: - /accounts/session: - get: - operationId: AccountApi_getSession - summary: Returns current session of the user. - description: Returns current user session. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsSessionResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_0 - - accounts - security: - - bearer: [] - /accounts/register: - post: - operationId: AccountApi_register - summary: Registers a new user account. - description: Object that contain username, password and role (optional) fields. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterUserDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - /accounts/login: - post: - operationId: AccountApi_login - summary: Logs user into the system. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LoginUserDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsSessionResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - /accounts/access-token: - post: - operationId: AccountApi_getAccessToken - summary: Returns access token. - description: Returns access token. - parameters: [] - responses: - '200': - description: Successful operation. - tags: *ref_0 - /accounts: - get: - operationId: AccountApi_getAllAccounts - summary: Returns a list of users, excluding Standard Registry and Auditors. - description: >- - Returns all users except those with roles Standard Registry and Auditor. - Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/standard-registries: - get: - operationId: AccountApi_getStandatdRegistries - summary: Returns all Standard Registries. - description: Returns all Standard Registries. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/standard-registries/aggregated: - get: - operationId: AccountApi_getAggregatedStandardRegistries - summary: Returns all Standard Registries aggregated with polices and vcDocuments. - description: Returns all Standard Registries aggregated with polices and vcDocuments - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/AggregatedDTOItem' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/balance: - get: - operationId: AccountApi_getBalance - summary: Returns user's Hedera account balance. - description: Requests current Hedera account balance. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/BalanceResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /analytics/search/policies: - post: - operationId: AnalyticsApi_searchPolicies - summary: Search policies. - description: >- - Search policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSearchPoliciesDTO' - examples: - Filter: - value: - policyId: '000000000000000000000000' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SearchPoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_1 - - analytics - security: - - bearerAuth: [] - /analytics/compare/policies: - post: - operationId: AnalyticsApi_comparePolicies - summary: Compare policies. - description: >- - Compare policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterPoliciesDTO' - examples: - Filter1: - value: - policyId1: '000000000000000000000001' - policyId2: '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - Filter2: - value: - policyIds: - - '000000000000000000000001' - - '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ComparePoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/modules: - post: - operationId: AnalyticsApi_compareModules - summary: Compare modules. - description: >- - Compare modules. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterModulesDTO' - examples: - Filter: - value: - moduleId1: '000000000000000000000001' - moduleId2: '000000000000000000000002' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareModulesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/schemas: - post: - operationId: AnalyticsApi_compareSchemas - summary: Compare schemas. - description: >- - Compare schemas. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSchemasDTO' - examples: - Filter: - value: - schemaId1: '000000000000000000000001' - schemaId2: '000000000000000000000002' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareSchemasDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/documents: - post: - operationId: AnalyticsApi_compareDocuments - summary: Compare documents. - description: >- - Compare documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareDocumentsDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/tools: - post: - operationId: AnalyticsApi_compareTools - summary: Compare tools. - description: >- - Compare tools. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterToolsDTO' - examples: - Filter1: - value: - toolId1: '000000000000000000000001' - toolId2: '000000000000000000000002' - Filter2: - value: - toolIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareToolsDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/policies/export: - post: - operationId: AnalyticsApi_comparePoliciesExport - summary: Compare policies. - description: >- - Compare policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterPoliciesDTO' - examples: - Filter1: - value: - policyId1: '000000000000000000000001' - policyId2: '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - Filter2: - value: - policyIds: - - '000000000000000000000001' - - '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/modules/export: - post: - operationId: AnalyticsApi_compareModulesExport - summary: Compare modules. - description: >- - Compare modules. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterModulesDTO' - examples: - Filter: - value: - moduleId1: '000000000000000000000001' - moduleId2: '000000000000000000000002' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/schemas/export: - post: - operationId: AnalyticsApi_compareSchemasExport - summary: Compare schemas. - description: >- - Compare schemas. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSchemasDTO' - examples: - Filter: - value: - schemaId1: '000000000000000000000001' - schemaId2: '000000000000000000000002' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/documents/export: - post: - operationId: AnalyticsApi_compareDocumentsExport - summary: Compare documents. - description: >- - Compare documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/tools/export: - post: - operationId: AnalyticsApi_compareToolsExport - summary: Compare tools. - description: >- - Compare tools. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterToolsDTO' - examples: - Filter1: - value: - toolId1: '000000000000000000000001' - toolId2: '000000000000000000000002' - Filter2: - value: - toolIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/search/blocks: - post: - operationId: AnalyticsApi_searchBlocks - summary: Search same blocks. - description: >- - Search same blocks. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSearchPoliciesDTO' - examples: - Filter: - value: - uuid: '' - config: {} - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SearchPoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /artifacts: - get: - tags: - - artifacts - description: Returns all artifacts. - security: - - bearerAuth: [] - summary: Returns all artifacts. - parameters: - - in: query - name: policyId - schema: - type: string - description: Policy identifier - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifacts/{parentId}: - post: - operationId: ArtifactApi_uploadArtifacts - summary: Upload artifact. - description: Upload artifact. For users with the Standard Registry role only. - parameters: - - name: parentId - required: true - in: path - description: Parent ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ArtifactDTOItem' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: - - artifacts - security: - - bearerAuth: [] - /artifacts/{artifactId}: - delete: - tags: - - artifacts - description: Delete artifact. - security: - - bearerAuth: [] - summary: Delete artifact. - parameters: - - in: path - name: artifactId - schema: - type: string - required: true - description: Artifact identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /contracts: - get: - operationId: ContractsApi_getContracts - summary: Return a list of all contracts. - description: Returns all contracts. - parameters: - - name: type - required: false - in: query - description: Contract type - example: RETIRE - schema: - enum: - - WIPE - - RETIRE - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Contracts. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_2 - - contracts - security: - - bearer: [] - post: - operationId: ContractsApi_createContract - summary: Create contract. - description: >- - Create smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - description: - type: string - responses: - '201': - description: Created contract. - content: - application/json: - schema: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/import: - post: - operationId: ContractsApi_importContract - summary: Import contract. - description: >- - Import smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contractId: - type: string - description: Hedera Identifier - example: 0.0.1 - description: - type: string - required: - - contractId - responses: - '200': - description: Imported contract. - content: - application/json: - schema: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/{contractId}/permissions: - get: - operationId: ContractsApi_contractPermissions - summary: Get contract permissions. - description: >- - Get smart-contract permissions. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Contract permissions. - content: - application/json: - schema: - type: number - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/{contractId}: - delete: - operationId: ContractsApi_removeContract - summary: Remove contract. - description: >- - Remove smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests: - get: - operationId: ContractsApi_getWipeRequests - summary: Return a list of all wipe requests. - description: >- - Returns all wipe requests. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WiperRequestDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests/enable: - post: - operationId: ContractsApi_enableWipeRequests - summary: Enable wipe requests. - description: >- - Enable wipe contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests/disable: - post: - operationId: ContractsApi_disableWipeRequests - summary: Disable wipe requests. - description: >- - Disable wipe contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests/{requestId}/approve: - post: - operationId: ContractsApi_approveWipeRequest - summary: Approve wipe request. - description: >- - Approve wipe contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests/{requestId}/reject: - delete: - operationId: ContractsApi_rejectWipeRequest - summary: Reject wipe request. - description: >- - Reject wipe contract request. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: ban - required: false - in: query - description: Reject and ban - schema: - type: boolean - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests: - delete: - operationId: ContractsApi_clearWipeRequests - summary: Clear wipe requests. - description: >- - Clear wipe contract requests. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/admin/{hederaId}: - post: - operationId: ContractsApi_wipeAddAdmin - summary: Add wipe admin. - description: >- - Add wipe contract admin. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveAdmin - summary: Remove wipe admin. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/manager/{hederaId}: - post: - operationId: ContractsApi_wipeAddManager - summary: Add wipe manager. - description: >- - Add wipe contract manager. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveManager - summary: Remove wipe manager. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/wiper/{hederaId}: - post: - operationId: ContractsApi_wipeAddWiper - summary: Add wipe wiper. - description: >- - Add wipe contract wiper. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveWiper - summary: Remove wipe wiper. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/pools/sync: - post: - operationId: ContractsApi_retireSyncPools - summary: Sync retire pools. - description: >- - Sync retire contract pools. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Sync date. - content: - application/json: - schema: - $ref: '#/components/schemas/Date' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests: - get: - operationId: ContractsApi_getRetireRequests - summary: Return a list of all retire requests. - description: Returns all retire requests. - parameters: - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RetireRequestDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools: - get: - operationId: ContractsApi_getRetirePools - summary: Return a list of all retire pools. - description: Returns all retire pools. - parameters: - - name: tokens - required: false - in: query - description: Tokens - example: 0.0.1,0.0.2,0.0.3 - schema: - type: string - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RetirePoolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/requests: - delete: - operationId: ContractsApi_clearRetireRequests - summary: Clear retire requests. - description: >- - Clear retire contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/pools: - delete: - operationId: ContractsApi_clearRetirePools - summary: Clear retire pools. - description: >- - Clear retire contract pools. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - post: - operationId: ContractsApi_setRetirePool - summary: Set retire pool. - description: >- - Set retire contract pool. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RetirePoolTokenDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RetirePoolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools/{poolId}: - delete: - operationId: ContractsApi_unsetRetirePool - summary: Unset retire pool. - description: >- - Unset retire contract pool. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: poolId - required: false - in: path - description: Pool Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}: - delete: - operationId: ContractsApi_unsetRetireRequest - summary: Unset retire request. - description: >- - Unset retire contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: false - in: path - description: Request Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools/{poolId}/retire: - post: - operationId: ContractsApi_retire - summary: Retire tokens. - description: Retire tokens. - parameters: - - name: poolId - required: false - in: path - description: Pool Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RetireRequestTokenDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}/approve: - post: - operationId: ContractsApi_approveRetire - summary: Approve retire request. - description: >- - Approve retire contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}/cancel: - delete: - operationId: ContractsApi_cancelRetireRequest - summary: Cancel retire request. - description: Cancel retire contract request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/admin/{hederaId}: - post: - operationId: ContractsApi_retireAddAdmin - summary: Add retire admin. - description: >- - Add retire contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_retireRemoveAdmin - summary: Remove wipe admin. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire: - get: - operationId: ContractsApi_getRetireVCs - summary: Return a list of all retire vcs. - description: Returns all retire vcs. - parameters: - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /demo/registered-users: - get: - operationId: DemoApi_registeredUsers - summary: Returns list of registered users. - description: Returns list of registered users. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RegisteredUsersDTO' - tags: - - demo - /demo/random-key: - get: - tags: - - demo - description: Generates a new Hedera account with a random private key. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/HederaAccount' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /demo/push/random-key: - get: - tags: - - demo - description: Generates a new Hedera account with a random private key. - security: - - bearerAuth: [] - summary: Generates a new Hedera account with a random private key. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /external: - post: - tags: - - external - description: Sends data from an external source. - summary: Sends data from an external source. - requestBody: - description: Object that contains a VC Document. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalData' - responses: - '200': - description: Successful operation. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /ipfs/file: - post: - operationId: IpfsApi_postFile - summary: Add file from ipfs. - description: Add file from ipfs. - parameters: [] - responses: - '201': - description: '' - tags: - - ipfs - security: - - bearerAuth: [] - /ipfs/file/{cid}: - get: - tags: - - ipfs - description: Get file from ipfs. - summary: Get file from ipfs. - parameters: - - in: path - name: cid - schema: - type: string - required: true - description: File CID. - security: - - bearerAuth: [] - responses: - '201': - description: Created. - content: - binary/octet-stream: - schema: - type: string - format: binary - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /logs: - post: - tags: - - logs - description: Returns logs. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - description: Log filters. - content: - application/json: - schema: - $ref: '#/components/schemas/LogFilters' - summary: Returns logs. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - totalCount: - type: number - logs: - $ref: '#/components/schemas/Log' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /logs/attributes: - get: - tags: - - logs - description: Returns logs attributes. For users with the Standard Registry role only. - parameters: - - in: query - name: name - schema: - type: string - description: Part of name. - - in: query - name: existingAttributes - schema: - type: array - items: - type: string - description: Attributes to exclude. - security: - - bearerAuth: [] - summary: Returns logs attributes. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /map/key: - get: - tags: - - maps - description: Returns map api key. - security: - - bearerAuth: [] - summary: Returns map api key. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /map/sh: - get: - operationId: MapApi_getSentinelKey - parameters: [] - responses: - '200': - description: '' - tags: - - map - /metrics: - get: - operationId: MetricsApi_getMetrics - parameters: [] - responses: - '200': - description: '' - tags: - - metrics - /modules: - get: - tags: - - modules - description: >- - Returns all modules. Only users with the Standard Registry and Installer - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of all modules. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - modules - description: >- - Creates a new module. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new module. - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/schemas: - get: - operationId: ModulesApi_getModuleSchemas - parameters: [] - responses: - '200': - description: '' - tags: &ref_3 - - modules - post: - operationId: ModulesApi_postSchemas - parameters: [] - responses: - '201': - description: '' - tags: *ref_3 - /modules/{uuid}: - get: - tags: - - modules - description: >- - Retrieves module configuration for the specified module ID. Only users - with the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - summary: Retrieves module configuration. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - modules - description: >- - Updates module configuration for the specified module ID. Only users - with the Standard Registry role are allowed to make the request. - summary: Updates module configuration. - parameters: - - in: path - name: uuid - description: Selected module ID. - required: true - schema: - type: string - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - modules - description: >- - Deletes the module with the provided module ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Module ID. - security: - - bearerAuth: [] - summary: Deletes the module. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/menu: - get: - tags: - - modules - description: >- - Returns modules menu. Only users with the Standard Registry and - Installer role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of modules. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/export/file: - get: - tags: - - modules - description: >- - Returns a zip file containing the published module and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - security: - - bearerAuth: [] - summary: >- - Return module and its artifacts in a zip file format for the specified - module. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/export/message: - get: - tags: - - modules - description: >- - Returns the Hedera message ID for the specified module published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - security: - - bearerAuth: [] - summary: Return Heder message ID for the specified published module. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/message: - post: - tags: - - modules - description: >- - Imports new module and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: Imports new module from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the module. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/file: - post: - tags: - - modules - description: >- - Imports new module and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new module from a zip file. - requestBody: - description: >- - A zip file that contains the module and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/message/preview: - post: - tags: - - modules - description: >- - Previews the module from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - summary: Module preview from IPFS. - security: - - bearerAuth: [] - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the module. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/file/preview: - post: - tags: - - modules - description: >- - Previews the module from a zip file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - summary: Module preview from a zip file. - security: - - bearerAuth: [] - requestBody: - description: >- - A zip file that contains the module and associated schemas and VCs to - be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/publish: - put: - tags: - - modules - description: >- - Publishes the module with the specified (internal) module ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - summary: Publishes the module onto IPFS. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/validate: - post: - tags: - - modules - description: >- - Validates selected module. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Validates module. - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ValidateModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tools: - post: - operationId: ToolsApi_createNewTool - summary: Creates a new tool. - description: >- - Creates a new tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_4 - - tools - security: - - bearerAuth: [] - get: - operationId: ToolsApi_getTools - summary: Return a list of all tools. - description: >- - Returns all tools. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: pageSize - required: false - in: query - description: The numbers of items to return - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - schema: - type: number - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push: - post: - operationId: ToolsApi_createNewToolAsync - summary: Creates a new tool. - description: >- - Creates a new tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}: - delete: - operationId: ToolsApi_deleteTool - summary: >- - Deletes the tool with the provided tool ID. Only users with the Standard - Registry role are allowed to make the request. - description: Deletes the tool. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - get: - operationId: ToolsApi_getToolById - summary: Retrieves tool configuration. - description: >- - Retrieves tool configuration for the specified tool ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - put: - operationId: ToolsApi_updateTool - summary: Updates tool configuration. - description: >- - Updates tool configuration for the specified tool ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/publish: - put: - operationId: ToolsApi_publishTool - summary: Publishes the tool onto IPFS. - description: >- - Publishes the tool with the specified (internal) tool ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/push/publish: - put: - operationId: ToolsApi_publishToolAsync - summary: Publishes the tool onto IPFS. - description: >- - Publishes the tool with the specified (internal) tool ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/validate: - post: - operationId: ToolsApi_validateTool - summary: Validates selected tool. - description: >- - Validates selected tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/export/file: - get: - operationId: ToolsApi_toolExportFile - summary: >- - Return tool and its artifacts in a zip file format for the specified - tool. - description: >- - Returns a zip file containing the published tool and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. Response zip file. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/export/message: - get: - operationId: ToolsApi_toolExportMessage - summary: Return Heder message ID for the specified published tool. - description: >- - Returns the Hedera message ID for the specified tool published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/message/preview: - post: - operationId: ToolsApi_toolImportMessagePreview - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/message: - post: - operationId: ToolsApi_toolImportMessage - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/file/preview: - post: - operationId: ToolsApi_toolImportFilePreview - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/file: - post: - operationId: ToolsApi_toolImportFile - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push/import/file: - post: - operationId: ToolsApi_toolImportFileAsync - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push/import/message: - post: - operationId: ToolsApi_toolImportMessageAsync - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/menu/all: - get: - operationId: ToolsApi_getMenu - summary: Return a list of tools. - description: >- - Returns tools menu. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /profiles/{username}: - get: - operationId: ProfileApi_getProfile - summary: Returns user account info. - description: >- - Returns user account information. For users with the Standard Registry - role it also returns address book and VC document information. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to fetch the information - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_5 - - profiles - security: - - bearerAuth: [] - - bearer: [] - put: - operationId: ProfileApi_setUserProfile - summary: Sets Hedera credentials for the user. - description: >- - Sets Hedera credentials for the user. For users with the Standard - Registry role it also creates an address book. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to update the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Created. - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/push/{username}: - put: - operationId: ProfileApi_setUserProfileAsync - summary: Sets Hedera credentials for the user. - description: >- - Sets Hedera credentials for the user. For users with the Standard - Registry role it also creates an address book. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to update the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/{username}/balance: - get: - operationId: ProfileApi_getUserBalance - summary: Returns user's Hedera account balance. - description: >- - Requests Hedera account balance. Only users with the Installer role are - allowed to make the request. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to fetch the balance. - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/restore/{username}: - put: - operationId: ProfileApi_restoreUserProfile - summary: Restore user data (policy, DID documents, VC documents). - description: Restore user data (policy, DID documents, VC documents). - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to restore the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/restore/topics/{username}: - put: - operationId: ProfileApi_restoreTopic - summary: List of available recovery topics. - description: List of available recovery topics. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to restore the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/did-document/validate: - post: - operationId: ProfileApi_validateDidDocument - summary: Validate DID document format. - description: Validate DID document format. - parameters: [] - requestBody: - required: true - description: DID Document. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/did-keys/validate: - post: - operationId: ProfileApi_validateDidKeys - summary: Validate DID document keys. - description: Validate DID document keys. - parameters: [] - requestBody: - required: true - description: DID Document and keys. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentWithKeyDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/DidKeyStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /policies: - get: - tags: - - policies - description: >- - Returns all policies. Only users with the Standard Registry and - Installer role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of all policies. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/PolicyConfig' - - type: object - properties: - userRoles: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: >- - Creates a new policy. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/migrate-data: - post: - operationId: PolicyApi_migrateData - summary: Migrate policy data. - description: >- - Migrate policy data. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Migration config. - content: - application/json: - schema: - $ref: '#/components/schemas/MigrationConfigDTO' - responses: - '200': - description: Errors while migration. - content: - application/json: - schema: - type: array - items: - type: object - properties: - error: - type: string - id: - type: string - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_6 - - policies - security: - - bearerAuth: [] - /policies/push/migrate-data: - post: - operationId: PolicyApi_migrateDataAsync - summary: Migrate policy data asynchronous. - description: >- - Migrate policy data asynchronous. Only users with the Standard Registry - role are allowed to make the request. - parameters: [] - requestBody: - required: true - description: Migration config. - content: - application/json: - schema: - $ref: '#/components/schemas/MigrationConfigDTO' - responses: - '202': - description: Created task. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - /policies/push: - post: - tags: - - policies - description: >- - Creates a new policy. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/{policyId}: - post: - operationId: PolicyApi_updatePolicyAsync - summary: '' - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - delete: - operationId: PolicyApi_deletePolicyAsync - parameters: [] - responses: - '202': - description: '' - tags: *ref_6 - security: - - bearerAuth: [] - /policies/{policyId}: - get: - tags: - - policies - description: >- - Retrieves policy configuration for the specified policy ID. Only users - with the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Retrieves policy configuration. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/PolicyConfig' - - type: object - properties: - userRoles: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - policies - description: >- - Updates policy configuration for the specified policy ID. Only users - with the Standard Registry role are allowed to make the request. - summary: Updates policy configuration. - parameters: - - in: path - name: policyId - description: Selected policy ID. - required: true - schema: - type: string - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/publish: - put: - tags: - - policies - description: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - policyVersion: - type: string - summary: Publishes the policy onto IPFS. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/{policyId}/publish: - put: - tags: - - policies - description: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - security: - - bearerAuth: [] - summary: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - policyVersion: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run: - put: - tags: - - policies - description: >- - Run policy without making any persistent changes or executing - transaction. Only users with the Standard Registry role are allowed to - make the request. - security: - - bearerAuth: [] - summary: Dry Run policy. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/discontinue: - put: - operationId: PolicyApi_discontinuePolicy - summary: Discontunue policy. - description: >- - Discontunue policy. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy identifier. - schema: {} - requestBody: - required: true - description: Discontinue details. - content: - application/json: - schema: - type: object - properties: - date: - type: date - responses: - '200': - description: Policies. - content: - application/json: - schema: - type: array - items: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/draft: - put: - tags: - - policies - description: >- - Return policy to editing. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Return policy to editing. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/validate: - post: - tags: - - policies - description: >- - Validates selected policy. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Validates policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ValidatePolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/navigation: - get: - operationId: PolicyApi_getPolicyNavigation - summary: Returns a policy navigation. - description: Returns a policy navigation. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/groups: - get: - tags: - - policies - description: Returns a list of groups the user is a member of. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Returns a list of groups the user is a member of. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: string - uuid: - type: string - role: - type: string - groupLabel: - type: string - groupName: - type: string - active: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: >- - Makes the selected group active. if UUID is not set then returns the - user to the default state. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Makes the selected group active. - requestBody: - description: Selected group. - required: true - content: - application/json: - schema: - type: object - properties: - uuid: - type: string - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/documents: - get: - operationId: PolicyApi_getPolicyDocuments - summary: Get policy documents. - description: >- - Get policy documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: pageSize - required: true - in: query - description: Page size. - schema: - type: number - - name: pageIndex - required: true - in: query - description: Page index. - schema: - type: number - - name: type - required: true - in: query - description: Document type. - schema: - enum: - - VC - - VP - type: string - - name: includeDocument - required: true - in: query - description: Include document field. - schema: - type: boolean - - name: policyId - required: true - in: path - description: Policy identifier. - schema: {} - responses: - '200': - description: Documents. - headers: - X-Total-Count: - description: Total documents count. - content: - application/json: - schema: - type: array - items: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/blocks: - get: - tags: - - policies - description: >- - Returns data from the root policy block. Only users with the Standard - Registry and Installer role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Retrieves data for the policy root block. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlock' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/blocks/{uuid}: - get: - tags: - - policies - description: >- - Requests block data. Only users with a role that described in block are - allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: uuid - schema: - type: string - required: true - description: Selected block UUID. - summary: Requests block data. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: Sends data to the specified block. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: uuid - schema: - type: string - required: true - description: Selected block UUID. - summary: Sends data to the specified block. - requestBody: - description: Object with the data to be sent to the block. - required: true - content: - application/json: - schema: - type: object - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tagName}/blocks: - post: - operationId: PolicyApi_setBlocksByTagName - summary: Sends data to the specified block. - description: Sends data to the specified block. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - get: - operationId: PolicyApi_getBlocksByTagName - summary: Requests block data. - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/tag/{tagName}: - get: - operationId: PolicyApi_getBlockByTagName - summary: Requests block data. - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/blocks/{uuid}/parents: - get: - operationId: PolicyApi_getBlockParents - parameters: [] - responses: - '200': - description: '' - tags: *ref_6 - /policies/{policyId}/export/file: - get: - tags: - - policies - description: >- - Returns a zip file containing the published policy and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - security: - - bearerAuth: [] - summary: >- - Return policy and its artifacts in a zip file format for the specified - policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/export/message: - get: - tags: - - policies - description: >- - Returns the Hedera message ID for the specified policy published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - security: - - bearerAuth: [] - summary: Return Heder message ID for the specified published policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/export/xlsx: - get: - operationId: PolicyApi_getPolicyExportXlsx - summary: >- - Return policy and its artifacts in a xlsx file format for the specified - policy. - description: >- - Returns a xlsx file containing the published policy and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/import/message: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: query - name: versionOfTopicId - schema: - type: string - description: The topic ID of policy version. - examples: - pageIndex: - summary: Example of a topic ID of policy version. - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new policy from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the Policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/message: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the Policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/message/preview: - post: - tags: - - policies - description: >- - Previews the policy from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - summary: Policy preview from IPFS. - security: - - bearerAuth: [] - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/message/preview: - post: - tags: - - policies - description: >- - Previews the policy from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Previews the policy from IPFS without loading it into the local DB. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/file: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: query - name: versionOfTopicId - schema: - type: string - description: The topic ID of policy version. - examples: - pageIndex: - summary: Example of a topic ID of policy version. - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new policy from a zip file. - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/file: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/file/preview: - post: - tags: - - policies - description: >- - Previews the policy from a zip file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - summary: Policy preview from a zip file. - security: - - bearerAuth: [] - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/xlsx: - post: - operationId: PolicyApi_importPolicyFromXlsx - summary: Imports new policy from a xlsx file. - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided xlsx file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - name: policyId - required: true - in: query - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/push/import/xlsx: - post: - operationId: PolicyApi_importPolicyFromXlsxAsync - summary: Imports new policy from a xlsx file. - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided xlsx file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - name: policyId - required: true - in: query - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/import/xlsx/preview: - post: - operationId: PolicyApi_importPolicyFromXlsxPreview - summary: Policy preview from a xlsx file. - description: >- - Previews the policy from a xlsx file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/blocks/about: - get: - operationId: PolicyApi_getBlockAbout - parameters: [] - responses: - '200': - description: '' - tags: *ref_6 - /policies/{policyId}/dry-run/users: - get: - tags: - - policies - description: >- - Returns all virtual users. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns all virtual users. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/user: - post: - tags: - - policies - description: >- - Create a new virtual account. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Create a new virtual account. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/login: - post: - tags: - - policies - description: >- - Logs virtual user into the system. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Logs virtual user into the system. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Virtual user - required: true - content: - application/json: - schema: - type: object - properties: - did: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/restart: - post: - tags: - - policies - description: >- - Restarts the execution of the policy. Clear data in database. Only users - with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Restarts the execution of the policy. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/transactions: - get: - tags: - - policies - description: >- - Returns lists of virtual transactions. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual transactions. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - type: - type: string - hederaAccountId: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/artifacts: - get: - tags: - - policies - description: >- - Returns lists of virtual artifacts. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual artifacts. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - type: - type: string - owner: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/ipfs: - get: - tags: - - policies - description: >- - Returns lists of virtual artifacts. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual artifacts. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - documentURL: - type: string - document: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/multiple: - post: - tags: - - policies - description: >- - Creates a link between the current policy and the main policy. Or - creates a group making the current policy the main one. - security: - - bearerAuth: [] - summary: Creates Multi policy config. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Multi policy config. - required: true - content: - application/json: - schema: - type: object - required: - - mainPolicyTopicId - - synchronizationTopicId - properties: - mainPolicyTopicId: - type: string - synchronizationTopicId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/MultiPolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - policies - description: Requests Multi policy config. - security: - - bearerAuth: [] - summary: Requests Multi policy config. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/MultiPolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/methodologies/categories: - get: - operationId: PolicyApi_getPolicyCategoriesAsync - summary: Get all categories - description: Get all categories - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyCategoryDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - /policies/methodologies/search: - post: - operationId: PolicyApi_getPoliciesByCategory - summary: Get filtered policies - description: Get policies by categories and text - parameters: [] - requestBody: - required: true - description: Filters - content: - application/json: - schema: - type: string - examples: - Filter1: - value: - categoryIds: - - '000000000000000000000001' - - '000000000000000000000002' - text: abc - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - /schema/{schemaId}: - get: - tags: - - schema - description: Returns schema by schema ID. - security: - - bearerAuth: [] - summary: Returns schema by schema ID. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schema/{schemaId}/parents: - get: - operationId: SingleSchemaApi_getSchemaParents - summary: Returns all parent schemas. - description: Returns all parent schemas. - parameters: - - name: schemaId - required: true - in: path - description: Schema identifier - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_7 - - schema - security: - - bearerAuth: [] - /schema/{schemaId}/tree: - get: - operationId: SingleSchemaApi_getSchemaTree - summary: Returns schema tree. - description: Returns schema tree. - parameters: - - name: schemaId - required: true - in: path - description: Schema identifier - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - name: - type: string - type: - type: string - children: - type: array - items: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_7 - security: - - bearerAuth: [] - /schemas: - get: - tags: - - schemas - description: Returns all schemas. - security: - - bearerAuth: [] - summary: Returns all schemas. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}: - post: - tags: - - schemas - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Create new schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - schemas - description: Returns all schemas by topicId. - security: - - bearerAuth: [] - summary: Returns all schemas by topicId. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/type/{schemaType}: - get: - operationId: SchemaApi_getSchemaByType - summary: Finds the schema using the json document type. - description: Finds the schema using the json document type. - parameters: - - name: schemaType - required: true - in: path - description: Type - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_8 - - schemas - security: - - bearerAuth: [] - /schemas/list/all: - get: - operationId: SchemaApi_getAll - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - /schemas/list/sub: - get: - operationId: SchemaApi_getSub - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: category - required: false - in: query - description: Schema category - schema: - type: string - - name: topicId - required: false - in: query - description: Topic Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - /schemas/push/copy: - post: - operationId: SchemaApi_copySchemaAsync - summary: Copy schema. - description: >- - Copy schema. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Object that contains a valid schema. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearer: [] - - bearerAuth: [] - /schemas/push/{topicId}: - post: - tags: - - schemas - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Create new schema. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}: - put: - tags: - - schemas - description: >- - Updates the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - schemas - description: >- - Deletes the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Deletes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/publish: - put: - tags: - - schemas - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{schemaId}/publish: - put: - tags: - - schemas - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/import/message/preview: - post: - tags: - - schemas - description: >- - Previews the schema from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/import/message/preview: - post: - tags: - - schemas - description: >- - Previews the schema from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/import/file/preview: - post: - tags: - - schemas - description: >- - Previews the schema from a zip file. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from a zip file. - requestBody: - description: A zip file containing the schema to be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}/import/message: - post: - tags: - - schemas - description: >- - Imports new schema from IPFS into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new schema from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{topicId}/import/message: - post: - tags: - - schemas - description: >- - Imports new schema from IPFS into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new schema from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}/import/file: - post: - tags: - - schemas - description: >- - Imports new schema from a zip file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new schema from a zip file. - requestBody: - description: A zip file containing schema to be imported. - content: - binary/octet-stream: - schema: - type: string - format: binary - required: true - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{topicId}/import/file: - post: - tags: - - schemas - description: >- - Imports new schema from a zip file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new schema from a zip file. - requestBody: - description: A zip file containing schema to be imported. - content: - binary/octet-stream: - schema: - type: string - format: binary - required: true - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/message: - post: - tags: - - schemas - description: >- - Returns Hedera message IDs of the published schemas, these messages - contain IPFS CIDs of these schema files. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: List Hedera message IDs of published schemas. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Selected schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportSchema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/file: - post: - tags: - - schemas - description: >- - Returns schema files for the schemas. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return zip file with schemas. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Selected schema ID. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{username}: - post: - tags: - - schemas - description: >- - Creates new system schema. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Creates new system schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - schemas - description: >- - Returns all system schemas by username. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns all system schemas by username. - parameters: - - in: path - name: username - schema: - type: string - required: true - description: Username. - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set. - examples: - pageIndex: - summary: Example of a pageIndex. - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The number of items to return. - examples: - pageSize: - summary: Example of a pageSize. - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total number of items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{schemaId}: - put: - tags: - - schemas - description: >- - Updates the system schema with the provided schema ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - schemas - description: >- - Deletes the system schema with the provided schema ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Deletes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{schemaId}/active: - put: - tags: - - schemas - description: >- - Makes the selected scheme active. Other schemes of the same type become - inactive. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/entity/{schemaEntity}: - get: - tags: - - schemas - description: Finds the schema using the schema type. - parameters: - - in: path - name: schemaEntity - schema: - type: string - enum: - - STANDARD_REGISTRY - - USER - - POLICY - - MINT_TOKEN - - WIPE_TOKEN - - MINT_NFTOKEN - required: true - description: schema type. - security: - - bearerAuth: [] - summary: Returns schema by schema type. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/xlsx: - get: - operationId: SchemaApi_getPolicyExportXlsx - summary: Return schemas in a xlsx file format for the specified policy. - description: >- - Returns a xlsx file containing schemas. Only users with the Standard - Registry role are allowed to make the request. - parameters: - - name: schemaId - required: true - in: path - description: Schema ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/{topicId}/import/xlsx: - post: - operationId: SchemaApi_importPolicyFromXlsx - summary: Imports new schema from a xlsx file into the local DB. - description: >- - Imports new schema from a xlsx file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: topicId - required: true - in: path - description: Topic Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/push/{topicId}/import/xlsx: - post: - operationId: SchemaApi_importPolicyFromXlsxAsync - summary: Imports new schema from a xlsx file into the local DB. - description: >- - Imports new schema from a xlsx file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: topicId - required: true - in: path - description: Topic Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/import/xlsx/preview: - post: - operationId: SchemaApi_importPolicyFromXlsxPreview - summary: Previews the schema from a xlsx file. - description: >- - Previews the schema from a xlsx file. Only users with the Standard - Registry role are allowed to make the request. - parameters: [] - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/export/template: - get: - operationId: SchemaApi_exportTemplate - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /settings: - get: - tags: - - settings - description: >- - Returns current settings. For users with the Standard Registry role - only. - security: - - bearerAuth: [] - summary: Returns current settings. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CommonSettings' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - settings - description: Set settings. For users with the Standard Registry role only. - security: - - bearerAuth: [] - summary: Set settings. - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/CommonSettings' - /settings/environment: - get: - tags: - - settings - description: Returns current environment name. - security: - - bearerAuth: [] - summary: Returns current environment name. - responses: - '200': - description: Successful operation. - content: - text/plain: - schema: - type: string - example: testnet - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /settings/about: - get: - operationId: SettingsApi_getAbout - parameters: [] - responses: - '200': - description: '' - tags: - - settings - /tags: - post: - operationId: TagsApi_setTags - parameters: [] - responses: - '201': - description: '' - tags: - - tags - /tags/search: - post: - tags: - - tags - description: Search tags. - security: - - bearerAuth: [] - requestBody: - description: Object that contains filters. - required: true - content: - application/json: - schema: - oneOf: - - type: object - required: - - entity - - target - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - target: - type: string - - type: object - required: - - entity - - targets - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - targets: - type: array - items: - type: string - examples: - Single: - value: - entity: PolicyDocument - target: targetId1 - Multiple: - value: - entity: PolicyDocument - targets: - - targetId1 - - targetId2 - summary: Search tags. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - description: a (targetId, Tags) map. `targetId1` is an example key - properties: - targetId1: - $ref: '#/components/schemas/TagMap' - additionalProperties: - $ref: '#/components/schemas/TagMap' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/{uuid}: - delete: - tags: - - tags - description: Delete tag. - security: - - bearerAuth: [] - summary: Delete tag. - parameters: - - in: path - name: uuid - schema: - type: string - example: 00000000-0000-0000-0000-000000000000 - required: true - description: Tag identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/synchronization: - post: - tags: - - tags - description: synchronization. - security: - - bearerAuth: [] - requestBody: - description: Object that contains filters. - required: true - content: - application/json: - schema: - type: object - required: - - entity - - target - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: targetId - summary: synchronization. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TagMap' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas: - get: - tags: - - tags - description: Returns all schema. - security: - - bearerAuth: [] - summary: Returns all schemas. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - tags - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates new schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/{schemaId}: - delete: - tags: - - tags - description: >- - Deletes the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Delete the schema. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - tags - description: >- - Updates the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/{schemaId}/publish: - put: - tags: - - tags - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/published: - get: - tags: - - tags - description: Return a list of all published schemas. - security: - - bearerAuth: [] - summary: Return a list of all published schemas. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tasks/{taskId}: - get: - tags: - - tasks - description: Returns task statuses by Id. - security: - - bearerAuth: [] - summary: Returns task statuses. - parameters: - - in: path - name: taskId - schema: - type: string - required: true - description: Task ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskStatus' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens: - get: - tags: - - tokens - description: >- - Returns all tokens. For the Standard Registry role it returns only the - list of tokens, for other users it also returns token balances as well - as the KYC, Freeze, and Association statuses. Not allowed for the - Auditor role. - security: - - bearerAuth: [] - summary: Return a list of tokens. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/TokenInfo' - - type: object - properties: - policies: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - tokens - description: >- - Creates a new token. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new token. - requestBody: - description: Object that contains token information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Token' - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/TokenInfo' - - type: object - properties: - policies: - type: array - items: - type: string - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push: - post: - tags: - - tokens - description: >- - Creates a new token. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new token. - requestBody: - description: Object that contains token information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Token' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}: - delete: - operationId: TokensApi_deleteTokenAsync - parameters: [] - responses: - '202': - description: '' - tags: &ref_9 - - tokens - /tokens/{tokenId}/associate: - put: - tags: - - tokens - description: >- - Associates the user with the provided Hedera token. Only users with the - Installer role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - security: - - bearerAuth: [] - summary: Associates the user with the provided Hedera token. - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/associate: - put: - tags: - - tokens - description: >- - Associates the user with the provided Hedera token. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Associates the user with the provided Hedera token. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/dissociate: - put: - tags: - - tokens - description: >- - Disassociates the user with the provided Hedera token. Only users with - the Installer role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - security: - - bearerAuth: [] - summary: Associate the user with the provided Hedera token. - responses: - '202': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/dissociate: - put: - tags: - - tokens - description: >- - Disassociates the user with the provided Hedera token. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Disassociates the user with the provided Hedera token. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/grant-kyc: - put: - tags: - - tokens - description: >- - Sets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Sets the KYC flag for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/grant-kyc: - put: - tags: - - tokens - description: >- - Sets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Sets the KYC flag for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/revoke-kyc: - put: - tags: - - tokens - description: >- - Unsets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Unsets the KYC flag for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/revoke-kyc: - put: - tags: - - tokens - description: >- - Unsets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Unsets the KYC flag for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/freeze: - put: - tags: - - tokens - description: >- - Freezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Freeze transfers of the specified token for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/unfreeze: - put: - tags: - - tokens - description: >- - Unfreezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Unfreezes transfers of the specified token for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/freeze: - put: - tags: - - tokens - description: >- - Freezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Freeze transfers of the specified token for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/unfreeze: - put: - tags: - - tokens - description: >- - Unfreezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Unfreezes transfers of the specified token for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/info: - get: - tags: - - tokens - description: >- - Returns user information for the selected token. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/serials: - get: - operationId: TokensApi_getTokenSerials - summary: Return token serials. - description: Returns token serials of current user. - parameters: - - name: tokenId - required: true - in: path - description: Token identifier - example: 0.0.1 - schema: - type: string - responses: - '200': - description: Token serials. - content: - application/json: - schema: - type: array - items: - type: number - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_9 - security: - - bearer: [] - /themes: - get: - tags: - - themes - description: Returns all themes. - security: - - bearerAuth: [] - summary: Return a list of all themes. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - themes - description: Creates a new theme. - security: - - bearerAuth: [] - summary: Creates a new theme. - requestBody: - description: Object that contains theme configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/{themeId}: - put: - tags: - - themes - description: Updates theme configuration for the specified theme ID. - summary: Updates theme configuration. - parameters: - - in: path - name: themeId - description: Selected theme ID. - required: true - schema: - type: string - requestBody: - description: Object that contains theme configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - themes - description: Deletes the theme with the provided theme ID. - parameters: - - in: path - name: themeId - schema: - type: string - required: true - description: Theme ID. - security: - - bearerAuth: [] - summary: Deletes the theme. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/import/file: - post: - tags: - - themes - description: Imports new theme from the provided zip file into the local DB. - security: - - bearerAuth: [] - summary: Imports new theme from a zip file. - requestBody: - description: A zip file that contains the theme to be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/{themeId}/export/file: - get: - tags: - - themes - description: Returns a zip file containing the theme. - parameters: - - in: path - name: themeId - schema: - type: string - required: true - description: Selected theme ID. - security: - - bearerAuth: [] - summary: Returns a zip file containing the theme. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /trust-chains: - get: - tags: - - trustchains - description: >- - Requests all VP documents. Only users with the Auditor role are allowed - to make the request. - security: - - bearerAuth: [] - summary: Returns a list of all VP documents. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - - in: query - name: policyId - schema: - type: string - description: Selected policy ID. - - in: query - name: policyOwner - schema: - type: string - description: Selected Standard Registry (DID). - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/VerifiablePresentation' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /trust-chains/{hash}: - get: - tags: - - trustchains - description: >- - Builds and returns a trustchain, from the VP to the root VC document. - Only users with the Auditor role are allowed to make the request. - parameters: - - in: path - name: hash - schema: - type: string - required: true - description: Hash or ID of a VP document. - security: - - bearerAuth: [] - summary: Returns a trustchain for a VP document. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TrustChains' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /wizard/policy: - post: - tags: - - wizard - description: >- - Creates a new policy by wizard. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains wizard configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WizardConfig' - responses: - '201': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - policyId: - type: string - wizardConfig: - $ref: '#/components/schemas/WizardConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /wizard/push/policy: - post: - operationId: WizardApi_setPolicyAsync - summary: Creates a new policy. - description: >- - Creates a new policy by wizard. Only users with the Standard Registry - role are allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - saveState: - type: boolean - wizardConfig: - type: object - required: - - policy - - roles - - schemas - - trustChain - properties: - roles: - type: array - items: - type: string - policy: - type: object - properties: - name: - type: string - description: - type: string - topicDescription: - type: string - policyTag: - type: string - schemas: - type: array - items: - type: object - properties: - name: - type: string - iri: - type: string - isApproveEnable: - type: boolean - isMintSchema: - type: boolean - mintOptions: - type: object - properties: - tokenId: - type: string - rule: - type: string - dependencySchemaIri: - type: string - relationshipsSchemaIri: - type: string - initialRolesFor: - type: array - items: - type: string - rolesConfig: - type: array - items: - type: object - properties: - role: - type: string - isApprover: - type: boolean - isCreator: - type: boolean - gridColumns: - type: array - items: - type: object - properties: - field: - type: string - title: - type: string - trustChain: - type: array - items: - type: object - properties: - role: - type: string - mintSchemaIri: - type: string - viewOnlyOwnDocuments: - type: boolean - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: - - wizard - /wizard/{policyId}/config: - post: - tags: - - wizard - description: >- - Get policy config by wizard. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier. - security: - - bearerAuth: [] - summary: Get policy config. - requestBody: - description: Object that contains wizard configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WizardConfig' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - policyConfig: - $ref: '#/components/schemas/PolicyConfig' - wizardConfig: - $ref: '#/components/schemas/WizardConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /branding: - post: - operationId: BrandingApi_setBranding - parameters: [] - responses: - '401': - description: Unauthorized - tags: &ref_10 - - branding - security: - - bearer: [] - get: - operationId: BrandingApi_getBranding - parameters: [] - responses: - '200': - description: '' - tags: *ref_10 - /suggestions: - post: - operationId: SuggestionsApi_policySuggestions - summary: Get next and nested suggested block types - description: >- - Get next and nested suggested block types. Only users with the Standard - Registry role are allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsInputDTO' - responses: - '200': - description: >- - Successful operation. Suggested next and nested block types - respectively. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsOutputDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_11 - - suggestions - security: - - bearer: [] - - bearerAuth: [] - /suggestions/config: - post: - operationId: SuggestionsApi_setPolicySuggestionsConfig - summary: Set suggestions config - description: >- - Set suggestions config. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - responses: - '201': - description: Successful operation. Response setted suggestions config. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_11 - security: - - bearer: [] - - bearerAuth: [] - get: - operationId: SuggestionsApi_getPolicySuggestionsConfig - summary: Get suggestions config - description: >- - Get suggestions config. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. Response suggestions config. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_11 - security: - - bearer: [] - - bearerAuth: [] - /notifications: - get: - operationId: NotificationsApi_getAllNotifications - summary: Get all notifications - description: Returns all notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns notifications and count. - headers: - X-Total-Count: - description: Count of notifications - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_12 - - notifications - security: - - bearer: [] - - bearerAuth: [] - /notifications/new: - get: - operationId: NotificationsApi_getNewNotifications - summary: Get new notifications - description: Returns new notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns new notifications. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/progresses: - get: - operationId: NotificationsApi_getProgresses - summary: Get progresses - description: Returns progresses. - parameters: [] - responses: - '200': - description: Successful operation. Returns progresses. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ProgressDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/read/all: - post: - operationId: NotificationsApi_readAll - summary: Read all notifications - description: Returns new notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns notifications. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/delete/{notificationId}: - delete: - operationId: NotificationsApi_delete - summary: Delete notifications up to this point - description: Returns deleted notifications count. - parameters: - - name: notificationId - required: true - in: path - schema: - type: string - responses: - '200': - description: Successful operation. Returns deleted notifications count. - content: - application/json: - schema: - type: number - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /projects/search: - post: - operationId: ProjectsAPI_projectSearch - summary: Search projects - description: Search projects by filters - parameters: [] - requestBody: - required: true - description: The question of choosing a methodology - content: - application/json: - schema: - type: string - examples: - q: - value: >- - What methodology can I use for production of electricity using - renewable energy technologies? - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ProjectDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_13 - - projects - /projects/compare/documents: - post: - operationId: ProjectsAPI_compareDocuments - summary: Compare documents. - description: Compare documents. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareDocumentsDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_13 - /projects/properties: - get: - operationId: ProjectsAPI_getPolicyProperties - summary: Get all properties - description: Get all properties - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PropertiesDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_13 - /record/{policyId}/status: - get: - operationId: RecordApi_getRecordStatus - summary: Get recording or running status. - description: >- - Get recording or running status. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RecordStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_14 - - record - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/start: - post: - operationId: RecordApi_startRecord - summary: Start recording. - description: >- - Start recording. Only users with the Standard Registry role are allowed - to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/stop: - post: - operationId: RecordApi_stopRecord - summary: Stop recording. - description: >- - Stop recording. Only users with the Standard Registry role are allowed - to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/actions: - get: - operationId: RecordApi_getRecordActions - summary: Get recorded actions. - description: >- - Get recorded actions. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RecordActionDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/start: - post: - operationId: RecordApi_runRecord - summary: Run record from a zip file. - description: >- - Run record from a zip file. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A zip file containing record to be run. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/stop: - post: - operationId: RecordApi_stopRunning - summary: Stop running. - description: >- - Stop running. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/results: - get: - operationId: RecordApi_getRecordResults - summary: Get running results. - description: >- - Get running results. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RunningResultDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/details: - get: - operationId: RecordApi_getRecordDetails - summary: Get running details. - description: >- - Get running details. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RunningDetailsDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/fast-forward: - post: - operationId: RecordApi_fastForward - summary: Fast Forward. - description: >- - Fast Forward. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/retry: - post: - operationId: RecordApi_retryStep - summary: Retry step. - description: >- - Retry step. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/skip: - post: - operationId: RecordApi_skipStep - summary: Skip step. - description: >- - Skip step. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /ai-suggestions/ask: - get: - operationId: AISuggestionsAPI_getAIAnswer - summary: Get methodology suggestion - description: Returns AI response to the current question - parameters: - - name: q - required: true - in: path - description: The question of choosing a methodology - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_15 - - ai-suggestions - /ai-suggestions/rebuild-vector: - put: - operationId: AISuggestionsAPI_rebuildVector - summary: Rebuild AI vector - description: Rebuilds vector based on policy data in the DB - parameters: [] - responses: - '200': - description: '' - tags: *ref_15 - /schemas/type/{type}: - get: - tags: - - schemas - description: Finds the schema using the json document type. - parameters: - - in: path - name: type - schema: - type: string - required: true - description: JSON type. - security: - - bearerAuth: [] - summary: Returns schema by type. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tag}: - get: - tags: - - policies - description: >- - Requests block ID from a policy by tag. Only users with the Standard - Registry and Installer roles are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - summary: Requests block ID from a policy by tag. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - id: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tag}/blocks: - post: - tags: - - policies - description: Sends data to the specified block. - security: - - bearerAuth: [] - summary: Sends data to the specified block. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - requestBody: - description: Object with the data to be sent to the block. - required: true - content: - application/json: - schema: - type: object - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - policies - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - security: - - bearerAuth: [] - summary: Requests block data. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /ipfs/file/: - post: - tags: - - ipfs - description: Add file to ipfs. - summary: Add file to ipfs. - requestBody: - description: Data array of file. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - security: - - bearerAuth: [] - responses: - '201': - description: Created. - content: - application/json: - schema: - description: CID of added file. - type: string - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifacts/{policyId}: - post: - tags: - - artifacts - description: Upload artifact. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - artifacts: - type: array - items: - type: string - format: binary - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier - summary: Upload Artifact. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact: - get: - deprecated: true - tags: - - artifacts - description: Returns all artifacts. - security: - - bearerAuth: [] - summary: Returns all artifacts. - parameters: - - in: query - name: policyId - schema: - type: string - description: Policy identifier - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact/{policyId}: - post: - deprecated: true - tags: - - artifacts - description: Upload artifact. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - artifacts: - type: array - items: - type: string - format: binary - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier - summary: Upload Artifact. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact/{artifactId}: - delete: - deprecated: true - tags: - - artifacts - description: Delete artifact. - security: - - bearerAuth: [] - summary: Delete artifact. - parameters: - - in: path - name: artifactId - schema: - type: string - required: true - description: Artifact identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/: - post: - tags: - - tags - description: Creates new tag. - security: - - bearerAuth: [] - summary: Creates new tag. - requestBody: - description: Object that contains tag information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Tag' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Tag' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' -info: - title: Guardian - description: >- - The Guardian is a modular open-source solution that includes best-in-class - identity management and decentralized ledger technology (DLT) libraries. At - the heart of the Guardian solution is a sophisticated Policy Workflow Engine - (PWE) that enables applications to offer a requirements-based tokenization - implementation. - version: 2.21.1 - contact: - name: API developer - url: https://envisionblockchain.com - email: info@envisionblockchain.com - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html -tags: [] -servers: - - url: /api/v1 - description: version 1.0 -components: - securitySchemes: - bearerAuth: - type: http - scheme: bearer - bearerFormat: JWT - schemas: - AccountsResponseDTO: - type: object - properties: - username: - type: string - role: - type: string - did: - type: string - required: - - username - - role - - did - InternalServerErrorDTO: - type: object - properties: - code: - type: number - message: - type: string - required: - - code - - message - RegisterUserDTO: - type: object - properties: - username: - type: string - password: - type: string - password_confirmation: - type: string - role: - type: string - required: - - username - - password - - password_confirmation - - role - AccountsSessionResponseDTO: - type: object - properties: - username: - type: string - role: - type: string - accessToken: - type: string - required: - - username - - role - - accessToken - LoginUserDTO: - type: object - properties: - username: - type: string - password: - type: string - required: - - username - - password - CredentialSubjectDTO: - type: object - properties: - geography: - type: string - law: - type: string - tags: - type: string - ISIC: - type: string - '@context': - type: array - items: - type: string - id: - type: string - type: - type: string - required: - - geography - - law - - tags - - ISIC - - '@context' - - id - - type - ProofDTO: - type: object - properties: - type: - type: string - created: - format: date-time - type: string - verificationMethod: - type: string - proofPurpose: - type: string - jws: - type: string - required: - - type - - created - - verificationMethod - - proofPurpose - - jws - VcDocumentDTO: - type: object - properties: - id: - type: string - type: - type: array - items: - type: string - issuer: - type: string - issuanceDate: - format: date-time - type: string - '@context': - type: array - items: - type: string - credentialSubject: - $ref: '#/components/schemas/CredentialSubjectDTO' - proof: - $ref: '#/components/schemas/ProofDTO' - required: - - id - - type - - issuer - - issuanceDate - - '@context' - - credentialSubject - - proof - PolicyDTO: - type: object - properties: - _id: - type: string - createDate: - format: date-time - type: string - uuid: - type: string - name: - type: string - description: - type: string - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - policyTag: - type: string - codeVersion: - type: string - userRoles: - type: array - items: - type: string - userGroups: - type: array - items: - type: string - userRole: - type: string - userGroup: - type: string - id: - type: string - required: - - _id - - createDate - - uuid - - name - - description - - status - - creator - - owner - - topicId - - policyTag - - codeVersion - - userRoles - - userGroups - - userRole - - userGroup - - id - AggregatedDTOItem: - type: object - properties: - did: - type: string - hederaAccountId: - type: string - vcDocument: - $ref: '#/components/schemas/VcDocumentDTO' - policies: - $ref: '#/components/schemas/PolicyDTO' - required: - - did - - hederaAccountId - - vcDocument - - policies - UserDTO: - type: object - properties: - username: - type: string - did: - type: string - required: - - username - - did - BalanceResponseDTO: - type: object - properties: - balance: - type: number - unit: - type: string - user: - $ref: '#/components/schemas/UserDTO' - required: - - balance - - unit - - user - FilterSearchPoliciesDTO: - type: object - properties: - policyId: - type: string - required: - - policyId - SearchPoliciesDTO: - type: object - properties: - target: - type: object - result: - type: object - required: - - target - - result - FilterPoliciesDTO: - type: object - properties: - policyId1: - type: string - policyId2: - type: string - policyIds: - type: string - eventsLvl: - type: number - propLvl: - type: number - childrenLvl: - type: number - idLvl: - type: number - required: - - policyId1 - - policyId2 - - policyIds - - eventsLvl - - propLvl - - childrenLvl - - idLvl - ComparePoliciesDTO: - type: object - properties: - blocks: - type: object - groups: - type: object - left: - type: object - right: - type: object - roles: - type: object - tokens: - type: object - topics: - type: object - total: - type: object - required: - - blocks - - groups - - left - - right - - roles - - tokens - - topics - - total - FilterModulesDTO: - type: object - properties: - moduleId1: - type: string - moduleId2: - type: string - eventsLvl: - type: number - propLvl: - type: number - childrenLvl: - type: number - idLvl: - type: number - required: - - moduleId1 - - moduleId2 - - eventsLvl - - propLvl - - childrenLvl - - idLvl - CompareModulesDTO: - type: object - properties: - blocks: - type: object - left: - type: object - right: - type: object - inputEvents: - type: object - outputEvents: - type: object - variables: - type: object - total: - type: object - required: - - blocks - - left - - right - - inputEvents - - outputEvents - - variables - - total - FilterSchemasDTO: - type: object - properties: - schemaId1: - type: string - schemaId2: - type: string - idLvl: - type: number - required: - - schemaId1 - - schemaId2 - - idLvl - CompareSchemasDTO: - type: object - properties: - fields: - type: object - left: - type: object - right: - type: object - total: - type: object - required: - - fields - - left - - right - - total - FilterDocumentsDTO: - type: object - properties: - documentId1: - type: string - documentId2: - type: string - documentIds: - type: string - required: - - documentId1 - - documentId2 - - documentIds - CompareDocumentsDTO: - type: object - properties: - documents: - type: object - left: - type: object - right: - type: object - total: - type: object - required: - - documents - - left - - right - - total - FilterToolsDTO: - type: object - properties: - toolId1: - type: string - toolId2: - type: string - toolIds: - type: string - required: - - toolId1 - - toolId2 - - toolIds - CompareToolsDTO: - type: object - properties: - blocks: - type: object - left: - type: object - right: - type: object - inputEvents: - type: object - outputEvents: - type: object - variables: - type: object - total: - type: object - required: - - blocks - - left - - right - - inputEvents - - outputEvents - - variables - - total - ArtifactDTOItem: - type: object - properties: - id: - type: string - name: - type: string - uuid: - type: string - extention: - type: string - type: - type: string - required: - - id - - name - - uuid - - extention - - type - ContractDTO: - type: object - properties: - id: - type: string - contractId: - type: string - description: - type: string - owner: - type: string - permissions: - type: number - topicId: - type: string - type: - type: string - enum: - - WIPE - - RETIRE - syncRequestsDate: - format: date-time - type: string - syncPoolsDate: - format: date-time - type: string - lastSyncEventTimeStamp: - type: string - wipeContractIds: - type: array - items: - type: string - required: - - id - - contractId - - description - - owner - - permissions - - topicId - - type - - syncRequestsDate - - syncPoolsDate - - lastSyncEventTimeStamp - - wipeContractIds - WiperRequestDTO: - type: object - properties: - id: - type: string - contractId: - type: string - user: - type: string - required: - - id - - contractId - - user - RetireRequestDTO: - type: object - properties: - id: - type: string - contractId: - type: string - tokens: - type: object - properties: - token: - type: string - count: - type: number - serials: - type: array - items: - type: number - decimals: - type: number - type: - enum: - - non-fungible - - fungible - tokenSymbol: - type: string - tokenIds: - type: array - items: - type: string - user: - type: string - required: - - id - - contractId - - tokens - - tokenIds - - user - Date: - type: object - properties: {} - RetirePoolDTO: - type: object - properties: - id: - type: string - contractId: - type: string - tokens: - type: object - properties: - token: - type: string - contract: - type: string - count: - type: number - decimals: - type: number - type: - enum: - - non-fungible - - fungible - tokenSymbol: - type: string - tokenIds: - type: array - items: - type: string - immediately: - type: boolean - enabled: - type: boolean - required: - - id - - contractId - - tokens - - tokenIds - - immediately - - enabled - RetirePoolTokenDTO: - type: object - properties: - token: - type: string - count: - type: number - required: - - token - - count - RetireRequestTokenDTO: - type: object - properties: - token: - type: string - count: - type: number - serials: - type: array - items: - type: string - required: - - token - - count - - serials - ProfileDTO: - type: object - properties: - username: - type: string - nullable: false - role: - type: string - nullable: false - did: - type: string - nullable: true - parent: - type: string - nullable: true - hederaAccountId: - type: string - nullable: true - confirmed: - type: boolean - nullable: true - failed: - type: boolean - nullable: true - topicId: - type: string - nullable: true - parentTopicId: - type: string - nullable: true - didDocument: - type: object - nullable: true - vcDocument: - type: object - nullable: true - required: - - username - - role - SubjectDTO: - type: object - properties: - '@context': - nullable: true - type: array - items: - type: string - id: - type: string - nullable: true - type: - type: string - nullable: true - required: - - '@context' - DidDocumentDTO: - type: object - properties: - id: - type: string - nullable: false - context: - nullable: true - type: array - items: - type: string - alsoKnownAs: - nullable: true - type: array - items: - type: string - controller: - nullable: true - type: array - items: - type: string - verificationMethod: - nullable: true - type: array - items: - type: object - authentication: - nullable: true - type: array - items: - type: object - assertionMethod: - nullable: true - type: array - items: - type: object - keyAgreement: - nullable: true - type: array - items: - type: object - capabilityInvocation: - nullable: true - type: array - items: - type: object - capabilityDelegation: - nullable: true - type: array - items: - type: object - service: - nullable: true - type: array - items: - type: object - required: - - id - - context - - alsoKnownAs - - controller - - verificationMethod - - authentication - - assertionMethod - - keyAgreement - - capabilityInvocation - - capabilityDelegation - - service - DidKeyDTO: - type: object - properties: - id: - type: string - nullable: false - key: - type: string - nullable: false - required: - - id - - key - CredentialsDTO: - type: object - properties: - entity: - type: string - nullable: false - hederaAccountId: - type: string - nullable: false - hederaAccountKey: - type: string - nullable: false - parent: - type: string - nullable: true - vcDocument: - nullable: true - allOf: - - $ref: '#/components/schemas/SubjectDTO' - didDocument: - nullable: true - allOf: - - $ref: '#/components/schemas/DidDocumentDTO' - didKeys: - nullable: true - type: array - items: - $ref: '#/components/schemas/DidKeyDTO' - required: - - entity - - hederaAccountId - - hederaAccountKey - TaskDTO: - type: object - properties: - taskId: - type: string - expectation: - type: number - required: - - taskId - - expectation - DidDocumentStatusDTO: - type: object - properties: - valid: - type: boolean - nullable: false - error: - type: string - nullable: true - didDocument: - type: object - nullable: false - required: - - valid - - error - - didDocument - DidDocumentWithKeyDTO: - type: object - properties: - document: - nullable: false - allOf: - - $ref: '#/components/schemas/DidDocumentDTO' - keys: - nullable: false - type: array - items: - $ref: '#/components/schemas/DidKeyDTO' - required: - - document - - keys - DidKeyStatusDTO: - type: object - properties: - id: - type: string - nullable: false - key: - type: string - nullable: false - valid: - type: boolean - nullable: false - required: - - id - - key - - valid - MigrationConfigPoliciesDTO: - type: object - properties: - src: - type: string - dst: - type: string - required: - - src - - dst - MigrationConfigDTO: - type: object - properties: - policies: - $ref: '#/components/schemas/MigrationConfigPoliciesDTO' - vcs: - type: array - items: - type: string - vps: - type: array - items: - type: string - schemas: - type: object - groups: - type: object - roles: - type: object - required: - - policies - - vcs - - vps - - schemas - - groups - - roles - PolicyCategoryDTO: - type: object - properties: - id: - type: string - name: - type: string - type: - type: string - required: - - id - - name - - type - SchemaDTO: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - entity: - type: string - document: - type: string - uuid: - type: string - iri: - type: string - hash: - type: string - status: - type: string - topicId: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - required: - - id - - name - - description - - entity - - document - - uuid - - iri - - hash - - status - - topicId - - version - - owner - - messageId - VersionSchemaDTO: - type: object - properties: - version: - type: string - required: - - version - MessageSchemaDTO: - type: object - properties: - messageId: - type: string - required: - - messageId - ExportSchemaDTO: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - required: - - id - - name - - description - - version - - owner - - messageId - SystemSchemaDTO: - type: object - properties: - name: - type: string - entity: - type: string - required: - - name - - entity - SettingsDTO: - type: object - properties: - ipfsStorageApiKey: - type: string - operatorId: - type: string - operatorKey: - type: string - required: - - ipfsStorageApiKey - - operatorId - - operatorKey - SuggestionsInputDTO: - type: object - properties: - blockType: - type: string - children: - nullable: true - type: array - items: - type: object - required: - - blockType - - children - SuggestionsOutputDTO: - type: object - properties: - next: - type: string - nested: - type: string - required: - - next - - nested - SuggestionsConfigItemDTO: - type: object - properties: - id: - type: string - type: - type: string - enum: - - Policy - - Module - index: - type: number - required: - - id - - type - - index - SuggestionsConfigDTO: - type: object - properties: - items: - $ref: '#/components/schemas/SuggestionsConfigItemDTO' - required: - - items - NotificationDTO: - type: object - properties: - title: - type: string - message: - type: string - type: - type: string - enum: - - INFO - - ERROR - - WARN - - SUCCESS - action: - type: string - enum: - - POLICY_CONFIGURATION - - POLICY_VIEW - - POLICIES_PAGE - - SCHEMAS_PAGE - - TOKENS_PAGE - - PROFILE_PAGE - result: - type: object - read: - type: boolean - old: - type: boolean - required: - - title - - message - - type - - action - - result - - read - - old - ProgressDTO: - type: object - properties: - action: - type: string - message: - type: string - progress: - type: number - type: - type: string - enum: - - INFO - - ERROR - - WARN - - SUCCESS - taskId: - type: string - required: - - action - - message - - progress - - type - - taskId - ProjectDTO: - type: object - properties: - id: - type: string - policyId: - type: string - policyName: - type: string - registered: - type: string - title: - type: string - companyName: - type: string - sectoralScope: - type: string - required: - - id - - policyId - - policyName - - registered - - title - - companyName - - sectoralScope - PropertiesDTO: - type: object - properties: - id: - type: string - title: - type: string - value: - type: string - required: - - id - - title - - value - RecordStatusDTO: - type: object - properties: - type: - type: string - policyId: - type: string - uuid: - type: string - status: - type: string - required: - - type - - policyId - - uuid - - status - Object: - type: object - properties: {} - RecordActionDTO: - type: object - properties: - uuid: - type: string - policyId: - type: string - method: - type: string - action: - type: string - time: - type: string - user: - type: string - target: - type: string - required: - - uuid - - policyId - - method - - action - - time - - user - - target - ResultInfoDTO: - type: object - properties: - tokens: - type: number - documents: - type: number - required: - - tokens - - documents - ResultDocumentDTO: - type: object - properties: - type: - type: string - schema: - type: string - rate: - type: string - documents: - type: object - required: - - type - - schema - - rate - - documents - RunningResultDTO: - type: object - properties: - info: - $ref: '#/components/schemas/ResultInfoDTO' - total: - type: number - documents: - $ref: '#/components/schemas/ResultDocumentDTO' - required: - - info - - total - - documents - RunningDetailsDTO: - type: object - properties: - left: - type: object - right: - type: object - total: - type: number - documents: - type: object - required: - - left - - right - - total - - documents - ToolDTO: - type: object - properties: - id: - type: string - uuid: - type: string - name: - type: string - description: - type: string - config: - type: object - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - messageId: - type: string - codeVersion: - type: string - createDate: - type: string - required: - - id - - uuid - - name - - description - - config - - status - - creator - - owner - - topicId - - messageId - - codeVersion - - createDate - RegisteredUsersDTO: - type: object - properties: - username: - type: string - did: - type: string - parent: - type: string - role: - type: string - policyRoles: - type: array - items: - type: string - required: - - username - - did - - parent - - role - - policyRoles - Credentials: - type: object - required: - - username - - password - properties: - username: - type: string - password: - type: string - Account: - type: object - required: - - username - - role - properties: - username: - type: string - role: - type: string - did: - type: string - Session: - type: object - required: - - username - - role - - accessToken - properties: - username: - type: string - role: - type: string - accessToken: - type: string - User: - type: object - required: - - username - - role - properties: - confirmed: - type: string - failed: - type: string - username: - type: string - role: - type: string - hederaAccountId: - type: string - hederaAccountKey: - type: string - did: - type: string - didDocument: - type: object - vcDocument: - type: object - parent: - type: string - topicId: - type: string - Schema: - type: object - required: - - id - - name - - description - - entity - - document - properties: - id: - type: string - iri: - type: string - uuid: - type: string - name: - type: string - description: - type: string - entity: - type: string - hash: - type: string - status: - type: string - document: - oneOf: - - type: string - - type: object - topicId: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - ImportSchema: - type: object - required: - - schemes - properties: - schemes: - type: array - items: - type: object - required: - - document - - entity - - name - - uuid - properties: - document: - type: string - entity: - type: string - hash: - type: string - name: - type: string - uuid: - type: string - ExportSchema: - type: object - required: - - ids - properties: - name: - type: string - version: - type: string - messageId: - type: string - Token: - type: object - required: - - changeSupply - - decimals - - enableAdmin - - enableKYC - - enableFreeze - - enableWipe - - initialSupply - - tokenName - - tokenSymbol - - tokenType - properties: - changeSupply: - type: boolean - decimals: - type: string - enableAdmin: - type: boolean - enableFreeze: - type: boolean - enableKYC: - type: boolean - enableWipe: - type: boolean - initialSupply: - type: string - tokenName: - type: string - tokenSymbol: - type: string - tokenType: - type: string - TokenInfo: - type: object - required: - - id - - tokenId - - tokenName - - tokenSymbol - - tokenType - - decimals - - associated - - balance - - frozen - - kyc - properties: - id: - type: string - tokenId: - type: string - tokenName: - type: string - tokenSymbol: - type: string - tokenType: - type: string - decimals: - type: string - associated: - type: boolean - balance: - type: string - frozen: - type: boolean - kyc: - type: boolean - enableAdmin: - type: boolean - enableKYC: - type: boolean - enableFreeze: - type: boolean - enableWipe: - type: boolean - PolicyConfig: - type: object - required: - - name - - version - - description - - topicDescription - - config - - topicId - - policyTag - properties: - id: - type: string - uuid: - type: string - name: - type: string - version: - type: string - description: - type: string - topicDescription: - type: string - config: - type: object - status: - type: string - owner: - type: string - policyRoles: - type: array - items: - type: string - topicId: - type: string - policyTag: - type: string - policyTopics: - type: array - items: - type: object - properties: - name: - type: string - description: - type: string - type: - type: string - static: - type: boolean - TrustChains: - type: object - required: - - chain - - userMap - properties: - chain: - type: array - items: - type: object - required: - - id - - type - - tag - - label - - schema - - owner - - document - properties: - id: - type: string - type: - type: string - tag: - type: string - label: - type: string - schema: - type: string - owner: - type: string - document: - type: object - userMap: - type: array - items: - type: object - required: - - did - - username - properties: - did: - type: string - username: - type: string - VerifiablePresentation: - type: object - required: - - hash - - id - - policyId - - signature - - status - - tag - - type - - updateDate - - createDate - - owner - - document - properties: - hash: - type: string - id: - type: string - policyId: - type: string - signature: - type: string - status: - type: string - tag: - type: string - type: - type: string - updateDate: - type: string - createDate: - type: string - owner: - type: string - document: - type: object - PublishPolicy: - type: object - required: - - errors - - isValid - - policies - properties: - errors: - type: array - items: - type: object - isValid: - type: boolean - policies: - type: array - items: - type: object - ValidatePolicy: - type: object - required: - - config - - results - properties: - config: - type: object - results: - type: object - PolicyBlock: - type: object - required: - - id - - blockType - - isActive - - uiMetaData - properties: - id: - type: string - blockType: - type: string - isActive: - type: boolean - uiMetaData: - type: object - blocks: - type: array - items: - type: object - PolicyBlockData: - type: object - required: - - id - - isActive - - uiMetaData - - data - properties: - id: - type: string - blockType: - type: string - isActive: - type: boolean - uiMetaData: - type: object - data: - type: object - fields: - type: array - items: - type: object - index: - type: number - roles: - type: array - items: - type: string - blocks: - type: array - items: - $ref: '#/components/schemas/PolicyBlock' - ExportPolicy: - type: object - required: - - name - - version - - messageId - properties: - name: - type: string - version: - type: string - tokens: - type: string - PreviewPolicy: - type: object - required: - - policy - - schemas - - tokens - properties: - policy: - type: object - schemas: - type: array - items: - type: object - tokens: - type: array - items: - type: object - Error: - type: object - required: - - code - - message - properties: - code: - type: number - message: - type: string - ExternalData: - type: object - required: - - owner - - policyTag - - document - properties: - owner: - type: string - policyTag: - type: string - document: - type: object - HederaAccount: - type: object - required: - - id - - key - properties: - id: - type: string - key: - type: string - CommonSettings: - type: object - properties: - operatorId: - type: string - operatorKey: - type: string - nftApiKey: - deprecated: true - type: string - ipfsStorageApiKey: - type: string - LogFilters: - type: object - properties: - type: - type: string - startDate: - type: string - endDate: - type: string - attributes: - type: array - items: - type: string - message: - type: string - pageSize: - type: number - pageIndex: - type: number - sortDirection: - type: string - enum: - - ASC - - DESC - Log: - type: object - properties: - type: - type: string - datetime: - type: string - message: - type: string - attributes: - type: array - items: - type: string - Task: - type: object - properties: - taskId: - type: string - expectation: - type: number - TaskStatus: - type: object - properties: - date: - type: string - name: - type: string - statuses: - type: array - items: - type: object - properties: - type: - type: string - message: - type: string - result: - type: object - error: - type: object - Artifact: - type: object - properties: - id: - type: string - name: - type: string - uuid: - type: string - extention: - type: string - type: - type: string - MultiPolicyConfig: - type: object - properties: - id: - type: string - uuid: - type: string - owner: - type: string - type: - type: string - instanceTopicId: - type: string - mainPolicyTopicId: - type: string - synchronizationTopicId: - type: string - policyOwner: - type: string - user: - type: string - Contract: - type: object - properties: - id: - type: string - contractId: - type: string - description: - type: string - owner: - type: string - isOwnerCreator: - type: string - status: - type: string - RetireRequest: - type: object - properties: - id: - type: string - contractId: - type: string - baseTokenId: - type: string - owner: - type: string - oppositeTokenId: - type: string - baseTokenCount: - type: number - oppositeTokenCount: - type: number - Module: - type: object - properties: - id: - type: string - uuid: - type: string - name: - type: string - description: - type: string - config: - type: object - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - messageId: - type: string - codeVersion: - type: string - createDate: - type: string - type: - type: string - PreviewModule: - type: object - properties: - module: - $ref: '#/components/schemas/Module' - ExportModule: - type: object - properties: - uuid: - type: string - name: - type: string - description: - type: string - messageId: - type: string - owner: - type: string - PublishModule: - type: object - properties: - errors: - type: object - isValid: - type: boolean - module: - $ref: '#/components/schemas/Module' - ValidateModule: - type: object - properties: - module: - $ref: '#/components/schemas/Module' - results: - type: object - Tag: - type: object - required: - - name - - entity - - localTarget - properties: - uuid: - type: string - example: 00000000-0000-0000-0000-000000000000 - name: - type: string - example: Tag label - description: - type: string - example: Description - owner: - type: string - example: did - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: '0000000000.000000000' - localTarget: - type: string - example: db id - status: - type: string - enum: - - Draft - - Published - - History - example: Published - operation: - type: string - enum: - - Create - - Delete - example: Create - date: - type: string - example: '1900-01-01T00:00:00.000Z' - topicId: - type: string - example: 0.0.0000000 - messageId: - type: string - example: '0000000000.000000000' - policyId: - type: string - example: db id - uri: - type: string - example: document uri - document: - type: object - TagMap: - type: object - required: - - entity - - target - - refreshDate - - tags - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: db id - refreshDate: - type: string - example: '1900-01-01T00:00:00.000Z' - tags: - type: array - items: - $ref: '#/components/schemas/Tag' - Theme: - type: object - required: - - uuid - - name - - rules - properties: - id: - type: string - example: db id - uuid: - type: string - example: 00000000-0000-0000-0000-000000000000 - name: - type: string - example: Theme name - rules: - type: array - items: - type: object - required: - - text - - background - - border - - shape - - borderWidth - - filterType - - filterValue - properties: - description: - type: string - example: description - text: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - background: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - border: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - shape: - type: string - enum: - - '0' - - '1' - - '2' - - '3' - - '4' - - '5' - example: '0' - borderWidth: - type: string - enum: - - 0px - - 1px - - 2px - - 3px - - 4px - - 5px - - 6px - - 7px - example: 2px - filterType: - type: string - enum: - - type - - api - - role - example: type - filterValue: - oneOf: - - type: string - - type: array - items: - type: string - example: - - type - WizardConfig: - type: object - required: - - policy - - roles - - schemas - - trustChain - properties: - roles: - type: array - items: - type: string - policy: - type: object - properties: - name: - type: string - description: - type: string - topicDescription: - type: string - policyTag: - type: string - schemas: - type: array - items: - type: object - properties: - name: - type: string - iri: - type: string - isApproveEnable: - type: boolean - isMintSchema: - type: boolean - mintOptions: - type: object - properties: - tokenId: - type: string - rule: - type: string - dependencySchemaIri: - type: string - relationshipsSchemaIri: - type: string - initialRolesFor: - type: array - items: - type: string - rolesConfig: - type: array - items: - type: object - properties: - role: - type: string - isApprover: - type: boolean - isCreator: - type: boolean - gridColumns: - type: array - items: - type: object - properties: - field: - type: string - title: - type: string - trustChain: - type: array - items: - type: object - properties: - role: - type: string - mintSchemaIri: - type: string - viewOnlyOwnDocuments: - type: boolean +openapi: 3.0.0 +paths: + /accounts/session: + get: + operationId: AccountApi_getSession + summary: Returns current session of the user. + description: Returns current user session. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_0 + - accounts + security: + - bearerAuth: [] + /accounts/register: + post: + operationId: AccountApi_register + summary: Registers a new user account. + description: Object that contain username, password and role (optional) fields. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/login: + post: + operationId: AccountApi_login + summary: Logs user into the system. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/access-token: + post: + operationId: AccountApi_getAccessToken + summary: Returns access token. + description: Returns access token. + parameters: [] + responses: + '200': + description: Successful operation. + tags: *ref_0 + /accounts: + get: + operationId: AccountApi_getAllAccounts + summary: Returns a list of users, excluding Standard Registry and Auditors. + description: >- + Returns all users except those with roles Standard Registry and Auditor. + Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries: + get: + operationId: AccountApi_getStandatdRegistries + summary: Returns all Standard Registries. + description: Returns all Standard Registries. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries/aggregated: + get: + operationId: AccountApi_getAggregatedStandardRegistries + summary: Returns all Standard Registries aggregated with polices and vcDocuments. + description: Returns all Standard Registries aggregated with polices and vcDocuments + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AggregatedDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/balance: + get: + operationId: AccountApi_getBalance + summary: Returns user's Hedera account balance. + description: Requests current Hedera account balance. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/BalanceResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /analytics/search/policies: + post: + operationId: AnalyticsApi_searchPolicies + summary: Search policies. + description: >- + Search policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + policyId: '000000000000000000000000' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_1 + - analytics + security: + - bearerAuth: [] + /analytics/compare/policies: + post: + operationId: AnalyticsApi_comparePolicies + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ComparePoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules: + post: + operationId: AnalyticsApi_compareModules + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareModulesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas: + post: + operationId: AnalyticsApi_compareSchemas + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareSchemasDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents: + post: + operationId: AnalyticsApi_compareDocuments + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools: + post: + operationId: AnalyticsApi_compareTools + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareToolsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/policies/export: + post: + operationId: AnalyticsApi_comparePoliciesExport + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules/export: + post: + operationId: AnalyticsApi_compareModulesExport + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas/export: + post: + operationId: AnalyticsApi_compareSchemasExport + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents/export: + post: + operationId: AnalyticsApi_compareDocumentsExport + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools/export: + post: + operationId: AnalyticsApi_compareToolsExport + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/search/blocks: + post: + operationId: AnalyticsApi_searchBlocks + summary: Search same blocks. + description: >- + Search same blocks. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + uuid: '' + config: {} + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /artifacts: + get: + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{parentId}: + post: + operationId: ArtifactApi_uploadArtifacts + summary: Upload artifact. + description: Upload artifact. For users with the Standard Registry role only. + parameters: + - name: parentId + required: true + in: path + description: Parent ID + schema: + type: string + requestBody: + required: true + description: Form data with artifacts. + content: + multipart/form-data: + schema: + type: array + items: + type: object + properties: + artifacts: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ArtifactDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - artifacts + security: + - bearerAuth: [] + /artifacts/{artifactId}: + delete: + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /contracts: + get: + operationId: ContractsApi_getContracts + summary: Return a list of all contracts. + description: Returns all contracts. + parameters: + - name: type + required: true + in: query + description: Contract type + example: RETIRE + schema: + enum: + - WIPE + - RETIRE + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Contracts. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_2 + - contracts + security: + - bearerAuth: [] + post: + operationId: ContractsApi_createContract + summary: Create contract. + description: >- + Create smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + responses: + '201': + description: Created contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/import: + post: + operationId: ContractsApi_importContract + summary: Import contract. + description: >- + Import smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contractId: + type: string + description: Hedera Identifier + example: 0.0.1 + description: + type: string + required: + - contractId + responses: + '200': + description: Imported contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/{contractId}/permissions: + get: + operationId: ContractsApi_contractPermissions + summary: Get contract permissions. + description: >- + Get smart-contract permissions. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Contract permissions. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/{contractId}: + delete: + operationId: ContractsApi_removeContract + summary: Remove contract. + description: >- + Remove smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests: + get: + operationId: ContractsApi_getWipeRequests + summary: Return a list of all wipe requests. + description: >- + Returns all wipe requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WiperRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests/enable: + post: + operationId: ContractsApi_enableWipeRequests + summary: Enable wipe requests. + description: >- + Enable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests/disable: + post: + operationId: ContractsApi_disableWipeRequests + summary: Disable wipe requests. + description: >- + Disable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveWipeRequest + summary: Approve wipe request. + description: >- + Approve wipe contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests/{requestId}/reject: + delete: + operationId: ContractsApi_rejectWipeRequest + summary: Reject wipe request. + description: >- + Reject wipe contract request. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: ban + required: true + in: query + description: Reject and ban + schema: + type: boolean + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests: + delete: + operationId: ContractsApi_clearWipeRequests + summary: Clear wipe requests. + description: >- + Clear wipe contract requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_wipeAddAdmin + summary: Add wipe admin. + description: >- + Add wipe contract admin. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/manager/{hederaId}: + post: + operationId: ContractsApi_wipeAddManager + summary: Add wipe manager. + description: >- + Add wipe contract manager. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveManager + summary: Remove wipe manager. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/wiper/{hederaId}: + post: + operationId: ContractsApi_wipeAddWiper + summary: Add wipe wiper. + description: >- + Add wipe contract wiper. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveWiper + summary: Remove wipe wiper. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/pools/sync: + post: + operationId: ContractsApi_retireSyncPools + summary: Sync retire pools. + description: >- + Sync retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Sync date. + content: + application/json: + schema: + $ref: '#/components/schemas/Date' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests: + get: + operationId: ContractsApi_getRetireRequests + summary: Return a list of all retire requests. + description: Returns all retire requests. + parameters: + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetireRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools: + get: + operationId: ContractsApi_getRetirePools + summary: Return a list of all retire pools. + description: Returns all retire pools. + parameters: + - name: tokens + required: true + in: query + description: Tokens + example: 0.0.1,0.0.2,0.0.3 + schema: + type: string + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/requests: + delete: + operationId: ContractsApi_clearRetireRequests + summary: Clear retire requests. + description: >- + Clear retire contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/pools: + delete: + operationId: ContractsApi_clearRetirePools + summary: Clear retire pools. + description: >- + Clear retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + post: + operationId: ContractsApi_setRetirePool + summary: Set retire pool. + description: >- + Set retire contract pool. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools/{poolId}: + delete: + operationId: ContractsApi_unsetRetirePool + summary: Unset retire pool. + description: >- + Unset retire contract pool. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: poolId + required: true + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}: + delete: + operationId: ContractsApi_unsetRetireRequest + summary: Unset retire request. + description: >- + Unset retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools/{poolId}/retire: + post: + operationId: ContractsApi_retire + summary: Retire tokens. + description: Retire tokens. + parameters: + - name: poolId + required: true + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetireRequestTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveRetire + summary: Approve retire request. + description: >- + Approve retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}/cancel: + delete: + operationId: ContractsApi_cancelRetireRequest + summary: Cancel retire request. + description: Cancel retire contract request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_retireAddAdmin + summary: Add retire admin. + description: >- + Add retire contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_retireRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire: + get: + operationId: ContractsApi_getRetireVCs + summary: Return a list of all retire vcs. + description: Returns all retire vcs. + parameters: + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VerifiablePresentation' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /demo/registered-users: + get: + operationId: DemoApi_registeredUsers + summary: Returns list of registered users. + description: Returns list of registered users. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredUsersDTO' + tags: + - demo + /demo/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/HederaAccount' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /demo/push/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + summary: Generates a new Hedera account with a random private key. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /external: + post: + tags: + - external + description: Sends data from an external source. + summary: Sends data from an external source. + requestBody: + description: Object that contains a VC Document. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalData' + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file: + post: + operationId: IpfsApi_postFile + summary: Add file from ipfs. + description: Add file from ipfs. + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_3 + - ipfs + security: + - bearerAuth: [] + /ipfs/file/dry-run/{policyId}: + post: + operationId: IpfsApi_postFileDryRun + summary: Add file from ipfs for dry run mode. + description: Add file from ipfs for dry run mode. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + responses: + '401': + description: Unauthorized + tags: *ref_3 + security: + - bearerAuth: [] + /ipfs/file/{cid}: + get: + tags: + - ipfs + description: Get file from ipfs. + summary: Get file from ipfs. + parameters: + - in: path + name: cid + schema: + type: string + required: true + description: File CID. + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + binary/octet-stream: + schema: + type: string + format: binary + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/{cid}/dry-run: + get: + operationId: IpfsApi_getFileDryRun + summary: Get file from ipfs for dry run mode. + description: Get file from ipfs for dry run mode. + parameters: + - name: cid + required: true + in: path + schema: + type: string + responses: + '401': + description: Unauthorized + tags: *ref_3 + security: + - bearerAuth: [] + /logs: + post: + tags: + - logs + description: Returns logs. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + description: Log filters. + content: + application/json: + schema: + $ref: '#/components/schemas/LogFilters' + summary: Returns logs. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + totalCount: + type: number + logs: + $ref: '#/components/schemas/Log' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs/attributes: + get: + tags: + - logs + description: Returns logs attributes. For users with the Standard Registry role only. + parameters: + - in: query + name: name + schema: + type: string + description: Part of name. + - in: query + name: existingAttributes + schema: + type: array + items: + type: string + description: Attributes to exclude. + security: + - bearerAuth: [] + summary: Returns logs attributes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/key: + get: + tags: + - maps + description: Returns map api key. + security: + - bearerAuth: [] + summary: Returns map api key. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/sh: + get: + operationId: MapApi_getSentinelKey + parameters: [] + responses: + '200': + description: '' + tags: + - map + /metrics: + get: + operationId: MetricsApi_getMetrics + parameters: [] + responses: + '200': + description: '' + tags: + - metrics + /modules: + get: + tags: + - modules + description: >- + Returns all modules. Only users with the Standard Registry and Installer + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all modules. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - modules + description: >- + Creates a new module. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/schemas: + get: + operationId: ModulesApi_getModuleSchemas + parameters: [] + responses: + '200': + description: '' + tags: &ref_4 + - modules + post: + operationId: ModulesApi_postSchemas + parameters: [] + responses: + '201': + description: '' + tags: *ref_4 + /modules/{uuid}: + get: + tags: + - modules + description: >- + Retrieves module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Retrieves module configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - modules + description: >- + Updates module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates module configuration. + parameters: + - in: path + name: uuid + description: Selected module ID. + required: true + schema: + type: string + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - modules + description: >- + Deletes the module with the provided module ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Module ID. + security: + - bearerAuth: [] + summary: Deletes the module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/menu: + get: + tags: + - modules + description: >- + Returns modules menu. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of modules. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/file: + get: + tags: + - modules + description: >- + Returns a zip file containing the published module and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: >- + Return module and its artifacts in a zip file format for the specified + module. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/message: + get: + tags: + - modules + description: >- + Returns the Hedera message ID for the specified module published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: Imports new module from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new module from a zip file. + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message/preview: + post: + tags: + - modules + description: >- + Previews the module from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Module preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file/preview: + post: + tags: + - modules + description: >- + Previews the module from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Module preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/publish: + put: + tags: + - modules + description: >- + Publishes the module with the specified (internal) module ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Publishes the module onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/validate: + post: + tags: + - modules + description: >- + Validates selected module. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tools: + post: + operationId: ToolsApi_createNewTool + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_5 + - tools + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getTools + summary: Return a list of all tools. + description: >- + Returns all tools. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: The numbers of items to return + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + schema: + type: number + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push: + post: + operationId: ToolsApi_createNewToolAsync + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}: + delete: + operationId: ToolsApi_deleteTool + summary: >- + Deletes the tool with the provided tool ID. Only users with the Standard + Registry role are allowed to make the request. + description: Deletes the tool. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getToolById + summary: Retrieves tool configuration. + description: >- + Retrieves tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + put: + operationId: ToolsApi_updateTool + summary: Updates tool configuration. + description: >- + Updates tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/publish: + put: + operationId: ToolsApi_publishTool + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/push/publish: + put: + operationId: ToolsApi_publishToolAsync + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/validate: + post: + operationId: ToolsApi_validateTool + summary: Validates selected tool. + description: >- + Validates selected tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/export/file: + get: + operationId: ToolsApi_toolExportFile + summary: >- + Return tool and its artifacts in a zip file format for the specified + tool. + description: >- + Returns a zip file containing the published tool and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. Response zip file. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/export/message: + get: + operationId: ToolsApi_toolExportMessage + summary: Return Heder message ID for the specified published tool. + description: >- + Returns the Hedera message ID for the specified tool published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/message/preview: + post: + operationId: ToolsApi_toolImportMessagePreview + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/message: + post: + operationId: ToolsApi_toolImportMessage + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file/preview: + post: + operationId: ToolsApi_toolImportFilePreview + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file: + post: + operationId: ToolsApi_toolImportFile + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadata + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/file: + post: + operationId: ToolsApi_toolImportFileAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadataAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/message: + post: + operationId: ToolsApi_toolImportMessageAsync + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/menu/all: + get: + operationId: ToolsApi_getMenu + summary: Return a list of tools. + description: >- + Returns tools menu. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /profiles/{username}: + get: + operationId: ProfileApi_getProfile + summary: Returns user account info. + description: >- + Returns user account information. For users with the Standard Registry + role it also returns address book and VC document information. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the information + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_6 + - profiles + security: + - bearerAuth: [] + - bearerAuth: [] + put: + operationId: ProfileApi_setUserProfile + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Created. + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/push/{username}: + put: + operationId: ProfileApi_setUserProfileAsync + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/{username}/balance: + get: + operationId: ProfileApi_getUserBalance + summary: Returns user's Hedera account balance. + description: >- + Requests Hedera account balance. Only users with the Installer role are + allowed to make the request. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the balance. + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/restore/{username}: + put: + operationId: ProfileApi_restoreUserProfile + summary: Restore user data (policy, DID documents, VC documents). + description: Restore user data (policy, DID documents, VC documents). + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/restore/topics/{username}: + put: + operationId: ProfileApi_restoreTopic + summary: List of available recovery topics. + description: List of available recovery topics. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/did-document/validate: + post: + operationId: ProfileApi_validateDidDocument + summary: Validate DID document format. + description: Validate DID document format. + parameters: [] + requestBody: + required: true + description: DID Document. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /profiles/did-keys/validate: + post: + operationId: ProfileApi_validateDidKeys + summary: Validate DID document keys. + description: Validate DID document keys. + parameters: [] + requestBody: + required: true + description: DID Document and keys. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentWithKeyDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidKeyStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies: + get: + tags: + - policies + description: >- + Returns all policies. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all policies. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/migrate-data: + post: + operationId: PolicyApi_migrateData + summary: Migrate policy data. + description: >- + Migrate policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '200': + description: Errors while migration. + content: + application/json: + schema: + type: array + items: + type: object + properties: + error: + type: string + id: + type: string + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_7 + - policies + security: + - bearerAuth: [] + /policies/push/migrate-data: + post: + operationId: PolicyApi_migrateDataAsync + summary: Migrate policy data asynchronous. + description: >- + Migrate policy data asynchronous. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '202': + description: Created task. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/push: + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}: + post: + operationId: PolicyApi_updatePolicyAsync + summary: '' + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + delete: + operationId: PolicyApi_deletePolicyAsync + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + responses: + '202': + description: '' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}: + get: + tags: + - policies + description: >- + Retrieves policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves policy configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - policies + description: >- + Updates policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates policy configuration. + parameters: + - in: path + name: policyId + description: Selected policy ID. + required: true + schema: + type: string + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + summary: Publishes the policy onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + security: + - bearerAuth: [] + summary: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run: + put: + tags: + - policies + description: >- + Run policy without making any persistent changes or executing + transaction. Only users with the Standard Registry role are allowed to + make the request. + security: + - bearerAuth: [] + summary: Dry Run policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/discontinue: + put: + operationId: PolicyApi_discontinuePolicy + summary: Discontunue policy. + description: >- + Discontunue policy. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Discontinue details. + content: + application/json: + schema: + type: object + properties: + date: + type: object + responses: + '200': + description: Policies. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/draft: + put: + tags: + - policies + description: >- + Return policy to editing. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Return policy to editing. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/validate: + post: + tags: + - policies + description: >- + Validates selected policy. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/navigation: + get: + operationId: PolicyApi_getPolicyNavigation + summary: Returns a policy navigation. + description: Returns a policy navigation. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/groups: + get: + tags: + - policies + description: Returns a list of groups the user is a member of. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Returns a list of groups the user is a member of. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + uuid: + type: string + role: + type: string + groupLabel: + type: string + groupName: + type: string + active: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Makes the selected group active. if UUID is not set then returns the + user to the default state. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Makes the selected group active. + requestBody: + description: Selected group. + required: true + content: + application/json: + schema: + type: object + properties: + uuid: + type: string + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/documents: + get: + operationId: PolicyApi_getPolicyDocuments + summary: Get policy documents. + description: >- + Get policy documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: Page size. + schema: + type: number + - name: pageIndex + required: true + in: query + description: Page index. + schema: + type: number + - name: type + required: true + in: query + description: Document type. + schema: + enum: + - VC + - VP + type: string + - name: includeDocument + required: true + in: query + description: Include document field. + schema: + type: boolean + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Documents. + headers: + X-Total-Count: + description: Total documents count. + schema: + type: number + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/data: + get: + operationId: PolicyApi_downloadPolicyData + summary: Get policy data. + description: >- + Get policy data. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy data. + content: + application/json: + schema: + type: string + format: binary + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/data: + post: + operationId: PolicyApi_uploadPolicyData + summary: Upload policy data. + description: >- + Upload policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Policy data file + content: + application/json: + schema: + type: string + format: binary + responses: + '200': + description: Uploaded policy. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/tag-block-map: + get: + operationId: PolicyApi_getTagBlockMap + summary: Get policy tag block map. + description: >- + Get policy tag block map. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy tag block map. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/virtual-keys: + get: + operationId: PolicyApi_downloadVirtualKeys + summary: Get policy virtual keys. + description: >- + Get policy virtual keys. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy virtual keys. + content: + application/json: + schema: + type: string + format: binary + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + post: + operationId: PolicyApi_uploadVirtualKeys + summary: Upload policy virtual keys. + description: >- + Upload policy virtual keys. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Virtual keys file + content: + application/json: + schema: + type: string + format: binary + responses: + '200': + description: Operation completed. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/blocks: + get: + tags: + - policies + description: >- + Returns data from the root policy block. Only users with the Standard + Registry and Installer role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves data for the policy root block. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlock' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/blocks/{uuid}: + get: + tags: + - policies + description: >- + Requests block data. Only users with a role that described in block are + allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Requests block data. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Sends data to the specified block. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tagName}/blocks: + post: + operationId: PolicyApi_setBlocksByTagName + summary: Sends data to the specified block. + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Block tag. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + get: + operationId: PolicyApi_getBlocksByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Block tag. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/tag/{tagName}: + get: + operationId: PolicyApi_getBlockByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Block tag. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/blocks/{uuid}/parents: + get: + operationId: PolicyApi_getBlockParents + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: block ID. + responses: + '200': + description: '' + tags: *ref_7 + /policies/{policyId}/export/file: + get: + tags: + - policies + description: >- + Returns a zip file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: >- + Return policy and its artifacts in a zip file format for the specified + policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/message: + get: + tags: + - policies + description: >- + Returns the Hedera message ID for the specified policy published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/xlsx: + get: + operationId: PolicyApi_getPolicyExportXlsx + summary: >- + Return policy and its artifacts in a xlsx file format for the specified + policy. + description: >- + Returns a xlsx file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Policy preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Previews the policy from IPFS without loading it into the local DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from a zip file. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadata + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: true + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/push/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadataAsync + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: true + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/import/file/preview: + post: + tags: + - policies + description: >- + Previews the policy from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Policy preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsx + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/push/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsxAsync + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/import/xlsx/preview: + post: + operationId: PolicyApi_importPolicyFromXlsxPreview + summary: Policy preview from a xlsx file. + description: >- + Previews the policy from a xlsx file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/blocks/about: + get: + operationId: PolicyApi_getBlockAbout + parameters: [] + responses: + '200': + description: '' + tags: *ref_7 + /policies/{policyId}/dry-run/users: + get: + tags: + - policies + description: >- + Returns all virtual users. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all virtual users. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/user: + post: + tags: + - policies + description: >- + Create a new virtual account. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Create a new virtual account. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/login: + post: + tags: + - policies + description: >- + Logs virtual user into the system. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Logs virtual user into the system. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Virtual user + required: true + content: + application/json: + schema: + type: object + properties: + did: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/restart: + post: + tags: + - policies + description: >- + Restarts the execution of the policy. Clear data in database. Only users + with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Restarts the execution of the policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/transactions: + get: + tags: + - policies + description: >- + Returns lists of virtual transactions. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual transactions. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + hederaAccountId: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/artifacts: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + owner: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/ipfs: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + documentURL: + type: string + document: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/multiple: + post: + tags: + - policies + description: >- + Creates a link between the current policy and the main policy. Or + creates a group making the current policy the main one. + security: + - bearerAuth: [] + summary: Creates Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Multi policy config. + required: true + content: + application/json: + schema: + type: object + required: + - mainPolicyTopicId + - synchronizationTopicId + properties: + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: Requests Multi policy config. + security: + - bearerAuth: [] + summary: Requests Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/methodologies/categories: + get: + operationId: PolicyApi_getPolicyCategoriesAsync + summary: Get all categories + description: Get all categories + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyCategoryDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + /policies/methodologies/search: + post: + operationId: PolicyApi_getPoliciesByCategory + summary: Get filtered policies + description: Get policies by categories and text + parameters: [] + requestBody: + required: true + description: Filters + content: + application/json: + schema: + type: string + examples: + Filter1: + value: + categoryIds: + - '000000000000000000000001' + - '000000000000000000000002' + text: abc + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + /schema/{schemaId}: + get: + tags: + - schema + description: Returns schema by schema ID. + security: + - bearerAuth: [] + summary: Returns schema by schema ID. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schema/{schemaId}/parents: + get: + operationId: SingleSchemaApi_getSchemaParents + summary: Returns all parent schemas. + description: Returns all parent schemas. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_8 + - schema + security: + - bearerAuth: [] + /schema/{schemaId}/tree: + get: + operationId: SingleSchemaApi_getSchemaTree + summary: Returns schema tree. + description: Returns schema tree. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + name: + type: string + type: + type: string + children: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas: + get: + tags: + - schemas + description: Returns all schemas. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Create new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: Returns all schemas by topicId. + security: + - bearerAuth: [] + summary: Returns all schemas by topicId. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/type/{schemaType}: + get: + operationId: SchemaApi_getSchemaByType + summary: Finds the schema using the json document type. + description: Finds the schema using the json document type. + parameters: + - name: schemaType + required: true + in: path + description: Type + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_9 + - schemas + security: + - bearerAuth: [] + /schemas/list/all: + get: + operationId: SchemaApi_getAll + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + /schemas/list/sub: + get: + operationId: SchemaApi_getSub + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: category + required: true + in: query + description: Schema category + schema: + type: string + - name: topicId + required: true + in: query + description: Topic Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + /schemas/push/copy: + post: + operationId: SchemaApi_copySchemaAsync + summary: Copy schema. + description: >- + Copy schema. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Object that contains a valid schema. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/push/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Create new schema. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/file/preview: + post: + tags: + - schemas + description: >- + Previews the schema from a zip file. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from a zip file. + requestBody: + description: A zip file containing the schema to be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/message: + post: + tags: + - schemas + description: >- + Returns Hedera message IDs of the published schemas, these messages + contain IPFS CIDs of these schema files. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: List Hedera message IDs of published schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportSchema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/file: + post: + tags: + - schemas + description: >- + Returns schema files for the schemas. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return zip file with schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{username}: + post: + tags: + - schemas + description: >- + Creates new system schema. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Creates new system schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: >- + Returns all system schemas by username. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all system schemas by username. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set. + examples: + pageIndex: + summary: Example of a pageIndex. + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The number of items to return. + examples: + pageSize: + summary: Example of a pageSize. + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total number of items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}/active: + put: + tags: + - schemas + description: >- + Makes the selected scheme active. Other schemes of the same type become + inactive. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/entity/{schemaEntity}: + get: + tags: + - schemas + description: Finds the schema using the schema type. + parameters: + - in: path + name: schemaEntity + schema: + type: string + enum: + - STANDARD_REGISTRY + - USER + - POLICY + - MINT_TOKEN + - WIPE_TOKEN + - MINT_NFTOKEN + required: true + description: schema type. + security: + - bearerAuth: [] + summary: Returns schema by schema type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/xlsx: + get: + operationId: SchemaApi_getPolicyExportXlsx + summary: Return schemas in a xlsx file format for the specified policy. + description: >- + Returns a xlsx file containing schemas. Only users with the Standard + Registry role are allowed to make the request. + parameters: + - name: schemaId + required: true + in: path + description: Schema ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsx + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/push/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsxAsync + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/import/xlsx/preview: + post: + operationId: SchemaApi_importPolicyFromXlsxPreview + summary: Previews the schema from a xlsx file. + description: >- + Previews the schema from a xlsx file. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/export/template: + get: + operationId: SchemaApi_exportTemplate + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /settings: + get: + tags: + - settings + description: >- + Returns current settings. For users with the Standard Registry role + only. + security: + - bearerAuth: [] + summary: Returns current settings. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - settings + description: Set settings. For users with the Standard Registry role only. + security: + - bearerAuth: [] + summary: Set settings. + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + /settings/environment: + get: + tags: + - settings + description: Returns current environment name. + security: + - bearerAuth: [] + summary: Returns current environment name. + responses: + '200': + description: Successful operation. + content: + text/plain: + schema: + type: string + example: testnet + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /settings/about: + get: + operationId: SettingsApi_getAbout + parameters: [] + responses: + '200': + description: '' + tags: + - settings + /tags: + post: + operationId: TagsApi_setTags + parameters: [] + responses: + '201': + description: '' + tags: + - tags + /tags/search: + post: + tags: + - tags + description: Search tags. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + oneOf: + - type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + target: + type: string + - type: object + required: + - entity + - targets + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + targets: + type: array + items: + type: string + examples: + Single: + value: + entity: PolicyDocument + target: targetId1 + Multiple: + value: + entity: PolicyDocument + targets: + - targetId1 + - targetId2 + summary: Search tags. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + description: a (targetId, Tags) map. `targetId1` is an example key + properties: + targetId1: + $ref: '#/components/schemas/TagMap' + additionalProperties: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/{uuid}: + delete: + tags: + - tags + description: Delete tag. + security: + - bearerAuth: [] + summary: Delete tag. + parameters: + - in: path + name: uuid + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: Tag identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/synchronization: + post: + tags: + - tags + description: synchronization. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: targetId + summary: synchronization. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas: + get: + tags: + - tags + description: Returns all schema. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tags + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}: + delete: + tags: + - tags + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Delete the schema. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - tags + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}/publish: + put: + tags: + - tags + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/published: + get: + tags: + - tags + description: Return a list of all published schemas. + security: + - bearerAuth: [] + summary: Return a list of all published schemas. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tasks/{taskId}: + get: + tags: + - tasks + description: Returns task statuses by Id. + security: + - bearerAuth: [] + summary: Returns task statuses. + parameters: + - in: path + name: taskId + schema: + type: string + required: true + description: Task ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskStatus' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens: + get: + tags: + - tokens + description: >- + Returns all tokens. For the Standard Registry role it returns only the + list of tokens, for other users it also returns token balances as well + as the KYC, Freeze, and Association statuses. Not allowed for the + Auditor role. + security: + - bearerAuth: [] + summary: Return a list of tokens. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push: + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}: + delete: + operationId: TokensApi_deleteTokenAsync + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: '' + tags: &ref_10 + - tokens + /tokens/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associate the user with the provided Hedera token. + responses: + '202': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Disassociates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/info: + get: + tags: + - tokens + description: >- + Returns user information for the selected token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/serials: + get: + operationId: TokensApi_getTokenSerials + summary: Return token serials. + description: Returns token serials of current user. + parameters: + - name: tokenId + required: true + in: path + description: Token identifier + example: 0.0.1 + schema: + type: string + responses: + '200': + description: Token serials. + content: + application/json: + schema: + type: array + items: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_10 + security: + - bearerAuth: [] + /themes: + get: + tags: + - themes + description: Returns all themes. + security: + - bearerAuth: [] + summary: Return a list of all themes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - themes + description: Creates a new theme. + security: + - bearerAuth: [] + summary: Creates a new theme. + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}: + put: + tags: + - themes + description: Updates theme configuration for the specified theme ID. + summary: Updates theme configuration. + parameters: + - in: path + name: themeId + description: Selected theme ID. + required: true + schema: + type: string + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - themes + description: Deletes the theme with the provided theme ID. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Theme ID. + security: + - bearerAuth: [] + summary: Deletes the theme. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/import/file: + post: + tags: + - themes + description: Imports new theme from the provided zip file into the local DB. + security: + - bearerAuth: [] + summary: Imports new theme from a zip file. + requestBody: + description: A zip file that contains the theme to be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}/export/file: + get: + tags: + - themes + description: Returns a zip file containing the theme. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Selected theme ID. + security: + - bearerAuth: [] + summary: Returns a zip file containing the theme. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains: + get: + tags: + - trustchains + description: >- + Requests all VP documents. Only users with the Auditor role are allowed + to make the request. + security: + - bearerAuth: [] + summary: Returns a list of all VP documents. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + - in: query + name: policyId + schema: + type: string + description: Selected policy ID. + - in: query + name: policyOwner + schema: + type: string + description: Selected Standard Registry (DID). + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VerifiablePresentation' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains/{hash}: + get: + tags: + - trustchains + description: >- + Builds and returns a trustchain, from the VP to the root VC document. + Only users with the Auditor role are allowed to make the request. + parameters: + - in: path + name: hash + schema: + type: string + required: true + description: Hash or ID of a VP document. + security: + - bearerAuth: [] + summary: Returns a trustchain for a VP document. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TrustChains' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/policy: + post: + tags: + - wizard + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '201': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyId: + type: string + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/push/policy: + post: + operationId: WizardApi_setPolicyAsync + summary: Creates a new policy. + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + saveState: + type: boolean + wizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - wizard + /wizard/{policyId}/config: + post: + tags: + - wizard + description: >- + Get policy config by wizard. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier. + security: + - bearerAuth: [] + summary: Get policy config. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyConfig: + $ref: '#/components/schemas/PolicyConfig' + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /branding: + post: + operationId: BrandingApi_setBranding + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_11 + - branding + security: + - bearerAuth: [] + get: + operationId: BrandingApi_getBranding + parameters: [] + responses: + '200': + description: '' + tags: *ref_11 + /suggestions: + post: + operationId: SuggestionsApi_policySuggestions + summary: Get next and nested suggested block types + description: >- + Get next and nested suggested block types. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsInputDTO' + responses: + '200': + description: >- + Successful operation. Suggested next and nested block types + respectively. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsOutputDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_12 + - suggestions + security: + - bearerAuth: [] + - bearerAuth: [] + /suggestions/config: + post: + operationId: SuggestionsApi_setPolicySuggestionsConfig + summary: Set suggestions config + description: >- + Set suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + responses: + '201': + description: Successful operation. Response setted suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearerAuth: [] + - bearerAuth: [] + get: + operationId: SuggestionsApi_getPolicySuggestionsConfig + summary: Get suggestions config + description: >- + Get suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. Response suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications: + get: + operationId: NotificationsApi_getAllNotifications + summary: Get all notifications + description: Returns all notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications and count. + headers: + X-Total-Count: + description: Count of notifications + schema: + type: number + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_13 + - notifications + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/new: + get: + operationId: NotificationsApi_getNewNotifications + summary: Get new notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns new notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/progresses: + get: + operationId: NotificationsApi_getProgresses + summary: Get progresses + description: Returns progresses. + parameters: [] + responses: + '200': + description: Successful operation. Returns progresses. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProgressDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/read/all: + post: + operationId: NotificationsApi_readAll + summary: Read all notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/delete/{notificationId}: + delete: + operationId: NotificationsApi_delete + summary: Delete notifications up to this point + description: Returns deleted notifications count. + parameters: + - name: notificationId + required: true + in: path + schema: + type: string + responses: + '200': + description: Successful operation. Returns deleted notifications count. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /projects/search: + post: + operationId: ProjectsAPI_projectSearch + summary: Search projects + description: Search projects by filters + parameters: [] + requestBody: + required: true + description: The question of choosing a methodology + content: + application/json: + schema: + type: string + examples: + q: + value: >- + What methodology can I use for production of electricity using + renewable energy technologies? + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProjectDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_14 + - projects + /projects/compare/documents: + post: + operationId: ProjectsAPI_compareDocuments + summary: Compare documents. + description: Compare documents. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + /projects/properties: + get: + operationId: ProjectsAPI_getPolicyProperties + summary: Get all properties + description: Get all properties + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PropertiesDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + /record/{policyId}/status: + get: + operationId: RecordApi_getRecordStatus + summary: Get recording or running status. + description: >- + Get recording or running status. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RecordStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_15 + - record + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/recording/start: + post: + operationId: RecordApi_startRecord + summary: Start recording. + description: >- + Start recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/recording/stop: + post: + operationId: RecordApi_stopRecord + summary: Stop recording. + description: >- + Stop recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/recording/actions: + get: + operationId: RecordApi_getRecordActions + summary: Get recorded actions. + description: >- + Get recorded actions. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecordActionDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/start: + post: + operationId: RecordApi_runRecord + summary: Run record from a zip file. + description: >- + Run record from a zip file. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A zip file containing record to be run. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/stop: + post: + operationId: RecordApi_stopRunning + summary: Stop running. + description: >- + Stop running. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/results: + get: + operationId: RecordApi_getRecordResults + summary: Get running results. + description: >- + Get running results. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningResultDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/details: + get: + operationId: RecordApi_getRecordDetails + summary: Get running details. + description: >- + Get running details. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningDetailsDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/fast-forward: + post: + operationId: RecordApi_fastForward + summary: Fast Forward. + description: >- + Fast Forward. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/retry: + post: + operationId: RecordApi_retryStep + summary: Retry step. + description: >- + Retry step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + - bearerAuth: [] + /record/{policyId}/running/skip: + post: + operationId: RecordApi_skipStep + summary: Skip step. + description: >- + Skip step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + /ai-suggestions/ask: + get: + operationId: AISuggestionsAPI_getAIAnswer + summary: Get methodology suggestion + description: Returns AI response to the current question + parameters: + - name: q + required: true + in: query + description: The question of choosing a methodology + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_16 + - ai-suggestions + /ai-suggestions/rebuild-vector: + put: + operationId: AISuggestionsAPI_rebuildVector + summary: Rebuild AI vector + description: Rebuilds vector based on policy data in the DB + parameters: [] + responses: + '200': + description: '' + tags: *ref_16 + /schemas/type/{type}: + get: + tags: + - schemas + description: Finds the schema using the json document type. + parameters: + - in: path + name: type + schema: + type: string + required: true + description: JSON type. + security: + - bearerAuth: [] + summary: Returns schema by type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}: + get: + tags: + - policies + description: >- + Requests block ID from a policy by tag. Only users with the Standard + Registry and Installer roles are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + summary: Requests block ID from a policy by tag. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + id: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}/blocks: + post: + tags: + - policies + description: Sends data to the specified block. + security: + - bearerAuth: [] + summary: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + security: + - bearerAuth: [] + summary: Requests block data. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/: + post: + tags: + - ipfs + description: Add file to ipfs. + summary: Add file to ipfs. + requestBody: + description: Data array of file. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + application/json: + schema: + description: CID of added file. + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{policyId}: + post: + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact: + get: + deprecated: true + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{policyId}: + post: + deprecated: true + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{artifactId}: + delete: + deprecated: true + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/: + post: + tags: + - tags + description: Creates new tag. + security: + - bearerAuth: [] + summary: Creates new tag. + requestBody: + description: Object that contains tag information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +info: + title: Guardian + description: >- + The Guardian is a modular open-source solution that includes best-in-class + identity management and decentralized ledger technology (DLT) libraries. At + the heart of the Guardian solution is a sophisticated Policy Workflow Engine + (PWE) that enables applications to offer a requirements-based tokenization + implementation. + version: 2.23.1 + contact: + name: API developer + url: https://envisionblockchain.com + email: info@envisionblockchain.com + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +tags: [] +servers: + - url: /api/v1 + description: version 1.0 +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + AccountsResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + did: + type: string + required: + - username + - role + - did + InternalServerErrorDTO: + type: object + properties: + code: + type: number + message: + type: string + required: + - code + - message + RegisterUserDTO: + type: object + properties: + username: + type: string + password: + type: string + password_confirmation: + type: string + role: + type: string + required: + - username + - password + - password_confirmation + - role + AccountsSessionResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + accessToken: + type: string + required: + - username + - role + - accessToken + LoginUserDTO: + type: object + properties: + username: + type: string + password: + type: string + required: + - username + - password + CredentialSubjectDTO: + type: object + properties: + geography: + type: string + law: + type: string + tags: + type: string + ISIC: + type: string + '@context': + type: array + items: + type: string + id: + type: string + type: + type: string + required: + - geography + - law + - tags + - ISIC + - '@context' + - id + - type + ProofDTO: + type: object + properties: + type: + type: string + created: + format: date-time + type: string + verificationMethod: + type: string + proofPurpose: + type: string + jws: + type: string + required: + - type + - created + - verificationMethod + - proofPurpose + - jws + VcDocumentDTO: + type: object + properties: + id: + type: string + type: + type: array + items: + type: string + issuer: + type: string + issuanceDate: + format: date-time + type: string + '@context': + type: array + items: + type: string + credentialSubject: + $ref: '#/components/schemas/CredentialSubjectDTO' + proof: + $ref: '#/components/schemas/ProofDTO' + required: + - id + - type + - issuer + - issuanceDate + - '@context' + - credentialSubject + - proof + PolicyDTO: + type: object + properties: + _id: + type: string + createDate: + format: date-time + type: string + uuid: + type: string + name: + type: string + description: + type: string + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + policyTag: + type: string + codeVersion: + type: string + userRoles: + type: array + items: + type: string + userGroups: + type: array + items: + type: string + userRole: + type: string + userGroup: + type: string + id: + type: string + required: + - _id + - createDate + - uuid + - name + - description + - status + - creator + - owner + - topicId + - policyTag + - codeVersion + - userRoles + - userGroups + - userRole + - userGroup + - id + AggregatedDTOItem: + type: object + properties: + did: + type: string + hederaAccountId: + type: string + vcDocument: + $ref: '#/components/schemas/VcDocumentDTO' + policies: + $ref: '#/components/schemas/PolicyDTO' + required: + - did + - hederaAccountId + - vcDocument + - policies + UserDTO: + type: object + properties: + username: + type: string + did: + type: string + required: + - username + - did + BalanceResponseDTO: + type: object + properties: + balance: + type: number + unit: + type: string + user: + $ref: '#/components/schemas/UserDTO' + required: + - balance + - unit + - user + FilterSearchPoliciesDTO: + type: object + properties: + policyId: + type: string + required: + - policyId + SearchPoliciesDTO: + type: object + properties: + target: + type: object + result: + type: object + required: + - target + - result + FilterPoliciesDTO: + type: object + properties: + policyId1: + type: string + policyId2: + type: string + policyIds: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - policyId1 + - policyId2 + - policyIds + - eventsLvl + - propLvl + - childrenLvl + - idLvl + ComparePoliciesDTO: + type: object + properties: + blocks: + type: object + groups: + type: object + left: + type: object + right: + type: object + roles: + type: object + tokens: + type: object + topics: + type: object + total: + type: object + required: + - blocks + - groups + - left + - right + - roles + - tokens + - topics + - total + FilterModulesDTO: + type: object + properties: + moduleId1: + type: string + moduleId2: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - moduleId1 + - moduleId2 + - eventsLvl + - propLvl + - childrenLvl + - idLvl + CompareModulesDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + FilterSchemasDTO: + type: object + properties: + schemaId1: + type: string + schemaId2: + type: string + idLvl: + type: number + required: + - schemaId1 + - schemaId2 + - idLvl + CompareSchemasDTO: + type: object + properties: + fields: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - fields + - left + - right + - total + FilterDocumentsDTO: + type: object + properties: + documentId1: + type: string + documentId2: + type: string + documentIds: + type: string + required: + - documentId1 + - documentId2 + - documentIds + CompareDocumentsDTO: + type: object + properties: + documents: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - documents + - left + - right + - total + FilterToolsDTO: + type: object + properties: + toolId1: + type: string + toolId2: + type: string + toolIds: + type: string + required: + - toolId1 + - toolId2 + - toolIds + CompareToolsDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + ArtifactDTOItem: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + required: + - id + - name + - uuid + - extention + - type + ContractDTO: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + permissions: + type: number + topicId: + type: string + type: + type: string + enum: + - WIPE + - RETIRE + syncRequestsDate: + format: date-time + type: string + syncPoolsDate: + format: date-time + type: string + lastSyncEventTimeStamp: + type: string + wipeContractIds: + type: array + items: + type: string + required: + - id + - contractId + - description + - owner + - permissions + - topicId + - type + - syncRequestsDate + - syncPoolsDate + - lastSyncEventTimeStamp + - wipeContractIds + WiperRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + user: + type: string + required: + - id + - contractId + - user + RetireRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + user: + type: string + required: + - id + - contractId + - tokens + - tokenIds + - user + Date: + type: object + properties: {} + RetirePoolDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + contract: + type: string + count: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + immediately: + type: boolean + enabled: + type: boolean + required: + - id + - contractId + - tokens + - tokenIds + - immediately + - enabled + RetirePoolTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + required: + - token + - count + RetireRequestTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: string + required: + - token + - count + - serials + ProfileDTO: + type: object + properties: + username: + type: string + nullable: false + role: + type: string + nullable: false + did: + type: string + nullable: true + parent: + type: string + nullable: true + hederaAccountId: + type: string + nullable: true + confirmed: + type: boolean + nullable: true + failed: + type: boolean + nullable: true + topicId: + type: string + nullable: true + parentTopicId: + type: string + nullable: true + didDocument: + type: object + nullable: true + vcDocument: + type: object + nullable: true + required: + - username + - role + SubjectDTO: + type: object + properties: + '@context': + nullable: true + type: array + items: + type: string + id: + type: string + nullable: true + type: + type: string + nullable: true + required: + - '@context' + DidDocumentDTO: + type: object + properties: + id: + type: string + nullable: false + context: + nullable: true + type: array + items: + type: string + alsoKnownAs: + nullable: true + type: array + items: + type: string + controller: + nullable: true + type: array + items: + type: string + verificationMethod: + nullable: true + type: array + items: + type: object + authentication: + nullable: true + type: array + items: + type: object + assertionMethod: + nullable: true + type: array + items: + type: object + keyAgreement: + nullable: true + type: array + items: + type: object + capabilityInvocation: + nullable: true + type: array + items: + type: object + capabilityDelegation: + nullable: true + type: array + items: + type: object + service: + nullable: true + type: array + items: + type: object + required: + - id + - context + - alsoKnownAs + - controller + - verificationMethod + - authentication + - assertionMethod + - keyAgreement + - capabilityInvocation + - capabilityDelegation + - service + DidKeyDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + required: + - id + - key + CredentialsDTO: + type: object + properties: + entity: + type: string + nullable: false + hederaAccountId: + type: string + nullable: false + hederaAccountKey: + type: string + nullable: false + parent: + type: string + nullable: true + vcDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/SubjectDTO' + didDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + didKeys: + nullable: true + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - entity + - hederaAccountId + - hederaAccountKey + TaskDTO: + type: object + properties: + taskId: + type: string + expectation: + type: number + required: + - taskId + - expectation + DidDocumentStatusDTO: + type: object + properties: + valid: + type: boolean + nullable: false + error: + type: string + nullable: true + didDocument: + type: object + nullable: false + required: + - valid + - error + - didDocument + DidDocumentWithKeyDTO: + type: object + properties: + document: + nullable: false + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + keys: + nullable: false + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - document + - keys + DidKeyStatusDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + valid: + type: boolean + nullable: false + required: + - id + - key + - valid + MigrationConfigPoliciesDTO: + type: object + properties: + src: + type: string + dst: + type: string + required: + - src + - dst + MigrationConfigDTO: + type: object + properties: + policies: + $ref: '#/components/schemas/MigrationConfigPoliciesDTO' + vcs: + type: array + items: + type: string + vps: + type: array + items: + type: string + schemas: + type: object + groups: + type: object + roles: + type: object + required: + - policies + - vcs + - vps + - schemas + - groups + - roles + PolicyCategoryDTO: + type: object + properties: + id: + type: string + name: + type: string + type: + type: string + required: + - id + - name + - type + SchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + entity: + type: string + document: + type: string + uuid: + type: string + iri: + type: string + hash: + type: string + status: + type: string + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - entity + - document + - uuid + - iri + - hash + - status + - topicId + - version + - owner + - messageId + VersionSchemaDTO: + type: object + properties: + version: + type: string + required: + - version + MessageSchemaDTO: + type: object + properties: + messageId: + type: string + required: + - messageId + ExportSchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - version + - owner + - messageId + SystemSchemaDTO: + type: object + properties: + name: + type: string + entity: + type: string + required: + - name + - entity + SettingsDTO: + type: object + properties: + ipfsStorageApiKey: + type: string + operatorId: + type: string + operatorKey: + type: string + required: + - ipfsStorageApiKey + - operatorId + - operatorKey + SuggestionsInputDTO: + type: object + properties: + blockType: + type: string + children: + nullable: true + type: array + items: + type: object + required: + - blockType + - children + SuggestionsOutputDTO: + type: object + properties: + next: + type: string + nested: + type: string + required: + - next + - nested + SuggestionsConfigItemDTO: + type: object + properties: + id: + type: string + type: + type: string + enum: + - Policy + - Module + index: + type: number + required: + - id + - type + - index + SuggestionsConfigDTO: + type: object + properties: + items: + $ref: '#/components/schemas/SuggestionsConfigItemDTO' + required: + - items + NotificationDTO: + type: object + properties: + title: + type: string + message: + type: string + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + action: + type: string + enum: + - POLICY_CONFIGURATION + - POLICY_VIEW + - POLICIES_PAGE + - SCHEMAS_PAGE + - TOKENS_PAGE + - PROFILE_PAGE + result: + type: object + read: + type: boolean + old: + type: boolean + required: + - title + - message + - type + - action + - result + - read + - old + ProgressDTO: + type: object + properties: + action: + type: string + message: + type: string + progress: + type: number + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + taskId: + type: string + required: + - action + - message + - progress + - type + - taskId + ProjectDTO: + type: object + properties: + id: + type: string + policyId: + type: string + policyName: + type: string + registered: + type: string + title: + type: string + companyName: + type: string + sectoralScope: + type: string + required: + - id + - policyId + - policyName + - registered + - title + - companyName + - sectoralScope + PropertiesDTO: + type: object + properties: + id: + type: string + title: + type: string + value: + type: string + required: + - id + - title + - value + RecordStatusDTO: + type: object + properties: + type: + type: string + policyId: + type: string + uuid: + type: string + status: + type: string + required: + - type + - policyId + - uuid + - status + Object: + type: object + properties: {} + RecordActionDTO: + type: object + properties: + uuid: + type: string + policyId: + type: string + method: + type: string + action: + type: string + time: + type: string + user: + type: string + target: + type: string + required: + - uuid + - policyId + - method + - action + - time + - user + - target + ResultInfoDTO: + type: object + properties: + tokens: + type: number + documents: + type: number + required: + - tokens + - documents + ResultDocumentDTO: + type: object + properties: + type: + type: string + schema: + type: string + rate: + type: string + documents: + type: object + required: + - type + - schema + - rate + - documents + RunningResultDTO: + type: object + properties: + info: + $ref: '#/components/schemas/ResultInfoDTO' + total: + type: number + documents: + $ref: '#/components/schemas/ResultDocumentDTO' + required: + - info + - total + - documents + RunningDetailsDTO: + type: object + properties: + left: + type: object + right: + type: object + total: + type: number + documents: + type: object + required: + - left + - right + - total + - documents + RegisteredUsersDTO: + type: object + properties: + username: + type: string + did: + type: string + parent: + type: string + role: + type: string + policyRoles: + type: array + items: + type: string + required: + - username + - did + - parent + - role + - policyRoles + ToolDTO: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + required: + - id + - uuid + - name + - description + - config + - status + - creator + - owner + - topicId + - messageId + - codeVersion + - createDate + Credentials: + type: object + required: + - username + - password + properties: + username: + type: string + password: + type: string + Account: + type: object + required: + - username + - role + properties: + username: + type: string + role: + type: string + did: + type: string + Session: + type: object + required: + - username + - role + - accessToken + properties: + username: + type: string + role: + type: string + accessToken: + type: string + User: + type: object + required: + - username + - role + properties: + confirmed: + type: string + failed: + type: string + username: + type: string + role: + type: string + hederaAccountId: + type: string + hederaAccountKey: + type: string + did: + type: string + didDocument: + type: object + vcDocument: + type: object + parent: + type: string + topicId: + type: string + Schema: + type: object + required: + - id + - name + - description + - entity + - document + properties: + id: + type: string + iri: + type: string + uuid: + type: string + name: + type: string + description: + type: string + entity: + type: string + hash: + type: string + status: + type: string + document: + oneOf: + - type: string + - type: object + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + ImportSchema: + type: object + required: + - schemes + properties: + schemes: + type: array + items: + type: object + required: + - document + - entity + - name + - uuid + properties: + document: + type: string + entity: + type: string + hash: + type: string + name: + type: string + uuid: + type: string + ExportSchema: + type: object + required: + - ids + properties: + name: + type: string + version: + type: string + messageId: + type: string + Token: + type: object + required: + - changeSupply + - decimals + - enableAdmin + - enableKYC + - enableFreeze + - enableWipe + - initialSupply + - tokenName + - tokenSymbol + - tokenType + properties: + changeSupply: + type: boolean + decimals: + type: string + enableAdmin: + type: boolean + enableFreeze: + type: boolean + enableKYC: + type: boolean + enableWipe: + type: boolean + initialSupply: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + TokenInfo: + type: object + required: + - id + - tokenId + - tokenName + - tokenSymbol + - tokenType + - decimals + - associated + - balance + - frozen + - kyc + properties: + id: + type: string + tokenId: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + decimals: + type: string + associated: + type: boolean + balance: + type: string + frozen: + type: boolean + kyc: + type: boolean + enableAdmin: + type: boolean + enableKYC: + type: boolean + enableFreeze: + type: boolean + enableWipe: + type: boolean + PolicyConfig: + type: object + required: + - name + - version + - description + - topicDescription + - config + - topicId + - policyTag + properties: + id: + type: string + uuid: + type: string + name: + type: string + version: + type: string + description: + type: string + topicDescription: + type: string + config: + type: object + status: + type: string + owner: + type: string + policyRoles: + type: array + items: + type: string + topicId: + type: string + policyTag: + type: string + policyTopics: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + type: + type: string + static: + type: boolean + TrustChains: + type: object + required: + - chain + - userMap + properties: + chain: + type: array + items: + type: object + required: + - id + - type + - tag + - label + - schema + - owner + - document + properties: + id: + type: string + type: + type: string + tag: + type: string + label: + type: string + schema: + type: string + owner: + type: string + document: + type: object + userMap: + type: array + items: + type: object + required: + - did + - username + properties: + did: + type: string + username: + type: string + VerifiablePresentation: + type: object + required: + - hash + - id + - policyId + - signature + - status + - tag + - type + - updateDate + - createDate + - owner + - document + properties: + hash: + type: string + id: + type: string + policyId: + type: string + signature: + type: string + status: + type: string + tag: + type: string + type: + type: string + updateDate: + type: string + createDate: + type: string + owner: + type: string + document: + type: object + PublishPolicy: + type: object + required: + - errors + - isValid + - policies + properties: + errors: + type: array + items: + type: object + isValid: + type: boolean + policies: + type: array + items: + type: object + ValidatePolicy: + type: object + required: + - config + - results + properties: + config: + type: object + results: + type: object + PolicyBlock: + type: object + required: + - id + - blockType + - isActive + - uiMetaData + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + blocks: + type: array + items: + type: object + PolicyBlockData: + type: object + required: + - id + - isActive + - uiMetaData + - data + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + data: + type: object + fields: + type: array + items: + type: object + index: + type: number + roles: + type: array + items: + type: string + blocks: + type: array + items: + $ref: '#/components/schemas/PolicyBlock' + ExportPolicy: + type: object + required: + - name + - version + - messageId + properties: + name: + type: string + version: + type: string + tokens: + type: string + PreviewPolicy: + type: object + required: + - policy + - schemas + - tokens + properties: + policy: + type: object + schemas: + type: array + items: + type: object + tokens: + type: array + items: + type: object + Error: + type: object + required: + - code + - message + properties: + code: + type: number + message: + type: string + ExternalData: + type: object + required: + - owner + - policyTag + - document + properties: + owner: + type: string + policyTag: + type: string + document: + type: object + HederaAccount: + type: object + required: + - id + - key + properties: + id: + type: string + key: + type: string + CommonSettings: + type: object + properties: + operatorId: + type: string + operatorKey: + type: string + nftApiKey: + deprecated: true + type: string + ipfsStorageApiKey: + type: string + LogFilters: + type: object + properties: + type: + type: string + startDate: + type: string + endDate: + type: string + attributes: + type: array + items: + type: string + message: + type: string + pageSize: + type: number + pageIndex: + type: number + sortDirection: + type: string + enum: + - ASC + - DESC + Log: + type: object + properties: + type: + type: string + datetime: + type: string + message: + type: string + attributes: + type: array + items: + type: string + Task: + type: object + properties: + taskId: + type: string + expectation: + type: number + TaskStatus: + type: object + properties: + date: + type: string + name: + type: string + statuses: + type: array + items: + type: object + properties: + type: + type: string + message: + type: string + result: + type: object + error: + type: object + Artifact: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + MultiPolicyConfig: + type: object + properties: + id: + type: string + uuid: + type: string + owner: + type: string + type: + type: string + instanceTopicId: + type: string + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + policyOwner: + type: string + user: + type: string + Contract: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + isOwnerCreator: + type: string + status: + type: string + RetireRequest: + type: object + properties: + id: + type: string + contractId: + type: string + baseTokenId: + type: string + owner: + type: string + oppositeTokenId: + type: string + baseTokenCount: + type: number + oppositeTokenCount: + type: number + Module: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + type: + type: string + PreviewModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + ExportModule: + type: object + properties: + uuid: + type: string + name: + type: string + description: + type: string + messageId: + type: string + owner: + type: string + PublishModule: + type: object + properties: + errors: + type: object + isValid: + type: boolean + module: + $ref: '#/components/schemas/Module' + ValidateModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + results: + type: object + Tag: + type: object + required: + - name + - entity + - localTarget + properties: + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Tag label + description: + type: string + example: Description + owner: + type: string + example: did + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: '0000000000.000000000' + localTarget: + type: string + example: db id + status: + type: string + enum: + - Draft + - Published + - History + example: Published + operation: + type: string + enum: + - Create + - Delete + example: Create + date: + type: string + example: '1900-01-01T00:00:00.000Z' + topicId: + type: string + example: 0.0.0000000 + messageId: + type: string + example: '0000000000.000000000' + policyId: + type: string + example: db id + uri: + type: string + example: document uri + document: + type: object + TagMap: + type: object + required: + - entity + - target + - refreshDate + - tags + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: db id + refreshDate: + type: string + example: '1900-01-01T00:00:00.000Z' + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + Theme: + type: object + required: + - uuid + - name + - rules + properties: + id: + type: string + example: db id + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Theme name + rules: + type: array + items: + type: object + required: + - text + - background + - border + - shape + - borderWidth + - filterType + - filterValue + properties: + description: + type: string + example: description + text: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + background: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + border: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + shape: + type: string + enum: + - '0' + - '1' + - '2' + - '3' + - '4' + - '5' + example: '0' + borderWidth: + type: string + enum: + - 0px + - 1px + - 2px + - 3px + - 4px + - 5px + - 6px + - 7px + example: 2px + filterType: + type: string + enum: + - type + - api + - role + example: type + filterValue: + oneOf: + - type: string + - type: array + items: + type: string + example: + - type + WizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean diff --git a/docs/.gitbook/assets/swagger.yaml b/docs/.gitbook/assets/swagger.yaml index 26784dd621..53b5add454 100644 --- a/docs/.gitbook/assets/swagger.yaml +++ b/docs/.gitbook/assets/swagger.yaml @@ -1,12210 +1,12519 @@ -openapi: 3.0.0 -paths: - /accounts/session: - get: - operationId: AccountApi_getSession - summary: Returns current session of the user. - description: Returns current user session. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsSessionResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_0 - - accounts - security: - - bearer: [] - /accounts/register: - post: - operationId: AccountApi_register - summary: Registers a new user account. - description: Object that contain username, password and role (optional) fields. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterUserDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - /accounts/login: - post: - operationId: AccountApi_login - summary: Logs user into the system. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LoginUserDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsSessionResponseDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - /accounts/access-token: - post: - operationId: AccountApi_getAccessToken - summary: Returns access token. - description: Returns access token. - parameters: [] - responses: - '200': - description: Successful operation. - tags: *ref_0 - /accounts: - get: - operationId: AccountApi_getAllAccounts - summary: Returns a list of users, excluding Standard Registry and Auditors. - description: >- - Returns all users except those with roles Standard Registry and Auditor. - Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/standard-registries: - get: - operationId: AccountApi_getStandatdRegistries - summary: Returns all Standard Registries. - description: Returns all Standard Registries. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountsResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/standard-registries/aggregated: - get: - operationId: AccountApi_getAggregatedStandardRegistries - summary: Returns all Standard Registries aggregated with polices and vcDocuments. - description: Returns all Standard Registries aggregated with polices and vcDocuments - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/AggregatedDTOItem' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /accounts/balance: - get: - operationId: AccountApi_getBalance - summary: Returns user's Hedera account balance. - description: Requests current Hedera account balance. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/BalanceResponseDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_0 - security: - - bearerAuth: [] - /analytics/search/policies: - post: - operationId: AnalyticsApi_searchPolicies - summary: Search policies. - description: >- - Search policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSearchPoliciesDTO' - examples: - Filter: - value: - policyId: '000000000000000000000000' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SearchPoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_1 - - analytics - security: - - bearerAuth: [] - /analytics/compare/policies: - post: - operationId: AnalyticsApi_comparePolicies - summary: Compare policies. - description: >- - Compare policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterPoliciesDTO' - examples: - Filter1: - value: - policyId1: '000000000000000000000001' - policyId2: '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - Filter2: - value: - policyIds: - - '000000000000000000000001' - - '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ComparePoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/modules: - post: - operationId: AnalyticsApi_compareModules - summary: Compare modules. - description: >- - Compare modules. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterModulesDTO' - examples: - Filter: - value: - moduleId1: '000000000000000000000001' - moduleId2: '000000000000000000000002' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareModulesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/schemas: - post: - operationId: AnalyticsApi_compareSchemas - summary: Compare schemas. - description: >- - Compare schemas. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSchemasDTO' - examples: - Filter: - value: - schemaId1: '000000000000000000000001' - schemaId2: '000000000000000000000002' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareSchemasDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/documents: - post: - operationId: AnalyticsApi_compareDocuments - summary: Compare documents. - description: >- - Compare documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareDocumentsDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/tools: - post: - operationId: AnalyticsApi_compareTools - summary: Compare tools. - description: >- - Compare tools. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterToolsDTO' - examples: - Filter1: - value: - toolId1: '000000000000000000000001' - toolId2: '000000000000000000000002' - Filter2: - value: - toolIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareToolsDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/policies/export: - post: - operationId: AnalyticsApi_comparePoliciesExport - summary: Compare policies. - description: >- - Compare policies. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterPoliciesDTO' - examples: - Filter1: - value: - policyId1: '000000000000000000000001' - policyId2: '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - Filter2: - value: - policyIds: - - '000000000000000000000001' - - '000000000000000000000002' - eventsLvl: '0' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/modules/export: - post: - operationId: AnalyticsApi_compareModulesExport - summary: Compare modules. - description: >- - Compare modules. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterModulesDTO' - examples: - Filter: - value: - moduleId1: '000000000000000000000001' - moduleId2: '000000000000000000000002' - propLvl: '0' - childrenLvl: '0' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/schemas/export: - post: - operationId: AnalyticsApi_compareSchemasExport - summary: Compare schemas. - description: >- - Compare schemas. Only users with the Standard Registry role are allowed - to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSchemasDTO' - examples: - Filter: - value: - schemaId1: '000000000000000000000001' - schemaId2: '000000000000000000000002' - idLvl: '0' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/documents/export: - post: - operationId: AnalyticsApi_compareDocumentsExport - summary: Compare documents. - description: >- - Compare documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/compare/tools/export: - post: - operationId: AnalyticsApi_compareToolsExport - summary: Compare tools. - description: >- - Compare tools. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterToolsDTO' - examples: - Filter1: - value: - toolId1: '000000000000000000000001' - toolId2: '000000000000000000000002' - Filter2: - value: - toolIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /analytics/search/blocks: - post: - operationId: AnalyticsApi_searchBlocks - summary: Search same blocks. - description: >- - Search same blocks. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSearchPoliciesDTO' - examples: - Filter: - value: - uuid: '' - config: {} - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SearchPoliciesDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_1 - security: - - bearerAuth: [] - /artifacts: - get: - tags: - - artifacts - description: Returns all artifacts. - security: - - bearerAuth: [] - summary: Returns all artifacts. - parameters: - - in: query - name: policyId - schema: - type: string - description: Policy identifier - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifacts/{parentId}: - post: - operationId: ArtifactApi_uploadArtifacts - summary: Upload artifact. - description: Upload artifact. For users with the Standard Registry role only. - parameters: - - name: parentId - required: true - in: path - description: Parent ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ArtifactDTOItem' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: - - artifacts - security: - - bearerAuth: [] - /artifacts/{artifactId}: - delete: - tags: - - artifacts - description: Delete artifact. - security: - - bearerAuth: [] - summary: Delete artifact. - parameters: - - in: path - name: artifactId - schema: - type: string - required: true - description: Artifact identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /contracts: - get: - operationId: ContractsApi_getContracts - summary: Return a list of all contracts. - description: Returns all contracts. - parameters: - - name: type - required: false - in: query - description: Contract type - example: RETIRE - schema: - enum: - - WIPE - - RETIRE - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Contracts. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_2 - - contracts - security: - - bearer: [] - post: - operationId: ContractsApi_createContract - summary: Create contract. - description: >- - Create smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - description: - type: string - responses: - '201': - description: Created contract. - content: - application/json: - schema: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/import: - post: - operationId: ContractsApi_importContract - summary: Import contract. - description: >- - Import smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contractId: - type: string - description: Hedera Identifier - example: 0.0.1 - description: - type: string - required: - - contractId - responses: - '200': - description: Imported contract. - content: - application/json: - schema: - $ref: '#/components/schemas/ContractDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/{contractId}/permissions: - get: - operationId: ContractsApi_contractPermissions - summary: Get contract permissions. - description: >- - Get smart-contract permissions. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Contract permissions. - content: - application/json: - schema: - type: number - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/{contractId}: - delete: - operationId: ContractsApi_removeContract - summary: Remove contract. - description: >- - Remove smart-contract. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests: - get: - operationId: ContractsApi_getWipeRequests - summary: Return a list of all wipe requests. - description: >- - Returns all wipe requests. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WiperRequestDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests/enable: - post: - operationId: ContractsApi_enableWipeRequests - summary: Enable wipe requests. - description: >- - Enable wipe contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests/disable: - post: - operationId: ContractsApi_disableWipeRequests - summary: Disable wipe requests. - description: >- - Disable wipe contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests/{requestId}/approve: - post: - operationId: ContractsApi_approveWipeRequest - summary: Approve wipe request. - description: >- - Approve wipe contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/requests/{requestId}/reject: - delete: - operationId: ContractsApi_rejectWipeRequest - summary: Reject wipe request. - description: >- - Reject wipe contract request. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: ban - required: false - in: query - description: Reject and ban - schema: - type: boolean - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/requests: - delete: - operationId: ContractsApi_clearWipeRequests - summary: Clear wipe requests. - description: >- - Clear wipe contract requests. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/admin/{hederaId}: - post: - operationId: ContractsApi_wipeAddAdmin - summary: Add wipe admin. - description: >- - Add wipe contract admin. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveAdmin - summary: Remove wipe admin. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/manager/{hederaId}: - post: - operationId: ContractsApi_wipeAddManager - summary: Add wipe manager. - description: >- - Add wipe contract manager. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveManager - summary: Remove wipe manager. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/wipe/{contractId}/wiper/{hederaId}: - post: - operationId: ContractsApi_wipeAddWiper - summary: Add wipe wiper. - description: >- - Add wipe contract wiper. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_wipeRemoveWiper - summary: Remove wipe wiper. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/pools/sync: - post: - operationId: ContractsApi_retireSyncPools - summary: Sync retire pools. - description: >- - Sync retire contract pools. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Sync date. - content: - application/json: - schema: - $ref: '#/components/schemas/Date' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests: - get: - operationId: ContractsApi_getRetireRequests - summary: Return a list of all retire requests. - description: Returns all retire requests. - parameters: - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RetireRequestDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools: - get: - operationId: ContractsApi_getRetirePools - summary: Return a list of all retire pools. - description: Returns all retire pools. - parameters: - - name: tokens - required: false - in: query - description: Tokens - example: 0.0.1,0.0.2,0.0.3 - schema: - type: string - - name: contractId - required: false - in: query - description: Contract identifier - example: 0.0.1 - schema: - type: string - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RetirePoolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/requests: - delete: - operationId: ContractsApi_clearRetireRequests - summary: Clear retire requests. - description: >- - Clear retire contract requests. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/pools: - delete: - operationId: ContractsApi_clearRetirePools - summary: Clear retire pools. - description: >- - Clear retire contract pools. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - post: - operationId: ContractsApi_setRetirePool - summary: Set retire pool. - description: >- - Set retire contract pool. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: contractId - required: false - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RetirePoolTokenDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RetirePoolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools/{poolId}: - delete: - operationId: ContractsApi_unsetRetirePool - summary: Unset retire pool. - description: >- - Unset retire contract pool. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: poolId - required: false - in: path - description: Pool Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}: - delete: - operationId: ContractsApi_unsetRetireRequest - summary: Unset retire request. - description: >- - Unset retire contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: false - in: path - description: Request Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/pools/{poolId}/retire: - post: - operationId: ContractsApi_retire - summary: Retire tokens. - description: Retire tokens. - parameters: - - name: poolId - required: false - in: path - description: Pool Identifier - example: 652745597a7b53526de37c05 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RetireRequestTokenDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}/approve: - post: - operationId: ContractsApi_approveRetire - summary: Approve retire request. - description: >- - Approve retire contract request. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/requests/{requestId}/cancel: - delete: - operationId: ContractsApi_cancelRetireRequest - summary: Cancel retire request. - description: Cancel retire contract request. - parameters: - - name: requestId - required: true - in: path - description: Request identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire/{contractId}/admin/{hederaId}: - post: - operationId: ContractsApi_retireAddAdmin - summary: Add retire admin. - description: >- - Add retire contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - delete: - operationId: ContractsApi_retireRemoveAdmin - summary: Remove wipe admin. - description: >- - Remove wipe contract admin. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: hederaId - required: true - in: path - description: Hedera identifier - example: 0.0.1 - schema: - type: string - - name: contractId - required: true - in: path - description: Contract identifier - example: 652745597a7b53526de37c05 - schema: - type: string - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /contracts/retire: - get: - operationId: ContractsApi_getRetireVCs - summary: Return a list of all retire vcs. - description: Returns all retire vcs. - parameters: - - name: pageSize - required: false - in: query - description: The numbers of items to return - example: 20 - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - example: 0 - schema: - type: number - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_2 - security: - - bearer: [] - /demo/registered-users: - get: - operationId: DemoApi_registeredUsers - summary: Returns list of registered users. - description: Returns list of registered users. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RegisteredUsersDTO' - tags: - - demo - /demo/random-key: - get: - tags: - - demo - description: Generates a new Hedera account with a random private key. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/HederaAccount' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /demo/push/random-key: - get: - tags: - - demo - description: Generates a new Hedera account with a random private key. - security: - - bearerAuth: [] - summary: Generates a new Hedera account with a random private key. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /external: - post: - tags: - - external - description: Sends data from an external source. - summary: Sends data from an external source. - requestBody: - description: Object that contains a VC Document. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalData' - responses: - '200': - description: Successful operation. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /ipfs/file: - post: - operationId: IpfsApi_postFile - summary: Add file from ipfs. - description: Add file from ipfs. - parameters: [] - responses: - '201': - description: '' - tags: - - ipfs - security: - - bearerAuth: [] - /ipfs/file/{cid}: - get: - tags: - - ipfs - description: Get file from ipfs. - summary: Get file from ipfs. - parameters: - - in: path - name: cid - schema: - type: string - required: true - description: File CID. - security: - - bearerAuth: [] - responses: - '201': - description: Created. - content: - binary/octet-stream: - schema: - type: string - format: binary - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /logs: - post: - tags: - - logs - description: Returns logs. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - description: Log filters. - content: - application/json: - schema: - $ref: '#/components/schemas/LogFilters' - summary: Returns logs. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - totalCount: - type: number - logs: - $ref: '#/components/schemas/Log' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /logs/attributes: - get: - tags: - - logs - description: Returns logs attributes. For users with the Standard Registry role only. - parameters: - - in: query - name: name - schema: - type: string - description: Part of name. - - in: query - name: existingAttributes - schema: - type: array - items: - type: string - description: Attributes to exclude. - security: - - bearerAuth: [] - summary: Returns logs attributes. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /map/key: - get: - tags: - - maps - description: Returns map api key. - security: - - bearerAuth: [] - summary: Returns map api key. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /map/sh: - get: - operationId: MapApi_getSentinelKey - parameters: [] - responses: - '200': - description: '' - tags: - - map - /metrics: - get: - operationId: MetricsApi_getMetrics - parameters: [] - responses: - '200': - description: '' - tags: - - metrics - /modules: - get: - tags: - - modules - description: >- - Returns all modules. Only users with the Standard Registry and Installer - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of all modules. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - modules - description: >- - Creates a new module. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new module. - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/schemas: - get: - operationId: ModulesApi_getModuleSchemas - parameters: [] - responses: - '200': - description: '' - tags: &ref_3 - - modules - post: - operationId: ModulesApi_postSchemas - parameters: [] - responses: - '201': - description: '' - tags: *ref_3 - /modules/{uuid}: - get: - tags: - - modules - description: >- - Retrieves module configuration for the specified module ID. Only users - with the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - summary: Retrieves module configuration. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - modules - description: >- - Updates module configuration for the specified module ID. Only users - with the Standard Registry role are allowed to make the request. - summary: Updates module configuration. - parameters: - - in: path - name: uuid - description: Selected module ID. - required: true - schema: - type: string - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - modules - description: >- - Deletes the module with the provided module ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Module ID. - security: - - bearerAuth: [] - summary: Deletes the module. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/menu: - get: - tags: - - modules - description: >- - Returns modules menu. Only users with the Standard Registry and - Installer role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of modules. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/export/file: - get: - tags: - - modules - description: >- - Returns a zip file containing the published module and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - security: - - bearerAuth: [] - summary: >- - Return module and its artifacts in a zip file format for the specified - module. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/export/message: - get: - tags: - - modules - description: >- - Returns the Hedera message ID for the specified module published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - security: - - bearerAuth: [] - summary: Return Heder message ID for the specified published module. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/message: - post: - tags: - - modules - description: >- - Imports new module and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: Imports new module from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the module. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/file: - post: - tags: - - modules - description: >- - Imports new module and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new module from a zip file. - requestBody: - description: >- - A zip file that contains the module and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/message/preview: - post: - tags: - - modules - description: >- - Previews the module from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - summary: Module preview from IPFS. - security: - - bearerAuth: [] - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the module. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/import/file/preview: - post: - tags: - - modules - description: >- - Previews the module from a zip file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - summary: Module preview from a zip file. - security: - - bearerAuth: [] - requestBody: - description: >- - A zip file that contains the module and associated schemas and VCs to - be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/{uuid}/publish: - put: - tags: - - modules - description: >- - Publishes the module with the specified (internal) module ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: uuid - schema: - type: string - required: true - description: Selected module ID. - summary: Publishes the module onto IPFS. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /modules/validate: - post: - tags: - - modules - description: >- - Validates selected module. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Validates module. - requestBody: - description: Object that contains module configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Module' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ValidateModule' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tools: - post: - operationId: ToolsApi_createNewTool - summary: Creates a new tool. - description: >- - Creates a new tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_4 - - tools - security: - - bearerAuth: [] - get: - operationId: ToolsApi_getTools - summary: Return a list of all tools. - description: >- - Returns all tools. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: pageSize - required: false - in: query - description: The numbers of items to return - schema: - type: number - - name: pageIndex - required: false - in: query - description: >- - The number of pages to skip before starting to collect the result - set - schema: - type: number - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push: - post: - operationId: ToolsApi_createNewToolAsync - summary: Creates a new tool. - description: >- - Creates a new tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}: - delete: - operationId: ToolsApi_deleteTool - summary: >- - Deletes the tool with the provided tool ID. Only users with the Standard - Registry role are allowed to make the request. - description: Deletes the tool. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - get: - operationId: ToolsApi_getToolById - summary: Retrieves tool configuration. - description: >- - Retrieves tool configuration for the specified tool ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - put: - operationId: ToolsApi_updateTool - summary: Updates tool configuration. - description: >- - Updates tool configuration for the specified tool ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/publish: - put: - operationId: ToolsApi_publishTool - summary: Publishes the tool onto IPFS. - description: >- - Publishes the tool with the specified (internal) tool ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/push/publish: - put: - operationId: ToolsApi_publishToolAsync - summary: Publishes the tool onto IPFS. - description: >- - Publishes the tool with the specified (internal) tool ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/validate: - post: - operationId: ToolsApi_validateTool - summary: Validates selected tool. - description: >- - Validates selected tool. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/export/file: - get: - operationId: ToolsApi_toolExportFile - summary: >- - Return tool and its artifacts in a zip file format for the specified - tool. - description: >- - Returns a zip file containing the published tool and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. Response zip file. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/{id}/export/message: - get: - operationId: ToolsApi_toolExportMessage - summary: Return Heder message ID for the specified published tool. - description: >- - Returns the Hedera message ID for the specified tool published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - name: id - required: true - in: path - description: Tool ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/message/preview: - post: - operationId: ToolsApi_toolImportMessagePreview - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/message: - post: - operationId: ToolsApi_toolImportMessage - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/file/preview: - post: - operationId: ToolsApi_toolImportFilePreview - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/import/file: - post: - operationId: ToolsApi_toolImportFile - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push/import/file: - post: - operationId: ToolsApi_toolImportFileAsync - summary: Imports new tool from a zip file. - description: >- - Imports new tool and all associated artifacts, such as schemas and VCs, - from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/push/import/message: - post: - operationId: ToolsApi_toolImportMessageAsync - summary: Imports new tool from IPFS. - description: >- - Imports new tool and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /tools/menu/all: - get: - operationId: ToolsApi_getMenu - summary: Return a list of tools. - description: >- - Returns tools menu. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_4 - security: - - bearerAuth: [] - /profiles/{username}: - get: - operationId: ProfileApi_getProfile - summary: Returns user account info. - description: >- - Returns user account information. For users with the Standard Registry - role it also returns address book and VC document information. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to fetch the information - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_5 - - profiles - security: - - bearerAuth: [] - - bearer: [] - put: - operationId: ProfileApi_setUserProfile - summary: Sets Hedera credentials for the user. - description: >- - Sets Hedera credentials for the user. For users with the Standard - Registry role it also creates an address book. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to update the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Created. - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/push/{username}: - put: - operationId: ProfileApi_setUserProfileAsync - summary: Sets Hedera credentials for the user. - description: >- - Sets Hedera credentials for the user. For users with the Standard - Registry role it also creates an address book. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to update the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/{username}/balance: - get: - operationId: ProfileApi_getUserBalance - summary: Returns user's Hedera account balance. - description: >- - Requests Hedera account balance. Only users with the Installer role are - allowed to make the request. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to fetch the balance. - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/restore/{username}: - put: - operationId: ProfileApi_restoreUserProfile - summary: Restore user data (policy, DID documents, VC documents). - description: Restore user data (policy, DID documents, VC documents). - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to restore the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/restore/topics/{username}: - put: - operationId: ProfileApi_restoreTopic - summary: List of available recovery topics. - description: List of available recovery topics. - parameters: - - name: username - required: true - in: path - description: The name of the user for whom to restore the information. - schema: - type: string - requestBody: - required: true - description: Object that contains the Hedera account data. - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialsDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/did-document/validate: - post: - operationId: ProfileApi_validateDidDocument - summary: Validate DID document format. - description: Validate DID document format. - parameters: [] - requestBody: - required: true - description: DID Document. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /profiles/did-keys/validate: - post: - operationId: ProfileApi_validateDidKeys - summary: Validate DID document keys. - description: Validate DID document keys. - parameters: [] - requestBody: - required: true - description: DID Document and keys. - content: - application/json: - schema: - $ref: '#/components/schemas/DidDocumentWithKeyDTO' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/DidKeyStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_5 - security: - - bearerAuth: [] - - bearer: [] - /policies: - get: - tags: - - policies - description: >- - Returns all policies. Only users with the Standard Registry and - Installer role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return a list of all policies. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/PolicyConfig' - - type: object - properties: - userRoles: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: >- - Creates a new policy. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/migrate-data: - post: - operationId: PolicyApi_migrateData - summary: Migrate policy data. - description: >- - Migrate policy data. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - description: Migration config. - content: - application/json: - schema: - $ref: '#/components/schemas/MigrationConfigDTO' - responses: - '200': - description: Errors while migration. - content: - application/json: - schema: - type: array - items: - type: object - properties: - error: - type: string - id: - type: string - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_6 - - policies - security: - - bearerAuth: [] - /policies/push/migrate-data: - post: - operationId: PolicyApi_migrateDataAsync - summary: Migrate policy data asynchronous. - description: >- - Migrate policy data asynchronous. Only users with the Standard Registry - role are allowed to make the request. - parameters: [] - requestBody: - required: true - description: Migration config. - content: - application/json: - schema: - $ref: '#/components/schemas/MigrationConfigDTO' - responses: - '202': - description: Created task. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - /policies/push: - post: - tags: - - policies - description: >- - Creates a new policy. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/{policyId}: - post: - operationId: PolicyApi_updatePolicyAsync - summary: '' - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - delete: - operationId: PolicyApi_deletePolicyAsync - parameters: [] - responses: - '202': - description: '' - tags: *ref_6 - security: - - bearerAuth: [] - /policies/{policyId}: - get: - tags: - - policies - description: >- - Retrieves policy configuration for the specified policy ID. Only users - with the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Retrieves policy configuration. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/PolicyConfig' - - type: object - properties: - userRoles: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - policies - description: >- - Updates policy configuration for the specified policy ID. Only users - with the Standard Registry role are allowed to make the request. - summary: Updates policy configuration. - parameters: - - in: path - name: policyId - description: Selected policy ID. - required: true - schema: - type: string - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/publish: - put: - tags: - - policies - description: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - policyVersion: - type: string - summary: Publishes the policy onto IPFS. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/{policyId}/publish: - put: - tags: - - policies - description: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. Only users with the Standard Registry role are allowed to make - the request. - security: - - bearerAuth: [] - summary: >- - Publishes the policy with the specified (internal) policy ID onto IPFS, - sends a message featuring its IPFS CID into the corresponding Hedera - topic. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - policyVersion: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run: - put: - tags: - - policies - description: >- - Run policy without making any persistent changes or executing - transaction. Only users with the Standard Registry role are allowed to - make the request. - security: - - bearerAuth: [] - summary: Dry Run policy. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/discontinue: - put: - operationId: PolicyApi_discontinuePolicy - summary: Discontunue policy. - description: >- - Discontunue policy. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy identifier. - schema: {} - requestBody: - required: true - description: Discontinue details. - content: - application/json: - schema: - type: object - properties: - date: - type: date - responses: - '200': - description: Policies. - content: - application/json: - schema: - type: array - items: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/draft: - put: - tags: - - policies - description: >- - Return policy to editing. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Return policy to editing. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PublishPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/validate: - post: - tags: - - policies - description: >- - Validates selected policy. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Validates policy. - requestBody: - description: Object that contains policy configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyConfig' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ValidatePolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/navigation: - get: - operationId: PolicyApi_getPolicyNavigation - summary: Returns a policy navigation. - description: Returns a policy navigation. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/groups: - get: - tags: - - policies - description: Returns a list of groups the user is a member of. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Returns a list of groups the user is a member of. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: string - uuid: - type: string - role: - type: string - groupLabel: - type: string - groupName: - type: string - active: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: >- - Makes the selected group active. if UUID is not set then returns the - user to the default state. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Makes the selected group active. - requestBody: - description: Selected group. - required: true - content: - application/json: - schema: - type: object - properties: - uuid: - type: string - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/documents: - get: - operationId: PolicyApi_getPolicyDocuments - summary: Get policy documents. - description: >- - Get policy documents. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: pageSize - required: true - in: query - description: Page size. - schema: - type: number - - name: pageIndex - required: true - in: query - description: Page index. - schema: - type: number - - name: type - required: true - in: query - description: Document type. - schema: - enum: - - VC - - VP - type: string - - name: includeDocument - required: true - in: query - description: Include document field. - schema: - type: boolean - - name: policyId - required: true - in: path - description: Policy identifier. - schema: {} - responses: - '200': - description: Documents. - headers: - X-Total-Count: - description: Total documents count. - content: - application/json: - schema: - type: array - items: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/blocks: - get: - tags: - - policies - description: >- - Returns data from the root policy block. Only users with the Standard - Registry and Installer role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - summary: Retrieves data for the policy root block. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlock' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/blocks/{uuid}: - get: - tags: - - policies - description: >- - Requests block data. Only users with a role that described in block are - allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: uuid - schema: - type: string - required: true - description: Selected block UUID. - summary: Requests block data. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - policies - description: Sends data to the specified block. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: uuid - schema: - type: string - required: true - description: Selected block UUID. - summary: Sends data to the specified block. - requestBody: - description: Object with the data to be sent to the block. - required: true - content: - application/json: - schema: - type: object - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tagName}/blocks: - post: - operationId: PolicyApi_setBlocksByTagName - summary: Sends data to the specified block. - description: Sends data to the specified block. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - get: - operationId: PolicyApi_getBlocksByTagName - summary: Requests block data. - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/tag/{tagName}: - get: - operationId: PolicyApi_getBlockByTagName - summary: Requests block data. - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearerAuth: [] - /policies/{policyId}/blocks/{uuid}/parents: - get: - operationId: PolicyApi_getBlockParents - parameters: [] - responses: - '200': - description: '' - tags: *ref_6 - /policies/{policyId}/export/file: - get: - tags: - - policies - description: >- - Returns a zip file containing the published policy and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - security: - - bearerAuth: [] - summary: >- - Return policy and its artifacts in a zip file format for the specified - policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/export/message: - get: - tags: - - policies - description: >- - Returns the Hedera message ID for the specified policy published onto - IPFS. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - security: - - bearerAuth: [] - summary: Return Heder message ID for the specified published policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/export/xlsx: - get: - operationId: PolicyApi_getPolicyExportXlsx - summary: >- - Return policy and its artifacts in a xlsx file format for the specified - policy. - description: >- - Returns a xlsx file containing the published policy and all associated - artifacts, i.e. schemas and VCs. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/import/message: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: query - name: versionOfTopicId - schema: - type: string - description: The topic ID of policy version. - examples: - pageIndex: - summary: Example of a topic ID of policy version. - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new policy from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the Policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/message: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: >- - Imports new policy and all associated artifacts from IPFS into the local - DB. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the Policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/message/preview: - post: - tags: - - policies - description: >- - Previews the policy from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - summary: Policy preview from IPFS. - security: - - bearerAuth: [] - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/message/preview: - post: - tags: - - policies - description: >- - Previews the policy from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Previews the policy from IPFS without loading it into the local DB. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the policy. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/file: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: query - name: versionOfTopicId - schema: - type: string - description: The topic ID of policy version. - examples: - pageIndex: - summary: Example of a topic ID of policy version. - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new policy from a zip file. - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/push/import/file: - post: - tags: - - policies - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided zip file into the local DB. - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/file/preview: - post: - tags: - - policies - description: >- - Previews the policy from a zip file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - summary: Policy preview from a zip file. - security: - - bearerAuth: [] - requestBody: - description: >- - A zip file that contains the policy and associated schemas and VCs to - be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PreviewPolicy' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/import/xlsx: - post: - operationId: PolicyApi_importPolicyFromXlsx - summary: Imports new policy from a xlsx file. - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided xlsx file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - name: policyId - required: true - in: query - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/push/import/xlsx: - post: - operationId: PolicyApi_importPolicyFromXlsxAsync - summary: Imports new policy from a xlsx file. - description: >- - Imports new policy and all associated artifacts, such as schemas and - VCs, from the provided xlsx file into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - name: policyId - required: true - in: query - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/import/xlsx/preview: - post: - operationId: PolicyApi_importPolicyFromXlsxPreview - summary: Policy preview from a xlsx file. - description: >- - Previews the policy from a xlsx file without loading it into the local - DB. Only users with the Standard Registry role are allowed to make the - request. - parameters: [] - requestBody: - required: true - description: A xlsx file containing policy config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - security: - - bearerAuth: [] - - bearer: [] - /policies/blocks/about: - get: - operationId: PolicyApi_getBlockAbout - parameters: [] - responses: - '200': - description: '' - tags: *ref_6 - /policies/{policyId}/dry-run/users: - get: - tags: - - policies - description: >- - Returns all virtual users. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns all virtual users. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/user: - post: - tags: - - policies - description: >- - Create a new virtual account. Only users with the Standard Registry role - are allowed to make the request. - security: - - bearerAuth: [] - summary: Create a new virtual account. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/login: - post: - tags: - - policies - description: >- - Logs virtual user into the system. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Logs virtual user into the system. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Virtual user - required: true - content: - application/json: - schema: - type: object - properties: - did: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - username: - type: string - did: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/restart: - post: - tags: - - policies - description: >- - Restarts the execution of the policy. Clear data in database. Only users - with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Restarts the execution of the policy. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/transactions: - get: - tags: - - policies - description: >- - Returns lists of virtual transactions. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual transactions. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - type: - type: string - hederaAccountId: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/artifacts: - get: - tags: - - policies - description: >- - Returns lists of virtual artifacts. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual artifacts. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - type: - type: string - owner: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/dry-run/ipfs: - get: - tags: - - policies - description: >- - Returns lists of virtual artifacts. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns lists of virtual artifacts. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - type: object - properties: - createDate: - type: string - documentURL: - type: string - document: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/multiple: - post: - tags: - - policies - description: >- - Creates a link between the current policy and the main policy. Or - creates a group making the current policy the main one. - security: - - bearerAuth: [] - summary: Creates Multi policy config. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - requestBody: - description: Multi policy config. - required: true - content: - application/json: - schema: - type: object - required: - - mainPolicyTopicId - - synchronizationTopicId - properties: - mainPolicyTopicId: - type: string - synchronizationTopicId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/MultiPolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - policies - description: Requests Multi policy config. - security: - - bearerAuth: [] - summary: Requests Multi policy config. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/MultiPolicyConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/methodologies/categories: - get: - operationId: PolicyApi_getPolicyCategoriesAsync - summary: Get all categories - description: Get all categories - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PolicyCategoryDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - /policies/methodologies/search: - post: - operationId: PolicyApi_getPoliciesByCategory - summary: Get filtered policies - description: Get policies by categories and text - parameters: [] - requestBody: - required: true - description: Filters - content: - application/json: - schema: - type: string - examples: - Filter1: - value: - categoryIds: - - '000000000000000000000001' - - '000000000000000000000002' - text: abc - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_6 - /schema/{schemaId}: - get: - tags: - - schema - description: Returns schema by schema ID. - security: - - bearerAuth: [] - summary: Returns schema by schema ID. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schema/{schemaId}/parents: - get: - operationId: SingleSchemaApi_getSchemaParents - summary: Returns all parent schemas. - description: Returns all parent schemas. - parameters: - - name: schemaId - required: true - in: path - description: Schema identifier - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_7 - - schema - security: - - bearerAuth: [] - /schema/{schemaId}/tree: - get: - operationId: SingleSchemaApi_getSchemaTree - summary: Returns schema tree. - description: Returns schema tree. - parameters: - - name: schemaId - required: true - in: path - description: Schema identifier - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - name: - type: string - type: - type: string - children: - type: array - items: - type: object - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_7 - security: - - bearerAuth: [] - /schemas: - get: - tags: - - schemas - description: Returns all schemas. - security: - - bearerAuth: [] - summary: Returns all schemas. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}: - post: - tags: - - schemas - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Create new schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - schemas - description: Returns all schemas by topicId. - security: - - bearerAuth: [] - summary: Returns all schemas by topicId. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/type/{schemaType}: - get: - operationId: SchemaApi_getSchemaByType - summary: Finds the schema using the json document type. - description: Finds the schema using the json document type. - parameters: - - name: schemaType - required: true - in: path - description: Type - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_8 - - schemas - security: - - bearerAuth: [] - /schemas/list/all: - get: - operationId: SchemaApi_getAll - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - /schemas/list/sub: - get: - operationId: SchemaApi_getSub - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: category - required: false - in: query - description: Schema category - schema: - type: string - - name: topicId - required: false - in: query - description: Topic Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SchemaDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - /schemas/push/copy: - post: - operationId: SchemaApi_copySchemaAsync - summary: Copy schema. - description: >- - Copy schema. Only users with the Standard Registry role are allowed to - make the request. - parameters: [] - requestBody: - required: true - description: Object that contains a valid schema. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearer: [] - - bearerAuth: [] - /schemas/push/{topicId}: - post: - tags: - - schemas - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Create new schema. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}: - put: - tags: - - schemas - description: >- - Updates the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - schemas - description: >- - Deletes the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Deletes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/publish: - put: - tags: - - schemas - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{schemaId}/publish: - put: - tags: - - schemas - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - security: - - bearerAuth: [] - summary: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/import/message/preview: - post: - tags: - - schemas - description: >- - Previews the schema from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/import/message/preview: - post: - tags: - - schemas - description: >- - Previews the schema from IPFS without loading it into the local DB. Only - users with the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/import/file/preview: - post: - tags: - - schemas - description: >- - Previews the schema from a zip file. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Schema preview from a zip file. - requestBody: - description: A zip file containing the schema to be viewed. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}/import/message: - post: - tags: - - schemas - description: >- - Imports new schema from IPFS into the local DB. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new schema from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{topicId}/import/message: - post: - tags: - - schemas - description: >- - Imports new schema from IPFS into the local DB. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new schema from IPFS. - requestBody: - description: >- - Object that contains the identifier of the Hedera message which - contains the IPFS CID of the schema. - required: true - content: - application/json: - schema: - type: object - properties: - messageId: - type: string - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{topicId}/import/file: - post: - tags: - - schemas - description: >- - Imports new schema from a zip file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - security: - - bearerAuth: [] - summary: Imports new schema from a zip file. - requestBody: - description: A zip file containing schema to be imported. - content: - binary/octet-stream: - schema: - type: string - format: binary - required: true - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/push/{topicId}/import/file: - post: - tags: - - schemas - description: >- - Imports new schema from a zip file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Imports new schema from a zip file. - requestBody: - description: A zip file containing schema to be imported. - content: - binary/octet-stream: - schema: - type: string - format: binary - required: true - parameters: - - in: path - name: topicId - schema: - type: string - required: true - description: Topic ID. - examples: - topicId: - summary: Example of a Topic ID - value: 0.0.00000001 - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/message: - post: - tags: - - schemas - description: >- - Returns Hedera message IDs of the published schemas, these messages - contain IPFS CIDs of these schema files. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: List Hedera message IDs of published schemas. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Selected schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ExportSchema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/file: - post: - tags: - - schemas - description: >- - Returns schema files for the schemas. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Return zip file with schemas. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Selected schema ID. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{username}: - post: - tags: - - schemas - description: >- - Creates new system schema. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Creates new system schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - schemas - description: >- - Returns all system schemas by username. Only users with the Standard - Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Returns all system schemas by username. - parameters: - - in: path - name: username - schema: - type: string - required: true - description: Username. - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set. - examples: - pageIndex: - summary: Example of a pageIndex. - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The number of items to return. - examples: - pageSize: - summary: Example of a pageSize. - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total number of items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{schemaId}: - put: - tags: - - schemas - description: >- - Updates the system schema with the provided schema ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - schemas - description: >- - Deletes the system schema with the provided schema ID. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Deletes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/{schemaId}/active: - put: - tags: - - schemas - description: >- - Makes the selected scheme active. Other schemes of the same type become - inactive. Only users with the Standard Registry role are allowed to make - the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - requestBody: - description: Object that contains policy version. - required: true - content: - application/json: - schema: - type: object - properties: - version: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/system/entity/{schemaEntity}: - get: - tags: - - schemas - description: Finds the schema using the schema type. - parameters: - - in: path - name: schemaEntity - schema: - type: string - enum: - - STANDARD_REGISTRY - - USER - - POLICY - - MINT_TOKEN - - WIPE_TOKEN - - MINT_NFTOKEN - required: true - description: schema type. - security: - - bearerAuth: [] - summary: Returns schema by schema type. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /schemas/{schemaId}/export/xlsx: - get: - operationId: SchemaApi_getPolicyExportXlsx - summary: Return schemas in a xlsx file format for the specified policy. - description: >- - Returns a xlsx file containing schemas. Only users with the Standard - Registry role are allowed to make the request. - parameters: - - name: schemaId - required: true - in: path - description: Schema ID - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/{topicId}/import/xlsx: - post: - operationId: SchemaApi_importPolicyFromXlsx - summary: Imports new schema from a xlsx file into the local DB. - description: >- - Imports new schema from a xlsx file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: topicId - required: true - in: path - description: Topic Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/push/{topicId}/import/xlsx: - post: - operationId: SchemaApi_importPolicyFromXlsxAsync - summary: Imports new schema from a xlsx file into the local DB. - description: >- - Imports new schema from a xlsx file into the local DB. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - name: topicId - required: true - in: path - description: Topic Id - schema: - type: string - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/import/xlsx/preview: - post: - operationId: SchemaApi_importPolicyFromXlsxPreview - summary: Previews the schema from a xlsx file. - description: >- - Previews the schema from a xlsx file. Only users with the Standard - Registry role are allowed to make the request. - parameters: [] - requestBody: - required: true - description: A xlsx file containing schema config. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /schemas/export/template: - get: - operationId: SchemaApi_exportTemplate - summary: Returns a list of schemas. - description: >- - Returns a list of schemas. Only users with the Standard Registry role - are allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_8 - security: - - bearerAuth: [] - - bearer: [] - /settings: - get: - tags: - - settings - description: >- - Returns current settings. For users with the Standard Registry role - only. - security: - - bearerAuth: [] - summary: Returns current settings. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CommonSettings' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - settings - description: Set settings. For users with the Standard Registry role only. - security: - - bearerAuth: [] - summary: Set settings. - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/CommonSettings' - /settings/environment: - get: - tags: - - settings - description: Returns current environment name. - security: - - bearerAuth: [] - summary: Returns current environment name. - responses: - '200': - description: Successful operation. - content: - text/plain: - schema: - type: string - example: testnet - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /settings/about: - get: - operationId: SettingsApi_getAbout - parameters: [] - responses: - '200': - description: '' - tags: - - settings - /tags: - post: - operationId: TagsApi_setTags - parameters: [] - responses: - '201': - description: '' - tags: - - tags - /tags/search: - post: - tags: - - tags - description: Search tags. - security: - - bearerAuth: [] - requestBody: - description: Object that contains filters. - required: true - content: - application/json: - schema: - oneOf: - - type: object - required: - - entity - - target - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - target: - type: string - - type: object - required: - - entity - - targets - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - targets: - type: array - items: - type: string - examples: - Single: - value: - entity: PolicyDocument - target: targetId1 - Multiple: - value: - entity: PolicyDocument - targets: - - targetId1 - - targetId2 - summary: Search tags. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - description: a (targetId, Tags) map. `targetId1` is an example key - properties: - targetId1: - $ref: '#/components/schemas/TagMap' - additionalProperties: - $ref: '#/components/schemas/TagMap' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/{uuid}: - delete: - tags: - - tags - description: Delete tag. - security: - - bearerAuth: [] - summary: Delete tag. - parameters: - - in: path - name: uuid - schema: - type: string - example: 00000000-0000-0000-0000-000000000000 - required: true - description: Tag identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/synchronization: - post: - tags: - - tags - description: synchronization. - security: - - bearerAuth: [] - requestBody: - description: Object that contains filters. - required: true - content: - application/json: - schema: - type: object - required: - - entity - - target - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: targetId - summary: synchronization. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TagMap' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas: - get: - tags: - - tags - description: Returns all schema. - security: - - bearerAuth: [] - summary: Returns all schemas. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - tags - description: >- - Creates new schema. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates new schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/{schemaId}: - delete: - tags: - - tags - description: >- - Deletes the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Delete the schema. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: - tags: - - tags - description: >- - Updates the schema with the provided schema ID. Only users with the - Standard Registry role are allowed to make the request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Updates the schema. - requestBody: - description: Object that contains a valid schema. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/{schemaId}/publish: - put: - tags: - - tags - description: >- - Publishes the schema with the provided (internal) schema ID onto IPFS, - sends a message featuring IPFS CID into the corresponding Hedera topic. - Only users with the Standard Registry role are allowed to make the - request. - parameters: - - in: path - name: schemaId - schema: - type: string - required: true - description: Schema ID. - security: - - bearerAuth: [] - summary: Publishes the schema. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/schemas/published: - get: - tags: - - tags - description: Return a list of all published schemas. - security: - - bearerAuth: [] - summary: Return a list of all published schemas. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tasks/{taskId}: - get: - tags: - - tasks - description: Returns task statuses by Id. - security: - - bearerAuth: [] - summary: Returns task statuses. - parameters: - - in: path - name: taskId - schema: - type: string - required: true - description: Task ID. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskStatus' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens: - get: - tags: - - tokens - description: >- - Returns all tokens. For the Standard Registry role it returns only the - list of tokens, for other users it also returns token balances as well - as the KYC, Freeze, and Association statuses. Not allowed for the - Auditor role. - security: - - bearerAuth: [] - summary: Return a list of tokens. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/TokenInfo' - - type: object - properties: - policies: - type: array - items: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - tokens - description: >- - Creates a new token. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new token. - requestBody: - description: Object that contains token information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Token' - responses: - '201': - description: Created. - content: - application/json: - schema: - type: array - items: - allOf: - - $ref: '#/components/schemas/TokenInfo' - - type: object - properties: - policies: - type: array - items: - type: string - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push: - post: - tags: - - tokens - description: >- - Creates a new token. Only users with the Standard Registry role are - allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new token. - requestBody: - description: Object that contains token information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Token' - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}: - delete: - operationId: TokensApi_deleteTokenAsync - parameters: [] - responses: - '202': - description: '' - tags: &ref_9 - - tokens - /tokens/{tokenId}/associate: - put: - tags: - - tokens - description: >- - Associates the user with the provided Hedera token. Only users with the - Installer role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - security: - - bearerAuth: [] - summary: Associates the user with the provided Hedera token. - responses: - '200': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/associate: - put: - tags: - - tokens - description: >- - Associates the user with the provided Hedera token. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Associates the user with the provided Hedera token. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/dissociate: - put: - tags: - - tokens - description: >- - Disassociates the user with the provided Hedera token. Only users with - the Installer role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - security: - - bearerAuth: [] - summary: Associate the user with the provided Hedera token. - responses: - '202': - description: Successful operation. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/dissociate: - put: - tags: - - tokens - description: >- - Disassociates the user with the provided Hedera token. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Disassociates the user with the provided Hedera token. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/grant-kyc: - put: - tags: - - tokens - description: >- - Sets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Sets the KYC flag for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/grant-kyc: - put: - tags: - - tokens - description: >- - Sets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Sets the KYC flag for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/revoke-kyc: - put: - tags: - - tokens - description: >- - Unsets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Unsets the KYC flag for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/revoke-kyc: - put: - tags: - - tokens - description: >- - Unsets the KYC flag for the user. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Unsets the KYC flag for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/freeze: - put: - tags: - - tokens - description: >- - Freezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Freeze transfers of the specified token for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/unfreeze: - put: - tags: - - tokens - description: >- - Unfreezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - security: - - bearerAuth: [] - summary: Unfreezes transfers of the specified token for the user. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/freeze: - put: - tags: - - tokens - description: >- - Freezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Freeze transfers of the specified token for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/push/{tokenId}/{username}/unfreeze: - put: - tags: - - tokens - description: >- - Unfreezes transfers of the specified token for the user. Only users with - the Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - summary: Unfreezes transfers of the specified token for the user. - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '202': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/{username}/info: - get: - tags: - - tokens - description: >- - Returns user information for the selected token. Only users with the - Standard Registry role are allowed to make the request. - security: - - bearerAuth: [] - parameters: - - in: path - name: tokenId - schema: - type: string - required: true - description: Token ID. - - in: path - name: username - schema: - type: string - required: true - description: Username. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TokenInfo' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tokens/{tokenId}/serials: - get: - operationId: TokensApi_getTokenSerials - summary: Return token serials. - description: Returns token serials of current user. - parameters: - - name: tokenId - required: true - in: path - description: Token identifier - example: 0.0.1 - schema: - type: string - responses: - '200': - description: Token serials. - content: - application/json: - schema: - type: array - items: - type: number - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_9 - security: - - bearer: [] - /themes: - get: - tags: - - themes - description: Returns all themes. - security: - - bearerAuth: [] - summary: Return a list of all themes. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - tags: - - themes - description: Creates a new theme. - security: - - bearerAuth: [] - summary: Creates a new theme. - requestBody: - description: Object that contains theme configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - responses: - '201': - description: Created. - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/{themeId}: - put: - tags: - - themes - description: Updates theme configuration for the specified theme ID. - summary: Updates theme configuration. - parameters: - - in: path - name: themeId - description: Selected theme ID. - required: true - schema: - type: string - requestBody: - description: Object that contains theme configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - themes - description: Deletes the theme with the provided theme ID. - parameters: - - in: path - name: themeId - schema: - type: string - required: true - description: Theme ID. - security: - - bearerAuth: [] - summary: Deletes the theme. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/import/file: - post: - tags: - - themes - description: Imports new theme from the provided zip file into the local DB. - security: - - bearerAuth: [] - summary: Imports new theme from a zip file. - requestBody: - description: A zip file that contains the theme to be imported. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Theme' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /themes/{themeId}/export/file: - get: - tags: - - themes - description: Returns a zip file containing the theme. - parameters: - - in: path - name: themeId - schema: - type: string - required: true - description: Selected theme ID. - security: - - bearerAuth: [] - summary: Returns a zip file containing the theme. - responses: - '200': - description: Successful operation. Response zip file - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /trust-chains: - get: - tags: - - trustchains - description: >- - Requests all VP documents. Only users with the Auditor role are allowed - to make the request. - security: - - bearerAuth: [] - summary: Returns a list of all VP documents. - parameters: - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - - in: query - name: policyId - schema: - type: string - description: Selected policy ID. - - in: query - name: policyOwner - schema: - type: string - description: Selected Standard Registry (DID). - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/VerifiablePresentation' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /trust-chains/{hash}: - get: - tags: - - trustchains - description: >- - Builds and returns a trustchain, from the VP to the root VC document. - Only users with the Auditor role are allowed to make the request. - parameters: - - in: path - name: hash - schema: - type: string - required: true - description: Hash or ID of a VP document. - security: - - bearerAuth: [] - summary: Returns a trustchain for a VP document. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/TrustChains' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /wizard/policy: - post: - tags: - - wizard - description: >- - Creates a new policy by wizard. Only users with the Standard Registry - role are allowed to make the request. - security: - - bearerAuth: [] - summary: Creates a new policy. - requestBody: - description: Object that contains wizard configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WizardConfig' - responses: - '201': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - policyId: - type: string - wizardConfig: - $ref: '#/components/schemas/WizardConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /wizard/push/policy: - post: - operationId: WizardApi_setPolicyAsync - summary: Creates a new policy. - description: >- - Creates a new policy by wizard. Only users with the Standard Registry - role are allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - saveState: - type: boolean - wizardConfig: - type: object - required: - - policy - - roles - - schemas - - trustChain - properties: - roles: - type: array - items: - type: string - policy: - type: object - properties: - name: - type: string - description: - type: string - topicDescription: - type: string - policyTag: - type: string - schemas: - type: array - items: - type: object - properties: - name: - type: string - iri: - type: string - isApproveEnable: - type: boolean - isMintSchema: - type: boolean - mintOptions: - type: object - properties: - tokenId: - type: string - rule: - type: string - dependencySchemaIri: - type: string - relationshipsSchemaIri: - type: string - initialRolesFor: - type: array - items: - type: string - rolesConfig: - type: array - items: - type: object - properties: - role: - type: string - isApprover: - type: boolean - isCreator: - type: boolean - gridColumns: - type: array - items: - type: object - properties: - field: - type: string - title: - type: string - trustChain: - type: array - items: - type: object - properties: - role: - type: string - mintSchemaIri: - type: string - viewOnlyOwnDocuments: - type: boolean - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: - - wizard - /wizard/{policyId}/config: - post: - tags: - - wizard - description: >- - Get policy config by wizard. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier. - security: - - bearerAuth: [] - summary: Get policy config. - requestBody: - description: Object that contains wizard configuration. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WizardConfig' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - policyConfig: - $ref: '#/components/schemas/PolicyConfig' - wizardConfig: - $ref: '#/components/schemas/WizardConfig' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /branding: - post: - operationId: BrandingApi_setBranding - parameters: [] - responses: - '401': - description: Unauthorized - tags: &ref_10 - - branding - security: - - bearer: [] - get: - operationId: BrandingApi_getBranding - parameters: [] - responses: - '200': - description: '' - tags: *ref_10 - /suggestions: - post: - operationId: SuggestionsApi_policySuggestions - summary: Get next and nested suggested block types - description: >- - Get next and nested suggested block types. Only users with the Standard - Registry role are allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsInputDTO' - responses: - '200': - description: >- - Successful operation. Suggested next and nested block types - respectively. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsOutputDTO' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_11 - - suggestions - security: - - bearer: [] - - bearerAuth: [] - /suggestions/config: - post: - operationId: SuggestionsApi_setPolicySuggestionsConfig - summary: Set suggestions config - description: >- - Set suggestions config. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - responses: - '201': - description: Successful operation. Response setted suggestions config. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_11 - security: - - bearer: [] - - bearerAuth: [] - get: - operationId: SuggestionsApi_getPolicySuggestionsConfig - summary: Get suggestions config - description: >- - Get suggestions config. Only users with the Standard Registry role are - allowed to make the request. - parameters: [] - responses: - '200': - description: Successful operation. Response suggestions config. - content: - application/json: - schema: - $ref: '#/components/schemas/SuggestionsConfigDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_11 - security: - - bearer: [] - - bearerAuth: [] - /notifications: - get: - operationId: NotificationsApi_getAllNotifications - summary: Get all notifications - description: Returns all notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns notifications and count. - headers: - X-Total-Count: - description: Count of notifications - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_12 - - notifications - security: - - bearer: [] - - bearerAuth: [] - /notifications/new: - get: - operationId: NotificationsApi_getNewNotifications - summary: Get new notifications - description: Returns new notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns new notifications. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/progresses: - get: - operationId: NotificationsApi_getProgresses - summary: Get progresses - description: Returns progresses. - parameters: [] - responses: - '200': - description: Successful operation. Returns progresses. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ProgressDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/read/all: - post: - operationId: NotificationsApi_readAll - summary: Read all notifications - description: Returns new notifications. - parameters: [] - responses: - '200': - description: Successful operation. Returns notifications. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NotificationDTO' - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /notifications/delete/{notificationId}: - delete: - operationId: NotificationsApi_delete - summary: Delete notifications up to this point - description: Returns deleted notifications count. - parameters: - - name: notificationId - required: true - in: path - schema: - type: string - responses: - '200': - description: Successful operation. Returns deleted notifications count. - content: - application/json: - schema: - type: number - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_12 - security: - - bearer: [] - - bearerAuth: [] - /projects/search: - post: - operationId: ProjectsAPI_projectSearch - summary: Search projects - description: Search projects by filters - parameters: [] - requestBody: - required: true - description: The question of choosing a methodology - content: - application/json: - schema: - type: string - examples: - q: - value: >- - What methodology can I use for production of electricity using - renewable energy technologies? - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ProjectDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_13 - - projects - /projects/compare/documents: - post: - operationId: ProjectsAPI_compareDocuments - summary: Compare documents. - description: Compare documents. - parameters: [] - requestBody: - required: true - description: Filters. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterDocumentsDTO' - examples: - Filter1: - value: - documentId1: '000000000000000000000001' - documentId2: '000000000000000000000002' - Filter2: - value: - documentIds: - - '000000000000000000000001' - - '000000000000000000000002' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/CompareDocumentsDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_13 - /projects/properties: - get: - operationId: ProjectsAPI_getPolicyProperties - summary: Get all properties - description: Get all properties - parameters: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PropertiesDTO' - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_13 - /record/{policyId}/status: - get: - operationId: RecordApi_getRecordStatus - summary: Get recording or running status. - description: >- - Get recording or running status. Only users with the Standard Registry - role are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RecordStatusDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_14 - - record - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/start: - post: - operationId: RecordApi_startRecord - summary: Start recording. - description: >- - Start recording. Only users with the Standard Registry role are allowed - to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/stop: - post: - operationId: RecordApi_stopRecord - summary: Stop recording. - description: >- - Stop recording. Only users with the Standard Registry role are allowed - to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: string - format: binary - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/recording/actions: - get: - operationId: RecordApi_getRecordActions - summary: Get recorded actions. - description: >- - Get recorded actions. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RecordActionDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/start: - post: - operationId: RecordApi_runRecord - summary: Run record from a zip file. - description: >- - Run record from a zip file. Only users with the Standard Registry role - are allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: A zip file containing record to be run. - content: - application/json: - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/stop: - post: - operationId: RecordApi_stopRunning - summary: Stop running. - description: >- - Stop running. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/results: - get: - operationId: RecordApi_getRecordResults - summary: Get running results. - description: >- - Get running results. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RunningResultDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/details: - get: - operationId: RecordApi_getRecordDetails - summary: Get running details. - description: >- - Get running details. Only users with the Standard Registry role are - allowed to make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/RunningDetailsDTO' - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/fast-forward: - post: - operationId: RecordApi_fastForward - summary: Fast Forward. - description: >- - Fast Forward. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/retry: - post: - operationId: RecordApi_retryStep - summary: Retry step. - description: >- - Retry step. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /record/{policyId}/running/skip: - post: - operationId: RecordApi_skipStep - summary: Skip step. - description: >- - Skip step. Only users with the Standard Registry role are allowed to - make the request. - parameters: - - name: policyId - required: true - in: path - description: Policy Id - schema: - type: string - requestBody: - required: true - description: Object that contains options - content: - application/json: - schema: - $ref: '#/components/schemas/Object' - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: *ref_14 - security: - - bearerAuth: [] - - bearer: [] - /ai-suggestions/ask: - get: - operationId: AISuggestionsAPI_getAIAnswer - summary: Get methodology suggestion - description: Returns AI response to the current question - parameters: - - name: q - required: true - in: path - description: The question of choosing a methodology - schema: - type: string - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' - tags: &ref_15 - - ai-suggestions - /ai-suggestions/rebuild-vector: - put: - operationId: AISuggestionsAPI_rebuildVector - summary: Rebuild AI vector - description: Rebuilds vector based on policy data in the DB - parameters: [] - responses: - '200': - description: '' - tags: *ref_15 - /schemas/type/{type}: - get: - tags: - - schemas - description: Finds the schema using the json document type. - parameters: - - in: path - name: type - schema: - type: string - required: true - description: JSON type. - security: - - bearerAuth: [] - summary: Returns schema by type. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tag}: - get: - tags: - - policies - description: >- - Requests block ID from a policy by tag. Only users with the Standard - Registry and Installer roles are allowed to make the request. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Selected policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - summary: Requests block ID from a policy by tag. - security: - - bearerAuth: [] - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: object - properties: - id: - type: string - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /policies/{policyId}/tag/{tag}/blocks: - post: - tags: - - policies - description: Sends data to the specified block. - security: - - bearerAuth: [] - summary: Sends data to the specified block. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - requestBody: - description: Object with the data to be sent to the block. - required: true - content: - application/json: - schema: - type: object - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - get: - tags: - - policies - description: >- - Requests block data by tag. Only users with a role that described in - block are allowed to make the request. - security: - - bearerAuth: [] - summary: Requests block data. - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy ID. - - in: path - name: tag - schema: - type: string - required: true - description: Tag from the selected policy. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyBlockData' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /ipfs/file/: - post: - tags: - - ipfs - description: Add file to ipfs. - summary: Add file to ipfs. - requestBody: - description: Data array of file. - required: true - content: - binary/octet-stream: - schema: - type: string - format: binary - security: - - bearerAuth: [] - responses: - '201': - description: Created. - content: - application/json: - schema: - description: CID of added file. - type: string - '401': - description: Unauthorized. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifacts/{policyId}: - post: - tags: - - artifacts - description: Upload artifact. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - artifacts: - type: array - items: - type: string - format: binary - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier - summary: Upload Artifact. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact: - get: - deprecated: true - tags: - - artifacts - description: Returns all artifacts. - security: - - bearerAuth: [] - summary: Returns all artifacts. - parameters: - - in: query - name: policyId - schema: - type: string - description: Policy identifier - - in: query - name: pageIndex - schema: - type: integer - description: >- - The number of pages to skip before starting to collect the result - set - examples: - pageIndex: - summary: Example of a pageIndex - value: 0 - - in: query - name: pageSize - schema: - type: integer - description: The numbers of items to return - examples: - pageSize: - summary: Example of a pageSize - value: 100 - responses: - '200': - description: Successful operation. - headers: - x-total-count: - schema: - type: integer - description: Total items in the collection. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact/{policyId}: - post: - deprecated: true - tags: - - artifacts - description: Upload artifact. For users with the Standard Registry role only. - security: - - bearerAuth: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - artifacts: - type: array - items: - type: string - format: binary - parameters: - - in: path - name: policyId - schema: - type: string - required: true - description: Policy identifier - summary: Upload Artifact. - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Artifact' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /artifact/{artifactId}: - delete: - deprecated: true - tags: - - artifacts - description: Delete artifact. - security: - - bearerAuth: [] - summary: Delete artifact. - parameters: - - in: path - name: artifactId - schema: - type: string - required: true - description: Artifact identifier - responses: - '200': - description: Successful operation. - content: - application/json: - schema: - type: boolean - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /tags/: - post: - tags: - - tags - description: Creates new tag. - security: - - bearerAuth: [] - summary: Creates new tag. - requestBody: - description: Object that contains tag information. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Tag' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/Tag' - '400': - description: Bad Request. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized. - '403': - description: Forbidden. - '500': - description: Internal server error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' -info: - title: Guardian - description: >- - The Guardian is a modular open-source solution that includes best-in-class - identity management and decentralized ledger technology (DLT) libraries. At - the heart of the Guardian solution is a sophisticated Policy Workflow Engine - (PWE) that enables applications to offer a requirements-based tokenization - implementation. - version: 2.21.1 - contact: - name: API developer - url: https://envisionblockchain.com - email: info@envisionblockchain.com - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html -tags: [] -servers: - - url: /api/v1 - description: version 1.0 -components: - securitySchemes: - bearerAuth: - type: http - scheme: bearer - bearerFormat: JWT - schemas: - AccountsResponseDTO: - type: object - properties: - username: - type: string - role: - type: string - did: - type: string - required: - - username - - role - - did - InternalServerErrorDTO: - type: object - properties: - code: - type: number - message: - type: string - required: - - code - - message - RegisterUserDTO: - type: object - properties: - username: - type: string - password: - type: string - password_confirmation: - type: string - role: - type: string - required: - - username - - password - - password_confirmation - - role - AccountsSessionResponseDTO: - type: object - properties: - username: - type: string - role: - type: string - accessToken: - type: string - required: - - username - - role - - accessToken - LoginUserDTO: - type: object - properties: - username: - type: string - password: - type: string - required: - - username - - password - CredentialSubjectDTO: - type: object - properties: - geography: - type: string - law: - type: string - tags: - type: string - ISIC: - type: string - '@context': - type: array - items: - type: string - id: - type: string - type: - type: string - required: - - geography - - law - - tags - - ISIC - - '@context' - - id - - type - ProofDTO: - type: object - properties: - type: - type: string - created: - format: date-time - type: string - verificationMethod: - type: string - proofPurpose: - type: string - jws: - type: string - required: - - type - - created - - verificationMethod - - proofPurpose - - jws - VcDocumentDTO: - type: object - properties: - id: - type: string - type: - type: array - items: - type: string - issuer: - type: string - issuanceDate: - format: date-time - type: string - '@context': - type: array - items: - type: string - credentialSubject: - $ref: '#/components/schemas/CredentialSubjectDTO' - proof: - $ref: '#/components/schemas/ProofDTO' - required: - - id - - type - - issuer - - issuanceDate - - '@context' - - credentialSubject - - proof - PolicyDTO: - type: object - properties: - _id: - type: string - createDate: - format: date-time - type: string - uuid: - type: string - name: - type: string - description: - type: string - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - policyTag: - type: string - codeVersion: - type: string - userRoles: - type: array - items: - type: string - userGroups: - type: array - items: - type: string - userRole: - type: string - userGroup: - type: string - id: - type: string - required: - - _id - - createDate - - uuid - - name - - description - - status - - creator - - owner - - topicId - - policyTag - - codeVersion - - userRoles - - userGroups - - userRole - - userGroup - - id - AggregatedDTOItem: - type: object - properties: - did: - type: string - hederaAccountId: - type: string - vcDocument: - $ref: '#/components/schemas/VcDocumentDTO' - policies: - $ref: '#/components/schemas/PolicyDTO' - required: - - did - - hederaAccountId - - vcDocument - - policies - UserDTO: - type: object - properties: - username: - type: string - did: - type: string - required: - - username - - did - BalanceResponseDTO: - type: object - properties: - balance: - type: number - unit: - type: string - user: - $ref: '#/components/schemas/UserDTO' - required: - - balance - - unit - - user - FilterSearchPoliciesDTO: - type: object - properties: - policyId: - type: string - required: - - policyId - SearchPoliciesDTO: - type: object - properties: - target: - type: object - result: - type: object - required: - - target - - result - FilterPoliciesDTO: - type: object - properties: - policyId1: - type: string - policyId2: - type: string - policyIds: - type: string - eventsLvl: - type: number - propLvl: - type: number - childrenLvl: - type: number - idLvl: - type: number - required: - - policyId1 - - policyId2 - - policyIds - - eventsLvl - - propLvl - - childrenLvl - - idLvl - ComparePoliciesDTO: - type: object - properties: - blocks: - type: object - groups: - type: object - left: - type: object - right: - type: object - roles: - type: object - tokens: - type: object - topics: - type: object - total: - type: object - required: - - blocks - - groups - - left - - right - - roles - - tokens - - topics - - total - FilterModulesDTO: - type: object - properties: - moduleId1: - type: string - moduleId2: - type: string - eventsLvl: - type: number - propLvl: - type: number - childrenLvl: - type: number - idLvl: - type: number - required: - - moduleId1 - - moduleId2 - - eventsLvl - - propLvl - - childrenLvl - - idLvl - CompareModulesDTO: - type: object - properties: - blocks: - type: object - left: - type: object - right: - type: object - inputEvents: - type: object - outputEvents: - type: object - variables: - type: object - total: - type: object - required: - - blocks - - left - - right - - inputEvents - - outputEvents - - variables - - total - FilterSchemasDTO: - type: object - properties: - schemaId1: - type: string - schemaId2: - type: string - idLvl: - type: number - required: - - schemaId1 - - schemaId2 - - idLvl - CompareSchemasDTO: - type: object - properties: - fields: - type: object - left: - type: object - right: - type: object - total: - type: object - required: - - fields - - left - - right - - total - FilterDocumentsDTO: - type: object - properties: - documentId1: - type: string - documentId2: - type: string - documentIds: - type: string - required: - - documentId1 - - documentId2 - - documentIds - CompareDocumentsDTO: - type: object - properties: - documents: - type: object - left: - type: object - right: - type: object - total: - type: object - required: - - documents - - left - - right - - total - FilterToolsDTO: - type: object - properties: - toolId1: - type: string - toolId2: - type: string - toolIds: - type: string - required: - - toolId1 - - toolId2 - - toolIds - CompareToolsDTO: - type: object - properties: - blocks: - type: object - left: - type: object - right: - type: object - inputEvents: - type: object - outputEvents: - type: object - variables: - type: object - total: - type: object - required: - - blocks - - left - - right - - inputEvents - - outputEvents - - variables - - total - ArtifactDTOItem: - type: object - properties: - id: - type: string - name: - type: string - uuid: - type: string - extention: - type: string - type: - type: string - required: - - id - - name - - uuid - - extention - - type - ContractDTO: - type: object - properties: - id: - type: string - contractId: - type: string - description: - type: string - owner: - type: string - permissions: - type: number - topicId: - type: string - type: - type: string - enum: - - WIPE - - RETIRE - syncRequestsDate: - format: date-time - type: string - syncPoolsDate: - format: date-time - type: string - lastSyncEventTimeStamp: - type: string - wipeContractIds: - type: array - items: - type: string - required: - - id - - contractId - - description - - owner - - permissions - - topicId - - type - - syncRequestsDate - - syncPoolsDate - - lastSyncEventTimeStamp - - wipeContractIds - WiperRequestDTO: - type: object - properties: - id: - type: string - contractId: - type: string - user: - type: string - required: - - id - - contractId - - user - RetireRequestDTO: - type: object - properties: - id: - type: string - contractId: - type: string - tokens: - type: object - properties: - token: - type: string - count: - type: number - serials: - type: array - items: - type: number - decimals: - type: number - type: - enum: - - non-fungible - - fungible - tokenSymbol: - type: string - tokenIds: - type: array - items: - type: string - user: - type: string - required: - - id - - contractId - - tokens - - tokenIds - - user - Date: - type: object - properties: {} - RetirePoolDTO: - type: object - properties: - id: - type: string - contractId: - type: string - tokens: - type: object - properties: - token: - type: string - contract: - type: string - count: - type: number - decimals: - type: number - type: - enum: - - non-fungible - - fungible - tokenSymbol: - type: string - tokenIds: - type: array - items: - type: string - immediately: - type: boolean - enabled: - type: boolean - required: - - id - - contractId - - tokens - - tokenIds - - immediately - - enabled - RetirePoolTokenDTO: - type: object - properties: - token: - type: string - count: - type: number - required: - - token - - count - RetireRequestTokenDTO: - type: object - properties: - token: - type: string - count: - type: number - serials: - type: array - items: - type: string - required: - - token - - count - - serials - ProfileDTO: - type: object - properties: - username: - type: string - nullable: false - role: - type: string - nullable: false - did: - type: string - nullable: true - parent: - type: string - nullable: true - hederaAccountId: - type: string - nullable: true - confirmed: - type: boolean - nullable: true - failed: - type: boolean - nullable: true - topicId: - type: string - nullable: true - parentTopicId: - type: string - nullable: true - didDocument: - type: object - nullable: true - vcDocument: - type: object - nullable: true - required: - - username - - role - SubjectDTO: - type: object - properties: - '@context': - nullable: true - type: array - items: - type: string - id: - type: string - nullable: true - type: - type: string - nullable: true - required: - - '@context' - DidDocumentDTO: - type: object - properties: - id: - type: string - nullable: false - context: - nullable: true - type: array - items: - type: string - alsoKnownAs: - nullable: true - type: array - items: - type: string - controller: - nullable: true - type: array - items: - type: string - verificationMethod: - nullable: true - type: array - items: - type: object - authentication: - nullable: true - type: array - items: - type: object - assertionMethod: - nullable: true - type: array - items: - type: object - keyAgreement: - nullable: true - type: array - items: - type: object - capabilityInvocation: - nullable: true - type: array - items: - type: object - capabilityDelegation: - nullable: true - type: array - items: - type: object - service: - nullable: true - type: array - items: - type: object - required: - - id - - context - - alsoKnownAs - - controller - - verificationMethod - - authentication - - assertionMethod - - keyAgreement - - capabilityInvocation - - capabilityDelegation - - service - DidKeyDTO: - type: object - properties: - id: - type: string - nullable: false - key: - type: string - nullable: false - required: - - id - - key - CredentialsDTO: - type: object - properties: - entity: - type: string - nullable: false - hederaAccountId: - type: string - nullable: false - hederaAccountKey: - type: string - nullable: false - parent: - type: string - nullable: true - vcDocument: - nullable: true - allOf: - - $ref: '#/components/schemas/SubjectDTO' - didDocument: - nullable: true - allOf: - - $ref: '#/components/schemas/DidDocumentDTO' - didKeys: - nullable: true - type: array - items: - $ref: '#/components/schemas/DidKeyDTO' - required: - - entity - - hederaAccountId - - hederaAccountKey - TaskDTO: - type: object - properties: - taskId: - type: string - expectation: - type: number - required: - - taskId - - expectation - DidDocumentStatusDTO: - type: object - properties: - valid: - type: boolean - nullable: false - error: - type: string - nullable: true - didDocument: - type: object - nullable: false - required: - - valid - - error - - didDocument - DidDocumentWithKeyDTO: - type: object - properties: - document: - nullable: false - allOf: - - $ref: '#/components/schemas/DidDocumentDTO' - keys: - nullable: false - type: array - items: - $ref: '#/components/schemas/DidKeyDTO' - required: - - document - - keys - DidKeyStatusDTO: - type: object - properties: - id: - type: string - nullable: false - key: - type: string - nullable: false - valid: - type: boolean - nullable: false - required: - - id - - key - - valid - MigrationConfigPoliciesDTO: - type: object - properties: - src: - type: string - dst: - type: string - required: - - src - - dst - MigrationConfigDTO: - type: object - properties: - policies: - $ref: '#/components/schemas/MigrationConfigPoliciesDTO' - vcs: - type: array - items: - type: string - vps: - type: array - items: - type: string - schemas: - type: object - groups: - type: object - roles: - type: object - required: - - policies - - vcs - - vps - - schemas - - groups - - roles - PolicyCategoryDTO: - type: object - properties: - id: - type: string - name: - type: string - type: - type: string - required: - - id - - name - - type - SchemaDTO: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - entity: - type: string - document: - type: string - uuid: - type: string - iri: - type: string - hash: - type: string - status: - type: string - topicId: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - required: - - id - - name - - description - - entity - - document - - uuid - - iri - - hash - - status - - topicId - - version - - owner - - messageId - VersionSchemaDTO: - type: object - properties: - version: - type: string - required: - - version - MessageSchemaDTO: - type: object - properties: - messageId: - type: string - required: - - messageId - ExportSchemaDTO: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - required: - - id - - name - - description - - version - - owner - - messageId - SystemSchemaDTO: - type: object - properties: - name: - type: string - entity: - type: string - required: - - name - - entity - SettingsDTO: - type: object - properties: - ipfsStorageApiKey: - type: string - operatorId: - type: string - operatorKey: - type: string - required: - - ipfsStorageApiKey - - operatorId - - operatorKey - SuggestionsInputDTO: - type: object - properties: - blockType: - type: string - children: - nullable: true - type: array - items: - type: object - required: - - blockType - - children - SuggestionsOutputDTO: - type: object - properties: - next: - type: string - nested: - type: string - required: - - next - - nested - SuggestionsConfigItemDTO: - type: object - properties: - id: - type: string - type: - type: string - enum: - - Policy - - Module - index: - type: number - required: - - id - - type - - index - SuggestionsConfigDTO: - type: object - properties: - items: - $ref: '#/components/schemas/SuggestionsConfigItemDTO' - required: - - items - NotificationDTO: - type: object - properties: - title: - type: string - message: - type: string - type: - type: string - enum: - - INFO - - ERROR - - WARN - - SUCCESS - action: - type: string - enum: - - POLICY_CONFIGURATION - - POLICY_VIEW - - POLICIES_PAGE - - SCHEMAS_PAGE - - TOKENS_PAGE - - PROFILE_PAGE - result: - type: object - read: - type: boolean - old: - type: boolean - required: - - title - - message - - type - - action - - result - - read - - old - ProgressDTO: - type: object - properties: - action: - type: string - message: - type: string - progress: - type: number - type: - type: string - enum: - - INFO - - ERROR - - WARN - - SUCCESS - taskId: - type: string - required: - - action - - message - - progress - - type - - taskId - ProjectDTO: - type: object - properties: - id: - type: string - policyId: - type: string - policyName: - type: string - registered: - type: string - title: - type: string - companyName: - type: string - sectoralScope: - type: string - required: - - id - - policyId - - policyName - - registered - - title - - companyName - - sectoralScope - PropertiesDTO: - type: object - properties: - id: - type: string - title: - type: string - value: - type: string - required: - - id - - title - - value - RecordStatusDTO: - type: object - properties: - type: - type: string - policyId: - type: string - uuid: - type: string - status: - type: string - required: - - type - - policyId - - uuid - - status - Object: - type: object - properties: {} - RecordActionDTO: - type: object - properties: - uuid: - type: string - policyId: - type: string - method: - type: string - action: - type: string - time: - type: string - user: - type: string - target: - type: string - required: - - uuid - - policyId - - method - - action - - time - - user - - target - ResultInfoDTO: - type: object - properties: - tokens: - type: number - documents: - type: number - required: - - tokens - - documents - ResultDocumentDTO: - type: object - properties: - type: - type: string - schema: - type: string - rate: - type: string - documents: - type: object - required: - - type - - schema - - rate - - documents - RunningResultDTO: - type: object - properties: - info: - $ref: '#/components/schemas/ResultInfoDTO' - total: - type: number - documents: - $ref: '#/components/schemas/ResultDocumentDTO' - required: - - info - - total - - documents - RunningDetailsDTO: - type: object - properties: - left: - type: object - right: - type: object - total: - type: number - documents: - type: object - required: - - left - - right - - total - - documents - ToolDTO: - type: object - properties: - id: - type: string - uuid: - type: string - name: - type: string - description: - type: string - config: - type: object - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - messageId: - type: string - codeVersion: - type: string - createDate: - type: string - required: - - id - - uuid - - name - - description - - config - - status - - creator - - owner - - topicId - - messageId - - codeVersion - - createDate - RegisteredUsersDTO: - type: object - properties: - username: - type: string - did: - type: string - parent: - type: string - role: - type: string - policyRoles: - type: array - items: - type: string - required: - - username - - did - - parent - - role - - policyRoles - Credentials: - type: object - required: - - username - - password - properties: - username: - type: string - password: - type: string - Account: - type: object - required: - - username - - role - properties: - username: - type: string - role: - type: string - did: - type: string - Session: - type: object - required: - - username - - role - - accessToken - properties: - username: - type: string - role: - type: string - accessToken: - type: string - User: - type: object - required: - - username - - role - properties: - confirmed: - type: string - failed: - type: string - username: - type: string - role: - type: string - hederaAccountId: - type: string - hederaAccountKey: - type: string - did: - type: string - didDocument: - type: object - vcDocument: - type: object - parent: - type: string - topicId: - type: string - Schema: - type: object - required: - - id - - name - - description - - entity - - document - properties: - id: - type: string - iri: - type: string - uuid: - type: string - name: - type: string - description: - type: string - entity: - type: string - hash: - type: string - status: - type: string - document: - oneOf: - - type: string - - type: object - topicId: - type: string - version: - type: string - owner: - type: string - messageId: - type: string - ImportSchema: - type: object - required: - - schemes - properties: - schemes: - type: array - items: - type: object - required: - - document - - entity - - name - - uuid - properties: - document: - type: string - entity: - type: string - hash: - type: string - name: - type: string - uuid: - type: string - ExportSchema: - type: object - required: - - ids - properties: - name: - type: string - version: - type: string - messageId: - type: string - Token: - type: object - required: - - changeSupply - - decimals - - enableAdmin - - enableKYC - - enableFreeze - - enableWipe - - initialSupply - - tokenName - - tokenSymbol - - tokenType - properties: - changeSupply: - type: boolean - decimals: - type: string - enableAdmin: - type: boolean - enableFreeze: - type: boolean - enableKYC: - type: boolean - enableWipe: - type: boolean - initialSupply: - type: string - tokenName: - type: string - tokenSymbol: - type: string - tokenType: - type: string - TokenInfo: - type: object - required: - - id - - tokenId - - tokenName - - tokenSymbol - - tokenType - - decimals - - associated - - balance - - frozen - - kyc - properties: - id: - type: string - tokenId: - type: string - tokenName: - type: string - tokenSymbol: - type: string - tokenType: - type: string - decimals: - type: string - associated: - type: boolean - balance: - type: string - frozen: - type: boolean - kyc: - type: boolean - enableAdmin: - type: boolean - enableKYC: - type: boolean - enableFreeze: - type: boolean - enableWipe: - type: boolean - PolicyConfig: - type: object - required: - - name - - version - - description - - topicDescription - - config - - topicId - - policyTag - properties: - id: - type: string - uuid: - type: string - name: - type: string - version: - type: string - description: - type: string - topicDescription: - type: string - config: - type: object - status: - type: string - owner: - type: string - policyRoles: - type: array - items: - type: string - topicId: - type: string - policyTag: - type: string - policyTopics: - type: array - items: - type: object - properties: - name: - type: string - description: - type: string - type: - type: string - static: - type: boolean - TrustChains: - type: object - required: - - chain - - userMap - properties: - chain: - type: array - items: - type: object - required: - - id - - type - - tag - - label - - schema - - owner - - document - properties: - id: - type: string - type: - type: string - tag: - type: string - label: - type: string - schema: - type: string - owner: - type: string - document: - type: object - userMap: - type: array - items: - type: object - required: - - did - - username - properties: - did: - type: string - username: - type: string - VerifiablePresentation: - type: object - required: - - hash - - id - - policyId - - signature - - status - - tag - - type - - updateDate - - createDate - - owner - - document - properties: - hash: - type: string - id: - type: string - policyId: - type: string - signature: - type: string - status: - type: string - tag: - type: string - type: - type: string - updateDate: - type: string - createDate: - type: string - owner: - type: string - document: - type: object - PublishPolicy: - type: object - required: - - errors - - isValid - - policies - properties: - errors: - type: array - items: - type: object - isValid: - type: boolean - policies: - type: array - items: - type: object - ValidatePolicy: - type: object - required: - - config - - results - properties: - config: - type: object - results: - type: object - PolicyBlock: - type: object - required: - - id - - blockType - - isActive - - uiMetaData - properties: - id: - type: string - blockType: - type: string - isActive: - type: boolean - uiMetaData: - type: object - blocks: - type: array - items: - type: object - PolicyBlockData: - type: object - required: - - id - - isActive - - uiMetaData - - data - properties: - id: - type: string - blockType: - type: string - isActive: - type: boolean - uiMetaData: - type: object - data: - type: object - fields: - type: array - items: - type: object - index: - type: number - roles: - type: array - items: - type: string - blocks: - type: array - items: - $ref: '#/components/schemas/PolicyBlock' - ExportPolicy: - type: object - required: - - name - - version - - messageId - properties: - name: - type: string - version: - type: string - tokens: - type: string - PreviewPolicy: - type: object - required: - - policy - - schemas - - tokens - properties: - policy: - type: object - schemas: - type: array - items: - type: object - tokens: - type: array - items: - type: object - Error: - type: object - required: - - code - - message - properties: - code: - type: number - message: - type: string - ExternalData: - type: object - required: - - owner - - policyTag - - document - properties: - owner: - type: string - policyTag: - type: string - document: - type: object - HederaAccount: - type: object - required: - - id - - key - properties: - id: - type: string - key: - type: string - CommonSettings: - type: object - properties: - operatorId: - type: string - operatorKey: - type: string - nftApiKey: - deprecated: true - type: string - ipfsStorageApiKey: - type: string - LogFilters: - type: object - properties: - type: - type: string - startDate: - type: string - endDate: - type: string - attributes: - type: array - items: - type: string - message: - type: string - pageSize: - type: number - pageIndex: - type: number - sortDirection: - type: string - enum: - - ASC - - DESC - Log: - type: object - properties: - type: - type: string - datetime: - type: string - message: - type: string - attributes: - type: array - items: - type: string - Task: - type: object - properties: - taskId: - type: string - expectation: - type: number - TaskStatus: - type: object - properties: - date: - type: string - name: - type: string - statuses: - type: array - items: - type: object - properties: - type: - type: string - message: - type: string - result: - type: object - error: - type: object - Artifact: - type: object - properties: - id: - type: string - name: - type: string - uuid: - type: string - extention: - type: string - type: - type: string - MultiPolicyConfig: - type: object - properties: - id: - type: string - uuid: - type: string - owner: - type: string - type: - type: string - instanceTopicId: - type: string - mainPolicyTopicId: - type: string - synchronizationTopicId: - type: string - policyOwner: - type: string - user: - type: string - Contract: - type: object - properties: - id: - type: string - contractId: - type: string - description: - type: string - owner: - type: string - isOwnerCreator: - type: string - status: - type: string - RetireRequest: - type: object - properties: - id: - type: string - contractId: - type: string - baseTokenId: - type: string - owner: - type: string - oppositeTokenId: - type: string - baseTokenCount: - type: number - oppositeTokenCount: - type: number - Module: - type: object - properties: - id: - type: string - uuid: - type: string - name: - type: string - description: - type: string - config: - type: object - status: - type: string - creator: - type: string - owner: - type: string - topicId: - type: string - messageId: - type: string - codeVersion: - type: string - createDate: - type: string - type: - type: string - PreviewModule: - type: object - properties: - module: - $ref: '#/components/schemas/Module' - ExportModule: - type: object - properties: - uuid: - type: string - name: - type: string - description: - type: string - messageId: - type: string - owner: - type: string - PublishModule: - type: object - properties: - errors: - type: object - isValid: - type: boolean - module: - $ref: '#/components/schemas/Module' - ValidateModule: - type: object - properties: - module: - $ref: '#/components/schemas/Module' - results: - type: object - Tag: - type: object - required: - - name - - entity - - localTarget - properties: - uuid: - type: string - example: 00000000-0000-0000-0000-000000000000 - name: - type: string - example: Tag label - description: - type: string - example: Description - owner: - type: string - example: did - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: '0000000000.000000000' - localTarget: - type: string - example: db id - status: - type: string - enum: - - Draft - - Published - - History - example: Published - operation: - type: string - enum: - - Create - - Delete - example: Create - date: - type: string - example: '1900-01-01T00:00:00.000Z' - topicId: - type: string - example: 0.0.0000000 - messageId: - type: string - example: '0000000000.000000000' - policyId: - type: string - example: db id - uri: - type: string - example: document uri - document: - type: object - TagMap: - type: object - required: - - entity - - target - - refreshDate - - tags - properties: - entity: - type: string - enum: - - Schema - - Policy - - Token - - Module - - Contract - - PolicyDocument - example: PolicyDocument - target: - type: string - example: db id - refreshDate: - type: string - example: '1900-01-01T00:00:00.000Z' - tags: - type: array - items: - $ref: '#/components/schemas/Tag' - Theme: - type: object - required: - - uuid - - name - - rules - properties: - id: - type: string - example: db id - uuid: - type: string - example: 00000000-0000-0000-0000-000000000000 - name: - type: string - example: Theme name - rules: - type: array - items: - type: object - required: - - text - - background - - border - - shape - - borderWidth - - filterType - - filterValue - properties: - description: - type: string - example: description - text: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - background: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - border: - type: string - pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) - example: '#000000' - shape: - type: string - enum: - - '0' - - '1' - - '2' - - '3' - - '4' - - '5' - example: '0' - borderWidth: - type: string - enum: - - 0px - - 1px - - 2px - - 3px - - 4px - - 5px - - 6px - - 7px - example: 2px - filterType: - type: string - enum: - - type - - api - - role - example: type - filterValue: - oneOf: - - type: string - - type: array - items: - type: string - example: - - type - WizardConfig: - type: object - required: - - policy - - roles - - schemas - - trustChain - properties: - roles: - type: array - items: - type: string - policy: - type: object - properties: - name: - type: string - description: - type: string - topicDescription: - type: string - policyTag: - type: string - schemas: - type: array - items: - type: object - properties: - name: - type: string - iri: - type: string - isApproveEnable: - type: boolean - isMintSchema: - type: boolean - mintOptions: - type: object - properties: - tokenId: - type: string - rule: - type: string - dependencySchemaIri: - type: string - relationshipsSchemaIri: - type: string - initialRolesFor: - type: array - items: - type: string - rolesConfig: - type: array - items: - type: object - properties: - role: - type: string - isApprover: - type: boolean - isCreator: - type: boolean - gridColumns: - type: array - items: - type: object - properties: - field: - type: string - title: - type: string - trustChain: - type: array - items: - type: object - properties: - role: - type: string - mintSchemaIri: - type: string - viewOnlyOwnDocuments: - type: boolean +openapi: 3.0.0 +paths: + /accounts/session: + get: + operationId: AccountApi_getSession + summary: Returns current session of the user. + description: Returns current user session. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_0 + - accounts + security: + - bearerAuth: [] + /accounts/register: + post: + operationId: AccountApi_register + summary: Registers a new user account. + description: Object that contain username, password and role (optional) fields. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/login: + post: + operationId: AccountApi_login + summary: Logs user into the system. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginUserDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsSessionResponseDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + /accounts/access-token: + post: + operationId: AccountApi_getAccessToken + summary: Returns access token. + description: Returns access token. + parameters: [] + responses: + '200': + description: Successful operation. + tags: *ref_0 + /accounts: + get: + operationId: AccountApi_getAllAccounts + summary: Returns a list of users, excluding Standard Registry and Auditors. + description: >- + Returns all users except those with roles Standard Registry and Auditor. + Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries: + get: + operationId: AccountApi_getStandatdRegistries + summary: Returns all Standard Registries. + description: Returns all Standard Registries. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountsResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/standard-registries/aggregated: + get: + operationId: AccountApi_getAggregatedStandardRegistries + summary: Returns all Standard Registries aggregated with polices and vcDocuments. + description: Returns all Standard Registries aggregated with polices and vcDocuments + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AggregatedDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /accounts/balance: + get: + operationId: AccountApi_getBalance + summary: Returns user's Hedera account balance. + description: Requests current Hedera account balance. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/BalanceResponseDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_0 + security: + - bearerAuth: [] + /analytics/search/policies: + post: + operationId: AnalyticsApi_searchPolicies + summary: Search policies. + description: >- + Search policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + policyId: '000000000000000000000000' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_1 + - analytics + security: + - bearerAuth: [] + /analytics/compare/policies: + post: + operationId: AnalyticsApi_comparePolicies + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ComparePoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules: + post: + operationId: AnalyticsApi_compareModules + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareModulesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas: + post: + operationId: AnalyticsApi_compareSchemas + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareSchemasDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents: + post: + operationId: AnalyticsApi_compareDocuments + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools: + post: + operationId: AnalyticsApi_compareTools + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareToolsDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/policies/export: + post: + operationId: AnalyticsApi_comparePoliciesExport + summary: Compare policies. + description: >- + Compare policies. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterPoliciesDTO' + examples: + Filter1: + value: + policyId1: '000000000000000000000001' + policyId2: '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + Filter2: + value: + policyIds: + - '000000000000000000000001' + - '000000000000000000000002' + eventsLvl: '0' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/modules/export: + post: + operationId: AnalyticsApi_compareModulesExport + summary: Compare modules. + description: >- + Compare modules. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterModulesDTO' + examples: + Filter: + value: + moduleId1: '000000000000000000000001' + moduleId2: '000000000000000000000002' + propLvl: '0' + childrenLvl: '0' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/schemas/export: + post: + operationId: AnalyticsApi_compareSchemasExport + summary: Compare schemas. + description: >- + Compare schemas. Only users with the Standard Registry role are allowed + to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSchemasDTO' + examples: + Filter: + value: + schemaId1: '000000000000000000000001' + schemaId2: '000000000000000000000002' + idLvl: '0' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/documents/export: + post: + operationId: AnalyticsApi_compareDocumentsExport + summary: Compare documents. + description: >- + Compare documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/compare/tools/export: + post: + operationId: AnalyticsApi_compareToolsExport + summary: Compare tools. + description: >- + Compare tools. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterToolsDTO' + examples: + Filter1: + value: + toolId1: '000000000000000000000001' + toolId2: '000000000000000000000002' + Filter2: + value: + toolIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /analytics/search/blocks: + post: + operationId: AnalyticsApi_searchBlocks + summary: Search same blocks. + description: >- + Search same blocks. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterSearchPoliciesDTO' + examples: + Filter: + value: + uuid: '' + config: {} + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPoliciesDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_1 + security: + - bearerAuth: [] + /artifacts: + get: + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{parentId}: + post: + operationId: ArtifactApi_uploadArtifacts + summary: Upload artifact. + description: Upload artifact. For users with the Standard Registry role only. + parameters: + - name: parentId + required: true + in: path + description: Parent ID + schema: + type: string + requestBody: + required: true + description: Form data with artifacts. + content: + multipart/form-data: + schema: + type: array + items: + type: object + properties: + artifacts: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ArtifactDTOItem' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - artifacts + security: + - bearerAuth: [] + /artifacts/{artifactId}: + delete: + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /contracts: + get: + operationId: ContractsApi_getContracts + summary: Return a list of all contracts. + description: Returns all contracts. + parameters: + - name: type + required: true + in: query + description: Contract type + example: RETIRE + schema: + enum: + - WIPE + - RETIRE + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Contracts. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_2 + - contracts + security: + - bearerAuth: [] + post: + operationId: ContractsApi_createContract + summary: Create contract. + description: >- + Create smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + responses: + '201': + description: Created contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/import: + post: + operationId: ContractsApi_importContract + summary: Import contract. + description: >- + Import smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contractId: + type: string + description: Hedera Identifier + example: 0.0.1 + description: + type: string + required: + - contractId + responses: + '200': + description: Imported contract. + content: + application/json: + schema: + $ref: '#/components/schemas/ContractDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/{contractId}/permissions: + get: + operationId: ContractsApi_contractPermissions + summary: Get contract permissions. + description: >- + Get smart-contract permissions. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Contract permissions. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/{contractId}: + delete: + operationId: ContractsApi_removeContract + summary: Remove contract. + description: >- + Remove smart-contract. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests: + get: + operationId: ContractsApi_getWipeRequests + summary: Return a list of all wipe requests. + description: >- + Returns all wipe requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WiperRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests/enable: + post: + operationId: ContractsApi_enableWipeRequests + summary: Enable wipe requests. + description: >- + Enable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests/disable: + post: + operationId: ContractsApi_disableWipeRequests + summary: Disable wipe requests. + description: >- + Disable wipe contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveWipeRequest + summary: Approve wipe request. + description: >- + Approve wipe contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/requests/{requestId}/reject: + delete: + operationId: ContractsApi_rejectWipeRequest + summary: Reject wipe request. + description: >- + Reject wipe contract request. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: ban + required: true + in: query + description: Reject and ban + schema: + type: boolean + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/requests: + delete: + operationId: ContractsApi_clearWipeRequests + summary: Clear wipe requests. + description: >- + Clear wipe contract requests. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_wipeAddAdmin + summary: Add wipe admin. + description: >- + Add wipe contract admin. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/manager/{hederaId}: + post: + operationId: ContractsApi_wipeAddManager + summary: Add wipe manager. + description: >- + Add wipe contract manager. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveManager + summary: Remove wipe manager. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/wipe/{contractId}/wiper/{hederaId}: + post: + operationId: ContractsApi_wipeAddWiper + summary: Add wipe wiper. + description: >- + Add wipe contract wiper. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_wipeRemoveWiper + summary: Remove wipe wiper. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/pools/sync: + post: + operationId: ContractsApi_retireSyncPools + summary: Sync retire pools. + description: >- + Sync retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Sync date. + content: + application/json: + schema: + $ref: '#/components/schemas/Date' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests: + get: + operationId: ContractsApi_getRetireRequests + summary: Return a list of all retire requests. + description: Returns all retire requests. + parameters: + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetireRequestDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools: + get: + operationId: ContractsApi_getRetirePools + summary: Return a list of all retire pools. + description: Returns all retire pools. + parameters: + - name: tokens + required: true + in: query + description: Tokens + example: 0.0.1,0.0.2,0.0.3 + schema: + type: string + - name: contractId + required: true + in: query + description: Contract identifier + example: 0.0.1 + schema: + type: string + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/requests: + delete: + operationId: ContractsApi_clearRetireRequests + summary: Clear retire requests. + description: >- + Clear retire contract requests. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/pools: + delete: + operationId: ContractsApi_clearRetirePools + summary: Clear retire pools. + description: >- + Clear retire contract pools. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + post: + operationId: ContractsApi_setRetirePool + summary: Set retire pool. + description: >- + Set retire contract pool. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RetirePoolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools/{poolId}: + delete: + operationId: ContractsApi_unsetRetirePool + summary: Unset retire pool. + description: >- + Unset retire contract pool. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: poolId + required: true + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}: + delete: + operationId: ContractsApi_unsetRetireRequest + summary: Unset retire request. + description: >- + Unset retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/pools/{poolId}/retire: + post: + operationId: ContractsApi_retire + summary: Retire tokens. + description: Retire tokens. + parameters: + - name: poolId + required: true + in: path + description: Pool Identifier + example: 652745597a7b53526de37c05 + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetireRequestTokenDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}/approve: + post: + operationId: ContractsApi_approveRetire + summary: Approve retire request. + description: >- + Approve retire contract request. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/requests/{requestId}/cancel: + delete: + operationId: ContractsApi_cancelRetireRequest + summary: Cancel retire request. + description: Cancel retire contract request. + parameters: + - name: requestId + required: true + in: path + description: Request identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire/{contractId}/admin/{hederaId}: + post: + operationId: ContractsApi_retireAddAdmin + summary: Add retire admin. + description: >- + Add retire contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + delete: + operationId: ContractsApi_retireRemoveAdmin + summary: Remove wipe admin. + description: >- + Remove wipe contract admin. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: hederaId + required: true + in: path + description: Hedera identifier + example: 0.0.1 + schema: + type: string + - name: contractId + required: true + in: path + description: Contract identifier + example: 652745597a7b53526de37c05 + schema: + type: string + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /contracts/retire: + get: + operationId: ContractsApi_getRetireVCs + summary: Return a list of all retire vcs. + description: Returns all retire vcs. + parameters: + - name: pageSize + required: true + in: query + description: The numbers of items to return + example: 20 + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + example: 0 + schema: + type: number + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_2 + security: + - bearerAuth: [] + /demo/registered-users: + get: + operationId: DemoApi_registeredUsers + summary: Returns list of registered users. + description: Returns list of registered users. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredUsersDTO' + tags: + - demo + /demo/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/HederaAccount' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /demo/push/random-key: + get: + tags: + - demo + description: Generates a new Hedera account with a random private key. + security: + - bearerAuth: [] + summary: Generates a new Hedera account with a random private key. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /external: + post: + tags: + - external + description: Sends data from an external source. + summary: Sends data from an external source. + requestBody: + description: Object that contains a VC Document. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalData' + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file: + post: + operationId: IpfsApi_postFile + summary: Add file from ipfs. + description: Add file from ipfs. + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_3 + - ipfs + security: + - bearerAuth: [] + /ipfs/file/dry-run/{policyId}: + post: + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + operationId: IpfsApi_postFileDryRun + summary: Add file from ipfs for dry run mode. + description: Add file from ipfs for dry run mode. + responses: + '401': + description: Unauthorized + tags: *ref_3 + security: + - bearerAuth: [] + /ipfs/file/{cid}: + get: + tags: + - ipfs + description: Get file from ipfs. + summary: Get file from ipfs. + parameters: + - in: path + name: cid + schema: + type: string + required: true + description: File CID. + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + binary/octet-stream: + schema: + type: string + format: binary + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/{cid}/dry-run: + get: + operationId: IpfsApi_getFileDryRun + summary: Get file from ipfs for dry run mode. + description: Get file from ipfs for dry run mode. + parameters: + - name: cid + required: true + in: path + schema: + type: string + responses: + '401': + description: Unauthorized + tags: *ref_3 + security: + - bearerAuth: [] + /logs: + post: + tags: + - logs + description: Returns logs. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + description: Log filters. + content: + application/json: + schema: + $ref: '#/components/schemas/LogFilters' + summary: Returns logs. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + totalCount: + type: number + logs: + $ref: '#/components/schemas/Log' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /logs/attributes: + get: + tags: + - logs + description: Returns logs attributes. For users with the Standard Registry role only. + parameters: + - in: query + name: name + schema: + type: string + description: Part of name. + - in: query + name: existingAttributes + schema: + type: array + items: + type: string + description: Attributes to exclude. + security: + - bearerAuth: [] + summary: Returns logs attributes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/key: + get: + tags: + - maps + description: Returns map api key. + security: + - bearerAuth: [] + summary: Returns map api key. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /map/sh: + get: + operationId: MapApi_getSentinelKey + parameters: [] + responses: + '200': + description: '' + tags: + - map + /metrics: + get: + operationId: MetricsApi_getMetrics + parameters: [] + responses: + '200': + description: '' + tags: + - metrics + /modules: + get: + tags: + - modules + description: >- + Returns all modules. Only users with the Standard Registry and Installer + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all modules. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - modules + description: >- + Creates a new module. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/schemas: + get: + operationId: ModulesApi_getModuleSchemas + parameters: [] + responses: + '200': + description: '' + tags: &ref_4 + - modules + post: + operationId: ModulesApi_postSchemas + parameters: [] + responses: + '201': + description: '' + tags: *ref_4 + /modules/{uuid}: + get: + tags: + - modules + description: >- + Retrieves module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Retrieves module configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - modules + description: >- + Updates module configuration for the specified module ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates module configuration. + parameters: + - in: path + name: uuid + description: Selected module ID. + required: true + schema: + type: string + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - modules + description: >- + Deletes the module with the provided module ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Module ID. + security: + - bearerAuth: [] + summary: Deletes the module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/menu: + get: + tags: + - modules + description: >- + Returns modules menu. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of modules. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/file: + get: + tags: + - modules + description: >- + Returns a zip file containing the published module and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: >- + Return module and its artifacts in a zip file format for the specified + module. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/export/message: + get: + tags: + - modules + description: >- + Returns the Hedera message ID for the specified module published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published module. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: Imports new module from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file: + post: + tags: + - modules + description: >- + Imports new module and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new module from a zip file. + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/message/preview: + post: + tags: + - modules + description: >- + Previews the module from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Module preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the module. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/import/file/preview: + post: + tags: + - modules + description: >- + Previews the module from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Module preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the module and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/{uuid}/publish: + put: + tags: + - modules + description: >- + Publishes the module with the specified (internal) module ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: uuid + schema: + type: string + required: true + description: Selected module ID. + summary: Publishes the module onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /modules/validate: + post: + tags: + - modules + description: >- + Validates selected module. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates module. + requestBody: + description: Object that contains module configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateModule' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tools: + post: + operationId: ToolsApi_createNewTool + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_5 + - tools + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getTools + summary: Return a list of all tools. + description: >- + Returns all tools. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: The numbers of items to return + schema: + type: number + - name: pageIndex + required: true + in: query + description: >- + The number of pages to skip before starting to collect the result + set + schema: + type: number + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push: + post: + operationId: ToolsApi_createNewToolAsync + summary: Creates a new tool. + description: >- + Creates a new tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}: + delete: + operationId: ToolsApi_deleteTool + summary: >- + Deletes the tool with the provided tool ID. Only users with the Standard + Registry role are allowed to make the request. + description: Deletes the tool. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + get: + operationId: ToolsApi_getToolById + summary: Retrieves tool configuration. + description: >- + Retrieves tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + put: + operationId: ToolsApi_updateTool + summary: Updates tool configuration. + description: >- + Updates tool configuration for the specified tool ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/publish: + put: + operationId: ToolsApi_publishTool + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/push/publish: + put: + operationId: ToolsApi_publishToolAsync + summary: Publishes the tool onto IPFS. + description: >- + Publishes the tool with the specified (internal) tool ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/validate: + post: + operationId: ToolsApi_validateTool + summary: Validates selected tool. + description: >- + Validates selected tool. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/export/file: + get: + operationId: ToolsApi_toolExportFile + summary: >- + Return tool and its artifacts in a zip file format for the specified + tool. + description: >- + Returns a zip file containing the published tool and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. Response zip file. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/{id}/export/message: + get: + operationId: ToolsApi_toolExportMessage + summary: Return Heder message ID for the specified published tool. + description: >- + Returns the Hedera message ID for the specified tool published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - name: id + required: true + in: path + description: Tool ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/message/preview: + post: + operationId: ToolsApi_toolImportMessagePreview + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/message: + post: + operationId: ToolsApi_toolImportMessage + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file/preview: + post: + operationId: ToolsApi_toolImportFilePreview + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file: + post: + operationId: ToolsApi_toolImportFile + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadata + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/file: + post: + operationId: ToolsApi_toolImportFileAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadataAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/push/import/message: + post: + operationId: ToolsApi_toolImportMessageAsync + summary: Imports new tool from IPFS. + description: >- + Imports new tool and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /tools/menu/all: + get: + operationId: ToolsApi_getMenu + summary: Return a list of tools. + description: >- + Returns tools menu. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] + /profiles/{username}: + get: + operationId: ProfileApi_getProfile + summary: Returns user account info. + description: >- + Returns user account information. For users with the Standard Registry + role it also returns address book and VC document information. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the information + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_6 + - profiles + security: + - bearerAuth: [] + put: + operationId: ProfileApi_setUserProfile + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Created. + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/push/{username}: + put: + operationId: ProfileApi_setUserProfileAsync + summary: Sets Hedera credentials for the user. + description: >- + Sets Hedera credentials for the user. For users with the Standard + Registry role it also creates an address book. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to update the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/{username}/balance: + get: + operationId: ProfileApi_getUserBalance + summary: Returns user's Hedera account balance. + description: >- + Requests Hedera account balance. Only users with the Installer role are + allowed to make the request. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to fetch the balance. + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/restore/{username}: + put: + operationId: ProfileApi_restoreUserProfile + summary: Restore user data (policy, DID documents, VC documents). + description: Restore user data (policy, DID documents, VC documents). + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/restore/topics/{username}: + put: + operationId: ProfileApi_restoreTopic + summary: List of available recovery topics. + description: List of available recovery topics. + parameters: + - name: username + required: true + in: path + description: The name of the user for whom to restore the information. + schema: + type: string + requestBody: + required: true + description: Object that contains the Hedera account data. + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/did-document/validate: + post: + operationId: ProfileApi_validateDidDocument + summary: Validate DID document format. + description: Validate DID document format. + parameters: [] + requestBody: + required: true + description: DID Document. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /profiles/did-keys/validate: + post: + operationId: ProfileApi_validateDidKeys + summary: Validate DID document keys. + description: Validate DID document keys. + parameters: [] + requestBody: + required: true + description: DID Document and keys. + content: + application/json: + schema: + $ref: '#/components/schemas/DidDocumentWithKeyDTO' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/DidKeyStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_6 + security: + - bearerAuth: [] + + /policies: + get: + tags: + - policies + description: >- + Returns all policies. Only users with the Standard Registry and + Installer role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return a list of all policies. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/migrate-data: + post: + operationId: PolicyApi_migrateData + summary: Migrate policy data. + description: >- + Migrate policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '200': + description: Errors while migration. + content: + application/json: + schema: + type: array + items: + type: object + properties: + error: + type: string + id: + type: string + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_7 + - policies + security: + - bearerAuth: [] + /policies/push/migrate-data: + post: + operationId: PolicyApi_migrateDataAsync + summary: Migrate policy data asynchronous. + description: >- + Migrate policy data asynchronous. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Migration config. + content: + application/json: + schema: + $ref: '#/components/schemas/MigrationConfigDTO' + responses: + '202': + description: Created task. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/push: + post: + tags: + - policies + description: >- + Creates a new policy. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}: + post: + operationId: PolicyApi_updatePolicyAsync + summary: '' + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + delete: + operationId: PolicyApi_deletePolicyAsync + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '202': + description: '' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}: + get: + tags: + - policies + description: >- + Retrieves policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves policy configuration. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PolicyConfig' + - type: object + properties: + userRoles: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - policies + description: >- + Updates policy configuration for the specified policy ID. Only users + with the Standard Registry role are allowed to make the request. + summary: Updates policy configuration. + parameters: + - in: path + name: policyId + description: Selected policy ID. + required: true + schema: + type: string + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + summary: Publishes the policy onto IPFS. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/{policyId}/publish: + put: + tags: + - policies + description: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. Only users with the Standard Registry role are allowed to make + the request. + security: + - bearerAuth: [] + summary: >- + Publishes the policy with the specified (internal) policy ID onto IPFS, + sends a message featuring its IPFS CID into the corresponding Hedera + topic. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + policyVersion: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run: + put: + tags: + - policies + description: >- + Run policy without making any persistent changes or executing + transaction. Only users with the Standard Registry role are allowed to + make the request. + security: + - bearerAuth: [] + summary: Dry Run policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/discontinue: + put: + operationId: PolicyApi_discontinuePolicy + summary: Discontunue policy. + description: >- + Discontunue policy. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Discontinue details. + content: + application/json: + schema: + type: object + properties: + date: + type: number + responses: + '200': + description: Policies. + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/draft: + put: + tags: + - policies + description: >- + Return policy to editing. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Return policy to editing. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PublishPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/validate: + post: + tags: + - policies + description: >- + Validates selected policy. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Validates policy. + requestBody: + description: Object that contains policy configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/navigation: + get: + operationId: PolicyApi_getPolicyNavigation + summary: Returns a policy navigation. + description: Returns a policy navigation. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + /policies/{policyId}/groups: + get: + tags: + - policies + description: Returns a list of groups the user is a member of. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Returns a list of groups the user is a member of. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + uuid: + type: string + role: + type: string + groupLabel: + type: string + groupName: + type: string + active: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: >- + Makes the selected group active. if UUID is not set then returns the + user to the default state. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Makes the selected group active. + requestBody: + description: Selected group. + required: true + content: + application/json: + schema: + type: object + properties: + uuid: + type: string + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/documents: + get: + operationId: PolicyApi_getPolicyDocuments + summary: Get policy documents. + description: >- + Get policy documents. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: pageSize + required: true + in: query + description: Page size. + schema: + type: number + - name: pageIndex + required: true + in: query + description: Page index. + schema: + type: number + - name: type + required: true + in: query + description: Document type. + schema: + enum: + - VC + - VP + type: string + - name: includeDocument + required: true + in: query + description: Include document field. + schema: + type: boolean + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Documents. + headers: + X-Total-Count: + description: Total documents count. + schema: + type: number + content: + application/json: + schema: + type: array + items: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks: + get: + tags: + - policies + description: >- + Returns data from the root policy block. Only users with the Standard + Registry and Installer role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + summary: Retrieves data for the policy root block. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlock' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/blocks/{uuid}: + get: + tags: + - policies + description: >- + Requests block data. Only users with a role that described in block are + allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Requests block data. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - policies + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: Selected block UUID. + summary: Sends data to the specified block. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tagName}/blocks: + post: + operationId: PolicyApi_setBlocksByTagName + summary: Sends data to the specified block. + description: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Tag name. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + get: + operationId: PolicyApi_getBlocksByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Tag name. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/tag/{tagName}: + get: + operationId: PolicyApi_getBlockByTagName + summary: Requests block data. + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tagName + schema: + type: string + required: true + description: Tag name. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/blocks/{uuid}/parents: + get: + operationId: PolicyApi_getBlockParents + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: uuid + schema: + type: string + required: true + description: uuid. + responses: + '200': + description: '' + tags: *ref_7 + /policies/{policyId}/export/file: + get: + tags: + - policies + description: >- + Returns a zip file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: >- + Return policy and its artifacts in a zip file format for the specified + policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/message: + get: + tags: + - policies + description: >- + Returns the Hedera message ID for the specified policy published onto + IPFS. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + security: + - bearerAuth: [] + summary: Return Heder message ID for the specified published policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/export/xlsx: + get: + operationId: PolicyApi_getPolicyExportXlsx + summary: >- + Return policy and its artifacts in a xlsx file format for the specified + policy. + description: >- + Returns a xlsx file containing the published policy and all associated + artifacts, i.e. schemas and VCs. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts from IPFS into the local + DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the Policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + summary: Policy preview from IPFS. + security: + - bearerAuth: [] + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/message/preview: + post: + tags: + - policies + description: >- + Previews the policy from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Previews the policy from IPFS without loading it into the local DB. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the policy. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: query + name: versionOfTopicId + schema: + type: string + description: The topic ID of policy version. + examples: + pageIndex: + summary: Example of a topic ID of policy version. + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new policy from a zip file. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadata + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: true + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/push/import/file: + post: + tags: + - policies + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/push/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadataAsync + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: true + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/import/file/preview: + post: + tags: + - policies + description: >- + Previews the policy from a zip file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + summary: Policy preview from a zip file. + security: + - bearerAuth: [] + requestBody: + description: >- + A zip file that contains the policy and associated schemas and VCs to + be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewPolicy' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsx + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/push/import/xlsx: + post: + operationId: PolicyApi_importPolicyFromXlsxAsync + summary: Imports new policy from a xlsx file. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided xlsx file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: policyId + required: true + in: query + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/import/xlsx/preview: + post: + operationId: PolicyApi_importPolicyFromXlsxPreview + summary: Policy preview from a xlsx file. + description: >- + Previews the policy from a xlsx file without loading it into the local + DB. Only users with the Standard Registry role are allowed to make the + request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing policy config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + + /policies/blocks/about: + get: + operationId: PolicyApi_getBlockAbout + parameters: [] + responses: + '200': + description: '' + tags: *ref_7 + /policies/{policyId}/dry-run/users: + get: + tags: + - policies + description: >- + Returns all virtual users. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all virtual users. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/user: + post: + tags: + - policies + description: >- + Create a new virtual account. Only users with the Standard Registry role + are allowed to make the request. + security: + - bearerAuth: [] + summary: Create a new virtual account. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/login: + post: + tags: + - policies + description: >- + Logs virtual user into the system. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Logs virtual user into the system. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Virtual user + required: true + content: + application/json: + schema: + type: object + properties: + did: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + username: + type: string + did: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/restart: + post: + tags: + - policies + description: >- + Restarts the execution of the policy. Clear data in database. Only users + with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Restarts the execution of the policy. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/transactions: + get: + tags: + - policies + description: >- + Returns lists of virtual transactions. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual transactions. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + hederaAccountId: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/artifacts: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + type: + type: string + owner: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/dry-run/ipfs: + get: + tags: + - policies + description: >- + Returns lists of virtual artifacts. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns lists of virtual artifacts. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + type: object + properties: + createDate: + type: string + documentURL: + type: string + document: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/multiple: + post: + tags: + - policies + description: >- + Creates a link between the current policy and the main policy. Or + creates a group making the current policy the main one. + security: + - bearerAuth: [] + summary: Creates Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + requestBody: + description: Multi policy config. + required: true + content: + application/json: + schema: + type: object + required: + - mainPolicyTopicId + - synchronizationTopicId + properties: + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: Requests Multi policy config. + security: + - bearerAuth: [] + summary: Requests Multi policy config. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MultiPolicyConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/methodologies/categories: + get: + operationId: PolicyApi_getPolicyCategoriesAsync + summary: Get all categories + description: Get all categories + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyCategoryDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + /policies/methodologies/search: + post: + operationId: PolicyApi_getPoliciesByCategory + summary: Get filtered policies + description: Get policies by categories and text + parameters: [] + requestBody: + required: true + description: Filters + content: + application/json: + schema: + type: string + examples: + Filter1: + value: + categoryIds: + - '000000000000000000000001' + - '000000000000000000000002' + text: abc + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + /schema/{schemaId}: + get: + tags: + - schema + description: Returns schema by schema ID. + security: + - bearerAuth: [] + summary: Returns schema by schema ID. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schema/{schemaId}/parents: + get: + operationId: SingleSchemaApi_getSchemaParents + summary: Returns all parent schemas. + description: Returns all parent schemas. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_8 + - schema + security: + - bearerAuth: [] + /schema/{schemaId}/tree: + get: + operationId: SingleSchemaApi_getSchemaTree + summary: Returns schema tree. + description: Returns schema tree. + parameters: + - name: schemaId + required: true + in: path + description: Schema identifier + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + name: + type: string + type: + type: string + children: + type: array + items: + type: object + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_8 + security: + - bearerAuth: [] + /schemas: + get: + tags: + - schemas + description: Returns all schemas. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Create new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: Returns all schemas by topicId. + security: + - bearerAuth: [] + summary: Returns all schemas by topicId. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/type/{schemaType}: + get: + operationId: SchemaApi_getSchemaByType + summary: Finds the schema using the json document type. + description: Finds the schema using the json document type. + parameters: + - name: schemaType + required: true + in: path + description: Type + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_9 + - schemas + security: + - bearerAuth: [] + /schemas/list/all: + get: + operationId: SchemaApi_getAll + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + /schemas/list/sub: + get: + operationId: SchemaApi_getSub + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: category + required: true + in: query + description: Schema category + schema: + type: string + - name: topicId + required: true + in: query + description: Topic Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SchemaDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + /schemas/push/copy: + post: + operationId: SchemaApi_copySchemaAsync + summary: Copy schema. + description: >- + Copy schema. Only users with the Standard Registry role are allowed to + make the request. + parameters: [] + requestBody: + required: true + description: Object that contains a valid schema. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + - bearerAuth: [] + /schemas/push/{topicId}: + post: + tags: + - schemas + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Create new schema. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{schemaId}/publish: + put: + tags: + - schemas + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + security: + - bearerAuth: [] + summary: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/import/message/preview: + post: + tags: + - schemas + description: >- + Previews the schema from IPFS without loading it into the local DB. Only + users with the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/import/file/preview: + post: + tags: + - schemas + description: >- + Previews the schema from a zip file. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Schema preview from a zip file. + requestBody: + description: A zip file containing the schema to be viewed. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/message: + post: + tags: + - schemas + description: >- + Imports new schema from IPFS into the local DB. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from IPFS. + requestBody: + description: >- + Object that contains the identifier of the Hedera message which + contains the IPFS CID of the schema. + required: true + content: + application/json: + schema: + type: object + properties: + messageId: + type: string + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/push/{topicId}/import/file: + post: + tags: + - schemas + description: >- + Imports new schema from a zip file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Imports new schema from a zip file. + requestBody: + description: A zip file containing schema to be imported. + content: + binary/octet-stream: + schema: + type: string + format: binary + required: true + parameters: + - in: path + name: topicId + schema: + type: string + required: true + description: Topic ID. + examples: + topicId: + summary: Example of a Topic ID + value: 0.0.00000001 + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/message: + post: + tags: + - schemas + description: >- + Returns Hedera message IDs of the published schemas, these messages + contain IPFS CIDs of these schema files. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: List Hedera message IDs of published schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ExportSchema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/file: + post: + tags: + - schemas + description: >- + Returns schema files for the schemas. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Return zip file with schemas. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Selected schema ID. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{username}: + post: + tags: + - schemas + description: >- + Creates new system schema. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Creates new system schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - schemas + description: >- + Returns all system schemas by username. Only users with the Standard + Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Returns all system schemas by username. + parameters: + - in: path + name: username + schema: + type: string + required: true + description: Username. + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set. + examples: + pageIndex: + summary: Example of a pageIndex. + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The number of items to return. + examples: + pageSize: + summary: Example of a pageSize. + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total number of items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}: + put: + tags: + - schemas + description: >- + Updates the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - schemas + description: >- + Deletes the system schema with the provided schema ID. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Deletes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/{schemaId}/active: + put: + tags: + - schemas + description: >- + Makes the selected scheme active. Other schemes of the same type become + inactive. Only users with the Standard Registry role are allowed to make + the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + requestBody: + description: Object that contains policy version. + required: true + content: + application/json: + schema: + type: object + properties: + version: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/system/entity/{schemaEntity}: + get: + tags: + - schemas + description: Finds the schema using the schema type. + parameters: + - in: path + name: schemaEntity + schema: + type: string + enum: + - STANDARD_REGISTRY + - USER + - POLICY + - MINT_TOKEN + - WIPE_TOKEN + - MINT_NFTOKEN + required: true + description: schema type. + security: + - bearerAuth: [] + summary: Returns schema by schema type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /schemas/{schemaId}/export/xlsx: + get: + operationId: SchemaApi_getPolicyExportXlsx + summary: Return schemas in a xlsx file format for the specified policy. + description: >- + Returns a xlsx file containing schemas. Only users with the Standard + Registry role are allowed to make the request. + parameters: + - name: schemaId + required: true + in: path + description: Schema ID + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + + /schemas/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsx + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + + /schemas/push/{topicId}/import/xlsx: + post: + operationId: SchemaApi_importPolicyFromXlsxAsync + summary: Imports new schema from a xlsx file into the local DB. + description: >- + Imports new schema from a xlsx file into the local DB. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - name: topicId + required: true + in: path + description: Topic Id + schema: + type: string + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + + /schemas/import/xlsx/preview: + post: + operationId: SchemaApi_importPolicyFromXlsxPreview + summary: Previews the schema from a xlsx file. + description: >- + Previews the schema from a xlsx file. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: A xlsx file containing schema config. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + + /schemas/export/template: + get: + operationId: SchemaApi_exportTemplate + summary: Returns a list of schemas. + description: >- + Returns a list of schemas. Only users with the Standard Registry role + are allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_9 + security: + - bearerAuth: [] + + /settings: + get: + tags: + - settings + description: >- + Returns current settings. For users with the Standard Registry role + only. + security: + - bearerAuth: [] + summary: Returns current settings. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - settings + description: Set settings. For users with the Standard Registry role only. + security: + - bearerAuth: [] + summary: Set settings. + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/CommonSettings' + /settings/environment: + get: + tags: + - settings + description: Returns current environment name. + security: + - bearerAuth: [] + summary: Returns current environment name. + responses: + '200': + description: Successful operation. + content: + text/plain: + schema: + type: string + example: testnet + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /settings/about: + get: + operationId: SettingsApi_getAbout + parameters: [] + responses: + '200': + description: '' + tags: + - settings + /tags: + post: + operationId: TagsApi_setTags + parameters: [] + responses: + '201': + description: '' + tags: + - tags + /tags/search: + post: + tags: + - tags + description: Search tags. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + oneOf: + - type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + target: + type: string + - type: object + required: + - entity + - targets + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + targets: + type: array + items: + type: string + examples: + Single: + value: + entity: PolicyDocument + target: targetId1 + Multiple: + value: + entity: PolicyDocument + targets: + - targetId1 + - targetId2 + summary: Search tags. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + description: a (targetId, Tags) map. `targetId1` is an example key + properties: + targetId1: + $ref: '#/components/schemas/TagMap' + additionalProperties: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/{uuid}: + delete: + tags: + - tags + description: Delete tag. + security: + - bearerAuth: [] + summary: Delete tag. + parameters: + - in: path + name: uuid + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: Tag identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/synchronization: + post: + tags: + - tags + description: synchronization. + security: + - bearerAuth: [] + requestBody: + description: Object that contains filters. + required: true + content: + application/json: + schema: + type: object + required: + - entity + - target + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: targetId + summary: synchronization. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TagMap' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas: + get: + tags: + - tags + description: Returns all schema. + security: + - bearerAuth: [] + summary: Returns all schemas. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tags + description: >- + Creates new schema. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates new schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}: + delete: + tags: + - tags + description: >- + Deletes the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Delete the schema. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - tags + description: >- + Updates the schema with the provided schema ID. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Updates the schema. + requestBody: + description: Object that contains a valid schema. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/{schemaId}/publish: + put: + tags: + - tags + description: >- + Publishes the schema with the provided (internal) schema ID onto IPFS, + sends a message featuring IPFS CID into the corresponding Hedera topic. + Only users with the Standard Registry role are allowed to make the + request. + parameters: + - in: path + name: schemaId + schema: + type: string + required: true + description: Schema ID. + security: + - bearerAuth: [] + summary: Publishes the schema. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/schemas/published: + get: + tags: + - tags + description: Return a list of all published schemas. + security: + - bearerAuth: [] + summary: Return a list of all published schemas. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tasks/{taskId}: + get: + tags: + - tasks + description: Returns task statuses by Id. + security: + - bearerAuth: [] + summary: Returns task statuses. + parameters: + - in: path + name: taskId + schema: + type: string + required: true + description: Task ID. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskStatus' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens: + get: + tags: + - tokens + description: >- + Returns all tokens. For the Standard Registry role it returns only the + list of tokens, for other users it also returns token balances as well + as the KYC, Freeze, and Association statuses. Not allowed for the + Auditor role. + security: + - bearerAuth: [] + summary: Return a list of tokens. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '201': + description: Created. + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/TokenInfo' + - type: object + properties: + policies: + type: array + items: + type: string + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push: + post: + tags: + - tokens + description: >- + Creates a new token. Only users with the Standard Registry role are + allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new token. + requestBody: + description: Object that contains token information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}: + delete: + operationId: TokensApi_deleteTokenAsync + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: '' + tags: &ref_10 + - tokens + /tokens/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + responses: + '200': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/associate: + put: + tags: + - tokens + description: >- + Associates the user with the provided Hedera token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Associates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Installer role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + security: + - bearerAuth: [] + summary: Associate the user with the provided Hedera token. + responses: + '202': + description: Successful operation. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/dissociate: + put: + tags: + - tokens + description: >- + Disassociates the user with the provided Hedera token. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Disassociates the user with the provided Hedera token. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/grant-kyc: + put: + tags: + - tokens + description: >- + Sets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Sets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/revoke-kyc: + put: + tags: + - tokens + description: >- + Unsets the KYC flag for the user. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unsets the KYC flag for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/freeze: + put: + tags: + - tokens + description: >- + Freezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Freeze transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/push/{tokenId}/{username}/unfreeze: + put: + tags: + - tokens + description: >- + Unfreezes transfers of the specified token for the user. Only users with + the Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + summary: Unfreezes transfers of the specified token for the user. + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '202': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/{username}/info: + get: + tags: + - tokens + description: >- + Returns user information for the selected token. Only users with the + Standard Registry role are allowed to make the request. + security: + - bearerAuth: [] + parameters: + - in: path + name: tokenId + schema: + type: string + required: true + description: Token ID. + - in: path + name: username + schema: + type: string + required: true + description: Username. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TokenInfo' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tokens/{tokenId}/serials: + get: + operationId: TokensApi_getTokenSerials + summary: Return token serials. + description: Returns token serials of current user. + parameters: + - name: tokenId + required: true + in: path + description: Token identifier + example: 0.0.1 + schema: + type: string + responses: + '200': + description: Token serials. + content: + application/json: + schema: + type: array + items: + type: number + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_10 + security: + - bearerAuth: [] + /themes: + get: + tags: + - themes + description: Returns all themes. + security: + - bearerAuth: [] + summary: Return a list of all themes. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - themes + description: Creates a new theme. + security: + - bearerAuth: [] + summary: Creates a new theme. + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + responses: + '201': + description: Created. + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}: + put: + tags: + - themes + description: Updates theme configuration for the specified theme ID. + summary: Updates theme configuration. + parameters: + - in: path + name: themeId + description: Selected theme ID. + required: true + schema: + type: string + requestBody: + description: Object that contains theme configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - themes + description: Deletes the theme with the provided theme ID. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Theme ID. + security: + - bearerAuth: [] + summary: Deletes the theme. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/import/file: + post: + tags: + - themes + description: Imports new theme from the provided zip file into the local DB. + security: + - bearerAuth: [] + summary: Imports new theme from a zip file. + requestBody: + description: A zip file that contains the theme to be imported. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Theme' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /themes/{themeId}/export/file: + get: + tags: + - themes + description: Returns a zip file containing the theme. + parameters: + - in: path + name: themeId + schema: + type: string + required: true + description: Selected theme ID. + security: + - bearerAuth: [] + summary: Returns a zip file containing the theme. + responses: + '200': + description: Successful operation. Response zip file + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains: + get: + tags: + - trustchains + description: >- + Requests all VP documents. Only users with the Auditor role are allowed + to make the request. + security: + - bearerAuth: [] + summary: Returns a list of all VP documents. + parameters: + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + - in: query + name: policyId + schema: + type: string + description: Selected policy ID. + - in: query + name: policyOwner + schema: + type: string + description: Selected Standard Registry (DID). + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VerifiablePresentation' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /trust-chains/{hash}: + get: + tags: + - trustchains + description: >- + Builds and returns a trustchain, from the VP to the root VC document. + Only users with the Auditor role are allowed to make the request. + parameters: + - in: path + name: hash + schema: + type: string + required: true + description: Hash or ID of a VP document. + security: + - bearerAuth: [] + summary: Returns a trustchain for a VP document. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TrustChains' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/policy: + post: + tags: + - wizard + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + security: + - bearerAuth: [] + summary: Creates a new policy. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '201': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyId: + type: string + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /wizard/push/policy: + post: + operationId: WizardApi_setPolicyAsync + summary: Creates a new policy. + description: >- + Creates a new policy by wizard. Only users with the Standard Registry + role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + saveState: + type: boolean + wizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: + - wizard + /wizard/{policyId}/config: + post: + tags: + - wizard + description: >- + Get policy config by wizard. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier. + security: + - bearerAuth: [] + summary: Get policy config. + requestBody: + description: Object that contains wizard configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WizardConfig' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + policyConfig: + $ref: '#/components/schemas/PolicyConfig' + wizardConfig: + $ref: '#/components/schemas/WizardConfig' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /branding: + post: + operationId: BrandingApi_setBranding + parameters: [] + responses: + '401': + description: Unauthorized + tags: &ref_11 + - branding + security: + - bearerAuth: [] + get: + operationId: BrandingApi_getBranding + parameters: [] + responses: + '200': + description: '' + tags: *ref_11 + /suggestions: + post: + operationId: SuggestionsApi_policySuggestions + summary: Get next and nested suggested block types + description: >- + Get next and nested suggested block types. Only users with the Standard + Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsInputDTO' + responses: + '200': + description: >- + Successful operation. Suggested next and nested block types + respectively. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsOutputDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_12 + - suggestions + security: + - bearerAuth: [] + - bearerAuth: [] + /suggestions/config: + post: + operationId: SuggestionsApi_setPolicySuggestionsConfig + summary: Set suggestions config + description: >- + Set suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + responses: + '201': + description: Successful operation. Response setted suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearerAuth: [] + - bearerAuth: [] + get: + operationId: SuggestionsApi_getPolicySuggestionsConfig + summary: Get suggestions config + description: >- + Get suggestions config. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + responses: + '200': + description: Successful operation. Response suggestions config. + content: + application/json: + schema: + $ref: '#/components/schemas/SuggestionsConfigDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_12 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications: + get: + operationId: NotificationsApi_getAllNotifications + summary: Get all notifications + description: Returns all notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications and count. + headers: + X-Total-Count: + description: Count of notifications + schema: + type: number + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_13 + - notifications + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/new: + get: + operationId: NotificationsApi_getNewNotifications + summary: Get new notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns new notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/progresses: + get: + operationId: NotificationsApi_getProgresses + summary: Get progresses + description: Returns progresses. + parameters: [] + responses: + '200': + description: Successful operation. Returns progresses. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProgressDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/read/all: + post: + operationId: NotificationsApi_readAll + summary: Read all notifications + description: Returns new notifications. + parameters: [] + responses: + '200': + description: Successful operation. Returns notifications. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationDTO' + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /notifications/delete/{notificationId}: + delete: + operationId: NotificationsApi_delete + summary: Delete notifications up to this point + description: Returns deleted notifications count. + parameters: + - name: notificationId + required: true + in: path + schema: + type: string + responses: + '200': + description: Successful operation. Returns deleted notifications count. + content: + application/json: + schema: + type: number + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_13 + security: + - bearerAuth: [] + - bearerAuth: [] + /projects/search: + post: + operationId: ProjectsAPI_projectSearch + summary: Search projects + description: Search projects by filters + parameters: [] + requestBody: + required: true + description: The question of choosing a methodology + content: + application/json: + schema: + type: string + examples: + q: + value: >- + What methodology can I use for production of electricity using + renewable energy technologies? + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProjectDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_14 + - projects + /projects/compare/documents: + post: + operationId: ProjectsAPI_compareDocuments + summary: Compare documents. + description: Compare documents. + parameters: [] + requestBody: + required: true + description: Filters. + content: + application/json: + schema: + $ref: '#/components/schemas/FilterDocumentsDTO' + examples: + Filter1: + value: + documentId1: '000000000000000000000001' + documentId2: '000000000000000000000002' + Filter2: + value: + documentIds: + - '000000000000000000000001' + - '000000000000000000000002' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/CompareDocumentsDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + /projects/properties: + get: + operationId: ProjectsAPI_getPolicyProperties + summary: Get all properties + description: Get all properties + parameters: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PropertiesDTO' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_14 + /record/{policyId}/status: + get: + operationId: RecordApi_getRecordStatus + summary: Get recording or running status. + description: >- + Get recording or running status. Only users with the Standard Registry + role are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RecordStatusDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_15 + - record + security: + - bearerAuth: [] + + /record/{policyId}/recording/start: + post: + operationId: RecordApi_startRecord + summary: Start recording. + description: >- + Start recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/recording/stop: + post: + operationId: RecordApi_stopRecord + summary: Stop recording. + description: >- + Stop recording. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: string + format: binary + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/recording/actions: + get: + operationId: RecordApi_getRecordActions + summary: Get recorded actions. + description: >- + Get recorded actions. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecordActionDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/start: + post: + operationId: RecordApi_runRecord + summary: Run record from a zip file. + description: >- + Run record from a zip file. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: A zip file containing record to be run. + content: + application/json: + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/stop: + post: + operationId: RecordApi_stopRunning + summary: Stop running. + description: >- + Stop running. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/results: + get: + operationId: RecordApi_getRecordResults + summary: Get running results. + description: >- + Get running results. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningResultDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/details: + get: + operationId: RecordApi_getRecordDetails + summary: Get running details. + description: >- + Get running details. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RunningDetailsDTO' + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/fast-forward: + post: + operationId: RecordApi_fastForward + summary: Fast Forward. + description: >- + Fast Forward. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/retry: + post: + operationId: RecordApi_retryStep + summary: Retry step. + description: >- + Retry step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /record/{policyId}/running/skip: + post: + operationId: RecordApi_skipStep + summary: Skip step. + description: >- + Skip step. Only users with the Standard Registry role are allowed to + make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy Id + schema: + type: string + requestBody: + required: true + description: Object that contains options + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_15 + security: + - bearerAuth: [] + + /ai-suggestions/ask: + get: + operationId: AISuggestionsAPI_getAIAnswer + summary: Get methodology suggestion + description: Returns AI response to the current question + parameters: + - name: q + required: true + in: query + description: The question of choosing a methodology + schema: + type: string + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + example: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018 + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: &ref_16 + - ai-suggestions + /ai-suggestions/rebuild-vector: + put: + operationId: AISuggestionsAPI_rebuildVector + summary: Rebuild AI vector + description: Rebuilds vector based on policy data in the DB + parameters: [] + responses: + '200': + description: '' + tags: *ref_16 + /schemas/type/{type}: + get: + tags: + - schemas + description: Finds the schema using the json document type. + parameters: + - in: path + name: type + schema: + type: string + required: true + description: JSON type. + security: + - bearerAuth: [] + summary: Returns schema by type. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}: + get: + tags: + - policies + description: >- + Requests block ID from a policy by tag. Only users with the Standard + Registry and Installer roles are allowed to make the request. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Selected policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + summary: Requests block ID from a policy by tag. + security: + - bearerAuth: [] + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + properties: + id: + type: string + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /policies/{policyId}/tag/{tag}/blocks: + post: + tags: + - policies + description: Sends data to the specified block. + security: + - bearerAuth: [] + summary: Sends data to the specified block. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + requestBody: + description: Object with the data to be sent to the block. + required: true + content: + application/json: + schema: + type: object + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - policies + description: >- + Requests block data by tag. Only users with a role that described in + block are allowed to make the request. + security: + - bearerAuth: [] + summary: Requests block data. + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy ID. + - in: path + name: tag + schema: + type: string + required: true + description: Tag from the selected policy. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyBlockData' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /ipfs/file/: + post: + tags: + - ipfs + description: Add file to ipfs. + summary: Add file to ipfs. + requestBody: + description: Data array of file. + required: true + content: + binary/octet-stream: + schema: + type: string + format: binary + security: + - bearerAuth: [] + responses: + '201': + description: Created. + content: + application/json: + schema: + description: CID of added file. + type: string + '401': + description: Unauthorized. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifacts/{policyId}: + post: + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact: + get: + deprecated: true + tags: + - artifacts + description: Returns all artifacts. + security: + - bearerAuth: [] + summary: Returns all artifacts. + parameters: + - in: query + name: policyId + schema: + type: string + description: Policy identifier + - in: query + name: pageIndex + schema: + type: integer + description: >- + The number of pages to skip before starting to collect the result + set + examples: + pageIndex: + summary: Example of a pageIndex + value: 0 + - in: query + name: pageSize + schema: + type: integer + description: The numbers of items to return + examples: + pageSize: + summary: Example of a pageSize + value: 100 + responses: + '200': + description: Successful operation. + headers: + x-total-count: + schema: + type: integer + description: Total items in the collection. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{policyId}: + post: + deprecated: true + tags: + - artifacts + description: Upload artifact. For users with the Standard Registry role only. + security: + - bearerAuth: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + artifacts: + type: array + items: + type: string + format: binary + parameters: + - in: path + name: policyId + schema: + type: string + required: true + description: Policy identifier + summary: Upload Artifact. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Artifact' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /artifact/{artifactId}: + delete: + deprecated: true + tags: + - artifacts + description: Delete artifact. + security: + - bearerAuth: [] + summary: Delete artifact. + parameters: + - in: path + name: artifactId + schema: + type: string + required: true + description: Artifact identifier + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: boolean + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /tags/: + post: + tags: + - tags + description: Creates new tag. + security: + - bearerAuth: [] + summary: Creates new tag. + requestBody: + description: Object that contains tag information. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + responses: + '201': + description: Created. + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +info: + title: Guardian + description: >- + The Guardian is a modular open-source solution that includes best-in-class + identity management and decentralized ledger technology (DLT) libraries. At + the heart of the Guardian solution is a sophisticated Policy Workflow Engine + (PWE) that enables applications to offer a requirements-based tokenization + implementation. + version: 2.23.1 + contact: + name: API developer + url: https://envisionblockchain.com + email: info@envisionblockchain.com + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +tags: [] +servers: + - url: /api/v1 + description: version 1.0 +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + AccountsResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + did: + type: string + required: + - username + - role + - did + InternalServerErrorDTO: + type: object + properties: + code: + type: number + message: + type: string + required: + - code + - message + RegisterUserDTO: + type: object + properties: + username: + type: string + password: + type: string + password_confirmation: + type: string + role: + type: string + required: + - username + - password + - password_confirmation + - role + AccountsSessionResponseDTO: + type: object + properties: + username: + type: string + role: + type: string + accessToken: + type: string + required: + - username + - role + - accessToken + LoginUserDTO: + type: object + properties: + username: + type: string + password: + type: string + required: + - username + - password + CredentialSubjectDTO: + type: object + properties: + geography: + type: string + law: + type: string + tags: + type: string + ISIC: + type: string + '@context': + type: array + items: + type: string + id: + type: string + type: + type: string + required: + - geography + - law + - tags + - ISIC + - '@context' + - id + - type + ProofDTO: + type: object + properties: + type: + type: string + created: + format: date-time + type: string + verificationMethod: + type: string + proofPurpose: + type: string + jws: + type: string + required: + - type + - created + - verificationMethod + - proofPurpose + - jws + VcDocumentDTO: + type: object + properties: + id: + type: string + type: + type: array + items: + type: string + issuer: + type: string + issuanceDate: + format: date-time + type: string + '@context': + type: array + items: + type: string + credentialSubject: + $ref: '#/components/schemas/CredentialSubjectDTO' + proof: + $ref: '#/components/schemas/ProofDTO' + required: + - id + - type + - issuer + - issuanceDate + - '@context' + - credentialSubject + - proof + PolicyDTO: + type: object + properties: + _id: + type: string + createDate: + format: date-time + type: string + uuid: + type: string + name: + type: string + description: + type: string + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + policyTag: + type: string + codeVersion: + type: string + userRoles: + type: array + items: + type: string + userGroups: + type: array + items: + type: string + userRole: + type: string + userGroup: + type: string + id: + type: string + required: + - _id + - createDate + - uuid + - name + - description + - status + - creator + - owner + - topicId + - policyTag + - codeVersion + - userRoles + - userGroups + - userRole + - userGroup + - id + AggregatedDTOItem: + type: object + properties: + did: + type: string + hederaAccountId: + type: string + vcDocument: + $ref: '#/components/schemas/VcDocumentDTO' + policies: + $ref: '#/components/schemas/PolicyDTO' + required: + - did + - hederaAccountId + - vcDocument + - policies + UserDTO: + type: object + properties: + username: + type: string + did: + type: string + required: + - username + - did + BalanceResponseDTO: + type: object + properties: + balance: + type: number + unit: + type: string + user: + $ref: '#/components/schemas/UserDTO' + required: + - balance + - unit + - user + FilterSearchPoliciesDTO: + type: object + properties: + policyId: + type: string + required: + - policyId + SearchPoliciesDTO: + type: object + properties: + target: + type: object + result: + type: object + required: + - target + - result + FilterPoliciesDTO: + type: object + properties: + policyId1: + type: string + policyId2: + type: string + policyIds: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - policyId1 + - policyId2 + - policyIds + - eventsLvl + - propLvl + - childrenLvl + - idLvl + ComparePoliciesDTO: + type: object + properties: + blocks: + type: object + groups: + type: object + left: + type: object + right: + type: object + roles: + type: object + tokens: + type: object + topics: + type: object + total: + type: object + required: + - blocks + - groups + - left + - right + - roles + - tokens + - topics + - total + FilterModulesDTO: + type: object + properties: + moduleId1: + type: string + moduleId2: + type: string + eventsLvl: + type: number + propLvl: + type: number + childrenLvl: + type: number + idLvl: + type: number + required: + - moduleId1 + - moduleId2 + - eventsLvl + - propLvl + - childrenLvl + - idLvl + CompareModulesDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + FilterSchemasDTO: + type: object + properties: + schemaId1: + type: string + schemaId2: + type: string + idLvl: + type: number + required: + - schemaId1 + - schemaId2 + - idLvl + CompareSchemasDTO: + type: object + properties: + fields: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - fields + - left + - right + - total + FilterDocumentsDTO: + type: object + properties: + documentId1: + type: string + documentId2: + type: string + documentIds: + type: string + required: + - documentId1 + - documentId2 + - documentIds + CompareDocumentsDTO: + type: object + properties: + documents: + type: object + left: + type: object + right: + type: object + total: + type: object + required: + - documents + - left + - right + - total + FilterToolsDTO: + type: object + properties: + toolId1: + type: string + toolId2: + type: string + toolIds: + type: string + required: + - toolId1 + - toolId2 + - toolIds + CompareToolsDTO: + type: object + properties: + blocks: + type: object + left: + type: object + right: + type: object + inputEvents: + type: object + outputEvents: + type: object + variables: + type: object + total: + type: object + required: + - blocks + - left + - right + - inputEvents + - outputEvents + - variables + - total + ArtifactDTOItem: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + required: + - id + - name + - uuid + - extention + - type + ContractDTO: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + permissions: + type: number + topicId: + type: string + type: + type: string + enum: + - WIPE + - RETIRE + syncRequestsDate: + format: date-time + type: string + syncPoolsDate: + format: date-time + type: string + lastSyncEventTimeStamp: + type: string + wipeContractIds: + type: array + items: + type: string + required: + - id + - contractId + - description + - owner + - permissions + - topicId + - type + - syncRequestsDate + - syncPoolsDate + - lastSyncEventTimeStamp + - wipeContractIds + WiperRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + user: + type: string + required: + - id + - contractId + - user + RetireRequestDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + user: + type: string + required: + - id + - contractId + - tokens + - tokenIds + - user + Date: + type: object + properties: {} + RetirePoolDTO: + type: object + properties: + id: + type: string + contractId: + type: string + tokens: + type: object + properties: + token: + type: string + contract: + type: string + count: + type: number + decimals: + type: number + type: + enum: + - non-fungible + - fungible + tokenSymbol: + type: string + tokenIds: + type: array + items: + type: string + immediately: + type: boolean + enabled: + type: boolean + required: + - id + - contractId + - tokens + - tokenIds + - immediately + - enabled + RetirePoolTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + required: + - token + - count + RetireRequestTokenDTO: + type: object + properties: + token: + type: string + count: + type: number + serials: + type: array + items: + type: string + required: + - token + - count + - serials + ProfileDTO: + type: object + properties: + username: + type: string + nullable: false + role: + type: string + nullable: false + did: + type: string + nullable: true + parent: + type: string + nullable: true + hederaAccountId: + type: string + nullable: true + confirmed: + type: boolean + nullable: true + failed: + type: boolean + nullable: true + topicId: + type: string + nullable: true + parentTopicId: + type: string + nullable: true + didDocument: + type: object + nullable: true + vcDocument: + type: object + nullable: true + required: + - username + - role + SubjectDTO: + type: object + properties: + '@context': + nullable: true + type: array + items: + type: string + id: + type: string + nullable: true + type: + type: string + nullable: true + required: + - '@context' + DidDocumentDTO: + type: object + properties: + id: + type: string + nullable: false + context: + nullable: true + type: array + items: + type: string + alsoKnownAs: + nullable: true + type: array + items: + type: string + controller: + nullable: true + type: array + items: + type: string + verificationMethod: + nullable: true + type: array + items: + type: object + authentication: + nullable: true + type: array + items: + type: object + assertionMethod: + nullable: true + type: array + items: + type: object + keyAgreement: + nullable: true + type: array + items: + type: object + capabilityInvocation: + nullable: true + type: array + items: + type: object + capabilityDelegation: + nullable: true + type: array + items: + type: object + service: + nullable: true + type: array + items: + type: object + required: + - id + - context + - alsoKnownAs + - controller + - verificationMethod + - authentication + - assertionMethod + - keyAgreement + - capabilityInvocation + - capabilityDelegation + - service + DidKeyDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + required: + - id + - key + CredentialsDTO: + type: object + properties: + entity: + type: string + nullable: false + hederaAccountId: + type: string + nullable: false + hederaAccountKey: + type: string + nullable: false + parent: + type: string + nullable: true + vcDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/SubjectDTO' + didDocument: + nullable: true + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + didKeys: + nullable: true + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - entity + - hederaAccountId + - hederaAccountKey + TaskDTO: + type: object + properties: + taskId: + type: string + expectation: + type: number + required: + - taskId + - expectation + DidDocumentStatusDTO: + type: object + properties: + valid: + type: boolean + nullable: false + error: + type: string + nullable: true + didDocument: + type: object + nullable: false + required: + - valid + - error + - didDocument + DidDocumentWithKeyDTO: + type: object + properties: + document: + nullable: false + allOf: + - $ref: '#/components/schemas/DidDocumentDTO' + keys: + nullable: false + type: array + items: + $ref: '#/components/schemas/DidKeyDTO' + required: + - document + - keys + DidKeyStatusDTO: + type: object + properties: + id: + type: string + nullable: false + key: + type: string + nullable: false + valid: + type: boolean + nullable: false + required: + - id + - key + - valid + MigrationConfigPoliciesDTO: + type: object + properties: + src: + type: string + dst: + type: string + required: + - src + - dst + MigrationConfigDTO: + type: object + properties: + policies: + $ref: '#/components/schemas/MigrationConfigPoliciesDTO' + vcs: + type: array + items: + type: string + vps: + type: array + items: + type: string + schemas: + type: object + groups: + type: object + roles: + type: object + required: + - policies + - vcs + - vps + - schemas + - groups + - roles + PolicyCategoryDTO: + type: object + properties: + id: + type: string + name: + type: string + type: + type: string + required: + - id + - name + - type + SchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + entity: + type: string + document: + type: string + uuid: + type: string + iri: + type: string + hash: + type: string + status: + type: string + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - entity + - document + - uuid + - iri + - hash + - status + - topicId + - version + - owner + - messageId + VersionSchemaDTO: + type: object + properties: + version: + type: string + required: + - version + MessageSchemaDTO: + type: object + properties: + messageId: + type: string + required: + - messageId + ExportSchemaDTO: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + required: + - id + - name + - description + - version + - owner + - messageId + SystemSchemaDTO: + type: object + properties: + name: + type: string + entity: + type: string + required: + - name + - entity + SettingsDTO: + type: object + properties: + ipfsStorageApiKey: + type: string + operatorId: + type: string + operatorKey: + type: string + required: + - ipfsStorageApiKey + - operatorId + - operatorKey + SuggestionsInputDTO: + type: object + properties: + blockType: + type: string + children: + nullable: true + type: array + items: + type: object + required: + - blockType + - children + SuggestionsOutputDTO: + type: object + properties: + next: + type: string + nested: + type: string + required: + - next + - nested + SuggestionsConfigItemDTO: + type: object + properties: + id: + type: string + type: + type: string + enum: + - Policy + - Module + index: + type: number + required: + - id + - type + - index + SuggestionsConfigDTO: + type: object + properties: + items: + $ref: '#/components/schemas/SuggestionsConfigItemDTO' + required: + - items + NotificationDTO: + type: object + properties: + title: + type: string + message: + type: string + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + action: + type: string + enum: + - POLICY_CONFIGURATION + - POLICY_VIEW + - POLICIES_PAGE + - SCHEMAS_PAGE + - TOKENS_PAGE + - PROFILE_PAGE + result: + type: object + read: + type: boolean + old: + type: boolean + required: + - title + - message + - type + - action + - result + - read + - old + ProgressDTO: + type: object + properties: + action: + type: string + message: + type: string + progress: + type: number + type: + type: string + enum: + - INFO + - ERROR + - WARN + - SUCCESS + taskId: + type: string + required: + - action + - message + - progress + - type + - taskId + ProjectDTO: + type: object + properties: + id: + type: string + policyId: + type: string + policyName: + type: string + registered: + type: string + title: + type: string + companyName: + type: string + sectoralScope: + type: string + required: + - id + - policyId + - policyName + - registered + - title + - companyName + - sectoralScope + PropertiesDTO: + type: object + properties: + id: + type: string + title: + type: string + value: + type: string + required: + - id + - title + - value + RecordStatusDTO: + type: object + properties: + type: + type: string + policyId: + type: string + uuid: + type: string + status: + type: string + required: + - type + - policyId + - uuid + - status + Object: + type: object + properties: {} + RecordActionDTO: + type: object + properties: + uuid: + type: string + policyId: + type: string + method: + type: string + action: + type: string + time: + type: string + user: + type: string + target: + type: string + required: + - uuid + - policyId + - method + - action + - time + - user + - target + ResultInfoDTO: + type: object + properties: + tokens: + type: number + documents: + type: number + required: + - tokens + - documents + ResultDocumentDTO: + type: object + properties: + type: + type: string + schema: + type: string + rate: + type: string + documents: + type: object + required: + - type + - schema + - rate + - documents + RunningResultDTO: + type: object + properties: + info: + $ref: '#/components/schemas/ResultInfoDTO' + total: + type: number + documents: + $ref: '#/components/schemas/ResultDocumentDTO' + required: + - info + - total + - documents + RunningDetailsDTO: + type: object + properties: + left: + type: object + right: + type: object + total: + type: number + documents: + type: object + required: + - left + - right + - total + - documents + RegisteredUsersDTO: + type: object + properties: + username: + type: string + did: + type: string + parent: + type: string + role: + type: string + policyRoles: + type: array + items: + type: string + required: + - username + - did + - parent + - role + - policyRoles + ToolDTO: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + required: + - id + - uuid + - name + - description + - config + - status + - creator + - owner + - topicId + - messageId + - codeVersion + - createDate + Credentials: + type: object + required: + - username + - password + properties: + username: + type: string + password: + type: string + Account: + type: object + required: + - username + - role + properties: + username: + type: string + role: + type: string + did: + type: string + Session: + type: object + required: + - username + - role + - accessToken + properties: + username: + type: string + role: + type: string + accessToken: + type: string + User: + type: object + required: + - username + - role + properties: + confirmed: + type: string + failed: + type: string + username: + type: string + role: + type: string + hederaAccountId: + type: string + hederaAccountKey: + type: string + did: + type: string + didDocument: + type: object + vcDocument: + type: object + parent: + type: string + topicId: + type: string + Schema: + type: object + required: + - id + - name + - description + - entity + - document + properties: + id: + type: string + iri: + type: string + uuid: + type: string + name: + type: string + description: + type: string + entity: + type: string + hash: + type: string + status: + type: string + document: + oneOf: + - type: string + - type: object + topicId: + type: string + version: + type: string + owner: + type: string + messageId: + type: string + ImportSchema: + type: object + required: + - schemes + properties: + schemes: + type: array + items: + type: object + required: + - document + - entity + - name + - uuid + properties: + document: + type: string + entity: + type: string + hash: + type: string + name: + type: string + uuid: + type: string + ExportSchema: + type: object + required: + - ids + properties: + name: + type: string + version: + type: string + messageId: + type: string + Token: + type: object + required: + - changeSupply + - decimals + - enableAdmin + - enableKYC + - enableFreeze + - enableWipe + - initialSupply + - tokenName + - tokenSymbol + - tokenType + properties: + changeSupply: + type: boolean + decimals: + type: string + enableAdmin: + type: boolean + enableFreeze: + type: boolean + enableKYC: + type: boolean + enableWipe: + type: boolean + initialSupply: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + TokenInfo: + type: object + required: + - id + - tokenId + - tokenName + - tokenSymbol + - tokenType + - decimals + - associated + - balance + - frozen + - kyc + properties: + id: + type: string + tokenId: + type: string + tokenName: + type: string + tokenSymbol: + type: string + tokenType: + type: string + decimals: + type: string + associated: + type: boolean + balance: + type: string + frozen: + type: boolean + kyc: + type: boolean + enableAdmin: + type: boolean + enableKYC: + type: boolean + enableFreeze: + type: boolean + enableWipe: + type: boolean + PolicyConfig: + type: object + required: + - name + - version + - description + - topicDescription + - config + - topicId + - policyTag + properties: + id: + type: string + uuid: + type: string + name: + type: string + version: + type: string + description: + type: string + topicDescription: + type: string + config: + type: object + status: + type: string + owner: + type: string + policyRoles: + type: array + items: + type: string + topicId: + type: string + policyTag: + type: string + policyTopics: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + type: + type: string + static: + type: boolean + TrustChains: + type: object + required: + - chain + - userMap + properties: + chain: + type: array + items: + type: object + required: + - id + - type + - tag + - label + - schema + - owner + - document + properties: + id: + type: string + type: + type: string + tag: + type: string + label: + type: string + schema: + type: string + owner: + type: string + document: + type: object + userMap: + type: array + items: + type: object + required: + - did + - username + properties: + did: + type: string + username: + type: string + VerifiablePresentation: + type: object + required: + - hash + - id + - policyId + - signature + - status + - tag + - type + - updateDate + - createDate + - owner + - document + properties: + hash: + type: string + id: + type: string + policyId: + type: string + signature: + type: string + status: + type: string + tag: + type: string + type: + type: string + updateDate: + type: string + createDate: + type: string + owner: + type: string + document: + type: object + PublishPolicy: + type: object + required: + - errors + - isValid + - policies + properties: + errors: + type: array + items: + type: object + isValid: + type: boolean + policies: + type: array + items: + type: object + ValidatePolicy: + type: object + required: + - config + - results + properties: + config: + type: object + results: + type: object + PolicyBlock: + type: object + required: + - id + - blockType + - isActive + - uiMetaData + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + blocks: + type: array + items: + type: object + PolicyBlockData: + type: object + required: + - id + - isActive + - uiMetaData + - data + properties: + id: + type: string + blockType: + type: string + isActive: + type: boolean + uiMetaData: + type: object + data: + type: object + fields: + type: array + items: + type: object + index: + type: number + roles: + type: array + items: + type: string + blocks: + type: array + items: + $ref: '#/components/schemas/PolicyBlock' + ExportPolicy: + type: object + required: + - name + - version + - messageId + properties: + name: + type: string + version: + type: string + tokens: + type: string + PreviewPolicy: + type: object + required: + - policy + - schemas + - tokens + properties: + policy: + type: object + schemas: + type: array + items: + type: object + tokens: + type: array + items: + type: object + Error: + type: object + required: + - code + - message + properties: + code: + type: number + message: + type: string + ExternalData: + type: object + required: + - owner + - policyTag + - document + properties: + owner: + type: string + policyTag: + type: string + document: + type: object + HederaAccount: + type: object + required: + - id + - key + properties: + id: + type: string + key: + type: string + CommonSettings: + type: object + properties: + operatorId: + type: string + operatorKey: + type: string + nftApiKey: + deprecated: true + type: string + ipfsStorageApiKey: + type: string + LogFilters: + type: object + properties: + type: + type: string + startDate: + type: string + endDate: + type: string + attributes: + type: array + items: + type: string + message: + type: string + pageSize: + type: number + pageIndex: + type: number + sortDirection: + type: string + enum: + - ASC + - DESC + Log: + type: object + properties: + type: + type: string + datetime: + type: string + message: + type: string + attributes: + type: array + items: + type: string + Task: + type: object + properties: + taskId: + type: string + expectation: + type: number + TaskStatus: + type: object + properties: + date: + type: string + name: + type: string + statuses: + type: array + items: + type: object + properties: + type: + type: string + message: + type: string + result: + type: object + error: + type: object + Artifact: + type: object + properties: + id: + type: string + name: + type: string + uuid: + type: string + extention: + type: string + type: + type: string + MultiPolicyConfig: + type: object + properties: + id: + type: string + uuid: + type: string + owner: + type: string + type: + type: string + instanceTopicId: + type: string + mainPolicyTopicId: + type: string + synchronizationTopicId: + type: string + policyOwner: + type: string + user: + type: string + Contract: + type: object + properties: + id: + type: string + contractId: + type: string + description: + type: string + owner: + type: string + isOwnerCreator: + type: string + status: + type: string + RetireRequest: + type: object + properties: + id: + type: string + contractId: + type: string + baseTokenId: + type: string + owner: + type: string + oppositeTokenId: + type: string + baseTokenCount: + type: number + oppositeTokenCount: + type: number + Module: + type: object + properties: + id: + type: string + uuid: + type: string + name: + type: string + description: + type: string + config: + type: object + status: + type: string + creator: + type: string + owner: + type: string + topicId: + type: string + messageId: + type: string + codeVersion: + type: string + createDate: + type: string + type: + type: string + PreviewModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + ExportModule: + type: object + properties: + uuid: + type: string + name: + type: string + description: + type: string + messageId: + type: string + owner: + type: string + PublishModule: + type: object + properties: + errors: + type: object + isValid: + type: boolean + module: + $ref: '#/components/schemas/Module' + ValidateModule: + type: object + properties: + module: + $ref: '#/components/schemas/Module' + results: + type: object + Tag: + type: object + required: + - name + - entity + - localTarget + properties: + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Tag label + description: + type: string + example: Description + owner: + type: string + example: did + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: '0000000000.000000000' + localTarget: + type: string + example: db id + status: + type: string + enum: + - Draft + - Published + - History + example: Published + operation: + type: string + enum: + - Create + - Delete + example: Create + date: + type: string + example: '1900-01-01T00:00:00.000Z' + topicId: + type: string + example: 0.0.0000000 + messageId: + type: string + example: '0000000000.000000000' + policyId: + type: string + example: db id + uri: + type: string + example: document uri + document: + type: object + TagMap: + type: object + required: + - entity + - target + - refreshDate + - tags + properties: + entity: + type: string + enum: + - Schema + - Policy + - Token + - Module + - Contract + - PolicyDocument + example: PolicyDocument + target: + type: string + example: db id + refreshDate: + type: string + example: '1900-01-01T00:00:00.000Z' + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + Theme: + type: object + required: + - uuid + - name + - rules + properties: + id: + type: string + example: db id + uuid: + type: string + example: 00000000-0000-0000-0000-000000000000 + name: + type: string + example: Theme name + rules: + type: array + items: + type: object + required: + - text + - background + - border + - shape + - borderWidth + - filterType + - filterValue + properties: + description: + type: string + example: description + text: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + background: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + border: + type: string + pattern: (^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{8}$) + example: '#000000' + shape: + type: string + enum: + - '0' + - '1' + - '2' + - '3' + - '4' + - '5' + example: '0' + borderWidth: + type: string + enum: + - 0px + - 1px + - 2px + - 3px + - 4px + - 5px + - 6px + - 7px + example: 2px + filterType: + type: string + enum: + - type + - api + - role + example: type + filterValue: + oneOf: + - type: string + - type: array + items: + type: string + example: + - type + WizardConfig: + type: object + required: + - policy + - roles + - schemas + - trustChain + properties: + roles: + type: array + items: + type: string + policy: + type: object + properties: + name: + type: string + description: + type: string + topicDescription: + type: string + policyTag: + type: string + schemas: + type: array + items: + type: object + properties: + name: + type: string + iri: + type: string + isApproveEnable: + type: boolean + isMintSchema: + type: boolean + mintOptions: + type: object + properties: + tokenId: + type: string + rule: + type: string + dependencySchemaIri: + type: string + relationshipsSchemaIri: + type: string + initialRolesFor: + type: array + items: + type: string + rolesConfig: + type: array + items: + type: object + properties: + role: + type: string + isApprover: + type: boolean + isCreator: + type: boolean + gridColumns: + type: array + items: + type: object + properties: + field: + type: string + title: + type: string + trustChain: + type: array + items: + type: object + properties: + role: + type: string + mintSchemaIri: + type: string + viewOnlyOwnDocuments: + type: boolean diff --git a/docs/README.md b/docs/README.md index 4c811534f3..93d4bdfe28 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,3 @@ # 🌏 Getting Started -Guardian is a modular open-source solution that includes best-in-class identity management and Decentralized Ledger Technology (DLT) libraries. At the heart of the Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a requirements-based tokenization implementation. +The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets. diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 2bb5291519..6ee8f32f1b 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -49,6 +49,8 @@ * [🔺 High Level Architecture](guardian/architecture/architecture-2.md) * [👏 Policies,Projects and Topics Mapping Architecture](guardian/architecture/schema-architecture.md) * [➗ MRV Splitting Logic](guardian/architecture/mrv-splitting-logic.md) + * [🔑 Internal (with Vault)Signing Sequence Diagram](guardian/architecture/internal-with-vault-signing-sequence-diagram.md) + * [🔥 FireBlocks Signing Sequence Diagram](guardian/architecture/fireblocks-signing-sequence-diagram.md) * [🗄️ Standard Registry](guardian/standard-registry/README.md) * [🛠️ Schemas](guardian/standard-registry/schemas/README.md) * [📂 Available Schema Types](guardian/standard-registry/schemas/available-schema-types.md) @@ -150,6 +152,7 @@ * [historyAddon](guardian/standard-registry/policies/policy-creation/introduction/historyaddon.md) * [selectiveAttributes Block](guardian/standard-registry/policies/policy-creation/introduction/selectiveattributes-block.md) * [tagsManagerBlock](guardian/standard-registry/policies/policy-creation/introduction/tagsmanagerblock.md) + * [externalDataBlock](guardian/standard-registry/policies/policy-creation/introduction/externaldatablock.md) * [externalTopicBlock](guardian/standard-registry/policies/policy-creation/introduction/externaltopicblock.md) * [messagesReportBlock](guardian/standard-registry/policies/policy-creation/introduction/messagesreportblock.md) * [notificationBlock](guardian/standard-registry/policies/policy-creation/introduction/notificationblock.md) @@ -205,12 +208,14 @@ * [Make the selected Group active](guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/make-the-selected-group-active.md) * [Creating link between policies](guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/creating-link-between-policies.md) * [Requesting Multi Policy Config](guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/requesting-multi-policy-config.md) + * [Importing Policy from a Zip file with Metadata](guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/importing-policy-from-a-zip-file-with-metadata.md) * [⚙️ APIs for Asynchronous Execution](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/README.md) * [Creates new Policy](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/creates-new-policy.md) * [Publishing a Policy](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/publishing-a-policy.md) * [Importing a Policy from IPFS](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-a-policy-from-ipfs.md) * [Importing a Policy from file](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-a-policy-from-file.md) * [Policy Review](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/policy-review.md) + * [Importing Policy from a Zip file with Metadata](guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-policy-from-a-zip-file-with-metadata.md) * [📁 Dry Run](guardian/standard-registry/policies/dry-run/README.md) * [💻 Dry Run Mode using UI](guardian/standard-registry/policies/dry-run/demo-guide-on-dry-run-operations.md) * [⚙️ Dry Run Mode using APIs](guardian/standard-registry/policies/dry-run/dry-run-mode-using-apis/README.md) @@ -277,6 +282,8 @@ * [Imports new tool from Zip Asynchronously](guardian/standard-registry/policies/tools/tools-apis/imports-new-tool-from-zip-asynchronously.md) * [Imports new tool from IPFS Asynchronously](guardian/standard-registry/policies/tools/tools-apis/imports-new-tool-from-ipfs-asynchronously.md) * [Returns List of Tools](guardian/standard-registry/policies/tools/tools-apis/returns-list-of-tools-1.md) + * [Importing Tool from a Zip file](guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file.md) + * [Importing Tool from a Zip file asynchronously](guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file-asynchronously.md) * [📁 Modules](guardian/standard-registry/policies/modules/README.md) * [💻 Modules using UI](guardian/standard-registry/policies/modules/modules-using-ui.md) * [⚙️ Modules APIs](guardian/standard-registry/policies/modules/modules-apis/README.md) @@ -397,6 +404,17 @@ * [MigratePolicy Data](guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md) * [Migrate Policy Data Asynchronous](guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migrate-policy-data-asynchronous.md) * [Get Policy Documents](guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/get-policy-documents.md) + * [📁 Live Project Data Migration](guardian/standard-registry/live-project-data-migration/README.md) + * [↔️ Live Project Data Migration UI](guardian/standard-registry/live-project-data-migration/live-project-data-migration-ui.md) + * [⚙️ APIs related to Live Project Data Migration](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/README.md) + * [Getting Policy Data](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-data.md) + * [Uploading Policy Data](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-data.md) + * [Getting Policy Tag Block Map](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-tag-block-map.md) + * [Getting Policy Virtual Keys](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-virtual-keys.md) + * [Uploading Policy Virtual Keys](guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-virtual-keys.md) + * [🔥 FireBlocks Raw Signing](guardian/standard-registry/fireblocks-raw-signing/README.md) + * [Fireblocks signing in Guardian UI](guardian/standard-registry/fireblocks-raw-signing/fireblocks-signing-in-guardian-ui.md) + * [Getting Keys from FireBlocks UI](guardian/standard-registry/fireblocks-raw-signing/getting-keys-from-fireblocks-ui.md) * [📁 TrustChain](guardian/standard-registry/trustchain/README.md) * [⚙️ TrustChain APIs](guardian/standard-registry/trustchain/trustchain-apis/README.md) * [Requesting](guardian/standard-registry/trustchain/trustchain-apis/requesting.md) @@ -530,6 +548,7 @@ * [🌲 Verra Afforestation, Reforestation, and Revegetation (ARR) v0.1](guardian/demo-guide/carbon-offsets/verra-afforestation-reforestation-and-revegetation-arr-v0.1.md) * [🌲 Gold Standard Afforestation and Reforestation (AR) v2.0](guardian/demo-guide/carbon-offsets/gold-standard-afforestation-and-reforestation-ar-v2.0.md) * [🍃 Dovu Methodologies](guardian/demo-guide/carbon-offsets/dovu-methodologies.md) + * [🍀 Dovu MMCM](guardian/demo-guide/carbon-offsets/dovu-mmcm.md) * [♨️ Improved Cookstove](guardian/demo-guide/carbon-offsets/improved-cookstove.md) * [♨️ GoldStandard - Metered Energy Cooking](guardian/demo-guide/carbon-offsets/goldstandard-metered-energy-cooking.md) * [🍀 Carbon Reduction Measurement - GHG Corporate Standard Policy Guid](guardian/demo-guide/carbon-offsets/carbon-reduction-measurement-ghg-corporate-standard-policy-guide.md) @@ -563,6 +582,7 @@ * [💻 Remote GHG Policy Demo Guide](guardian/demo-guide/carbon-emissions/remote-work-ghg-policy/remote-ghg-policy-demo-guide.md) * [🏢 Carbon Emissions Measurement - GHG Corporate Standard Policy Guide](guardian/demo-guide/carbon-emissions/carbon-emissions-measurement-ghg-corporate-standard-policy-guide.md) * [🏭 atma GHG Scope II Carbon Emission Policy](guardian/demo-guide/carbon-emissions/atma-ghg-scope-ii-carbon-emission-policy.md) + * [🏭 Atma Scope 3 GHG Policy](guardian/demo-guide/carbon-emissions/atma-scope-3-ghg-policy.md) * [🏭 GHGP Corporate Standard](guardian/demo-guide/carbon-emissions/ghgp-corporate-standard.md) * [🏭 GHGP Corporate Standard V2](guardian/demo-guide/carbon-emissions/ghgp-corporate-standard-v2.md) * [❓ FAQs](guardian/faqs.md) diff --git a/docs/guardian/architecture/fireblocks-signing-sequence-diagram.md b/docs/guardian/architecture/fireblocks-signing-sequence-diagram.md new file mode 100644 index 0000000000..93497e22ec --- /dev/null +++ b/docs/guardian/architecture/fireblocks-signing-sequence-diagram.md @@ -0,0 +1,3 @@ +# 🔥 FireBlocks Signing Sequence Diagram + +
diff --git a/docs/guardian/architecture/internal-with-vault-signing-sequence-diagram.md b/docs/guardian/architecture/internal-with-vault-signing-sequence-diagram.md new file mode 100644 index 0000000000..b8a3870df7 --- /dev/null +++ b/docs/guardian/architecture/internal-with-vault-signing-sequence-diagram.md @@ -0,0 +1,4 @@ +# 🔑 Internal (with Vault)Signing Sequence Diagram + +
+ diff --git a/docs/guardian/automation-testing/performing-ui-automation-testing.md b/docs/guardian/automation-testing/performing-ui-automation-testing.md index d23afb1b3c..f2df221741 100644 --- a/docs/guardian/automation-testing/performing-ui-automation-testing.md +++ b/docs/guardian/automation-testing/performing-ui-automation-testing.md @@ -28,7 +28,7 @@ and then select test under ui-tests/specs/policies Finally, all the selected test runs and you can see the key components of the Test Runner that you need to pay attention to when executing tests. -
+
**Test Status Menu:** The menu shows a summary of the number of tests passed, passed, failed, or incomplete, and the time spent on the test. diff --git a/docs/guardian/demo-guide/carbon-emissions/atma-scope-3-ghg-policy.md b/docs/guardian/demo-guide/carbon-emissions/atma-scope-3-ghg-policy.md new file mode 100644 index 0000000000..8e88403f3f --- /dev/null +++ b/docs/guardian/demo-guide/carbon-emissions/atma-scope-3-ghg-policy.md @@ -0,0 +1,248 @@ +# 🏭 Atma Scope 3 GHG Policy + +The atma.io connected product cloud from Avery Dennison utilizes this policy to calculate scope 3 emissions during the RFID Inlay production processes. The policy is fully integrated into the atma.io platform and is designed for API-driven usage. + +MRV data from the production process is received by the policy, which also tracks waiver batches. Once the Scope 2 emissions have been calculated, this subsequent policy should be triggered. The Scope 2 emissions that need to be passed on a UoA (Unit of Analysis) level to this policy can either be retrieved from a dedicated Scope 2 policy or calculated via a different process, depending on the use case. + +Currently the following roles exist within the policy: + +* **Organization**: The organization that is tracking carbon emissions during the inlay production process is referred to as the Organization + +## Policy Setup + +Information about the product and production process must be recorded within the policy before production data can be captured. This is similar to the Scope 2 policy, where production-related information is first added when setting up the scope 2 policies. The current iteration of the policy is limited to tracking the emissions of only one product. If multiple products need to be tracked, additional policy instances must be created. + +The following information is required when setting up a policy: + +1. Organization Information: Information about the organization and the company's governance structure, such as business entities. +2. Definition of GHG sources: Captures information about the GHG sources, such as Ground transport and Supplier PCF Data. +3. Product information: Information about the product and its production process, such as quantity information and used materials. + +## Policy Workflow and Usage + +During the production process, MRV data is sent to the initialized policy on a 'per batch' level. Based on this provided information and emissions from scope 2 (on a per unit of analysis level), a partial scope 3 emission is calculated. Additionally, an emission token is minted, representing the carbon emissions on a per batch level. + +The included Postman collection utilizes the Guardian REST API to set up the policy and initialize and populate it with example data. Before the policy can be used, the collection level variables for fields such as guardian instance URL and credentials must be set. + +
+ +## Policy Output & Data Fields + +``` +{ + "dataPeriodStartFrom": "2022-01-01", + "dataPeriodEndTo": "2023-01-01", + "functionalUnitWeight": 0.569, + "productId": "Test Product", + "itemId": "Batch-134583", + "materialAcquisitionCalculation": { + "calculationMethodology": "Activity Data/EEIO Emission Factors", + "emissionFactors": [ + { + "material": "Paper", + "amount": 0.028 + }, + { + "material": "PET", + "amount": 3.3 + }, + { + "material": "Aluminium", + "amount": 16.1 + }, + { + "material": "Chip", + "amount": 5 + }, + { + "material": "Adhesive", + "amount": 3 + }, + { + "material": "Liner", + "amount": 2.5 + } + ], + "cumulativeMaterialEmissions": [ + { + "material": "Paper", + "emission": 0.01986892947648, + "unit": "mt" + }, + { + "material": "PET", + "emission": 0.03959999999999999, + "unit": "mt" + }, + { + "material": "Aluminium", + "emission": 0.7134676166799999, + "unit": "mt" + }, + { + "material": "Chip", + "emission": 0.02, + "unit": "mt" + }, + { + "material": "Adhesive", + "emission": 0.7799999999999999, + "unit": "mt" + }, + { + "material": "Liner", + "emission": 2.1799687229999996, + "unit": "mt" + } + ], + "cumulativeMaterialEmissionsTotal": 3.7529052691564795, + "emissionFactorSources": [], + "isPrimary": true, + "productionOutputUnits": "Unit", + "cumulativeActivityDataQuantity": [ + { + "material": "Face paper", + "materialType": "Face paper", + "amount": 664168.3432 + }, + { + "material": "PET Strap", + "materialType": "PET Strap", + "amount": 12000 + }, + { + "material": "Paper Strap", + "materialType": "Paper Strap", + "amount": 45436.28096 + }, + { + "material": "Aluminium", + "materialType": "Aluminium", + "amount": 44314.758799999996 + }, + { + "material": "Chip", + "materialType": "Chip", + "amount": 4000 + }, + { + "material": "Adhesive", + "materialType": "Adhesive", + "amount": 260000 + }, + { + "material": "Liner", + "materialType": "Liner", + "amount": 871987.4892000001 + } + ], + "co2ePerUnitOfAnalysis": 0.9382263172891199, + "annualGHGEmissions": 93.82263172891197, + "consumptionPerUnitOfAnalysis": 0.47547671804 + }, + "materialAcquisitionTransportCalculations": [ + { + "supplierId": "Aluminum_001", + "serviceId": "Ground transportation_001", + "productId": "Aluminum input_001", + "calculationMethodology": "Activity Data/Supplier-specific PCF Data/EEIO Emission Factor", + "cumulativeWeightOfProductInput": 0.04431475879999999, + "cumulativeWeightOfCargoLoad": 0.04923862088888888, + "cumulativeDistanceTraveled": 135.5539233071111, + "cumulativeTonKm": 6.674488239720362, + "cumulativeFuelConsumption": 12.531229016222222, + "wellToWheelEmissionFactor": 11, + "wellToWheelEmissionSource": "TBD", + "cumulativeEmissionsFromFuelCombustion": 0.0012080823713893855, + "cumulativeEmissionsFromWheelToWheel": 0.00013784351917844445, + "cumulativeEmissionsTotal": 0.00134592589056783, + "co2ePerUnitOfAnalysis": 0.0003364814726419575, + "annualGHGEmissions": 0.03364814726419575, + "measurementUncertainty": {} + }, + { + "supplierId": "Paper_002", + "serviceId": "Ground transportation_002", + "productId": "Ground transportation_002", + "calculationMethodology": "Activity Data/Supplier-specific PCF Data/EEIO Emission Factor", + "cumulativeWeightOfProductInput": 0.7096046241599998, + "cumulativeWeightOfCargoLoad": 0.7884495823999998, + "cumulativeDistanceTraveled": 168.17629592591996, + "cumulativeTonKm": 132.59853029237038, + "cumulativeFuelConsumption": 14.822852149119997, + "wellToWheelEmissionFactor": 11, + "wellToWheelEmissionSource": "TBD", + "cumulativeEmissionsFromFuelCombustion": 0.014851035392745482, + "cumulativeEmissionsFromWheelToWheel": 0.00016305137364031999, + "cumulativeEmissionsTotal": 0.015014086766385801, + "co2ePerUnitOfAnalysis": 0.0037535216915964504, + "annualGHGEmissions": 0.37535216915964503, + "measurementUncertainty": {} + } + ], + "markedBasedGhgInventoryResults": { + "gco2ePerUoaCradleToGate": 0.9776746204533582, + "gco2ePerUoaGateToGate": 0.0353583, + "co2ePercentageMaterialAcquisitionAndPreProcessing": 0.9638342867245506, + "co2ePercentageProduction": 0.036165713275449436, + "biogenicCarbonContent": 0, + "fossilCarbonContent": 0, + "percentageFromPrimaryData": 1, + "totalMtCo2eAllProductsProduced": 97.7674620453358 + }, + "co2ePerCumulativeOutput": 3910698.4818134326, + "cumulativeOutput": 4000000 +} +``` + +The referenced data in this section reflects industry standards and needs to be adopted by policy users to reflect real-world values or changed to matching industry standard values. + +The actual out of our policy is the scope 3 emission - Cradle to Gate - for an individual item of the batch, listed in `"gco2ePerUoaCradleToGate"` and represents roughly 0.978 grams CO2-eq. + +The output for the full batch of all produced inlays is available in`"co2ePerCumulativeOutput"` and represents roughly **3,910,698 grams CO2-eq.** + +Subsequently, we use the output of the carbon emission policy to store PACT Pathfinder 1 compliant records in our system, following the 2.0.1-20230314 specification 2. + +One such sample is outlined below and includes the required data points from our policy output. + +``` +{ + "id": "b568cea5-099c-4231-a812-4443af3c7d9e", + "specVersion": "2.0.1-20230314", + "version": 2, + "created": "2023-11-24T08:58:35.129000+00:00", + "status": "Active", + "companyName": "Sample Corporation", + "companyIds": [ + "urn:pathfinder:company:customcode:buyer-assigned:SampleCorp", + "urn:pathfinder:company:customcode:buyer-assigned:SC" + ], + "productDescription": "The Sample Inlay from SampleCorp is a high performing inlay suitable for a wide variety applications", + "productIds": [ + "urn:pathfinder:product:customcode:vendor-assigned:product:0200000000236", + "urn:pathfinder:product:customcode:vendor-assigned:item:BatchId-1700816119" + ], + "productCategoryCpc": "4716", + "productNameCompany": "SI-7872-BC-13", + "comment": "Batch consisting of 10 individual items.", + "pcf": { + "declaredUnit": "kilogram", + "unitaryProductAmount": "0.00569", + "pCfExcludingBiogenic": "0.010402681719213987", + "fossilGhgEmissions": "0.00000034461634846093226", + "fossilCarbonContent": "0", + "biogenicCarbonContent": "0", + "referencePeriodStart": "2023-01-01T00:00:00+00:00", + "referencePeriodEnd": "2023-12-31T00:00:00+00:00", + "boundaryProcessesDescription": "", + "characterizationFactors": "AR5", + "crossSectoralStandardsUsed": [ + "GHG Protocol Product standard" + ], + "productOrSectorSpecificRules": [], + "exemptedEmissionsPercent": 0, + "exemptedEmissionsDescription": "", + "packagingEmissionsIncluded": false + } + } +``` diff --git a/docs/guardian/demo-guide/carbon-emissions/ghgp-corporate-standard-v2.md b/docs/guardian/demo-guide/carbon-emissions/ghgp-corporate-standard-v2.md index de21493ac7..ecf688e05e 100644 --- a/docs/guardian/demo-guide/carbon-emissions/ghgp-corporate-standard-v2.md +++ b/docs/guardian/demo-guide/carbon-emissions/ghgp-corporate-standard-v2.md @@ -48,7 +48,7 @@ The Guardian GHGP Corporate Policy offers a unique technical opportunity for com ### Policy Workflow -
+
### Policy Guide @@ -145,33 +145,33 @@ The Organization is responsible for inputting key data and information and assig 1. Assign role as VVB and add VVB name -
-
+
+ 2. All the GHG resources once viewed can be verified. -
+
-
+
-
+
-
+
3. After verification of GHG resources, VVB reviews reporting metrics and approve/reject. -
+
### Administrator (Registry) 1. After the organizational emissions have been calculated, the Registry will approve or reject the CET issuance request, and consequently issue CETs if approved. -
+
2. Once it is approved, tokens are minted as shown: -
+
### Futureproofing (Automated GHG Inventories) diff --git a/docs/guardian/demo-guide/carbon-offsets/ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md b/docs/guardian/demo-guide/carbon-offsets/ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md index 34dc8fe41d..65c1522479 100644 --- a/docs/guardian/demo-guide/carbon-offsets/ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md +++ b/docs/guardian/demo-guide/carbon-offsets/ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md @@ -26,6 +26,8 @@ [Important Documents & Schemas](ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md#toc160021935) +[Tools Referenced](ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md#toc160021936) + [Token (Carbon Emission Reduction)](ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md#toc160021936) [Step by Step](ams-i.d-grid-connected-renewable-electricity-generation-v.18.0.md#toc160021937) @@ -79,7 +81,9 @@ At Monitoring Periods: * Quantity of Biomass/Fossil Fuel Consumed * Net Calorific Value of Biomass -### Demo Video +### Demo Video + +[Youtube ](https://www.youtube.com/watch?v=QiH0R3NVKJo\&list=PLnld0e1pwLho3M7uAzcbyzyJobn-X9wG\_\&index=3) ### Policy Workflow @@ -89,8 +93,6 @@ At Monitoring Periods: This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Policy: - ### Available Roles **Project Participant** - The project participant is responsible for executing the emission reduction project. The project participant must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project participant receives certified emission reduction (CER) tokens as an incentive for their emission reductions. @@ -101,12 +103,15 @@ Policy: ### Important Documents & Schemas -1. Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. -2. Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. -3. Methodological Tool 10 - Tool to determine the remaining lifetime of equipment. -4. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. -5. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. -6. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. + +### Tools Referenced + +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. +* Methodological Tool 10 - Tool to determine the remaining lifetime of equipment. ### Token (Carbon Emission Reduction) diff --git a/docs/guardian/demo-guide/carbon-offsets/carbon-development-mechanism-cdm-ams-iii.ar-policy.md b/docs/guardian/demo-guide/carbon-offsets/carbon-development-mechanism-cdm-ams-iii.ar-policy.md index e1c48c3fbe..a5083d3522 100644 --- a/docs/guardian/demo-guide/carbon-offsets/carbon-development-mechanism-cdm-ams-iii.ar-policy.md +++ b/docs/guardian/demo-guide/carbon-offsets/carbon-development-mechanism-cdm-ams-iii.ar-policy.md @@ -9,6 +9,7 @@ * [Policy Guide](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#policy-guide) * [Available Roles](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#available-roles) * [Important Documents & Schemas](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#important-documents-and-schemas) +* [Tools Referenced](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#tools-referenced) * [Token (Carbon Credit)](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#token-carbon-credit) * [Step By Step](carbon-development-mechanism-cdm-ams-iii.ar-policy.md#step-by-step) @@ -34,12 +35,11 @@ In conclusion, LED/CFL bulbs outshine fuel-based lighting on multiple fronts. Th ## **Policy Workflow** -
+
## **Policy Guide** -\ -This policy is published to the Hedera network and can either be imported via Github(.policy file) or IPFS timestamp. IPFS timestamp: 1698756576.572245003 +This policy is published to the Hedera network and can either be imported via Github(.policy file) or IPFS timestamp. ## **Available Roles** @@ -51,17 +51,19 @@ This policy is published to the Hedera network and can either be imported via Gi ## **Important Documents & Schemas** -1. Methodological Tool 07- Tool to calculate the emission factor for an electricity system -2. Methodological Tool 19- Demonstration of additionality of microscale project activities -3. Methodological Tool 21- Demonstration of additionality of small-scale project activities  -4. Methodological Tool 33- Default values for common parameters -5. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc.  -6. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions.  -7. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology.    +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc.  +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions.  +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology.    + +### Tools Referenced + +* Methodological Tool 07- Tool to calculate the emission factor for an electricity system +* Methodological Tool 19- Demonstration of additionality of microscale project activities +* Methodological Tool 21- Demonstration of additionality of small-scale project activities  +* Methodological Tool 33- Default values for common parameters ## **Token (Carbon Credit)** -\ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. ## **Step By Step** diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0001-flaring-or-use-of-landfill-gas.md b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0001-flaring-or-use-of-landfill-gas.md index 2d573866d6..87fc3887fd 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0001-flaring-or-use-of-landfill-gas.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0001-flaring-or-use-of-landfill-gas.md @@ -16,12 +16,12 @@ ​ [Key Documents and Schemas](cdm-acm0001-flaring-or-use-of-landfill-gas.md#key-documents-and-schemas) +[Tools Referenced](cdm-acm0001-flaring-or-use-of-landfill-gas.md#tools-referenced) + ​ [Token (Carbon Emission Reduction)](cdm-acm0001-flaring-or-use-of-landfill-gas.md#token-carbon-emission-reduction) ​ [Workflow ](cdm-acm0001-flaring-or-use-of-landfill-gas.md#workflow) -​ [IPFS Timestamp](cdm-acm0001-flaring-or-use-of-landfill-gas.md#ipfs-timestamp) - [Step-by-Step](cdm-acm0001-flaring-or-use-of-landfill-gas.md#step-by-step)​​ ### Introduction to ACM0001 @@ -60,42 +60,116 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Key Documents and Schemas -Methodological Tool 02 – Combined tool to identify the baseline scenario and demonstrate additionality. +Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. -Methodological Tool 03 – Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. -Methodological Tool 04 – Emissions from solid waste disposal sites. +Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +### Tools Referenced -Methodological Tool 06 – Project emissions from flaring. +* Methodological Tool 02 – Combined tool to identify the baseline scenario and demonstrate additionality. +* Methodological Tool 03 – Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 04 – Emissions from solid waste disposal sites. +* Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 06 – Project emissions from flaring. +* Methodological Tool 08 – Tool to determine the mass flow of a greenhouse gas in a gaseous stream. +* Methodological Tool 09 – Determining the baseline efficiency of thermal or electric energy generation systems. +* Methodological Tool 12 – Project and leakage emissions from transportation of freight. +* Methodological Tool 32 – Positive lists of technologies. -Methodological Tool 08 – Tool to determine the mass flow of a greenhouse gas in a gaseous stream. +### Token (Carbon Emission Reduction) -Methodological Tool 09 – Determining the baseline efficiency of thermal or electric energy generation systems. +Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. -Methodological Tool 12 – Project and leakage emissions from transportation of freight. +### Workflow -Methodological Tool 32 – Positive lists of technologies. +
-Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +### Step-by-Step -Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. -Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +
-### Token (Carbon Emission Reduction) +
-Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. +
-### Workflow +
-
+2. Once the policy has successfully imported, you will be redirected to the policy configurator. The policy configurator can be used to edit the policy using the workflow blocks. There will also be a tab for the “Tools” used within this policy as illustrated in the image below. To start using the policy you must first change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” or “Go” button. This can be done through the policy configurator page or though the “Policies” page. -### IPFS Timestamp +
-Coming Soon +
-### Step-by-Step +
+ +
+ +
+ +3. Create a new user by clicking the “Create User” button and assign their role as “Project Participant”. + +
+ +
+ +
+ +4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). + +
+ +5. Сreate a new user again and assign their role as “VVB”. + +
+ +6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). + +
+ +7. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. + +
+ +
+ +8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. + +
+ +
+ +9. Log back in as the SR and after reviewing the document located in the “Projects” tab, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. + +
+ +10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. + +
+ +
+ +11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. + +
+ +12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. + +
+ +13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. + +
+ +14. Once the minting process is completed, you can view the token amount by navigating to the “VPs” tab. + +
+ +15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1/472495” when the tokens are still minting like the example provided below. + +
-Coming Soon +
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md index 3dacffe751..e9696136ac 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md @@ -18,12 +18,12 @@ [Key Documents and Schemas ](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#key-documents-and-schemas) +[Tools Referenced](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#token-carbon-emission-reduction) [Workflow](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#workflow) -[IPFS Timestamp](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#ipfs-timestamp) - [Step-by-Step](cdm-acm0002-grid-connected-electricity-generation-from-renewable-sources.md#step-by-step) ### Introduction to ACM0002 @@ -68,26 +68,22 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Key Documents and Schemas -Methodological Tool 01 - Tool for the demonstration and assessment of additionality. - -Methodological Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality. - -Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. - -Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. - -Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. - -Methodological Tool 10 – Tool to determine the remaining lifetime of equipment. - -Methodological Tool 32 - Positive lists of technologies. - Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +### Tools Referenced + +* Methodological Tool 01 - Tool for the demonstration and assessment of additionality. +* Methodological Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality. +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. +* Methodological Tool 10 – Tool to determine the remaining lifetime of equipment. +* Methodological Tool 32 - Positive lists of technologies. + ### Token (Carbon Emission Reduction) Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. @@ -96,88 +92,84 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2.
-### IPFS Timestamp - -Coming Soon - ### Step-by-Step 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right -
+
-
+
-
+
2. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
3. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
5. Сreate a new user again and assign their role as VVB. -
+
6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
7. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
9. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
-
+
14. Once the minting process is completed, you can view the token amount by selecting the “Token History” tab. -
+
15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1” when the tokens are still minting. Once the process is complete a notification will appear stating that the tokens have been minted and transferred. -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0006-electricity-and-heat-generation-from-biomass.md b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0006-electricity-and-heat-generation-from-biomass.md index a0fe331721..34c277947e 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0006-electricity-and-heat-generation-from-biomass.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0006-electricity-and-heat-generation-from-biomass.md @@ -7,7 +7,8 @@ * [Policy Workflow](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#policy-workflow) * [Policy Guide](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#policy-guide) * [Available Roles](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#available-roles) -* [Important Documents \\& Schemas](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#important-documents--schemas) +* [Important Documents & Schemas](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#important-documents--schemas) +* [Tools Referenced](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#tools-referenced) * [Token(Carbon Emissions Reduction)](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#tokencarbon-emissions-reduction) * [Step By Step](cdm-acm0006-electricity-and-heat-generation-from-biomass.md#step-by-step) @@ -37,33 +38,35 @@ In the modern landscape of emission reduction initiatives, the value of transpar This policy is published to Hedera network and can either be imported via Github (.policy file) or IPSF timestamp. -#### Available Roles +### Available Roles * Project participant - The project participant is responsible for executing the emission reduction project. The project participant must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project participant receives certified emission reduction (CER) tokens as an incentive for their emission reductions. * Verification and Validation Body (VVB) - The VVB plays a critical role in independently verifying and validating the project data submitted by the project participant. They thoroughly assess the project's emission reduction potential, methodologies, and adherence to the policy guidelines. Based on their evaluation, the VVB either approves or rejects the project for registration. * Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (UNFCCC) serves as the registry for the CDM. They oversee the multiple workflow steps involved in the project's approval, including the verification and validation process by the VVB and the endorsement by the DNA. The UNFCCC's approval is necessary for the project's successful registration and issuance of CER tokens -#### Important Documents & Schemas +### Important Documents & Schemas * Project Description: General information on project, location, technology, equipment, biomass types etc. * Emission Reductions Calculation: Calculate and specify baseline emissions, project emissions and leakage as per methodology equations. * Monitoring Plan: Description of monitoring approach, parameters, frequency, QA/QC procedures etc. in line with methodology. * Monitoring Report: Periodic monitoring reports with data on parameters like biomass use, electricity generation etc. -Tools referenced: - +### Tools referenced -Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality +* Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality +* Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion +* Tool 04 - Emissions from solid waste disposal sites +* Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation +* Tool 07 - Tool to calculate the emission factor for an electricity system +* Tool 09 - Determining the baseline efficiency of thermal or electric energy generation systems +* Tool 10 - Tool to determine the remaining lifetime of equipment +* Tool 12 - Project and leakage emissions from transportation of freight +* Tool 16 - Project and leakage emissions from biomass -Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion - -Tool 04 - Emissions from solid waste disposal sites - -Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation - -Tool 07 - Tool to calculate the emission factor for an electricity system - Tool 09 - Determining the baseline efficiency of thermal or electric energy generation systems - Tool 10 - Tool to determine the remaining lifetime of equipment - Tool 12 - Project and leakage emissions from transportation of freight - Tool 16 - Project and leakage emissions from biomass - -#### Token(Carbon Emissions Reduction) +### Token(Carbon Emissions Reduction) Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. -#### Step By Step +### Step By Step + +Coming Soon diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md index 5d79c0427a..ada11f31cb 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md @@ -7,7 +7,8 @@ Table of contents * [Policy Workflow](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#policy-workflow) * [Policy Guide](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#policy-guide) * [Available Roles](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#available-roles) -* [Important Documents \\& Schemas](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#important-documents--schemas) +* [Important Documents & Schemas](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#important-documents--schemas) +* [Tools Referenced](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#tools-referenced) * [Token(Carbon Emissions Reduction)](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#tokencarbon-emissions-reduction) * [Step By Step](cdm-acm0007-conversion-from-single-cycle-to-combined-cycle-power-generation.md#step-by-step) @@ -39,115 +40,112 @@ ACM0007 thus enables a practical solution to reduce grid emissions intensity in ### Policy Guide -This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp: 1706881469.628524368 +This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp -#### Available Roles +### Available Roles * Project participant - The project participant is responsible for executing the emission reduction project. The project participant must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project participant receives certified emission reduction (CER) tokens as an incentive for their emission reductions. * Verification and Validation Body (VVB) - The VVB plays a critical role in independently verifying and validating the project data submitted by the project participant. They thoroughly assess the project's emission reduction potential, methodologies, and adherence to the policy guidelines. Based on their evaluation, the VVB either approves or rejects the project for registration. * Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (UNFCCC) serves as the registry for the CDM. They oversee the multiple workflow steps involved in the project's approval, including the verification and validation process by the VVB and the endorsement by the DNA. The UNFCCC's approval is necessary for the project's successful registration and issuance of CER tokens -#### Important Documents & Schemas +### Important Documents & Schemas * Project Description: Information on project participant, location, technology, configuration, crediting period etc. * Emission Reductions Calculation: Calculate and specify baseline emissions, project emissions and leakage as per methodology equations. * Monitoring Plan: Description of monitoring approach, parameters, frequency, QA/QC procedures etc. in line with methodology. * Monitoring Report: Periodic monitoring report with data for monitored parameters and calculated emission reductions. -#### Tools referenced: +### Tools referenced -Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality +* Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality +* Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion +* Tool 07 - Tool to calculate the emission factor for an electricity system +* Tool 10 - Tool to determine the remaining lifetime of equipment -Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion - -Tool 07 - Tool to calculate the emission factor for an electricity system - -Tool 10 - Tool to determine the remaining lifetime of equipment - -#### Token(Carbon Emissions Reduction) +### Token(Carbon Emissions Reduction) Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. -#### Step By Step +### Step By Step 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. -
+
-
+
-
+
2. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
3. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
5. Сreate a new user again and assign their role as VVB. -
+
6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
7. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
9. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
-
+
11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
-
+
14. Once the minting process is completed, you can view the token amount by selecting the “Token History” tab. -
+
15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1/47191” when the tokens are still minting like the example provided below. -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md index de70e2c3b0..78f7732ff9 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md @@ -18,6 +18,8 @@ [Key Documents and Schemas](cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md#key-documents-and-schemas) +[Tools Referenced](cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md#token-carbon-emission-reduction) [Step-by-Step](cdm-acm0018-electricity-generation-from-biomass-in-power-only-plants.md#step-by-step) @@ -64,31 +66,22 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Key Documents and Schemas -Methodological Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality. - -Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. - -Methodological Tool 04 - Emissions from solid waste disposal sites - -Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. - -Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. - -Methodological Tool 09 - Tool to determine the baseline efficiency of thermal or electric energy generation systems. - -Methodological Tool 10 – Tool to determine the remaining lifetime of equipment. - -Methodological Tool 11 - Assessment of the validity of the original/current baseline and update of the baseline at the renewal of the crediting period. - -Methodological Tool 12 - Project and leakage emissions from transportation of freight. - -Methodological Tool 16 - Project and leakage emissions from biomass. - -Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +### Tools Referenced -Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +* Methodological Tool 02 - Combined tool to identify the baseline scenario and demonstrate additionality. +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 04 - Emissions from solid waste disposal sites +* Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. +* Methodological Tool 09 - Tool to determine the baseline efficiency of thermal or electric energy generation systems. +* Methodological Tool 10 – Tool to determine the remaining lifetime of equipment. +* Methodological Tool 11 - Assessment of the validity of the original/current baseline and update of the baseline at the renewal of the crediting period. +* Methodological Tool 12 - Project and leakage emissions from transportation of freight. +* Methodological Tool 16 - Project and leakage emissions from biomass. ### Token (Carbon Emission Reduction) @@ -96,4 +89,4 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. ### Step-by-Step -(Screenshots) +(Coming Soon) diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user.md index 35ff65446b..ceb2b0160a 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user.md @@ -16,12 +16,12 @@ [Key Documents and Schemas](cdm-ams-i.a.-electricity-generation-by-the-user.md#key-documents-and-schemas) +[Tools Referenced](cdm-ams-i.a.-electricity-generation-by-the-user.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-i.a.-electricity-generation-by-the-user.md#token-carbon-emission-reduction) [Workflow](cdm-ams-i.a.-electricity-generation-by-the-user.md#workflow) -[IPFS Timestamp](cdm-ams-i.a.-electricity-generation-by-the-user.md#ipfs-timestamp) - [Step-by-Step](cdm-ams-i.a.-electricity-generation-by-the-user.md#step-by-step) ### Introduction to AMS-I.A. @@ -60,17 +60,15 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Key Documents and Schemas -Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. - -Methodological Tool 16 – Project emissions from cultivation of biomass. - -Methodological Tool 33 – Default values for common parameters. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +### Tools Referenced -Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. - -Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +* Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 16 – Project emissions from cultivation of biomass. +* Methodological Tool 33 – Default values for common parameters. ### Token (Carbon Emission Reduction) @@ -80,10 +78,6 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2.
-### IPFS Timestamp - -(Placeholder) - ### Step-by-Step -(Screenshots) +(Coming Soon) diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md index cd9d8fc3f0..e5bca935b5 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md @@ -12,7 +12,7 @@ [Available Roles](cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md#available-roles) -[Important Documents & Schemas](cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md#important-documents-and-schemas) +[Tools Referenced](cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md#tools-referenced) [Step By Step](cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity.md#step-by-step) @@ -52,7 +52,7 @@ This policy is published to Hedera network and can either be imported via Github * Verification and Validation Body (VVB) - The VVB plays a critical role in independently verifying and validating the project data submitted by the project proponent. They thoroughly assess the project's emission reduction potential, methodologies, and adherence to the policy guidelines. Based on their evaluation, the VVB either approves or rejects the project for registration. * Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (UNFCCC) serves as the registry for the CDM. They oversee the multiple workflow steps involved in the project's approval, including the verification and validation process by the VVB and the endorsement by the DNA. The UNFCCC's approval is necessary for the project's successful registration and issuance of CER tokens. -### Important Documents & Schemas +### Tools Referenced * Methodological Tool 03- Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. * Methodological Tool 04- Emissions from solid waste disposal sites. @@ -67,3 +67,5 @@ This policy is published to Hedera network and can either be imported via Github * Methodological Tool 22- Leakage in biomass small-scale project activities. ### Step By Step + +Coming Soon diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md index 597e14ca62..defdb5bcf9 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md @@ -16,12 +16,12 @@ [Key Documents and Schemas](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#key-documents-and-schemas) +[Tools Referenced](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#token-carbon-emission-reduction) [Workflow](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#workflow) -[IPFS Timestamp](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#ipfs-timestamp) - [Step-by-Step](cdm-ams-i.f.-renewable-electricity-generation-for-captive-use-and-mini-grid.md#step-by-step) ### Introduction to AMS-I.F. @@ -60,21 +60,17 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Key Documents and Schemas -Methodological Tool 03 – Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. - -Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. - -Methodological Tool 07 – Tool to calculate the emission factor for an electricity system. - -Methodological Tool 16 – Project emissions from cultivation of biomass. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -Methodological Tool 33 – Default values for common parameters. +### Tools Referenced -Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. - -Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. - -Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +* Methodological Tool 03 – Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 05 – Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 07 – Tool to calculate the emission factor for an electricity system. +* Methodological Tool 16 – Project emissions from cultivation of biomass. +* Methodological Tool 33 – Default values for common parameters. ### Token (Carbon Emission Reduction) @@ -84,10 +80,6 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2.
-### IPFS Timestamp - -(Placeholder) - ### Step-by-Step -(Screenshots) +Coming Soon diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.g.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.g.md index 6caf929bec..450e95d5c2 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.g.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.g.md @@ -1,6 +1,6 @@ # 🏨 CDM AMS II.G: Energy Efficiency Measures in Thermal Applications of Non-Renewable Biomass -Table of Contents +## Table of Contents [Introduction](cdm-ams-ii.g.md#\_toc975016542) @@ -16,6 +16,8 @@ Table of Contents [Important Documents & Schemas](cdm-ams-ii.g.md#\_toc1808393583) +[Tools Referenced](cdm-ams-ii.g.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-ii.g.md#\_toc360615091) [Step by Step](cdm-ams-ii.g.md#\_toc619173481) @@ -54,8 +56,6 @@ AMS-II.G provides a standardized and measurable framework for clean cooking proj This policy is published to Hedera network and can either be imported via Github (.policy file) or IPSF timestamp. -Latest Version - 1706881318.979259003 - ### **Available Roles** Project Proponent - The project proponent is responsible for executing the emission reduction project. They develop and implement strategies to substitute fossil fuel-based lighting systems with LED/CFL lighting systems. The project proponent must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project proponent receives certified emission reduction (CER) tokens as an incentive for their emission reductions. @@ -70,8 +70,11 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U 1. Project Description - Project Proponent information, standard project information, methodology information, etc. 2. Emissions Reduction – Schema included within the project information form; this is filled out by the project proponent to calculate annual emission reductions. -3. Default Values (Tool 33) - Tool 33 is included as a module within the policy. This module is used to calculate default values for common parameters like fNRB (Fraction of non-renewable biomass). -4. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. + +### Tools Referenced + +* Tool 33 - Tool 33 is included as a module within the policy. This module is used to calculate default values for common parameters like fNRB (Fraction of non-renewable biomass). ### Token (Carbon Emission Reduction) diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md index 72b035abf3..5f71c2b7c5 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md @@ -20,6 +20,8 @@ [Key Documents and Schemas](cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md#key-documents-and-schemas) +[Tools Referenced](cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md#token-carbon-emission-reduction) [Step-by-Step](cdm-ams-ii.j.-demand-side-activities-for-efficient-lighting-technologies.md#step-by-step) @@ -66,17 +68,17 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Policy Guide -This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp : 1706881157.848214003 +This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. ### Key Documents and Schemas -Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. - -Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +### Tools Referenced -Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +* Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. ### Token (Carbon Emission Reduction) @@ -86,78 +88,78 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. -
+
2. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
3. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
5. Сreate a new user again and assign their role as VVB. -
+
6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
7. Log in as the SR and select the “Project Participant” or the “VVB” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
-
+
9. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
-
+
14. Once the minting process is completed, you can view the token amount by selecting the “VPs” tab. -
+
15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md index 75938d19ea..f2f3f272b5 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md @@ -16,6 +16,8 @@ [Important Documents & Schemas](cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md#important-documents-and-schemas) +[Tools Referenced](cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md#tools-referenced) + [Token (Carbon Emission Reduction) ](cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md#token-carbon-emission-reduction) [Step by Step](cdm-ams-iii.av.-low-greenhouse-gas-emitting-safe-drinking-water-production-systems.md#step-by-step) @@ -42,9 +44,7 @@ Safe drinking water is an indispensable component of public health and well-bein ### Policy Guide -This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp.  - -Policy: +This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp.  ### Available Roles  @@ -54,15 +54,18 @@ Policy: ### Important Documents & Schemas  -1. Methodological Tool 01- Tool for the demonstration and assessment of additionality -2. Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. -3. Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. -4. Methodological Tool 19- Demonstration of additionality of microscale project activities -5. Methodological Tool 21- Demonstration of additionality of small-scale project activities -6. Methodological Tool 30- Calculation of the fraction of non-renewable biomass -7. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc.  -8. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions.  -9. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology.  +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc.  +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions.  +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology.  + +### Tools Referenced + +* Methodological Tool 01- Tool for the demonstration and assessment of additionality +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 19- Demonstration of additionality of microscale project activities +* Methodological Tool 21- Demonstration of additionality of small-scale project activities +* Methodological Tool 30- Calculation of the fraction of non-renewable biomass ### Token (Carbon Emission Reduction)  @@ -72,82 +75,82 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. -
+
-
+
-
+
2. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
3. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
5. Сreate a new user again and assign their role as VVB. -
+
6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
7. Log in as the SR and select the “Project Participant” or the “VVB” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
-
+
9. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
-
+
14. Once the minting process is completed, you can view the token amount by selecting the “VPs” tab. -
+
15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.bb.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.bb.md index 2a6cae3514..1f8cfc0ef0 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.bb.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.bb.md @@ -32,6 +32,8 @@ [Important Documents & Schemas](cdm-ams-iii.bb.md#toc146642055) +[Tools Referenced](cdm-ams-iii.bb.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-iii.bb.md#toc146642056) [Step by Step](cdm-ams-iii.bb.md#toc146642057) @@ -91,7 +93,7 @@ AMS-III.BB is applicable under specific conditions, including: * Limited to communities lacking access to national or regional grids. * A requirement that at least 75% of the end users are households. -#### Important Parameters +### Important Parameters Key parameters play a vital role in the implementation and monitoring of AMS-III.BB projects: @@ -101,14 +103,13 @@ Key parameters play a vital role in the implementation and monitoring of AMS-III ### Need and Use for the AMS-III.BB Policy -\ The AMS-III.BB methodology plays a vital role in addressing the growing need for sustainable electrification in communities that lack access to reliable electricity. It provides a structured approach for projects aimed at extending the grid or constructing new mini grids to connect consumers who were previously off the grid. These initiatives aim to displace high-carbon-intensive electricity sources and fuel-based lighting systems, thus reducing greenhouse gas emissions and fostering economic development in underserved regions. To understand the significance of AMS-III.BB, it's essential to compare the merits and considerations of mini grids versus grid electricity. Mini-grids are localized power generation and distribution systems, often deployed in remote or rural areaswhere connecting to the national or regional grid is cost-prohibitive. They bring electricity to communities that were once reliant on high-carbon-intensive mini-grids or stand-alone power generators. While mini grids offer reliable electricity access and the potential to integrate renewable energy sources, they can be economically challenging to establish and may rely on fossil fuel generators. In contrast, grid electricity operates within large, interconnected networks, benefiting from economies of scale and efficient power transmission. Grids can access a diverse energy mix, including renewables, and are subject to stringent environmental regulations, generally resulting in lower emissions compared to mini grids. The choice between mini-grids and grid electricity depends on the specific needs, geographic location, and economic viability of the targeted community or region. ### Demo Video -\[Link] +[Youtube](https://www.youtube.com/watch?v=CN0IDPGGS44\&list=PLnld0e1pwLho3M7uAzcbyzyJobn-X9wG\_\&index=10) ### Policy Workflow @@ -128,12 +129,15 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Important Documents & Schemas -1. Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. -2. Methodological Tool 21 - Demonstration of additionality of smallscale project activities. -3. Methodological Tool 33 - Default values for common parameters. -4. Project Description - Project Proponent information, standard project information, methodology information like baseline emissions, project emissions, etc. -5. Emissions Reduction – Schema included within the project information form; this is filled out by the project proponent to calculate annual emission reductions. -6. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +1. Project Description - Project Proponent information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project proponent to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. + +### Tools Referenced + +* Methodological Tool 07 - Tool to calculate the emission factor for an electricity system. +* Methodological Tool 21 - Demonstration of additionality of smallscale project activities. +* Methodological Tool 33 - Default values for common parameters. ### Token (Carbon Emission Reduction) diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.d.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.d.md index 29b5bced7f..30065d26a3 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.d.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.d.md @@ -16,6 +16,8 @@ [Important Documents and Schemas](cdm-ams-iii.d.md#important-documents-and-schemas) +[Tools Referenced](cdm-ams-iii.d.md#tools-referenced) + [Token](cdm-ams-iii.d.md#token-carbon-emission-reduction) [Step By Step](cdm-ams-iii.d.md#step-by-step) @@ -50,8 +52,6 @@ In the context of modern emission reduction projects, the necessity for transpar This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Latest Version - 1698756329.359347003 - ## Available Roles **Project Proponent** - The project proponent is responsible for executing the emission reduction project. The project proponent must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project proponent receives certified emission reduction (CER) tokens as an incentive for their emission reductions. @@ -64,19 +64,16 @@ Latest Version - 1698756329.359347003 ## Important Documents & Schemas -1\. Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. - -2\. Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. - -3\. Methodological Tool 06 - Tool to determine project emissions from flaring gases containing methane. - -4\. Methodological Tool 14 - Project and leakage emissions from anaerobic digesters - -5\. Project Description - Project Proponent information, standard project information, methodology information like baseline emissions, project emissions, etc. +1. Project Description - Project Proponent information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project proponent to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. -6\. Emissions Reduction – Schema included within the project information form; this is filled out by the project proponent to calculate annual emission reductions. +### Tools Referenced -7\. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 06 - Tool to determine project emissions from flaring gases containing methane. +* Methodological Tool 14 - Project and leakage emissions from anaerobic digesters ## Token (Carbon Emission Reduction) @@ -86,88 +83,88 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. As the policy is importing you can see the schemas, tools, and tokens importing. -
+
-
+
-
+
2. By clicking on the pen icon, we can open the policy configurator to see the workflow blocks. To expand the containers, click on the dropdown arrow, we’ll then see where the tools are located, like tool 14 in the AMS-III.D policy. Then we can click on the block for tool 14 and scroll down in the properties section at the bottom right of the page this is where we can find the message ID for this tool. -
+
-
+
-
+
-
+
3. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
4. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
5. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
6. Сreate a new user again and assign their role as VVB. -
+
7. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
8. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
9. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
10. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
11. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
12. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
13. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
14. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
15. Once the minting process is completed, you can view the token amount by selecting the “VP” tab. -
+
16. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1” when the tokens are still minting. Once the process is complete a notification will appear stating that the tokens have been minted and transferred. -
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md index 9679b2b38b..02234a3703 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md @@ -18,6 +18,8 @@ [Important Documents & Schemas ](cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md#important-documents-and-schemas) +[Tools Referenced](cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md#tools-referenced) + [Token (Carbon Emission Reduction)](cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md#token-carbon-emission-reduction) [Step by Step](cdm-ams-iii.f.-avoidance-of-methane-emissions-through-composting.md#step-by-step) @@ -62,8 +64,6 @@ AMS-III.F's emphasis on controlled aerobic treatment of organic waste, notably t This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Policy: - ### Available Roles Project Participant - The project participant is responsible for executing the emission reduction project. The project participant must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project participant receives certified emission reduction (CER) tokens as an incentive for their emission reductions. @@ -74,13 +74,16 @@ Registry (UNFCCC) - The United Nations Framework Convention on Climate Change (U ### Important Documents & Schemas -1. Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. -2. Methodological Tool 04 - Emissions from solid waste disposal sites -3. Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. -4. Methodological Tool 13 - Project and leakage emissions from composting -5. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. -6. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. -7. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. +1. Project Description - Project Participant information, standard project information, methodology information like baseline emissions, project emissions, etc. +2. Emissions Reduction – Schema included within the project information form; this is filled out by the project participant to calculate annual emission reductions. +3. Monitoring Report – The monitoring report is to be filled out based on the monitoring plan mentioned within the methodology. + +### Tools Referenced + +* Methodological Tool 03 - Tool to calculate project or leakage CO2 emissions from fossil fuel combustion. +* Methodological Tool 04 - Emissions from solid waste disposal sites +* Methodological Tool 05 - Baseline, project and/or leakage emissions from electricity consumption and monitoring of electricity generation. +* Methodological Tool 13 - Project and leakage emissions from composting ### Token (Carbon Emission Reduction) @@ -90,82 +93,82 @@ Certified Emission Reduction (CER) credits, each equivalent to one tonne of CO2. 1. Log in as the Standard Registry and import the policy either by file or through IPFS timestamp by selecting the third button at the top right. -
+
-
+
-
+
2. To start using the policy you first have to change the status of the policy from “Draft” to “Dry Run” or “Publish”, then select the “Register” button. -
+
-
+
3. Create a new user by clicking the “Create User” button and assign their role as Project Participant. -
+
4. The Project Participant can now provide their name or the name they would like to see reflect when registering for this project (i.e. their organization’s name). -
+
5. Сreate a new user again and assign their role as VVB. -
+
6. The VVB can now provide their name or the name they would like users to see when reviewing projects (i.e. their organization’s name). -
+
7. Log in as the SR and select the “Project Participants” or the “VVBs” tab to view the documents submitted by the Project Participant and by the VVB. The SR can approve their requests by clicking on the “Approve" button. -
+
-
+
8. Log in as the Project Participant and create a new project by clicking on the "New Project" button. This form is used to collect information about the project, organization, and all the data needed to run the emission reduction calculations. Once all the required fields have been filled the “Create” button will turn dark blue. By selecting the “Create” button all the data will be sent to the SR for review/approval. -
+
-
+
-
+
9. Log back in as the SR and after reviewing the document by selecting the “View Document” button, the SR can validate the project submitted by the Project Participant by clicking the “Validate” button. If the data does not satisfy the rules set by the SR, then the “Reject” button can be used. -
+
-
+
10. Log in as the Project Participant and create a monitoring report by clicking on the “Add Report” button then fill out the monitoring report form. -
+
-
+
11. After creating the monitoring report, the project participant assigns the VVB to verify it by navigating to the “Monitoring Reports” tab and selecting the dropdown under “Assign”. -
+
12. Log in as the VVB and click the “Monitoring Reports” tab to review the document submitted by the Project Participant. After reviewing the monitoring report by selecting “View Document”, the VVB can select “Verify”. -
+
-
+
13. Log in as the SR to review the monitoring report by selecting the “View Document” button in the “Monitoring Reports” tab. The SR can approve the monitoring report by selecting “Approve”. This will also trigger the minting process. You can see the minting status under “Status” change from “Minting” to “Minted”. -
+
-
+
14. Once the minting process is completed, you can view the token amount by selecting the “Token History” tab. -
+
15. The TrustChain can also be viewed by clicking on the “View TrustChain” button. Please note that the token amount may show “-1” when the tokens are still minting. Once the process is complete a notification will appear stating that the tokens have been minted and transferred. -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md index db01f4e390..72bf0ebab5 100644 --- a/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md +++ b/docs/guardian/demo-guide/carbon-offsets/cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md @@ -7,7 +7,8 @@ * [Policy Workflow](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#policy-workflow) * [Policy Guide](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#policy-guide) * [Available Roles](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#available-roles) -* [Important Documents \\& Schemas](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#important-documents--schemas) +* [Important Documents & Schemas](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#important-documents--schemas) +* [Tools Referenced](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#tools-referenced) * [Token(Carbon Emissions Reduction)](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#tokencarbon-emissions-reduction) * [Step By Step](cdm-ams-iii.h.-methane-recovery-in-wastewater-treatment.md#step-by-step) @@ -37,8 +38,6 @@ In the modern landscape of emission reduction initiatives, transparency and cred This policy is published to Hedera network and can either be imported via Github (.policy file) or IPSF timestamp. -Policy Timestamp: - ## Available Roles * Project participant - The project participant is responsible for executing the emission reduction project. The project participant must adhere to the requirements outlined by the CDM and provide evidence of the emission reductions achieved. Upon successful verification, the project participant receives certified emission reduction (CER) tokens as an incentive for their emission reductions. @@ -52,7 +51,7 @@ Policy Timestamp: * Monitoring Plan: Description of monitoring approach, parameters, frequency, QA/QC procedures etc. in line with methodology. * Monitoring Report: Periodic monitoring report with data for parameters like methane captured, combusted etc. -## Tools referenced in this methodology:  +## Tools Referenced * Tool 03- Tool to calculate project or leakage CO2 emissions from fossil fuel combustion * Tool 04- Emissions from solid waste disposal sites diff --git a/docs/guardian/demo-guide/carbon-offsets/dovu-methodologies.md b/docs/guardian/demo-guide/carbon-offsets/dovu-methodologies.md index 9339e78a91..5e8b2c8b4e 100644 --- a/docs/guardian/demo-guide/carbon-offsets/dovu-methodologies.md +++ b/docs/guardian/demo-guide/carbon-offsets/dovu-methodologies.md @@ -27,7 +27,7 @@ The first step towards compliance was building a system to support manual attest 1. We need to download the policy from open source repo and import it by clicking on Import button. -
+
2. Once, imported the policy, you can publish the policy to Hedera by clicking on publish button. 3. Now, we will logout and login as a Registrant role and click on Go on the respective policy: @@ -38,7 +38,7 @@ The first step towards compliance was building a system to support manual attest For AgreCalc we see below form: -
+
for Cool Farm, we see below form: @@ -48,11 +48,11 @@ for Cool Farm, we see below form: 6. Now we log out and login as Standard Registry, once viewing the registrant documents, we approve the application by clicking on Approve button. 7. Once approved, we again login back as Registrant and submit Farm Registrant form by clicking on Create Farm button: -
+
8. Once filled and clicked on OK, Registrant waits for approval from Standard Registry: -
+
9. Now we login as Standard Registry and click on Farm Projects tab, we can see the Request being submitted by Registrant for Approve/Reject @@ -62,16 +62,16 @@ For testing purpose, we will approve the farm project. 10. Once SR approves, we login back as Registrant and submit AgreCalc Document by filling out the form: -
+
For Cool Farm Tool methodology, you will see the below request form: -
+
11. Once the Request is submitted, Registrant is waiting for it to be approved by Verifier. 12. Now we logout and login as Verifier, we verify the documents by clicking on approve. -
+
13. Once approved, we login as SR and check the Token History by clicking on Token History Tab: @@ -79,4 +79,4 @@ For Cool Farm Tool methodology, you will see the below request form: 14. We can also check the TrustChain by clicking on View TrustChain button: -
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/dovu-mmcm.md b/docs/guardian/demo-guide/carbon-offsets/dovu-mmcm.md new file mode 100644 index 0000000000..fc9e3a54da --- /dev/null +++ b/docs/guardian/demo-guide/carbon-offsets/dovu-mmcm.md @@ -0,0 +1,171 @@ +--- +description: >- + Sustainable End-of-Life Vehicle Scrapping Program: Government Backed Voluntary + Program +--- + +# 🍀 Dovu MMCM + +## Executive Summary + +India, with its position as the world's second most populous country, is facing a significant challenge with the disposal of end-of-life vehicles (ELVs). With the automotive sector booming, the number of vehicles reaching the end of their service life is escalating. However, the recycling of these vehicles is still not fully developed, and the sector is predominantly run by the informal sector, which often disregards environmental and safety regulations. + +The informal recycling facilities have been criticized for contributing to environmental pollution and selling potentially unsafe automotive parts. In response, the Indian government is promoting the establishment of Registered Vehicle Scrapping Facilities (RVSFs) that adhere to stringent environmental norms and compliance. These facilities, however, are struggling to compete with the informal sector, which typically offers quicker and cheaper services. + +In the context of these challenges, MMCM, an enviro-tech company, is working to bridge the gap for RVSFs by introducing the concept of carbon credits. By ensuring proper waste management of ELVs, these credits provide an additional revenue stream, making it financially viable for RVSFs to operate within environmental compliance. This initiative by MMCM not only supports the formal sector in overcoming economic hurdles but also encourages sustainable practices in vehicle recycling, aligning with global environmental standards. + +This methodology and related formula for calculation has been given a technical opinion from IIT Bombay, evidence of this opinion has been uploaded within the folder. + +## Blended Methodology Approach + +The combined methodologies of the End-of-Life Vehicle (ELV) recycling project introduce an innovative approach, by integrating UN AMS-III.BA (Recovery and recycling of materials from E-waste) and AMS-III.AJ (Recovery and recycling of materials from solid wastes) methodologies. This comprehensive process maximizes the environmental benefits, ensures transparency, and paves the way for generating a unique Certificate of Deposit (CD). + +A significant potential lies in presenting this combined methodology to the United Nations Framework Convention on Climate Change (UNFCCC)'s Methodologies Panel under the Clean Development Mechanism (CDM). The aim here is to secure an official accreditation for this methodology as a novel, digitized form of the combined AMS-III.BA & AMS-III.AJ methodologies. + +## Visualization of Integrated Carbon Credit Methodologies + +We have illustrated a schematic representation of the process involved in the amalgamation of the two accredited methodologies - AMS-III.BA and AMS-III.AJ. This schematic diagram aims to abstract away the specific application of End-of-Life Vehicles (ELVs) and instead focus on the broad, integrative processes involved. + +By deprioritizing explicit references to ELVs or specific geographical settings, such as India, our objective is to underscore the universal adaptability and applicability of this combined methodology. This approach offers a dual advantage: it retains confidentiality while highlighting the potential versatility of the integrated methodology across various sectors and projects. + +The visualization provided is structured to simplify the understanding of our integrative approach while emphasizing the workflow and interdependencies of each stage and entity involved. + +!\[AMS-III.BA and AMS-III.AJ Breakdown]\(AMS-III.BA and AMS-III.AJ Breakdown.png) + +## Generalization of Methodology Integration for Sustainable Practices + +The methodologies AMS-III.BA and AMS-III.AJ under the Clean Development Mechanism (CDM) are inherently designed to foster and encourage sustainable practices through the effective promotion of recovery and recycling procedures. + +AMS-III.BA specifically zeroes in on electronic waste, colloquially known as E-waste, with a clear aim of stimulating extraction and reuse of valuable materials such as metals, plastics, and glass. The beauty of this approach lies in its transformative power - morphing E-waste from a daunting environmental problem into a viable resource. This methodology is essentially propelling us towards the principles of a circular economy. + +Running in parallel, AMS-III.AJ promotes recovery and recycling practices for a broad variety of solid waste types, going beyond the sole focus on electronic waste. This methodology recognizes the substantial contribution of solid waste to global greenhouse gas emissions, and seeks to combat this via advocating efficient waste management and recycling procedures. The ripple effects of this approach are multifold - conservation of natural resources, reduction in landfill waste, and a decrease in emissions emanating from waste processing and the production of new materials. + +When these methodologies are applied in tandem, they guide projects that are able to turn waste streams into valuable materials, thereby bolstering sustainable development and significantly contributing to climate change mitigation. By utilizing a joint application of these methodologies, we can further amplify their impacts, birthing more holistic waste management solutions and a wider scope of emission reductions. + +## Policy and Schema Breakdown for End-of-Life Vehicles + +The goal is to align the various stages and streamline the policy flow for the respective roles, which include the Project, Registered Vehicle Scrapping Facility (RVSF) or RC, and Measurement Reporting Verification (MRV). This alignment will enable us to effectively map the End-of-Life Vehicle (ELV) methodology. Here are some explanations of the different entities: + +The project describes the ELV methodology in its entirety, providing outside actors with an understanding of all its properties. + +The Recycling Centre (RVSF) is an entity that participates in the project. The role of the RVSF is to scrap ELV vehicles and generate a Certificate of Deposit. We can refer to this as the MRV or claim stage. + +The claim or MRV describes the scrapping of an end-of-life vehicle (ELV) that can be used to mint carbon credits. This includes many of the properties inside the Certificate of Deposit, as well as the output from the MMCM document. This can be substantiated by the raw data values that are required to be listed. + +It is crucial that we record all RVSFs along with their associated ELV submissions to maintain a track record of provenance + +## Usage + +While this policy can be used throught the standard UI the usage of the policy is primarily API based with the aim to automate ingestion, utilising the generic dMRV project structure and tools from DOVU: + +* [DOVU Middleware API](https://github.com/dovuofficial/guardian-middleware-api/) +* [DOVU PHP SDK](https://github.com/dovuofficial/guardian-php-sdk) +* [Middleware API Documentation](https://middleware.guardian.dovu.market/docs) + +These following tools sit on top of the guardian, and come complete, with examples of tests on how to best consume the policy + +## Roles + +There are three primary roles: + +* The standard registry (like DOVU) + * This role would consist of policy management through the guardian, It has the ability to approve projects or sites, the policy can also be modified to enable the verifier or VVB entity to approve. +* The Supplier or project implementor (MMCM) + * This would comprise the agent as a whole, For the issuance of the original project definition, the site, registrations, and the ingestion of all claim data. +* The Verifier (Certificate of deposits) + * This is evidence that is provided from third parties. In this case, government documentation that proves the benefit, the recycling of the vehicle. + +Naturally, over time, these features and elements will be automated, and there will be further signatures where appropriate. But as at April 2024, We have signed Governmental documents for proof of recycling, as well as proof of site registration in addition to methodology and formula sign off from ITT Bombay. + +## Data Schemas + +These schemas, or data points, have been collaborated upon between DOVU and the MMCM team using the [DOVU generic dMRV structure](https://docs.google.com/document/d/1micqwUz2-dVQ8VbWf55WBOxMzB\_xTqMfxlqFUoHFW-8/edit) as an initial template, which comprises document or entity submissions: + +3 Document Submissions + +* The creation or the definition of a project. +* The creation of a site, that refers to an instance a sensor or a geographical area. +* The submission of a claim with MRV data to be the expected minted value of carbon units (or NFTs) connected to the guardian. + +3 Approval steps + +* Steps 1 & 2 are an approval from DOVU or a registry/verifier +* The final step is the approval from a reputable verifier who is used to the current MRV, or verified data source. + +In the case of MMCM ELV asset generation "Certificate of deposits" That prove the sign off of a vehicle that has been recycled, and then ingested to extract out of data points is used as the verified and indexable data source. + +### Project (ELV Scrapping CO2 Emission Avoidance) + +For now these are basic properties that help to describe the project and baseline scenario where appropriate. + +* Unique reference (UUID) +* Project Name + * Sustainable End of Life Vehicle Scrapping Program +* Project Summary + * This is completed through digitizing of blended UN e-waste methodology (AMS-III.BA) and UN Recovery and recycling of materials from solid wastes (AMS-III.AJ) and applying it to end-of-life vehicles for tracking emission avoidance. Introducing a new unit type for selling credits to enhance market transparency and traceability. These units, termed ELV Credit, represents the environmental impact of processing each End of Life Vehicle (ELV) through Government Authorized Vehicle Scrapping Centers, which are termed Registered Vehicle Scrapping Facility (RVSFs) in India. +* Classification Category + * CARBON\_AVOIDANCE +* Host Country + * India +* Targeted Benefit Type + * Technological Emission Avoidance +* Voluntary Standard (UNFCCC Third Party Verified Blended Methodologies: AMS-III.BA.: Recovery and recycling of materials from E-waste (v3.0) \&AMS-III.AJ.: Recovery and recycling of materials from solid wastes (v7.0) ) + * For this the recommendation would be UNF, as the methodologies have been published through the Framework convention on climate change. + * AMS-III.BA.: Recovery and recycling of materials from E-waste (v3.0) + * AMS-III.AJ.: Recovery and recycling of materials from solid wastes (v7.0) +* Project start date: 1 August 2022 (see link) +* Methodology Resource Link + * AMS-III.BA: [https://cdm.unfccc.int/methodologies/DB/TO0E8JPL9361FDB1IPF0TUPS0WJXV3](https://cdm.unfccc.int/methodologies/DB/TO0E8JPL9361FDB1IPF0TUPS0WJXV3) + * AMS-III.AJ.: [https://cdm.unfccc.int/methodologies/DB/R22750M155F84YR0D4YVYOS0CLSCII](https://cdm.unfccc.int/methodologies/DB/R22750M155F84YR0D4YVYOS0CLSCII) + +## Registered Vehicle Scrapping Facility (RVSF) + +A recycling center is associated with the project but ingests ELV assets for scrapping for material, allowing for individual ELV scrapped assets to be tracked back to the RC. + +* Unique Identifier (UUID) +* RVSF Name +* RVSF Address +* RVSF POC Name +* RVSF POC Contact Number +* Geographic Location (lat, long) + +## Claim / MRV (ELV Submission and certificate of deposit) + +This stage for Measurement Reporting and Verification (MRV) will be where a given ELV is submitted to a RSVF to be scrapped to generate a certificate of deposit. The goal here is to record as much information as possible relating to the certificate in addition to the generated carbon values with a subset of raw material data. + +In addition, we can add a verification payload to ensure that the data that MMCM sends to the DOVU platform has proof of original signed proofs in place, this will later be reinforced from solutions like are offered from demia. + +* Unique Identifier (UUID) +* Proof + * Certificate of Deposit OR + * Certificate of Vehicle Scrapping +* Proof UID + * Certificate of Deposit - COD2022109DL5SR8634 + * Certificate of Vehicle Scrapping - CVS20230430GJ07R7461 +* Proof Hash (CID - IPFS) + * (we will use a link for the demo but this can be a hash for privacy reasons) + * [https://cloudflare-ipfs.com/ipfs/bafybeiafql4r5xn6nyuamktltmjnklapiyck5w6mtpx7pragvhtr56iase/COD1161.pdf](https://cloudflare-ipfs.com/ipfs/bafybeiafql4r5xn6nyuamktltmjnklapiyck5w6mtpx7pragvhtr56iase/COD1161.pdf) +* Carbon Emission Reduction (ER) - tCO2e + * 0.6 tCO2e per 1000kgs of End Of Life Vehicle scrapped +* Vintage + * Year +* Properties + * Materials (All in Metric Tons) + * Ferrous (Tons) + * Aluminum (Tons) + * Copper (Tons) + * Plastics (Tons) + * Glass (Tons) + * Tyres (Tons) + * Precious Metals (Tons) + * Others (Tons) + * Fluids (Tons) + * ELV + * Vehicle ID Type (Categories: Registration Number, Chassis Number, or Engine Number) + * Vehicle RC Number (Masked; Actual Regn. No, Chassis No., or Engine No.) + * Vehicle Type (LMV/Motor Car) + * Vehicle Unladen Weight (Tons) + * Maker + * Fuel Type + +The purpose here is to view all the details that I have been created from the original certificate of deposit, and while at the same time, introduce all of the unique fields within the claim object itself to make up the MRV component. diff --git a/docs/guardian/demo-guide/carbon-offsets/gold-standard-afforestation-and-reforestation-ar-v2.0.md b/docs/guardian/demo-guide/carbon-offsets/gold-standard-afforestation-and-reforestation-ar-v2.0.md index c0eb9c74e7..1a4cf61bcd 100644 --- a/docs/guardian/demo-guide/carbon-offsets/gold-standard-afforestation-and-reforestation-ar-v2.0.md +++ b/docs/guardian/demo-guide/carbon-offsets/gold-standard-afforestation-and-reforestation-ar-v2.0.md @@ -36,8 +36,6 @@ Now we will be creating the Policy. Click on the "Policies" tab and select "Poli For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button. -The policy can also be imported by using IPFS timestamp: 1707206651.379730003 - Once the policy is imported successfully, you get two options: Publish and Dry Run mode. We select the Dry Run option and select Go.
diff --git a/docs/guardian/demo-guide/carbon-offsets/gold-standard-carbon-sequestration-through-accelerated-carbonation-of-concrete-aggregate.md b/docs/guardian/demo-guide/carbon-offsets/gold-standard-carbon-sequestration-through-accelerated-carbonation-of-concrete-aggregate.md index 1e2a500713..c5abdad9a8 100644 --- a/docs/guardian/demo-guide/carbon-offsets/gold-standard-carbon-sequestration-through-accelerated-carbonation-of-concrete-aggregate.md +++ b/docs/guardian/demo-guide/carbon-offsets/gold-standard-carbon-sequestration-through-accelerated-carbonation-of-concrete-aggregate.md @@ -83,14 +83,12 @@ Carbon sequestration projects play a crucial role in addressing global climate c ### Policy Workflow -
+
### Policy Guide This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Policy: 1706888033.418420003 - ### Available Roles **Project Proponent -** The project proponent is responsible for executing the emission reduction project. The project proponent must adhere to the requirements outlined by Gold Standard’s methodology and provide evidence of the emission reductions achieved. Upon successful verification, the project proponent receives Verified Emission Reductions (VER) as an incentive for their emission reductions. @@ -126,23 +124,23 @@ Note: If you would like to organize your data before adding it to the project f 1. Create a new user and assign role as Project Proponent. -![](<../../../.gitbook/assets/1 (1) (1).png>) +![](<../../../.gitbook/assets/1 (1) (1) (1).png>) -![](<../../../.gitbook/assets/2 (1) (1).png>) +![](<../../../.gitbook/assets/2 (1) (1) (1).png>) 2. Create a New project by clicking on "New Project" button and enter all the required details. -![](<../../../.gitbook/assets/3 (1) (1).png>) +![](<../../../.gitbook/assets/3 (1) (1) (1).png>) -![](<../../../.gitbook/assets/4 (1) (1).png>) +![](<../../../.gitbook/assets/4 (1) (1) (1).png>) 3. Once project details are submitted, the Registry adds the project to the project pipeline. -![](<../../../.gitbook/assets/5 (1) (1).png>) +![](<../../../.gitbook/assets/5 (1) (1) (1).png>) 4. Now, we create a new user and assign its role as VVB. -![](<../../../.gitbook/assets/6 (1) (1).png>) +![](<../../../.gitbook/assets/6 (1) (1) (1).png>) ![](<../../../.gitbook/assets/7 (1) (1).png>) diff --git a/docs/guardian/demo-guide/carbon-offsets/goldstandard-metered-energy-cooking.md b/docs/guardian/demo-guide/carbon-offsets/goldstandard-metered-energy-cooking.md index b9db54b164..eb3a92befd 100644 --- a/docs/guardian/demo-guide/carbon-offsets/goldstandard-metered-energy-cooking.md +++ b/docs/guardian/demo-guide/carbon-offsets/goldstandard-metered-energy-cooking.md @@ -12,13 +12,13 @@ description: Policy developed by Gautam Prajapati during the SBS Hackathon * [Demo Video](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) * [Policy Workflow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) * [Policy Guide](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Available Roles](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Important Documents & Schemas](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Token(Carbon credit)](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Step By Step](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Registry(Gold Standard) Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [Project Proponent Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) - * [VVB Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) +* [Available Roles](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) +* [Important Documents & Schemas](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) +* [Token(Carbon credit)](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) +* [Step By Step](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) + * [Registry(Gold Standard) Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) + * [Project Proponent Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) + * [VVB Flow](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) * [Futureproofing(Automated credit issuance)](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) * [TODO](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) * [Existing Cookstove Policy Comparison](https://github.com/hashgraph/guardian/blob/main/docs/guardian/demo-guide/carbon-offsets/broken-reference/README.md) @@ -55,7 +55,7 @@ This approach is more precise than traditional methodologies, which rely on more ### Policy Workflow -
+
### Policy Guide @@ -129,7 +129,7 @@ Registry is allowed to publish and edit policy config, schemas, tokens and all t
-
+
3. Once project is approved by registry, a detailed PDD(project design document) needs to be submitted. This is the most important document highlighting the technical details of project. It includes calculations around baseline, project and leakage scenarios for accurate calculation of avoided emissions. diff --git a/docs/guardian/demo-guide/carbon-offsets/improved-cookstove.md b/docs/guardian/demo-guide/carbon-offsets/improved-cookstove.md index b6a6a33419..3d9fe46bb5 100644 --- a/docs/guardian/demo-guide/carbon-offsets/improved-cookstove.md +++ b/docs/guardian/demo-guide/carbon-offsets/improved-cookstove.md @@ -40,7 +40,7 @@ We need to first import the policy from open source repository. Once imported, there will be 2 additional users with different roles (aside from the Standard Registry) that need to be created. Create a user account for the Project Developer. Once created and entered into the Policy, select the Project Developer role from the drop-down. -
+
Fill out the Agent Application and wait for the approval. @@ -52,39 +52,39 @@ The next step is to create a user account for the verifier. Once created and ent Fill out the Agent Application to become a verifier and wait for approval. -
+
Now log back into the Standard Registry account and go into the policy. You will notice now two approvals waiting for action. -
+
The next step is for the Project Developer to create a new project. Do this by logging into the Project Developer policy screen, clicking on the "Create new project" button, and filling out the "Project Listing Application" form. -
+
-
+
Logging back into the Standard Registry role, you can see that the Project Listings now has a new review request. -
+
-
+
Now, the Project Developer must go into their screen and "Submit a PDD" and fill out the Project Design Document form. -
+
-
+
Now, the Project Developer must go into their screen and "Submit a PDD" and fill out the Project Design Document form.
-
+
The Verifier must now go into their Policy screen and view the PDD by click on the "Review button" and filling out the review form. -
+
After that, the Verifer can select a Review ID and "Finalise review." @@ -94,13 +94,13 @@ After that, the Verifer can select a Review ID and "Finalise review." Once the PDD has been verified, the Project Developer can "Request registration." -
+
-
+
The Standard Registry can log into their Policy screen, view the incoming Project Registration, and approve it. -
+
Once the Standard Registry approved the Project Developer's Project Registration, the Project Developer can submit the report by clicking on the "Submit MR" button and filling out the form. @@ -112,7 +112,7 @@ Once the Monitoring Report has been submitted to the Verifier, the Verifier can
-
+
The Verifier can submit the Review ID and "Finalise review" @@ -120,14 +120,14 @@ The Verifier can submit the Review ID and "Finalise review" At this point in the methodology workflow, the Project Developer can "request credit issuance" by clicking on the "Request credit issuance button" and filling out the Request ICCC issuance form. -
+
-
+
The Standard Registry can now see the Credit Issuance request and approve it. -
+
Once approved, you can see the Trustchain in the Token History tab of the Standard Registry's policy account. -
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/pwrm0002-plastic-waste-recycling.md b/docs/guardian/demo-guide/carbon-offsets/pwrm0002-plastic-waste-recycling.md index 19b65448bf..f2b945849e 100644 --- a/docs/guardian/demo-guide/carbon-offsets/pwrm0002-plastic-waste-recycling.md +++ b/docs/guardian/demo-guide/carbon-offsets/pwrm0002-plastic-waste-recycling.md @@ -30,18 +30,16 @@ Plastic waste presents an escalating environmental crisis, with over 300 million ## Demo Video -Coming Soon +[Youtube](https://youtu.be/S1nyOxvnf3A?si=IWd6maYKIurLq4jU) ## Policy Workflow -
+
## Policy Guide This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Policy: - ## Available Roles * Project Proponent - The project proponent is responsible for executing the waste reduction project. The project proponent must adhere to the requirements outlined by Verra’s Plastic Waste Reduction Standard and provide evidence of the waste collection achieved. Upon successful verification, the project proponent receives Waste Recycling Credits (WRC) as an incentive for their waste reductions. @@ -61,78 +59,78 @@ Waste Recycling Credit (WRC), each equivalent to (1) tonne of plastic that has b 1. Import the policy using IPFS or Policy File. -
+
-
+
-
+
2. Set the policy to Dry Run or Publish it using the dropdown. Then select “Register”. -
+
-
+
3. Create a new user and assign their role as the Project Proponent. -
+
4. Create a new project by clicking on the "New Project" button and enter all the required details. -
+
5. Once the project details are submitted, Verra can add it to the project pipeline. -
+
6. The Standard Registry can now add the project to the project pipeline by selecting “Add”. -
+
7. Now, we create a new user and assign its role as the VVB -
+
8. The VVB now has to provide their name. -
+
9. Once the VVB’s name is set, the VVB waits for SR to approve it. -
+
10. Now we log in as SR and approve the VVB. -
+
11. Log in as the Project Proponent and assign the VVB to the project using the dropdown. -
+
12. Once the VVB is assigned, the VVB will now have access to the project for validation/verification. -
+
13. Once validated, we log in as Project Proponent and add a monitoring report. -
+
-
+
14. Once the report is submitted, we now log in as the VVB and validate the monitoring report by clicking on the “Verify” button. -
+
15. Once the monitoring report is validated, we log in as the SR and click on “Mint” to mint the tokens. -
+
16. Once minting is completed, we can view tokens in the “VPs” tab -
+
17. The TrustChain can also be viewed by clicking on the “View TrustChain” button: -
+
-
+
diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-afforestation-reforestation-and-revegetation-arr-v0.1.md b/docs/guardian/demo-guide/carbon-offsets/verra-afforestation-reforestation-and-revegetation-arr-v0.1.md index 80757c2f5f..4e737eeba7 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-afforestation-reforestation-and-revegetation-arr-v0.1.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-afforestation-reforestation-and-revegetation-arr-v0.1.md @@ -38,8 +38,6 @@ Now we will be creating the Policy. Click on the "Policies" tab and select "Poli For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button. -Policy can also be imported by using IPFS timestamp: 1707209648.628432394 - Once the policy is imported successfully, you get two options: Publish and Dry Run mode. We select the Dry Run option and select Go.
diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-pwrm0001-plastic-waste-reduction-methodology.md b/docs/guardian/demo-guide/carbon-offsets/verra-pwrm0001-plastic-waste-reduction-methodology.md index 255ecbba4d..f36a050a99 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-pwrm0001-plastic-waste-reduction-methodology.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-pwrm0001-plastic-waste-reduction-methodology.md @@ -1,4 +1,4 @@ -# ⬇ Verra PWRM0001: Plastic Waste Reduction Methodology +# ⬇️ Verra PWRM0001: Plastic Waste Reduction Methodology ## Table of Contents @@ -38,9 +38,7 @@ Considering escalating environmental concerns and the imperative to safeguard ou ### Demo Video -[https://youtu.be/Xu0lGnJTT3s?si=hKQLuV-5nuL-lLQY](https://youtu.be/Xu0lGnJTT3s?si=hKQLuV-5nuL-lLQY) - -![](<../../../.gitbook/assets/0 (4).jpeg>) +[Youtube](https://youtu.be/Xu0lGnJTT3s?si=hKQLuV-5nuL-lLQY) ### Policy Workflow @@ -48,7 +46,7 @@ Considering escalating environmental concerns and the imperative to safeguard ou ### Policy Guide -This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp : 1707206885.406272003 +This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. ### Available Roles diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-redd+-demo-guide.md b/docs/guardian/demo-guide/carbon-offsets/verra-redd+-demo-guide.md index d030322543..8f7464c22b 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-redd+-demo-guide.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-redd+-demo-guide.md @@ -27,7 +27,7 @@ REDD 2.2.2 = 1707207149.487956003 Verra REDD Policy 3 groups = 1707207286.119377003 ``` -
+
Once Policy is imported successfully, you get two options : Publish and Dry Run mode. diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-redd_3-user-journey-demo-ui-guide.md b/docs/guardian/demo-guide/carbon-offsets/verra-redd_3-user-journey-demo-ui-guide.md index f6fe4ff146..d745a4cc06 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-redd_3-user-journey-demo-ui-guide.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-redd_3-user-journey-demo-ui-guide.md @@ -16,7 +16,7 @@ description: >- You will need to run the installation commands, open a tab on your browser and navigate to [http://localhost:3000/](http://localhost:3000/). -In this demo we will import the Verra REDD Policy = 1698754217.516521003 +In this demo we will import the Verra REDD Policy. ### Verra REDD\_3 for the Standard Registry @@ -57,9 +57,7 @@ In this case we want to **“import**” a policy which will also import all sch Once you have decided that you want to import a specific Verra Policy, you will need to choose one of the following Hedera message IDs. -For this demo we will use the Verra REDD 3, - -**Verra REDD Policy 3 groups = 1698754217.516521003** +For this demo we will use the Verra REDD 3. Once you have chosen one, you will add this to the ‘Hedera message Timestamp’ pop up which will then allow you to preview the policy. If you intend to import this policy as a new version of another that you have already been using, just select which policy you wish to refer to under the **“Version of”**. Once you have done your preview you can click on **“Import”**. diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-vm0017-redd+-methodology.md b/docs/guardian/demo-guide/carbon-offsets/verra-vm0017-redd+-methodology.md index 2892f4e54d..3a2f2859bd 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-vm0017-redd+-methodology.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-vm0017-redd+-methodology.md @@ -38,7 +38,7 @@ You'll now be prompted to configure your Standard Registry account. Go through t Now we will be creating the Policy. Click on the "Policies" tab and select "Policies." We have two ways to create policies. -For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button through IPFS timestamp: 1707207701.007757003 +For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button. Once the policy is imported successfully, you get two options: Publish and Dry Run mode. We select the Dry Run option and select Go. diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-vm0041.md b/docs/guardian/demo-guide/carbon-offsets/verra-vm0041.md index 46e2777c53..c7209fbc1e 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-vm0041.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-vm0041.md @@ -62,9 +62,7 @@ VM0041 represents a pivotal methodology in addressing methane emissions within t ### Demo Video -[https://youtu.be/yym5TjkxQAs?si=\_N-sE8IvMJS030Xk](https://youtu.be/yym5TjkxQAs?si=\_N-sE8IvMJS030Xk) - -![Video titled: VM0041 - Reduction of Enteric Methane Emissions from Ruminants through the Use of Feed Ingredients](<../../../.gitbook/assets/0 (1).jpeg>) +[Youtube](https://youtu.be/yym5TjkxQAs?si=\_N-sE8IvMJS030Xk) ### Policy Workflow @@ -74,8 +72,6 @@ VM0041 represents a pivotal methodology in addressing methane emissions within t This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Policy: 1707208032.927115206 - ### Available Roles Project Proponent - The project proponent is responsible for executing the emission reduction project. The project proponent must adhere to the requirements outlined by Verra’s VCS program and provide evidence of the emission reductions achieved. Upon successful verification, the project proponent receives Verified Carbon Units (VCU) as an incentive for their emission reductions. @@ -98,21 +94,21 @@ Verified Carbon Unit (VCU) credits, each equivalent to one tonne of CO2. 1. Create a new user and assign role as Project Proponent. -![](<../../../.gitbook/assets/2 (1) (1) (1).png>) +![](<../../../.gitbook/assets/2 (1) (1) (1) (1).png>) 2. Create a New project by clicking on "New Project" button and enter all the required details. -![](<../../../.gitbook/assets/3 (1) (1) (1).png>) +![](<../../../.gitbook/assets/3 (1) (1) (1) (1).png>) -![](<../../../.gitbook/assets/4 (1) (1) (1).png>) +![](<../../../.gitbook/assets/4 (1) (1) (1) (1).png>) 3. Once project details are submitted, Verra adds the project to the project pipeline. -![](<../../../.gitbook/assets/5 (1) (1) (1).png>) +![](<../../../.gitbook/assets/5 (1) (1) (1) (1).png>) 4. Now, we create a new user and assign its role as VVB -![](<../../../.gitbook/assets/6 (1) (1) (1).png>) +![](<../../../.gitbook/assets/6 (1) (1) (1) (1).png>) 5. We need to set VVB name diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-vm0042-redd+-methodology.md b/docs/guardian/demo-guide/carbon-offsets/verra-vm0042-redd+-methodology.md index ea60f05271..41a0e56965 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-vm0042-redd+-methodology.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-vm0042-redd+-methodology.md @@ -36,7 +36,7 @@ You'll now be prompted to configure your Standard Registry account. Go through t Now we will be creating the Policy. Click on the "Policies" tab and select "Policies." We have two ways to create policies. -For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button through IPFS timestamp: 1707208546.227326003 +For this demo guide, we will use the "Import from Open Source" way. Click on that button and find the policy for this guide and click on the import button. Once the policy is imported successfully, you get two options: Publish and Dry Run mode. We select the Dry Run option and select Go. diff --git a/docs/guardian/demo-guide/carbon-offsets/verra-vm0044.md b/docs/guardian/demo-guide/carbon-offsets/verra-vm0044.md index da8a11b1d1..a561ef9bb4 100644 --- a/docs/guardian/demo-guide/carbon-offsets/verra-vm0044.md +++ b/docs/guardian/demo-guide/carbon-offsets/verra-vm0044.md @@ -51,8 +51,6 @@ Within this digital methodology, users will use a collection of Clean Developmen This policy is published to Hedera network and can either be imported via Github (.policy file) or IPFS timestamp. -Latest Version - 1698670386.926112366 - **Available Roles** Project Proponent - The project proponent is responsible for executing the emission reduction project. The project proponent must adhere to the requirements outlined by Verra’s VCS program and provide evidence of the emission reductions achieved. Upon successful verification, the project proponent receives Verified Carbon Units (VCU) as an incentive for their emission reductions. diff --git a/docs/guardian/readme/getting-started/installation/building-from-source-and-run-using-docker/README.md b/docs/guardian/readme/getting-started/installation/building-from-source-and-run-using-docker/README.md index 914b287acc..949948ffc4 100644 --- a/docs/guardian/readme/getting-started/installation/building-from-source-and-run-using-docker/README.md +++ b/docs/guardian/readme/getting-started/installation/building-from-source-and-run-using-docker/README.md @@ -165,20 +165,32 @@ To know complete process of How to setup IPFS Storage variables, please check [H #### 4.3 Setting up IPFS Filebase Bucket: -To configure the Filebase IPFS provider, set the following variables in the file * -`./configs/.env..guardian.system` +To configure the Filebase IPFS provider, set the following variables in the file `./configs/.env..guardian.system`**:** - ``` - IPFS_STORAGE_API_KEY="Generated Firebase Bucket Token" - IPFS_PROVIDER="filebase" - ``` +``` +IPFS_STORAGE_API_KEY="Generated Firebase Bucket Token" +IPFS_PROVIDER="filebase" +``` + +Create a new "bucket" on Filebase since we utilize the **IPFS Pinning Service API Endpoint** service. The **token** generated for a bucket corresponds to the **IPFS\_STORAGE\_API\_KEY** environment variable within the guardian's configuration. + +For detailed setup instructions, refer to the official [https://docs.filebase.com/api-documentation/ipfs-pinning-service-api](https://docs.filebase.com/api-documentation/ipfs-pinning-service-api). + +**4.4 Implement and test a custom IPFS provider:** + +We provide a flexible workflow for integrating additional IPFS providers: + +* Configure your environment variables under "configs/". +* In the "worker-service" directory, execute `yarn test:ipfs` to: + * Build the project within the directory. + * Run tests to verify the validity of your configuration without needing to build the entire Guardian system. +* To add a new provider, extend the "IpfsProvider" enum in the "ipfs-client" with your provider's enum value and implement your logic following the given examples. Consider the following recommendations: -Create a new "bucket" on Filebase since we utilize the **IPFS Pinning Service API Endpoint** service. The **token** -generated for a bucket corresponds to the **IPFS_STORAGE_API_KEY** environment variable within the guardian's -configuration. + * Design your logic based on interfaces for greater simplicity and maintainability _**(This requires more work in v2.20.x)**_. + * Ensure that a custom validator for your new client is present in the "worker-service". + * Test iteratively by running `yarn test:ipfs` in the "worker-service" directory until your client is fully functional with your desired configuration. -For detailed setup instructions, refer to the -official . + This streamlined process allows any product team to swiftly integrate new IPFS clients into the Guardian system, significantly reducing development time #### 5. Setting up Chat GPT API KEY to enable AI Search and Guided Search: diff --git a/docs/guardian/readme/getting-started/installation/launching-guardian.md b/docs/guardian/readme/getting-started/installation/launching-guardian.md index dbd3a967b7..986a549c03 100644 --- a/docs/guardian/readme/getting-started/installation/launching-guardian.md +++ b/docs/guardian/readme/getting-started/installation/launching-guardian.md @@ -23,7 +23,7 @@ Once you generated Operator ID and Operator Key, we can either click on Next or If Next is clicked, we need to manually setup the Registry or if Restore Data is clicked, it is filled automatically. -![](<../../../../.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1) (1).png>) +![](<../../../../.gitbook/assets/image (23) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) **Note:** The above fields in UI are mandatory only for this default Schema. @@ -60,3 +60,30 @@ Where the list of `attributes` is extendable, and all attributes in it are **opt | Mainnet | 0.0.1368856 | | Testnet | 0.0.2411 | | Previewnet | 0.0.10071 | + +### RETIRE\_CONTRACT\_FILE\_ID and WIPE\_CONTRACT\_FILE\_ID for different Hedera Networks + +
NetworkRETIRE_CONTRACT_FILE_IDWIPE_CONTRACT_FILE_ID
Mainnet0.0.53441160.0.5344170
Testnet0.0.22190.0.2235
+ +### **How to Deploy Contracts on Mainnet using your own account:** + +**Note:** If you wish you have an option to deploy your own instances (from an account that your organization controls - e.g. an ‘official’ account of your organization). We have created scripts for easy deployment you can use. In this case the following procedure needs to be followed: + +1. Navigate to `./guardian-cli`folder. +2. Execute `npm install` followed by `npm run build` and `npm i -g` +3. Now the scripts are ready, and you can execute at the level of the `guardian-cli` folder +4. RETIRE contract deployment: + +`guardian-cli deploy-contract-file ../contracts/retire/Retire.sol Retire {account} {key} -n {network}` + +5. WIPE contract deployment: + +`guardian-cli deploy-contract-file ../contracts/wipe/Wipe.sol Wipe {account} {key} -n {network}` + +Where: + +* `account` - accound ID in hedera +* `key` - its private key +* `network` - the target network (testnet, mainnet, previewnet), by default it uses testnet + +The contract file identifier will be printed out in the terminal. diff --git a/docs/guardian/readme/getting-started/installation/setting-up-environment-parameters.md b/docs/guardian/readme/getting-started/installation/setting-up-environment-parameters.md index f5bdf11a1d..b98adc3bad 100644 --- a/docs/guardian/readme/getting-started/installation/setting-up-environment-parameters.md +++ b/docs/guardian/readme/getting-started/installation/setting-up-environment-parameters.md @@ -1,6 +1,6 @@ # 🏡 Setting up environment parameters -### .env / .env.docker Parameters in `guardian-service` +### `.env / .env.docker` Parameters in `guardian-service`
ParameterPurposeExample
MQ_ADDRESSWeb Socket Addresslocalhost
SERVICE_CHANNELVersion of the Guardianguardian.1
DB_HOSTHostname of the Databaselocalhost
DB_DATABASEDatabase Nameguardian_db
INITIAL_BALANCEInitial Balance Value500
INITIAL_STANDARD_REGISTRY_BALANCESetting Initial Standard Registry Balance500
OPERATOR_IDThe ID of the operation-
OPERATOR_KEYPrivate key of the operator-
LOCALNODE_ADDRESSThe address of the localnode server. This can be its IP address or a domain name1.1.1.1
LOCALNODE_PROTOCOLCommunication protocol for interactions with the local node, can be http or https.http/https
HEDERA_NETType of the Hedera node to transact withtestnet, localnode, mainnet
INITIALIZATION_TOPIC_IDThe ID of the initialization topic.0.0.1960
MESSAGE_LANGLanguage of the message text of all messagesen-US
LOG_LEVELLevel of the Logs2
SEND_KEYS_TO_VAULTChecked if keys to be sent to vaultTrue/False
MULTI_POLICY_SCHEDULERto set custom cron mask (timer mask) for sync job0 0 * * *
CONTRACT_FILE_IDDefines the file identifier in hedera to create smart-contract.0.0.2746
MQ_MESSAGE_CHUNKTo set up the message chunk size500000
HEDERA_CUSTOM_NODESDefine hedera nodes to execute and pay transaction fee0.testnet.hedera.com:50211":"0.0.3
HEDERA_CUSTOM_MIRROR_NODESDefine hedera mirror nodestestnet.mirrornode.hedera.com:443"
MAP_API_KEYDefines api to integrate Map schema typeALZ_X.....
DOCUMENT_CACHE_FIELD_LIMITDefines document field symbols limit for caching.500
BATCH_NFT_MINT_SIZEDefines size of batch of mint NFT transaction10
DIRECT_MESSAGE_PORTPort for direct messages (if not set generate random port)300
DIRECT_MESSAGE_HOSTHost for direct messages (if not set get hostname)localhost
DIRECT_MESSAGE_PROTOCOLProtocol https or http (http by default, https need additional server like nginx)http
MQ_MAX_PAYLOADMax message size for send via message-broker (otherwise create direct message) if not set always send messages using message broker35
RETIRE_CONTRACT_FILE_IDContract file ID for Retirement0.0.2219
WIPE_CONTRACT_FILE_IDContract file ID for wiping0.0.2235
DOCUMENTS_HANDLING_CHUNK_SIZETo set chunk size for delete or create a lot of data (value will affect speed performance communication with DB), default is 500.500
@@ -10,7 +10,7 @@ Values from .env file need to be set up only on first start (when db or vault are empty). Then later if you want it to be changed, you can change it through Settings from admin Panel or through API. {% endhint %} -### .env / .env.docker Parameters in api-gateway +### `.env / .env.docker` Parameters in `api-gateway` | Parameter | Purpose | Example | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | diff --git a/docs/guardian/readme/getting-started/prerequisites.md b/docs/guardian/readme/getting-started/prerequisites.md index bcc4bd5465..6e6120dc37 100644 --- a/docs/guardian/readme/getting-started/prerequisites.md +++ b/docs/guardian/readme/getting-started/prerequisites.md @@ -1,9 +1,11 @@ -# 🗒 Prerequisites +# 🗒️ Prerequisites * [Docker](https://www.docker.com/) (To build with one command) * [MongoDB](https://www.mongodb.com/)[ V6](https://www.mongodb.com/) , [NodeJS](https://nodejs.org/)[ v16](https://nodejs.org/en) and [Nats](https://nats.io/)[ 1.12.2](https://nats.io/) (If you build with docker these components will be installed automatically) * [Hedera Testnet Account](https://portal.hedera.com/) * [Web3.Storage Account](https://web3.storage/) +* [Filebase Account](https://filebase.com/) +* [Redict 7.3.0](https://redict.io/) When building reference implementation, you can manually build every component or run a single command with Docker. diff --git a/docs/guardian/readme/roadmap.md b/docs/guardian/readme/roadmap.md index 8a340d51c2..d69d44e57e 100644 --- a/docs/guardian/readme/roadmap.md +++ b/docs/guardian/readme/roadmap.md @@ -1,4 +1,4 @@ -# 🛣 Roadmap +# 🛣️ Roadmap To get more information on Roadmap, please click: [https://app.zenhub.com/workspaces/guardian-618c27c08661c0001461263a/roadmap?invite=true](https://app.zenhub.com/workspaces/guardian-618c27c08661c0001461263a/roadmap?invite=true) @@ -78,12 +78,6 @@ Introduce the ability to mint Mitigation Asset Type tokens as the result of the Referral Link : [https://github.com/hashgraph/guardian/issues/54](https://github.com/hashgraph/guardian/issues/54) -### FireBlocks Integration - -We need to integrate FireBlocks , a Key management tool to manage the Keys and secure Guardian. To get complete info on Fireblocks, please look at [https://www.fireblocks.com/](https://www.fireblocks.com/) - -Referral Link : [https://github.com/hashgraph/guardian/issues/1314](https://github.com/hashgraph/guardian/issues/1314) - ### Development of AMS-II.J.: Demand-Side Activities for Efficient Lighting Technologies 1. Designing of the Schema and getting it approved. Development of the policy using Schema @@ -127,22 +121,6 @@ Update to memo field VP/DID structure to normalize DID spec with the rest of Hed Referral Link : [https://github.com/hashgraph/guardian/issues/2211](https://github.com/hashgraph/guardian/issues/2211) -### Remove requirement for hardcoded (error prone) status options - -The ability to define states and to link it to a type, perhaps been able to link a button or UI to a set of states. There should be warnings for modifying, a state label or title within the UI, whereby it makes it harder for an asset to be identified. In addition, the validation check should ensure that the correct states have been selected for button objects or other like-UI, to reduce the time and frustration hardcoding different states. - -In short, standardizing all state options for all policies -- perhaps having a new type of button that is linked to a custom state list/enum sat with drop-down links could be the way to go. - -The states could be anything, but the goal would be to be standardized throughout all policies: - -* approved -* rejected -* etc - -While this is good for the demand side of value extraction. This is highly beneficial for the creator of policies as you could select the correct value from a state-list drop down instead of having to hardcode all state options for button, selection or filters for approved or rejected states. - -Referral Link : [https://github.com/hashgraph/guardian/issues/2791](https://github.com/hashgraph/guardian/issues/2791) - ### Development of PWRM0002 Plastic Waste Recycling Methodology, v1.1 Designing of the Schema and getting it approved. @@ -153,12 +131,6 @@ Development of all the tool involved in the policy Referral Link : [https://github.com/hashgraph/guardian/issues/2920](https://github.com/hashgraph/guardian/issues/2920) -### DLT to Address Flawed Methodologies Blog - -Draft and published a blog post on the topic of DLT as a solution to address poor data quality and flawed emission and carbon credit methodologies. - -Referral Link : [https://github.com/hashgraph/guardian/issues/2906](https://github.com/hashgraph/guardian/issues/2906) - ### Development of AMS-I.F.: Renewable Electricity Generation for Captive Use and Mini-Grid 1. Designing of the Schema and getting it approved. @@ -209,9 +181,16 @@ Referral Link: [https://github.com/hashgraph/guardian/issues/2884](https://githu Referral Link : [https://github.com/hashgraph/guardian/issues/2873](https://github.com/hashgraph/guardian/issues/2873) +## ---- April 2024---- +### Full project data comparison as produced/captured by policies -## ---- April 2024---- +Introduce a comparison functionality where it'd be possible to 'diff' arbitrary sections or the entire trust-chains for different tokens, potentially issued by different policies such that the system would: + +* graphically display the differences where a user would then be able to 'scroll' through and review them in the UI +* get a numerical 'similarity score' indicating how similar the two 'chains' are + +Referral Link : [https://github.com/hashgraph/guardian/issues/2704](https://github.com/hashgraph/guardian/issues/2704) ### Live project (data) migration across Policies, across Guardian instances @@ -233,7 +212,7 @@ The migration process should be automated, and should result in the 'stopped' pr Referral Link: [https://github.com/hashgraph/guardian/issues/3176](https://github.com/hashgraph/guardian/issues/3176) -### Development of AMS-III.AU: Methane Emission Reduction by Adjusted Water Management Practice in Rice Cultivation – v.4.0 +## Development of Gold Standard's Methodology for Methane Emission Reduction by Adjusted Water Management Practice in Rice Cultivation Designing of the Schema and getting it approved. @@ -243,6 +222,18 @@ Development of all the tool involved in the policy Referral Link : [https://github.com/hashgraph/guardian/issues/2921](https://github.com/hashgraph/guardian/issues/2921) +### FireBlocks Integration + +We need to integrate FireBlocks , a Key management tool to manage the Keys and secure Guardian. To get complete info on Fireblocks, please look at [https://www.fireblocks.com/](https://www.fireblocks.com/) + +Referral Link : [https://github.com/hashgraph/guardian/issues/1314](https://github.com/hashgraph/guardian/issues/1314) + +### DLT to Address Flawed Methodologies Blog + +Draft and published a blog post on the topic of DLT as a solution to address poor data quality and flawed emission and carbon credit methodologies. + +Referral Link : [https://github.com/hashgraph/guardian/issues/2906](https://github.com/hashgraph/guardian/issues/2906) + ## ---- May 2024---- ### Global environmental/Guardian data search (indexer) component for Hedera and IPFS @@ -253,15 +244,6 @@ Referral Link : [https://github.com/hashgraph/guardian/issues/2921](https://gith Referral Link : [https://github.com/hashgraph/guardian/issues/2629](https://github.com/hashgraph/guardian/issues/2629) -### Full project data comparison as produced/captured by policies - -Introduce a comparison functionality where it'd be possible to 'diff' arbitrary sections or the entire trust-chains for different tokens, potentially issued by different policies such that the system would: - -* graphically display the differences where a user would then be able to 'scroll' through and review them in the UI -* get a numerical 'similarity score' indicating how similar the two 'chains' are - -Referral Link : [https://github.com/hashgraph/guardian/issues/2704](https://github.com/hashgraph/guardian/issues/2704) - ### Revamp Guardian user/roles and permissions model * Fundamentally separate the concept of users, roles and permissions in Guardian @@ -368,4 +350,3 @@ Referral Link : [https://github.com/hashgraph/guardian/issues/2924](https://gith * Identify the business requirements for the Environmental Scorecards, i.e., how they could be used by supply and demand-side actors, markets, etc.? Referral Link : [https://github.com/hashgraph/guardian/issues/1017](https://github.com/hashgraph/guardian/issues/1017) - diff --git a/docs/guardian/standard-registry/bring-your-own-dids/bring-your-own-byo-dids-ui.md b/docs/guardian/standard-registry/bring-your-own-dids/bring-your-own-byo-dids-ui.md index d0db996c1b..035f3d58cf 100644 --- a/docs/guardian/standard-registry/bring-your-own-dids/bring-your-own-byo-dids-ui.md +++ b/docs/guardian/standard-registry/bring-your-own-dids/bring-your-own-byo-dids-ui.md @@ -17,7 +17,7 @@ Enter Hedera network account with non-0 hbar balance to be used by the system fo #### 1.2.1 Default DID -
+
When the ‘Generate new DID document’ option is selected, clicking on the Next button would result in Guardian generating a new dedicated DID to be used exclusively in Guardian based on the Hedera account ID entered at the previous step. Such DID would have the following format: @@ -34,21 +34,21 @@ Example: #### 1.2.2 Externally-controlled (custom) DID -
+
-
+
Selecting ‘Custom DID document’ option enables the dialogue text window where the externally-generated/controlled DID document can be pasted from the clip-board. The document must contain Ed25519VerificationKey2018 and Bls12381G2Key2020 verification methods to be useable by Guardian. ### 1.3 Keys -
+
For BYO DID of Standard Registries, in the cases where there are multiple verification methods Standard Registry users are required to specify which one of them is to be used in Guardian, and pass the corresponding private key into Guardian to be used for signatures. ### 1.4 VC Document -
+
Final step of the registration presents a form, based on the corresponding system schema, for the user to fill out. @@ -56,11 +56,11 @@ Final step of the registration presents a form, based on the corresponding syste ### 2.1. Select the Standard Registry to be associated with -
+
### 2.2 User Hedera Account -
+
Specify the existing Hedera account with non-0 hbar balance to be used for submitting transactions associated with this user’s DID. @@ -68,19 +68,19 @@ Specify the existing Hedera account with non-0 hbar balance to be used for submi #### 2.3.1 Default DID -
+
For more details please refer to Section [1.2.1](bring-your-own-byo-dids-ui.md#id-1.2.1-default-did). #### 2.3.2 Custom DID -
+
For more details, please refer to Section [1.2.2](bring-your-own-byo-dids-ui.md#id-1.2.2-externally-controlled-custom-did) ### 2.4 Keys -
+
For more details, please refer to section [1.3](bring-your-own-byo-dids-ui.md#id-1.3-keys) diff --git a/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migrate-policy-data-asynchronous.md b/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migrate-policy-data-asynchronous.md index 88b218e1f9..61c4ccf1f7 100644 --- a/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migrate-policy-data-asynchronous.md +++ b/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migrate-policy-data-asynchronous.md @@ -1,29 +1,7 @@ # Migrate Policy Data Asynchronous -{% swagger method="post" path="" baseUrl="/policies/push/migrate-data" summary="Migrate policy data asynchronous" %} -{% swagger-description %} -Migrate policy data asynchronous. Only users with the Standard Registry role are allowed to make the request. -{% endswagger-description %} -{% swagger-parameter in="body" type="String" required="true" %} -Migration config. -{% endswagger-parameter %} -{% swagger-response status="202: Accepted" description="Created Task" %} -``` -content: - application/json: - schema: - type: object -``` -{% endswagger-response %} - -{% swagger-response status="500: Internal Server Error" description="Internal Server Error" %} -``` -content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' -``` -{% endswagger-response %} +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/push/migrate-data" method="post" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) {% endswagger %} diff --git a/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md b/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md index ba29949707..ec2ff47b3a 100644 --- a/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md +++ b/docs/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md @@ -1,36 +1,5 @@ # MigratePolicy Data -{% swagger method="post" path="" baseUrl="/policies/migrate-data" summary="Migrate policy data." %} -{% swagger-description %} -Migrate policy data. Only users with the Standard Registry role are allowed to make the request. -{% endswagger-description %} - -{% swagger-parameter in="body" type="String" required="true" %} -Migration config. -{% endswagger-parameter %} - -{% swagger-response status="200: OK" description="Error while Migration" %} -``` -content: - application/json: - schema: - type: array - items: - type: object - properties: - error: - type: string - id: - type: string -``` -{% endswagger-response %} - -{% swagger-response status="500: Internal Server Error" description="Internal Server Error" %} -``` -content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerErrorDTO' -``` -{% endswagger-response %} +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/migrate-data" method="post" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) {% endswagger %} diff --git a/docs/guardian/standard-registry/discontinuing-policy-workflow/user-guide.md b/docs/guardian/standard-registry/discontinuing-policy-workflow/user-guide.md index 363ea7df18..567076a304 100644 --- a/docs/guardian/standard-registry/discontinuing-policy-workflow/user-guide.md +++ b/docs/guardian/standard-registry/discontinuing-policy-workflow/user-guide.md @@ -39,9 +39,11 @@ 4. Schemas : Map the source policy schemas with the destination policy schemas. 5. Roles : Map source policy roles with the destination policy roles. 6. Groups : Map the source policy groups with the destination policy groups. -7. Clicking OK you will start an asynchronous migration task +7. Tokens: Map the token templates +8. Blocks : Block mapping (while state migrating is enabled) +9. Clicking OK you will start an asynchronous migration task -
+
![image9.png](<../../../.gitbook/assets/7 (13).png>) diff --git a/docs/guardian/standard-registry/fireblocks-raw-signing/README.md b/docs/guardian/standard-registry/fireblocks-raw-signing/README.md new file mode 100644 index 0000000000..993dad6c76 --- /dev/null +++ b/docs/guardian/standard-registry/fireblocks-raw-signing/README.md @@ -0,0 +1,2 @@ +# 🔥 FireBlocks Raw Signing + diff --git a/docs/guardian/standard-registry/fireblocks-raw-signing/fireblocks-signing-in-guardian-ui.md b/docs/guardian/standard-registry/fireblocks-raw-signing/fireblocks-signing-in-guardian-ui.md new file mode 100644 index 0000000000..6a891935dd --- /dev/null +++ b/docs/guardian/standard-registry/fireblocks-raw-signing/fireblocks-signing-in-guardian-ui.md @@ -0,0 +1,14 @@ +# Fireblocks signing in Guardian UI + +1\. Enabling Fireblocks Remote Signing: + +When creating a user, select the “**Use fireblocks signing**” option and populate the following fields with values from your Fireblocks account configuration: + +* Fireblocks Vault ID +* Fireblocks Asset ID +* Fireblocks API Key +* Fireblocks Private Key + +![](../../../.gitbook/assets/0.png) + +Users, which have been created with this option enabled to remotely sign their Hedera transactions using Fireblocks API instead of via the built-in Guardian signing workflow. diff --git a/docs/guardian/standard-registry/fireblocks-raw-signing/getting-keys-from-fireblocks-ui.md b/docs/guardian/standard-registry/fireblocks-raw-signing/getting-keys-from-fireblocks-ui.md new file mode 100644 index 0000000000..0303f6b6c0 --- /dev/null +++ b/docs/guardian/standard-registry/fireblocks-raw-signing/getting-keys-from-fireblocks-ui.md @@ -0,0 +1,21 @@ +# Getting Keys from FireBlocks UI + +1. Create API user. + +![image2.png](../../../.gitbook/assets/1.png) + +In new API user dialog, you can download Private key file or upload your custom key file. + +![image3.png](../../../.gitbook/assets/2.png) + +Content of this file you need to pass into “Fireblocks Private Key” field. + +2. When the user was created – click on Key icon to copy API key. + +![image5.png](../../../.gitbook/assets/3.png) + +Use this to fill the “Fireblocks API key” field. + +3. In the FireBlocks console navigate to the “Accounts” tab and select one of the accounts listed. Create a wallet for HBAR (mainnet) or HBAR\_TEST (testnet) asset ID. Click on the wallet created, the number in url should be used for the value in the “Fireblocks Vault ID” field, and the asset name chosen is for the “Fireblocks Asset ID” field. + +![image1.png](../../../.gitbook/assets/4.png) diff --git a/docs/guardian/standard-registry/live-project-data-migration/README.md b/docs/guardian/standard-registry/live-project-data-migration/README.md new file mode 100644 index 0000000000..9849326d45 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/README.md @@ -0,0 +1,2 @@ +# 📁 Live Project Data Migration + diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/README.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/README.md new file mode 100644 index 0000000000..e47824b460 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/README.md @@ -0,0 +1,2 @@ +# ⚙️ APIs related to Live Project Data Migration + diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-data.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-data.md new file mode 100644 index 0000000000..2b806c6508 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-data.md @@ -0,0 +1,7 @@ +# Getting Policy Data + + + +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/{policyId}/data" method="get" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) +{% endswagger %} diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-tag-block-map.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-tag-block-map.md new file mode 100644 index 0000000000..8da32ffb11 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-tag-block-map.md @@ -0,0 +1,7 @@ +# Getting Policy Tag Block Map + + + +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/{policyId}/tag-block-map" method="get" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) +{% endswagger %} diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-virtual-keys.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-virtual-keys.md new file mode 100644 index 0000000000..2c68ba72b6 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/getting-policy-virtual-keys.md @@ -0,0 +1,7 @@ +# Getting Policy Virtual Keys + + + +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/{policyId}/virtual-keys" method="get" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) +{% endswagger %} diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-data.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-data.md new file mode 100644 index 0000000000..17fbdce51b --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-data.md @@ -0,0 +1,7 @@ +# Uploading Policy Data + + + +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/data" method="post" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) +{% endswagger %} diff --git a/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-virtual-keys.md b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-virtual-keys.md new file mode 100644 index 0000000000..c9beeee59c --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/apis-related-to-live-project-data-migration/uploading-policy-virtual-keys.md @@ -0,0 +1,7 @@ +# Uploading Policy Virtual Keys + + + +{% swagger src="../../../../.gitbook/assets/swagger (1).yaml" path="/policies/{policyId}/virtual-keys" method="post" %} +[swagger (1).yaml](<../../../../.gitbook/assets/swagger (1).yaml>) +{% endswagger %} diff --git a/docs/guardian/standard-registry/live-project-data-migration/live-project-data-migration-ui.md b/docs/guardian/standard-registry/live-project-data-migration/live-project-data-migration-ui.md new file mode 100644 index 0000000000..38a94961d7 --- /dev/null +++ b/docs/guardian/standard-registry/live-project-data-migration/live-project-data-migration-ui.md @@ -0,0 +1,39 @@ +# ↔️ Live Project Data Migration UI + +## 1. Exporting Policy Data + +We have added button "**Export policy data**" for published policies and dry-run policies. + +By clicking you will get all policy data in the **.data** file. + +Then you can use this file for migrating data to another policy. + +
+ +## 2. Importing/Exporting Keys for Dry Run Policies + +We have added buttons "**Export/Import virtual keys**" for dry-run policies. + +By clicking you will get virtual user’s keys and DID Documents. + +Then you can import it in another dry-run policy, where data was migrated from current policy. + +
+ +## 3. Migrating Policy State to Destination Policy + +We have added "**Migrate policy state**" flag to migrate data dialog. + +When you enable it, you will migrate all policy state to destination policy (includes block states - steps, timers, multi-sign, split documents, aggregate documents, etc...) + +To get information about different steps in the below migration process screen, please refer to [Migration Process](../discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data.md) + +
+ +## 4. Change VC Document during Migration + +We have added ability to change VC which will be migrated by clicking on "**Edit document**" button under operations column: + +
+ +
diff --git a/docs/guardian/standard-registry/notifications/user-guide.md b/docs/guardian/standard-registry/notifications/user-guide.md index e28b939a27..71a750915e 100644 --- a/docs/guardian/standard-registry/notifications/user-guide.md +++ b/docs/guardian/standard-registry/notifications/user-guide.md @@ -9,7 +9,7 @@ Added notification icon and also tooltip with count of unread notifications: -![image4.png](<../../../.gitbook/assets/0 (1) (1).png>) +![image4.png](<../../../.gitbook/assets/0 (1) (1) (1).png>) ### 2. View : diff --git a/docs/guardian/standard-registry/policies/auto-suggestion/demo-using-ui.md b/docs/guardian/standard-registry/policies/auto-suggestion/demo-using-ui.md index 4021b1cabd..1efaed9c4b 100644 --- a/docs/guardian/standard-registry/policies/auto-suggestion/demo-using-ui.md +++ b/docs/guardian/standard-registry/policies/auto-suggestion/demo-using-ui.md @@ -6,7 +6,7 @@ 1. It allows to setup suggestion priority order of policies and modules. A user with SR role can drag and drop items to create specific prioritized sequence of policies to use for suggestions. -
+
2. Suggestion mode can be turned on by clicking on “Suggestions” button in policy/module configurator diff --git a/docs/guardian/standard-registry/policies/block-policy-discoverability/search-block-using-ui.md b/docs/guardian/standard-registry/policies/block-policy-discoverability/search-block-using-ui.md index 108de05251..a8bb48963c 100644 --- a/docs/guardian/standard-registry/policies/block-policy-discoverability/search-block-using-ui.md +++ b/docs/guardian/standard-registry/policies/block-policy-discoverability/search-block-using-ui.md @@ -9,19 +9,19 @@ Blocks of similar configuration can be searched by clicking on search icon with respect to the block as shown below: -
+
## 2. Search Result Search result displays all the policies and its blocks, which have same flow with respect to the base block search. -
+
### 2.1 Context The search finds and displays the ranked list (most similar on top) of longest continuous matching sequences of blocks surrounding the target block (highlighted). The search considers all dimensions - next/previous, parent/child - to be of equal weight and thus ranks results by the number of blocks in the found ‘similar’ sequence. -
+
Additionally, the system compares the configuration of the blocks individually, and displays the %% of similarity to the right of each block in comparison with the corresponding blocks in the base policy. @@ -35,13 +35,13 @@ Clicking “Apply” button will transfer (or apply) the configuration of the fo **Note:** Original settings of the base policy block will be lost if ‘Apply’ action is executed. {% endhint %} -
+
### 2.3 Search Results Layout Display Search results are displayed as folded groups by Policy (policy name is displayed in the group heading). -
+
The results are sorted by (in the correct order): @@ -49,7 +49,7 @@ The results are sorted by (in the correct order): 2\. Cumulative similarity score (%%) of the blocks -
+
## 2. Demo Video diff --git a/docs/guardian/standard-registry/policies/block-policy-discoverability/search-policy-using-ui.md b/docs/guardian/standard-registry/policies/block-policy-discoverability/search-policy-using-ui.md index 79dd5f309d..3ee5a0f158 100644 --- a/docs/guardian/standard-registry/policies/block-policy-discoverability/search-policy-using-ui.md +++ b/docs/guardian/standard-registry/policies/block-policy-discoverability/search-policy-using-ui.md @@ -7,15 +7,15 @@ Policies can be searched by clicking on "Search policies" button. It can be searched based on their similarity to the given policy. -
+
The results are displayed in the descending order, the most similar policy is displayed at the top. It also displays similarity rate percentage. -
+
We can also have an option for full display mode of similarity result as shown: -
+
## 2. Demo Video diff --git a/docs/guardian/standard-registry/policies/demo-on-integrating-external-policies-using-ui.md b/docs/guardian/standard-registry/policies/demo-on-integrating-external-policies-using-ui.md index 7e8442634b..4455c3dc64 100644 --- a/docs/guardian/standard-registry/policies/demo-on-integrating-external-policies-using-ui.md +++ b/docs/guardian/standard-registry/policies/demo-on-integrating-external-policies-using-ui.md @@ -21,7 +21,7 @@ Here are the following steps to Integrate external policies as data sources: 4. This is the final step which confirms the linking of the policies via their documents. -
+
{% hint style="info" %} **Note:** Documents between the policies are synchronized automatically. Additionally, it can also be synched by clicking on sync button as shown below: diff --git a/docs/guardian/standard-registry/policies/library-of-policy-examples/creating-and-using-roles.md b/docs/guardian/standard-registry/policies/library-of-policy-examples/creating-and-using-roles.md index 7523f4a70a..910227d63d 100644 --- a/docs/guardian/standard-registry/policies/library-of-policy-examples/creating-and-using-roles.md +++ b/docs/guardian/standard-registry/policies/library-of-policy-examples/creating-and-using-roles.md @@ -8,7 +8,7 @@ For a demo example of following steps, here is the policy timestamp: **167516453 1. Switch to the Roles tab -![Roles Tab](<../../../../.gitbook/assets/0 (1) (1) (1).png>) +![Roles Tab](<../../../../.gitbook/assets/0 (1) (1) (1) (1).png>) 2. Create 2 new roles called ‘**Example role 1**_’ and_ ‘_**Example role 2**_’ diff --git a/docs/guardian/standard-registry/policies/library-of-policy-examples/data-input-via-forms-using-roles-to-partition-user-activities..md b/docs/guardian/standard-registry/policies/library-of-policy-examples/data-input-via-forms-using-roles-to-partition-user-activities..md index 7e501303d8..158080f080 100644 --- a/docs/guardian/standard-registry/policies/library-of-policy-examples/data-input-via-forms-using-roles-to-partition-user-activities..md +++ b/docs/guardian/standard-registry/policies/library-of-policy-examples/data-input-via-forms-using-roles-to-partition-user-activities..md @@ -29,7 +29,7 @@ See detailed information about the Roles in [Example 1](creating-and-using-roles 1.1 Go to ‘Schemas’ tab and create a new schema -![Creating new Schema](<../../../../.gitbook/assets/1 (1) (1) (1) (1).png>) +![Creating new Schema](<../../../../.gitbook/assets/1 (1) (1) (1) (1) (1).png>) 1.2 To make sure there is some demo/test data content in this schema create 3 fields: @@ -46,19 +46,19 @@ See detailed information about the Roles in [Example 1](creating-and-using-roles For this ‘**interfaceStepBlock**’ is required with ‘**Cyclic**’ option enabled. This will allow to return to the initial state after the document was saved. -![InterfaceStepBlock is added as cyclic\_container](<../../../../.gitbook/assets/3 (1) (1) (1) (1) (1).png>) +![InterfaceStepBlock is added as cyclic\_container](<../../../../.gitbook/assets/3 (1) (1) (1) (1) (1) (1).png>) 2.2 Add ‘**requestVcDocumentBlock**’ into the ‘_cyclic\_container_’ -![Adding requestVcDocumentBlock into cyclic\_container](<../../../../.gitbook/assets/4 (1) (1) (1) (1) (1).png>) +![Adding requestVcDocumentBlock into cyclic\_container](<../../../../.gitbook/assets/4 (1) (1) (1) (1) (1) (1).png>) 2.3 Then select the previously created Schema -![Selecting already created Schema](<../../../../.gitbook/assets/5 (1) (1) (1) (1) (1).png>) +![Selecting already created Schema](<../../../../.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png>) 2.4 Select ‘New UUID’ to configure automatic generation of unique IDs for each document -![Selecting UUID](<../../../../.gitbook/assets/6 (1) (1) (1) (1).png>) +![Selecting UUID](<../../../../.gitbook/assets/6 (1) (1) (1) (1) (1).png>) 2.5 By default ‘**requestVcDocumentBlock**’ is displayed as a Form covering the entire page. To prevent this choose ‘**DIALOG**’ value for the field ‘Type’. diff --git a/docs/guardian/standard-registry/policies/library-of-policy-examples/token-operations.md b/docs/guardian/standard-registry/policies/library-of-policy-examples/token-operations.md index 21993d0c24..e10f04ff34 100644 --- a/docs/guardian/standard-registry/policies/library-of-policy-examples/token-operations.md +++ b/docs/guardian/standard-registry/policies/library-of-policy-examples/token-operations.md @@ -14,7 +14,7 @@ Second step of policy execution is data input and document submission. To enable To enable document submission we will use document input block (**requestVcDocumentBlock**) and document persistence block (**sendToGuardianBlock**) -![creating new\_user\_registration Block](<../../../../.gitbook/assets/0 (1) (1) (1) (1).png>) +![creating new\_user\_registration Block](<../../../../.gitbook/assets/0 (1) (1) (1) (1) (1).png>) **Please see** [**example 2**](data-input-via-forms-using-roles-to-partition-user-activities..md) **for the more in-depth guide of working with documents in Guardian Policies.** @@ -46,7 +46,7 @@ Switch to the ‘**Tokens**’ tab and create a new token 2.2.2 Select token and the action type -![Selecting Token and Action Type](<../../../../.gitbook/assets/5 (1) (1) (1) (1) (1) (1).png>) +![Selecting Token and Action Type](<../../../../.gitbook/assets/5 (1) (1) (1) (1) (1) (1) (1).png>) 3. User ‘**tokenActionBlock**_**’**_ to mint tokens diff --git a/docs/guardian/standard-registry/policies/modules/modules-differentiation/module-differentiation-using-ui.md b/docs/guardian/standard-registry/policies/modules/modules-differentiation/module-differentiation-using-ui.md index dc3e6f8deb..3fd9c78c24 100644 --- a/docs/guardian/standard-registry/policies/modules/modules-differentiation/module-differentiation-using-ui.md +++ b/docs/guardian/standard-registry/policies/modules/modules-differentiation/module-differentiation-using-ui.md @@ -47,7 +47,7 @@ Once, compare button is clicked, we need to select the first and second modules Block comparison structure can be expanded to view the comparison of their Properties: -![image4.png](<../../../../../.gitbook/assets/3 (1) (1) (1) (1).png>) +![image4.png](<../../../../../.gitbook/assets/3 (1) (1) (1) (1) (1).png>) * * diff --git a/docs/guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-policy-from-a-zip-file-with-metadata.md b/docs/guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-policy-from-a-zip-file-with-metadata.md new file mode 100644 index 0000000000..2d0654f5b8 --- /dev/null +++ b/docs/guardian/standard-registry/policies/policy-creation/apis-for-asynchronous-execution/importing-policy-from-a-zip-file-with-metadata.md @@ -0,0 +1,5 @@ +# Importing Policy from a Zip file with Metadata + +{% swagger src="../../../../../.gitbook/assets/swagger.yaml" path="/policies/push/import/file-metadata" method="post" %} +[swagger.yaml](../../../../../.gitbook/assets/swagger.yaml) +{% endswagger %} diff --git a/docs/guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/importing-policy-from-a-zip-file-with-metadata.md b/docs/guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/importing-policy-from-a-zip-file-with-metadata.md new file mode 100644 index 0000000000..ee2cf9c595 --- /dev/null +++ b/docs/guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/importing-policy-from-a-zip-file-with-metadata.md @@ -0,0 +1,5 @@ +# Importing Policy from a Zip file with Metadata + +{% swagger src="../../../../../.gitbook/assets/swagger.yaml" path="/policies/import/file-metadata" method="post" %} +[swagger.yaml](../../../../../.gitbook/assets/swagger.yaml) +{% endswagger %} diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md index 233ac8bf3b..aab5e68c8f 100644 --- a/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md @@ -48,3 +48,4 @@ Starting with the [Wikipedia definition](https://en.wikipedia.org/wiki/Workflow\ | externalTopicBlock | This block allows to configure the link to Hedera topics established by other policy instances for monitoring of ‘document published’ messages and ingestion of the targeted VC documents. | [externalTopicBlock](externaltopicblock.md) | | messagesReportBlock | This block allows to create report based on the inter-referenced messages. | [messagesReportBlock](messagesreportblock.md) | | notificationBlock | This block is used to generate notifications | [notificationBlock](notificationblock.md) | +| externalDataBlock | This block extractDataBlock provides means to extract a data set which corresponds to any of these embedded schemas (at any depth level) | [externalDataBlock](external-data-workflow-block.md) | diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/externaldatablock.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/externaldatablock.md new file mode 100644 index 0000000000..942b14407f --- /dev/null +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/externaldatablock.md @@ -0,0 +1,18 @@ +# externalDataBlock + +This block is used for VC documents which are based on (or ‘conform to’) a schema which contains embedded schemas, extractDataBlock provides means to extract a data set which corresponds to any of these embedded schemas (at any depth level), and if required after processing to return the updated values back into the VC dataset to their original ‘place’. + +## 1. Properties + +| Property Name | Details | Example | Status | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| Action | an action which is executed by the block |

o Get – find and extract the part of the document which corresponds to the specified schema

o Set – update the part of the document, which corresponds to the specified schema, with new data

| | +| Schema | the schema which is target of the action. It is used to identify the embedded part of the data object - i.e. the field in the document which corresponds to this schema | Contact Details (1.1) | | + +### 1.1 Extraction + +
+ +### 1.2 Update + +
diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/multisignblock.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/multisignblock.md index 77b8c38554..635565dd86 100644 --- a/docs/guardian/standard-registry/policies/policy-creation/introduction/multisignblock.md +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/multisignblock.md @@ -78,7 +78,7 @@ This block provides a way to specify multiple signators for a single VC document 4.1.1 multiSignBlock must be used with Groups. -
+
4.1.2 multiSignBlock must be child block of grid block to receive all data it requires to operate. @@ -102,13 +102,13 @@ Number of users, who have signed or declined the document can be displayed with To get detailed information on Signature status, we have an info icon near the threshold as shown below: -
+
#### 5.4 Final Signature Result To get the final Signature Result with detailed information such as which users have Signed / Declined, we need to hover on the Status as shown below: -
+
### API Parameters diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/reportblock-and-reportitemblock.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/reportblock-and-reportitemblock.md index 8001bf7b9e..07e67d2ecf 100644 --- a/docs/guardian/standard-registry/policies/policy-creation/introduction/reportblock-and-reportitemblock.md +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/reportblock-and-reportitemblock.md @@ -19,7 +19,7 @@ We have added new Impacts Section to display Primary/Secondary Impacts token det In the case when multiple linked mint blocks are used then the system displays all linked VPs as shown below: -
+
#### 2.1 Data Format: diff --git a/docs/guardian/standard-registry/policies/policy-creation/policy-demo.md b/docs/guardian/standard-registry/policies/policy-creation/policy-demo.md index 71fe6f2ac8..c10f3d12e2 100644 --- a/docs/guardian/standard-registry/policies/policy-creation/policy-demo.md +++ b/docs/guardian/standard-registry/policies/policy-creation/policy-demo.md @@ -2,7 +2,7 @@ Once you login as a Standard Registry and finish the setup, click on Policies tab. -![](<../../../../.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) +![](<../../../../.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) We have two options to create Policy : @@ -43,7 +43,7 @@ Instead of creating Policy from scratch, there is an option of importing the Pol **Note:** Files with **.policy** extension are only accepted. These files are in zip format, i.e. they are zip archives of the text file. {% endhint %} -![](<../../../../.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) +![](<../../../../.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) 2.1 Once the .zip file is selected, we get the Policy Import Review screen. Once everything looks good, click on Import Button. @@ -75,6 +75,12 @@ Instead of creating Policy from scratch, there is an option of importing the Pol When you click on Save to file, Policy is exported as a .zip file. +**Note:** While importing tool via file, or policy via file or IPFS, you can change used tools in preview dialog, it will change tools references in schemas and config automatically. + +To get complete information about tools, please refer to [Tools](https://github.com/hashgraph/guardian/blob/main/Methodology%20Library/CDM/Tools/readme.md) section. + +
+ ### 3. Filtering Policies On the Policy page, it is now possible to filter the policies list by policy name and tags. All available tags are presented in the dropdown list, which you can create using "Create Tag" for each policy, which makes it easier using the filter. diff --git a/docs/guardian/standard-registry/policies/policy-wizard/demo-on-policy-wizard-using-ui.md b/docs/guardian/standard-registry/policies/policy-wizard/demo-on-policy-wizard-using-ui.md index 32b13ab1a0..657a5ab45d 100644 --- a/docs/guardian/standard-registry/policies/policy-wizard/demo-on-policy-wizard-using-ui.md +++ b/docs/guardian/standard-registry/policies/policy-wizard/demo-on-policy-wizard-using-ui.md @@ -53,7 +53,7 @@ If **Approve and Reject** and **Minting tokens** are set to _enable_ the corresp Note: We can select multiple schemas by entering the schemas names separated by a delimiter: ",". {% endhint %} -
+
#### 3.1.1 {role} configuration diff --git a/docs/guardian/standard-registry/policies/roles-and-groups/roles-and-groups.md b/docs/guardian/standard-registry/policies/roles-and-groups/roles-and-groups.md index 51617e20be..189ba6869b 100644 --- a/docs/guardian/standard-registry/policies/roles-and-groups/roles-and-groups.md +++ b/docs/guardian/standard-registry/policies/roles-and-groups/roles-and-groups.md @@ -47,7 +47,7 @@ Groups are separate sets of documents access , which can be limited to users who | Relationship Type |

· Single – only a single user can be included in the group. This type is maintained for backward compatibility with historic policy versions.

· Multiple – the group can include multiple users. This is the new mode of operation.

| | Access Type |

· Global – static group is created at the start. The creator of the group is the creator of the policy.

· Private – a new instance of the group is created every time a user selects group creation action. The creator of the group is the user who executed the group creation action.

| -
+
@@ -64,7 +64,7 @@ Groups are separate sets of documents access , which can be limited to users who
-
+
### 3. Switching between Groups diff --git a/docs/guardian/standard-registry/policies/tagging/tagging-using-ui.md b/docs/guardian/standard-registry/policies/tagging/tagging-using-ui.md index 4268552683..8cfce49a07 100644 --- a/docs/guardian/standard-registry/policies/tagging/tagging-using-ui.md +++ b/docs/guardian/standard-registry/policies/tagging/tagging-using-ui.md @@ -58,11 +58,11 @@ Tags can be created by clicking on "Create Tag" button. Tag can be created with label and the description as shown below: -![Label and Description](<../../../../.gitbook/assets/1 (1) (1) (1).png>) +![Label and Description](<../../../../.gitbook/assets/1 (1) (1) (1) (1).png>) An additional document can be added/linked with the tag using _**Add Document** button and then selecting a suitable document schema_ -![Adding Document](<../../../../.gitbook/assets/2 (1) (1) (1) (1).png>) +![Adding Document](<../../../../.gitbook/assets/2 (1) (1) (1) (1) (1).png>) #### **2.2 Remove** @@ -74,11 +74,11 @@ Users (DIDs) who created a tag are able to remove it later. For documents displayed in the grid only the first (alphabetically) tag is shown. -![Documents display](<../../../../.gitbook/assets/4 (1) (1) (1) (1).png>) +![Documents display](<../../../../.gitbook/assets/4 (1) (1) (1) (1) (1).png>) Users can click on the tag icon to show the detailed information about all tag assigned to the document. -![All the tags assigned to the document](<../../../../.gitbook/assets/5 (1) (1) (1) (1).png>) +![All the tags assigned to the document](<../../../../.gitbook/assets/5 (1) (1) (1) (1) (1).png>) Tags are grounded by labels. When a label is selected then a detailed information about all tags with this label is displayed below. diff --git a/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file-asynchronously.md b/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file-asynchronously.md new file mode 100644 index 0000000000..62dd2560ca --- /dev/null +++ b/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file-asynchronously.md @@ -0,0 +1,5 @@ +# Importing Tool from a Zip file asynchronously + +{% swagger src="../../../../../.gitbook/assets/swagger.yaml" path="/tools/push/import/file-metadata" method="post" %} +[swagger.yaml](../../../../../.gitbook/assets/swagger.yaml) +{% endswagger %} diff --git a/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file.md b/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file.md new file mode 100644 index 0000000000..fa56cddd9f --- /dev/null +++ b/docs/guardian/standard-registry/policies/tools/tools-apis/importing-tool-from-a-zip-file.md @@ -0,0 +1,5 @@ +# Importing Tool from a Zip file + +{% swagger src="../../../../../.gitbook/assets/swagger.yaml" path="/tools/import/file-metadata" method="post" %} +[swagger.yaml](../../../../../.gitbook/assets/swagger.yaml) +{% endswagger %} diff --git a/docs/guardian/standard-registry/policies/tools/tools-using-ui.md b/docs/guardian/standard-registry/policies/tools/tools-using-ui.md index ae32486bda..2f2a0104c5 100644 --- a/docs/guardian/standard-registry/policies/tools/tools-using-ui.md +++ b/docs/guardian/standard-registry/policies/tools/tools-using-ui.md @@ -52,7 +52,11 @@ Tools that have not been published can only be edited.
+### 1.6 Changing Tools +While importing tool via file, or policy via file or IPFS, you can change used tools in preview dialog, it will change tools references in schemas and config automatically. + +
## 2. Schemas diff --git a/docs/guardian/standard-registry/project-comparison/project-comparison-using-ui.md b/docs/guardian/standard-registry/project-comparison/project-comparison-using-ui.md index 55824d2983..082c92069e 100644 --- a/docs/guardian/standard-registry/project-comparison/project-comparison-using-ui.md +++ b/docs/guardian/standard-registry/project-comparison/project-comparison-using-ui.md @@ -9,7 +9,7 @@ Project Schemas are predefined templates used to create VC documents. These schemas are selected for a specific policy and serve as the structural basis for generating project data. -
+
In the current schema setup, specific ‘property fields’ are explicitly designated for the comparison process. These fields play a crucial role in evaluating and contrasting different projects. @@ -31,7 +31,7 @@ Within a single group, filters apply a logical 'OR' to search for relevant proje The functionality is further expanded by enabling searches based on project titles. -
+
### Result Dashboard @@ -45,7 +45,7 @@ Users can select multiple projects for a side-by-side comparison by clicking the On this page, users will find a comparative table displaying selected project fields. This visual representation allows for an easy and intuitive comparison of different projects, highlighting similarities and differences. -
+
## 2. Demo Video diff --git a/docs/guardian/standard-registry/schemas/creating-system-schema-using-ui.md b/docs/guardian/standard-registry/schemas/creating-system-schema-using-ui.md index 77da0dcc2d..fd28b7f989 100644 --- a/docs/guardian/standard-registry/schemas/creating-system-schema-using-ui.md +++ b/docs/guardian/standard-registry/schemas/creating-system-schema-using-ui.md @@ -6,7 +6,7 @@ To create a new Schemas, click on the **New** button at the top right corner. After clicking on the New button, you will be asked to enter Schema details such as Schema Name, Policy Dropdown, Entity : VC/MRV/NONE, Schema Description and any other required fields. -![](<../../../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) +![](<../../../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) In addition to the basic Schema details we also have an option to add Field and Condition to each field. @@ -22,7 +22,7 @@ We can select respective property for that specific field by searching by enteri We can also customize the Field keys and Field Title by clicking on Advanced Tab. -![](<../../../.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) +![](<../../../.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) Instead of creating a new Schema from scratch, there is also an option to import it via File or via IPFS. @@ -48,7 +48,7 @@ Sample iREC Schema timestamp is below: Once the Schema is imported, we need to select the Policy from the Policy dropdown to connect the Schema and the Policy. -
+
diff --git a/docs/guardian/standard-registry/schemas/example-data/adding-example-data-using-ui.md b/docs/guardian/standard-registry/schemas/example-data/adding-example-data-using-ui.md index 5217a2a0b0..af8c402fce 100644 --- a/docs/guardian/standard-registry/schemas/example-data/adding-example-data-using-ui.md +++ b/docs/guardian/standard-registry/schemas/example-data/adding-example-data-using-ui.md @@ -6,14 +6,14 @@ Once you click on the above button, you will be able to fill all schema fields with sample values: -
+
2. **Preview** – shows a preview of how users will see the policy form during the execution of the policy
-
+
In Dry Run mode it is possible to quickly fill in the fields using the provided example values from the schema. This feature is most useful for testing/demonstrations or for experimenting and learning Guardian capabilities. -
+
diff --git a/docs/guardian/standard-registry/schemas/schema-differentiation/schema-differentiation-using-ui.md b/docs/guardian/standard-registry/schemas/schema-differentiation/schema-differentiation-using-ui.md index c9c9a85bdf..5de5eb26d8 100644 --- a/docs/guardian/standard-registry/schemas/schema-differentiation/schema-differentiation-using-ui.md +++ b/docs/guardian/standard-registry/schemas/schema-differentiation/schema-differentiation-using-ui.md @@ -6,7 +6,7 @@ We can compare two schemas by following some steps as follows: We click on **Compare** button present in Schemas tab as shown below: -
+
## 2. Comparison View @@ -27,7 +27,7 @@ We click on **Compare** button present in Schemas tab as shown below:
-
+
**Display settings** _–_ description and show/hide settings for each color/type of difference diff --git a/docs/guardian/standard-registry/schemas/schema-tree/schema-tree-ui.md b/docs/guardian/standard-registry/schemas/schema-tree/schema-tree-ui.md index 7cf4c39850..60c98360ae 100644 --- a/docs/guardian/standard-registry/schemas/schema-tree/schema-tree-ui.md +++ b/docs/guardian/standard-registry/schemas/schema-tree/schema-tree-ui.md @@ -12,7 +12,7 @@ We can move the image by holding and moving the mouse. Each schema and its child schemas are represented by same color in parent to child fashion. -
+
## 2. Downloading Tree diff --git a/docs/guardian/standard-registry/schemas/system-policy-schemas.md b/docs/guardian/standard-registry/schemas/system-policy-schemas.md index 28a91796eb..f7e126466d 100644 --- a/docs/guardian/standard-registry/schemas/system-policy-schemas.md +++ b/docs/guardian/standard-registry/schemas/system-policy-schemas.md @@ -17,7 +17,7 @@ To display System / Policy Schemas in the GUI, we have added a toggle in the Sch Whenever an account is created, System Schemas are generated automatically. -
+
{% hint style="info" %} Note: By default System Schemas cannot be edited/deleted. diff --git a/docs/guardian/standard-registry/schemas/tag-schema/creating-tag-schemas-using-ui.md b/docs/guardian/standard-registry/schemas/tag-schema/creating-tag-schemas-using-ui.md index c9ea6d4dc4..b53cfaceb8 100644 --- a/docs/guardian/standard-registry/schemas/tag-schema/creating-tag-schemas-using-ui.md +++ b/docs/guardian/standard-registry/schemas/tag-schema/creating-tag-schemas-using-ui.md @@ -4,6 +4,6 @@ Tags can have attached/linked documents. To add a document to the tag a schema is required. Such documents can be found under the **Tag Schemas** section. -
+
Users can select one of the published schemas in the section when adding a tag to add a corresponding document to the tag being created. diff --git a/docs/guardian/tokens/retirement-contract/README.md b/docs/guardian/tokens/retirement-contract/README.md index a2a5f76688..0a7a205df6 100644 --- a/docs/guardian/tokens/retirement-contract/README.md +++ b/docs/guardian/tokens/retirement-contract/README.md @@ -6,10 +6,10 @@ The ‘retirement contracts’ are responsible for the mechanics of matching ‘ The high-level flow of the actions which configure token retirement is illustrated on the sequence diagram below: -
+
Guardian contains a full production retirement system implementation which allows the configuration of arbitrary pools of tokens (two-sided, one-sides, with arbitrary ‘exchange rates’ etc), issued by different SRs, operating on different Guardian instances, to be configured for retirement with arbitrary additional rules further controlling their lifecycle. A simplified architecture diagram of the retirement contracts implementation is shown on the diagram below. -
+
diff --git a/docs/guardian/tokens/retirement-contract/creating-contract-using-ui.md b/docs/guardian/tokens/retirement-contract/creating-contract-using-ui.md index 7c0c3a817d..1325181876 100644 --- a/docs/guardian/tokens/retirement-contract/creating-contract-using-ui.md +++ b/docs/guardian/tokens/retirement-contract/creating-contract-using-ui.md @@ -2,11 +2,11 @@ 1. Guardian instance out of the box contains implementations for ‘Wiping’ and ‘Retirement’ contracts which can be deployed/enabled from the UI. -
+
2. Each SR has its own contract permissions. Since contracts are deployed on Hedera and their methods can be called independently via 3rd party systems but the status of these contracts can change without Guardian’s knowledge. SRs can action a ‘refresh’ of their permissions by clicking on the refresh sign (chargeable Hedera operation, costs < 1 hbar) -
+
### **Contract Roles:** @@ -28,39 +28,39 @@ 4\) At the token creation the system can be configured to delegate all permissions for wiping tokens to a specific wiping contract -
+
5\) _SRs_ can add pools with tokens which have a wipe contract (Set pool operation in retire contract). Also you can check “without approval” to set retirement tokens as immediate operation (without approval).\ -
+
6\) _SRs_ can check/delete/refresh pools (Pools operation in retirement contract). Not enabled means that the retirement contract has no wiper permissions in the appropriate wipe contract. It will be changed to enabled automatically when _the SR_ approves a request for a wiper role from this retirement contract. If the wipe contract is not in Guardian a manual refresh is required to update the instance permissions status. -
+
7\) _SRs_ can check/approve/reject/ban requests for the wiper role in the wipe contract (Requests operation in wipe contract). -
+
8\) To execute the retirement Guardian users which hold USER role navigate to the ‘Retire’ tab and click on ‘Retire’ button, choose appropriate pool and set token count/serials -
+
-
+
9\) If a token retirement requires approval, _users_ which hold USER role can see their requests by clicking on the ‘Requests’ button. -
+
10\) Contract owners can also see these requests and approve or reject (Requests operation on retirement contract). -
+
11\) After approval or rejection of the requests _users_ which hold USER role can see retire VCs on ‘Retire’ tab -
+
-
+
diff --git a/docs/guardian/tokens/token-template/how-to-create-token-template.md b/docs/guardian/tokens/token-template/how-to-create-token-template.md index 582a16bc48..d2d31ecc2d 100644 --- a/docs/guardian/tokens/token-template/how-to-create-token-template.md +++ b/docs/guardian/tokens/token-template/how-to-create-token-template.md @@ -2,4 +2,4 @@ We have a new tab as Token for all Blocks. This tab is used to add token template and set value for each token option. These values will be filled by User if it is null. -
+
diff --git a/docs/guardian/users/multi-policy/page-1.md b/docs/guardian/users/multi-policy/page-1.md index a01d0ff57d..232ca5f571 100644 --- a/docs/guardian/users/multi-policy/page-1.md +++ b/docs/guardian/users/multi-policy/page-1.md @@ -13,7 +13,7 @@ Step 1: Need to click on the linking icon for the policy, which you wanted to be Step 2: We get a policy linking pop up to create a link for the primary policy or joining an existing policy: -
+
After the ‘primary’ policy is registered a special ‘link’ becomes accessible which can be used to ‘connect’ additional ‘secondary’ policies. diff --git a/e2e-tests/.gitignore b/e2e-tests/.gitignore index 97d6a2bc32..44602cabe3 100644 --- a/e2e-tests/.gitignore +++ b/e2e-tests/.gitignore @@ -3,3 +3,4 @@ reports/ screenshots/ test_results/ .gitignore +0_fullflow.cy.js diff --git a/e2e-tests/cypress/e2e/api-tests/artifacts/postArtifact.cy.js b/e2e-tests/cypress/e2e/api-tests/artifacts/postArtifact.cy.js index 8705fc4bcd..209d308070 100644 --- a/e2e-tests/cypress/e2e/api-tests/artifacts/postArtifact.cy.js +++ b/e2e-tests/cypress/e2e/api-tests/artifacts/postArtifact.cy.js @@ -109,8 +109,9 @@ context("Artifacts", { tags: "@artifacts" }, () => { }, failOnStatusCode:false, }).then((response) => { - expect(response.status).to.eq(STATUS_CODE.UNPROCESSABLE); - expect(response.body.message).to.eq("There are no files to upload"); + expect(response.status).to.eq(STATUS_CODE.BAD_REQUEST); + // expect(response.status).to.eq(STATUS_CODE.UNPROCESSABLE); + // expect(response.body.message).to.eq("There are no files to upload"); }); }) }) diff --git a/e2e-tests/cypress/e2e/api-tests/contracts/getContracts.cy.js b/e2e-tests/cypress/e2e/api-tests/contracts/getContracts.cy.js index 9489e28c43..c17aee901c 100644 --- a/e2e-tests/cypress/e2e/api-tests/contracts/getContracts.cy.js +++ b/e2e-tests/cypress/e2e/api-tests/contracts/getContracts.cy.js @@ -3,6 +3,53 @@ import API from "../../../support/ApiUrls"; context("Contracts", { tags: '@contracts' },() => { const authorization = Cypress.env("authorization"); + before(() => { + const contractNameR = Math.floor(Math.random() * 999) + "RCon4RequestsTests"; + const contractNameW = Math.floor(Math.random() * 999) + "WCon4RequestsTests"; + let policyid + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization, + }, + body: { + "description": contractNameR, + "type": "RETIRE", + }, + }).then((resp) => { + expect(resp.status).eql(STATUS_CODE.SUCCESS); + }); + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization, + }, + body: { + "description": contractNameW, + "type": "WIPE", + }, + }).then((resp) => { + expect(resp.status).eql(STATUS_CODE.SUCCESS); + }); + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.PolicisImportMsg, + body: { + "messageId": Cypress.env('policy_for_compare1')//iRec 4 + }, + headers: { + authorization, + }, + timeout: 180000 + }) + .then((response) => { + expect(response.status).to.eq(STATUS_CODE.SUCCESS); + policyid = response.body.at(-1).id; + }) + }) + it("Get list of contracts", () => { cy.request({ method: METHOD.GET, @@ -12,13 +59,48 @@ context("Contracts", { tags: '@contracts' },() => { }, }).then((resp) => { expect(resp.status).eql(STATUS_CODE.OK); - if (resp.body.length != 0) { - expect(resp.body.at(-1)).to.have.property("_id"); - expect(resp.body.at(-1)).to.have.property("contractId"); - expect(resp.body.at(-1)).to.have.property("type"); - expect(resp.body.at(-1)).to.have.property("description"); - expect(resp.body.at(-1)).to.have.property("owner"); - } + expect(resp.body.at(-1)).to.have.property("_id"); + expect(resp.body.at(-1)).to.have.property("contractId"); + expect(resp.body.at(-1)).to.have.property("type"); + expect(resp.body.at(-1)).to.have.property("description"); + expect(resp.body.at(-1)).to.have.property("owner"); + }); + }); + + + it("Get list of contracts without auth token - Negative", () => { + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.ListOfContracts, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.UNAUTHORIZED); + }); + }); + + it("Get list of contracts with invalid auth token - Negative", () => { + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization: "Bearer wqe", + }, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.UNAUTHORIZED); + }); + }); + + it("Get list of contracts with empty auth token - Negative", () => { + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization: "", + }, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.UNAUTHORIZED); }); }); }); diff --git a/e2e-tests/cypress/e2e/api-tests/contracts/getRequests.cy.js b/e2e-tests/cypress/e2e/api-tests/contracts/getRequests.cy.js index 1a932b25f3..c280c35c12 100644 --- a/e2e-tests/cypress/e2e/api-tests/contracts/getRequests.cy.js +++ b/e2e-tests/cypress/e2e/api-tests/contracts/getRequests.cy.js @@ -3,16 +3,823 @@ import API from "../../../support/ApiUrls"; context("Contracts", { tags: '@contracts' },() => { const authorization = Cypress.env("authorization"); + //const username = Math.floor(Math.random() * 999) + "User"; + const username = "4User"; + const contractNameR = Math.floor(Math.random() * 999) + "RCon4RequestsTests"; + const contractNameW = Math.floor(Math.random() * 999) + "WCon4RequestsTests"; + const optionKey = "option" + let wContractId, rContractId, tokenId, policyId, hederaId, rConractUuid + let waitForApproveApplicationBlockId, deviceGridBlockId, issueRequestGridBlockId, approveRegistrantBtnBlockId - it("Get all retire contracts requests", () => { + let whileWipeRequestCreating = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.at(0)?.contractId) + whileWipeRequestCreating(dataToCompare, request, attempts) + else { + let data = response.body.at(0).contractId + if (data !== dataToCompare) + whileWipeRequestCreating(dataToCompare, request, attempts) + } + }) + } + } + + let whileApplicationCreating = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.uiMetaData?.title) + whileApplicationCreating(dataToCompare, request, attempts) + else { + let data = response.body.uiMetaData.title + if (data !== dataToCompare) + whileApplicationCreating(dataToCompare, request, attempts) + } + }) + } + } + + let whileApplicationApproving = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.fields) + whileApplicationApproving(dataToCompare, request, attempts) + else { + let data = response.body.fields[0]?.title + if (data !== dataToCompare) + whileApplicationApproving(dataToCompare, request, attempts) + } + }) + } + } + + let whileDeviceCreating = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.data) + whileDeviceCreating(dataToCompare, request, attempts) + else { + let data = response.body.data[0]?.[optionKey]?.status + if (data !== dataToCompare) + whileDeviceCreating(dataToCompare, request, attempts) + } + }) + } + } + + let whileDeviceApproving = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.data) + whileDeviceApproving(dataToCompare, request, attempts) + else { + let data = response.body.data[0]?.[optionKey]?.status + if (data !== dataToCompare) + whileDeviceApproving(dataToCompare, request, attempts) + } + }) + } + } + + let whileIssueRequestCreating = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.data) + whileIssueRequestCreating(dataToCompare, request, attempts) + else { + let data = response.body.data[0]?.[optionKey]?.status + if (data !== dataToCompare) + whileIssueRequestCreating(dataToCompare, request, attempts) + } + }) + } + } + + let whileIssueRequestApproving = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body?.data) + whileIssueRequestApproving(dataToCompare, request, attempts) + else { + let data = response.body.data[0]?.[optionKey]?.status + + cy.log(response) + cy.log(data) + cy.log(dataToCompare) + if (data !== dataToCompare) + whileIssueRequestApproving(dataToCompare, request, attempts) + } + }) + } + } + + let whileBalanceVerifying = (dataToCompare, request, attempts) => { + if (attempts < 100) { + attempts++ + let balance + cy.wait(3000) + cy.request(request).then((response) => { + if (!response?.body) + whileBalanceVerifying(dataToCompare, request, attempts) + else { + for (let i = 0; i < response.body.length; i++) { + if (response.body[i].tokenId === tokenId) + balance = response.body[i].balance + } + if (balance !== dataToCompare) + whileBalanceVerifying(dataToCompare, request, attempts) + } + }) + } + } + + before("Create contracts, policy and register new user", () => { + //Create retire contract and save id + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization, + }, + body: { + "description": contractNameR, + "type": "RETIRE", + }, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.SUCCESS); + rContractId = response.body.contractId; + rConractUuid = response.body.id; + }); + + //Create wipe contract and save id + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.ListOfContracts, + headers: { + authorization, + }, + body: { + "description": contractNameW, + "type": "WIPE", + }, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.SUCCESS); + wContractId = response.body.contractId; + }); + + //Import policy and save id + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.PolicisImportMsg, + body: { + "messageId": Cypress.env('policy_for_compare1')//iRec 4 + }, + headers: { + authorization, + }, + timeout: 180000 + }) + .then((response) => { + expect(response.status).to.eq(STATUS_CODE.SUCCESS); + policyId = response.body.at(-1).id; + }) + + //Get token(Irec token) draft id to update it + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.ListOfTokens, + headers: { + authorization, + }, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.OK); + tokenId = response.body.at(0).tokenId; + }).then(() => { + //Put wipe contract to token + cy.request({ + method: METHOD.PUT, + url: API.ApiServer + API.ListOfTokens + API.Async, + headers: { + authorization, + }, + body: { + tokenId: tokenId, + wipeContractId: wContractId, + draftToken: true + } + }) + }).then(() => { + //Publish policy + cy.request({ + method: 'PUT', + url: API.ApiServer + API.Policies + policyId + "/" + API.Publish, + body: { + policyVersion: "1.2.5" + }, + headers: { + authorization + }, + timeout: 600000 + }) + .then((response) => { + expect(response.status).to.eq(STATUS_CODE.OK); + }) + }) + + //Register new user + cy.request({ + method: METHOD.POST, + url: API.ApiServer + API.AccountRegister, + body: { + username: username, + password: "test", + password_confirmation: "test", + role: "USER", + } + }).then((response) => { + expect(response.status).to.eq(STATUS_CODE.SUCCESS); + }) + //Login and get PT + cy.request({ + method: "POST", + url: API.ApiServer + "accounts/login", + body: { + username: username, + password: "test" + } + }).then((response) => { + //Get AT + cy.request({ + method: "POST", + url: API.ApiServer + "accounts/access-token", + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + let accessToken = "Bearer " + response.body.accessToken + //Get SR did + cy.request({ + method: 'GET', + url: API.ApiServer + 'accounts/standard-registries/aggregated', + headers: { + authorization: accessToken + } + }).then((response) => { + let SRDid = response.body[0].did + //Get generated hedera creds + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.RandomKey, + headers: {authorization}, + }).then((response) => { + hederaId = response.body.id + let hederaAccountKey = response.body.key + //Update profile + cy.request({ + method: 'PUT', + url: API.ApiServer + 'profiles/' + username, + body: { + hederaAccountId: hederaId, + hederaAccountKey: hederaAccountKey, + parent: SRDid + }, + headers: { + authorization: accessToken + }, + timeout: 180000 + }) + }) + }) + }) + }) + }) + + before("Get blocks for waiting(approve app, device grid, issue grid) and token id", () => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + let accessToken = "Bearer " + response.body.accessToken + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.WaitForApproveApplication, + headers: { + authorization: accessToken + } + }).then((response) => { + waitForApproveApplicationBlockId = response.body.id + }) + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.DeviceGrid, + headers: { + authorization: accessToken + } + }).then((response) => { + deviceGridBlockId = response.body.id + }) + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.IssueRequestGrid, + headers: { + authorization: accessToken + } + }).then((response) => { + issueRequestGridBlockId = response.body.id + }) + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.ApproveRegistrantBtn, + headers: { + authorization + } + }).then((response) => { + approveRegistrantBtnBlockId = response.body.id + }) + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.ListOfTokens, + headers: { + authorization, + }, + }).then((response) => { + expect(response.status).eql(STATUS_CODE.OK); + tokenId = response.body.at(0).tokenId; + }) + }) + }) + }) + + before("Mint token", () => { + //Choose role + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + let accessToken = "Bearer " + response.body.accessToken + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.ChooseRegistrantRole, + headers: { + authorization: accessToken + }, + body: { + role: "Registrant" + } + }) + + cy.wait(10000) + + //Create app and wait while it in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.CreateApplication, + headers: { + authorization: accessToken + }, + body: { + document: { + field1: {}, + field2: {}, + field3: {} + }, + ref: null + } + }) + + let requestForApplicationCreationProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + waitForApproveApplicationBlockId, + headers: { + authorization: accessToken + } + } + + whileApplicationCreating("Submitted for Approval", requestForApplicationCreationProgress, 0) + }) + }) + + //Get applications data and prepare body for approve + let applicationData cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.GetApplications, + headers: { + authorization + } + }).then((response) => { + applicationData = response.body.data[0]; + applicationData.option.status = "Approved" + let appDataBody = JSON.stringify({ + document: applicationData, + tag: "Button_0" + }) + //Approve app + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.ApproveApplication, + headers: { + authorization, + "content-type": "application/json" + }, + body: appDataBody + }) + }) + + //Wait while approve in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + accessToken = "Bearer " + response.body.accessToken + + let requestForApplicationApproveProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + deviceGridBlockId, + headers: { + authorization: accessToken + } + } + + whileApplicationApproving("Device Name", requestForApplicationApproveProgress, 0) + }) + }) + + //Create device and wait while it in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + let accessToken = "Bearer " + response.body.accessToken + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.CreateDevice, + headers: { + authorization: accessToken + }, + body: { + document: { + field3: {}, + field4: {}, + field5: {} + }, + ref: null + } + }) + + let requestForDeviceCreationProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + deviceGridBlockId, + headers: { + authorization: accessToken + } + } + + whileDeviceCreating("Waiting for approval", requestForDeviceCreationProgress, 0) + }) + }) + + //Get devices data and prepare body for approve + let deviceBody + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.GetDevices, + headers: { + authorization + } + }).then((response) => { + deviceBody = response.body; + let data = deviceBody.data[deviceBody.data.length - 1] + data[optionKey].status = "Approved" + let appDataBody = JSON.stringify({ + document: data, + tag: "Button_0" + }) + //Approve device + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.ApproveDevice, + headers: { + authorization, + "content-type": "application/json" + }, + body: appDataBody + }) + }) + + //Wait while approve in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + accessToken = "Bearer " + response.body.accessToken + + let requestForDeviceApproveProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + deviceGridBlockId, + headers: { + authorization: accessToken + } + } + + whileDeviceApproving("Approved", requestForDeviceApproveProgress, 0) + }) + }) + + //Get issue data and prepare body for create + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + let accessToken = "Bearer " + response.body.accessToken + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.GetDeviceIssue, + headers: { + authorization: accessToken + } + }).then((response) => { + let obj = response.body + let device_issue_row = obj.data[obj.data.length - 1] + + //Create issue and wait while it in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.CreateIssue, + headers: { + authorization: accessToken, + "content-type": "application/json" + }, + body: { + document: { + field2: {}, + field3: {}, + field6: "2024-03-01", + field7: 1, + field8: "2024-03-02", + field17: username, + field18: hederaId + }, + ref: device_issue_row + } + }) + + let requestForIssueCreationProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + issueRequestGridBlockId, + headers: { + authorization: accessToken + } + } + + whileIssueRequestCreating("Waiting for approval", requestForIssueCreationProgress, 0) + }) + }) + }) + + //Get issue data and prepare body for approve + let issueRow + cy.request({ + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.GetIssues, + headers: { + authorization + } + }).then((response) => { + issueRow = response.body.data + issueRow = issueRow[issueRow.length - 1] + issueRow[optionKey].status = "Approved" + issueRow = JSON.stringify({ + document: issueRow, + tag: "Button_0" + }) + //Approve issue + cy.request({ + method: "POST", + url: API.ApiServer + API.Policies + policyId + "/" + API.ApproveIssueRequestsBtn, + headers: { + authorization, + "content-type": "application/json" + }, + body: issueRow + }) + }) + + //Wait while approve in progress + let accessToken + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + accessToken = "Bearer " + response.body.accessToken + + let requestForIssueApproveProgress = { + method: "GET", + url: API.ApiServer + API.Policies + policyId + "/" + API.Blocks + issueRequestGridBlockId, + headers: { + authorization: accessToken + } + } + + whileIssueRequestApproving("Approved", requestForIssueApproveProgress, 0) + }) + }) + + //Wait while balance updating + cy.request({ + method: "POST", + url: API.ApiServer + API.AccountsLogin, + body: { + username: username, + password: "test" + } + }).then((response) => { + cy.request({ + method: "POST", + url: API.ApiServer + API.AccessToken, + body: { + refreshToken: response.body.refreshToken + } + }).then((response) => { + accessToken = "Bearer " + response.body.accessToken + + let requestForBalance = { + method: "GET", + url: API.ApiServer + API.ListOfTokens, + headers: { + authorization: accessToken + } + } + + whileBalanceVerifying("1", requestForBalance) + }) + }) + }) + + before("Set pool", () => { + //Set pool to retire contract and wait while it in progress + cy.request({ + method: "POST", + url: API.ApiServer + API.RetireContract + rConractUuid + "/" + API.PoolContract, + headers: { + authorization, + }, + body: { + tokens: [ + { + token: tokenId, + count: 1 + } + ], + immediately: false + } + }).then((response) => { + expect(response.status).eql(STATUS_CODE.OK); + }) + + let requestForWipeRequestCreationProgress = { method: METHOD.GET, - url: API.ApiServer + API.ListOfRequests, + url: API.ApiServer + API.WipeRequests, headers: { authorization, }, - }).then((resp) => { - expect(resp.status).eql(STATUS_CODE.OK); + qs: { + contractId: wContractId + } + } + + whileWipeRequestCreating(wContractId, requestForWipeRequestCreationProgress, 0) + }) + + it("Get wipe request", () => { + cy.wait(1000) + cy.request({ + method: METHOD.GET, + url: API.ApiServer + API.WipeRequests, + headers: { + authorization, + }, + qs: { + contractId: wContractId + } + }).then((response) => { + expect(response.status).eql(STATUS_CODE.OK); + expect(response.body.at(0).contractId).eql(wContractId) }); }); + + // it("Get all wipe contracts requests", () => { + // cy.request({ + // method: METHOD.GET, + // url: API.ApiServer + API.WipeRequests, + // headers: { + // authorization, + // }, + // }).then((resp) => { + // expect(resp.status).eql(STATUS_CODE.OK); + // }); + // }); + // + // it("Get all retire contracts requests", () => { + // cy.request({ + // method: METHOD.GET, + // url: API.ApiServer + API.RetireRequests, + // headers: { + // authorization, + // }, + // }).then((resp) => { + // expect(resp.status).eql(STATUS_CODE.OK); + // }); + // }); }); diff --git a/e2e-tests/cypress/e2e/api-tests/policies/putPushPoliciesPublish.cy.js b/e2e-tests/cypress/e2e/api-tests/policies/putPushPoliciesPublish.cy.js index 8b61452368..8abfaebe5c 100644 --- a/e2e-tests/cypress/e2e/api-tests/policies/putPushPoliciesPublish.cy.js +++ b/e2e-tests/cypress/e2e/api-tests/policies/putPushPoliciesPublish.cy.js @@ -6,29 +6,29 @@ context('Policy - Import', { tags: '@policies' },() => { const authorization = Cypress.env('authorization'); it('Push publish the policy with the specified (internal) policy ID', () => { - cy.request({ - method: 'POST', - url: API.ApiServer + 'policies/import/message', - body: { messageId: (Cypress.env('irec_policy')) }, - headers: { - authorization, - }, - timeout: 180000 - }) - .then(response => { - let firstPolicyId = response.body.at(-1).id - let firstPolicyStatus = response.body.at(-1).status - expect(firstPolicyStatus).to.equal('DRAFT') - cy.request({ - method: 'PUT', - url: API.ApiServer + 'policies/push/' + firstPolicyId + '/publish', - body: { policyVersion: "1.2.5" }, - headers: { authorization }, - timeout: 600000 - }) - .then((response) => { - expect(response.status).to.eq(STATUS_CODE.ACCEPTED); - }) + cy.request({ + method: 'POST', + url: API.ApiServer + 'policies/import/message', + body: {messageId: (Cypress.env('irec_policy'))}, + headers: { + authorization, + }, + timeout: 180000 }) + .then(response => { + let firstPolicyId = response.body.at(-1).id + let firstPolicyStatus = response.body.at(-1).status + expect(firstPolicyStatus).to.equal('DRAFT') + cy.request({ + method: 'PUT', + url: API.ApiServer + 'policies/push/' + firstPolicyId + '/publish', + body: {policyVersion: "1.2.5"}, + headers: {authorization}, + timeout: 600000 + }) + .then((response) => { + expect(response.status).to.eq(STATUS_CODE.ACCEPTED); + }) + }) }) - }) +}) diff --git a/e2e-tests/cypress/e2e/ui-tests/pages/policies.js b/e2e-tests/cypress/e2e/ui-tests/pages/policies.js index 7f402852de..6d8df9a8eb 100644 --- a/e2e-tests/cypress/e2e/ui-tests/pages/policies.js +++ b/e2e-tests/cypress/e2e/ui-tests/pages/policies.js @@ -23,7 +23,7 @@ const PoliciesPageLocators = { submitBtn: 'button[type="submit"]', createBtn: 'div.g-dialog-actions-btn', addBtn: "*[class^='btn-approve btn-option ng-star-inserted']", - createPolicyBtn: "Create New", + createPolicyBtn: 'p-button[ng-reflect-text="Create a Policy"]', inputName: "*[formcontrolname^='name']", draftBtn: 'ng-reflect-menu="[object Object]"', approveBtn: 'div.btn-approve', @@ -77,7 +77,7 @@ export class PoliciesPage { } createPolicyButton() { - cy.contains(PoliciesPageLocators.createPolicyBtn).click(); + cy.get(PoliciesPageLocators.createPolicyBtn).click(); } approveUser() { diff --git a/e2e-tests/cypress/support/ApiUrls.js b/e2e-tests/cypress/support/ApiUrls.js index 81c954bd08..bb773c2654 100644 --- a/e2e-tests/cypress/support/ApiUrls.js +++ b/e2e-tests/cypress/support/ApiUrls.js @@ -25,7 +25,10 @@ const API = { //Contracts ListOfContracts: "contracts/", ListOfPairs: "contracts/pairs/", - ListOfRequests: "contracts/retire/requests/", + RetireRequests: "contracts/retire/requests/", + WipeRequests: "contracts/wipe/requests/", + RetireContract: "contracts/retire/", + PoolContract: "pools/", //Modules ListOfAllModules: "modules/", ListOfModules: "modules/menu/", @@ -67,11 +70,32 @@ const API = { PolicisImportMsgPreview: "policies/import/message/preview", PolicisImportMsgPreviewPush: "policies/push/import/message/preview", PolicyGroups: "groups/", + ChooseRegistrantRole: "tag/choose_role/blocks/", + CreateApplication: "tag/create_application/blocks", + WaitForApproveApplication: "tag/wait_for_approve", + DeviceGrid: "tag/devices_grid", + IssueRequestGrid: "tag/issue_requests_grid", + GetApplications: "tag/registrants_grid/blocks", + ApproveApplication: "tag/approve_registrant_btn/blocks", + ApproveRegistrantBtn: "tag/approve_registrant_btn", + CreateDevice: "tag/create_device_form/blocks", + GetDevices: "tag/approve_devices_grid/blocks", + ApproveDevice: "tag/approve_device_btn/blocks", + GetDeviceIssue: "tag/devices_grid/blocks", + GetIssues: "tag/issue_requests_grid(evident)/blocks", + ApproveIssueRequestsBtn: "tag/approve_issue_requests_btn/blocks", + CreateIssue: "tag/create_issue_request_form/blocks", + + + //Artifacts Artifacts: "artifacts/", Tags: "tags/", //General ExportCSV: "export?type=csv", - ExportFile: "export/file" + ExportFile: "export/file", + Async: "push/", + Publish: "publish/", + Blocks: "blocks/" }; export default API; diff --git a/e2e-tests/cypress/support/GuardianUrls.js b/e2e-tests/cypress/support/GuardianUrls.js index a4b445976e..cf7afa2ce7 100644 --- a/e2e-tests/cypress/support/GuardianUrls.js +++ b/e2e-tests/cypress/support/GuardianUrls.js @@ -1,8 +1,8 @@ -const PORT = 3000; +const PORT = 4200; const URL = { // Web - Root: "http://localhost:"+PORT+"/", + Root: "http://localhost:"+PORT+"", //Tabs diff --git a/e2e-tests/cypress/support/api/api-const.js b/e2e-tests/cypress/support/api/api-const.js index bd235d3f22..6dae67ee76 100644 --- a/e2e-tests/cypress/support/api/api-const.js +++ b/e2e-tests/cypress/support/api/api-const.js @@ -11,6 +11,7 @@ export const STATUS_CODE = { SUCCESS: 201, ACCEPTED: 202, NO_CONTENT: 204, + BAD_REQUEST: 400, UNAUTHORIZED: 401, FORBIDDEN: 403, NOT_FOUND: 404, diff --git a/ecosystem.config.js b/ecosystem.config.js index a7a4db8e45..0ce8ffc99b 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -1,6 +1,7 @@ +import fs from 'fs'; +import path from 'path'; + function readEnvFile(filePath) { - const fs = require('fs'); - const path = require('path'); const envFile = path.resolve(__dirname, filePath); return fs .readFileSync(envFile, { encoding: 'utf8' }) @@ -23,22 +24,21 @@ console.log(readEnvFile('./worker-service/.env')); const appEnv = readEnvFile('.env'); -module.exports = { - apps: [{ - name: 'logger', - script: 'npm run start', - cwd: './logger-service/dist', - env: { - ...readEnvFile('./logger-service/.env') - } +const apps = [{ + name: 'logger', + script: 'npm run start', + cwd: './logger-service/dist', + env: { + ...readEnvFile('./logger-service/.env'), }, +}, { name: 'gateway', script: 'npm run start', cwd: './api-gateway/dist', env: { - ...readEnvFile('./api-gateway/.env') - } + ...readEnvFile('./api-gateway/.env'), + }, }, { name: 'auth', @@ -46,8 +46,8 @@ module.exports = { cwd: './auth-service/dist', env: { SECRET_MANAGER: appEnv.SECRET_MANAGER, - ...readEnvFile('./auth-service/.env') - } + ...readEnvFile('./auth-service/.env'), + }, }, { name: 'guardian', @@ -55,8 +55,8 @@ module.exports = { cwd: './guardian-service/dist', env: { SECRET_MANAGER: appEnv.SECRET_MANAGER, - ...readEnvFile('./guardian-service/.env') - } + ...readEnvFile('./guardian-service/.env'), + }, }, { name: 'policy', @@ -64,8 +64,8 @@ module.exports = { cwd: './policy-service/dist', env: { SECRET_MANAGER: appEnv.SECRET_MANAGER, - ...readEnvFile('./policy-service/.env') - } + ...readEnvFile('./policy-service/.env'), + }, }, { name: 'worker', @@ -73,8 +73,8 @@ module.exports = { cwd: './worker-service/dist', env: { SECRET_MANAGER: appEnv.SECRET_MANAGER, - ...readEnvFile('./worker-service/.env') - } + ...readEnvFile('./worker-service/.env'), + }, }, { name: 'topic', @@ -96,7 +96,10 @@ module.exports = { script: 'npm run start', cwd: './analytics-service/dist', env: { - ...readEnvFile('./analytics-service/.env') - } - }] -}; \ No newline at end of file + ...readEnvFile('./analytics-service/.env'), + }, + }]; + +export { + apps, +}; diff --git a/frontend/package.json b/frontend/package.json index f282b0c32f..132e6e59da 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -74,5 +74,5 @@ "test": "ng test", "watch": "ng build --watch --configuration development --output-path ../www-data" }, - "version": "2.23.1" + "version": "2.24.0" } diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 91545dc064..dd5a4745f6 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -8,6 +8,7 @@ import { ToastrModule } from 'ngx-toastr'; import { AppRoutingModule, AuditorGuard, StandardRegistryGuard, UserGuard } from './app-routing.module'; import { AppComponent } from './app.component'; import { SchemaHelper } from '@guardian/interfaces'; +import { CheckboxModule } from 'primeng/checkbox'; //Services import { AuthInterceptor, AuthService } from './services/auth.service'; import { ProfileService } from './services/profile.service'; @@ -199,6 +200,7 @@ import { UseWithServiceDirective } from './directives/use-with-service.directive ContractEngineModule, ProjectComparisonModule, DndModule, + CheckboxModule, AngularSvgIconModule.forRoot() ], exports: [], diff --git a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.html b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.html index bda21c28ad..dcfc199427 100644 --- a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.html +++ b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.html @@ -7,9 +7,13 @@
- +
+ + +
@@ -18,6 +22,41 @@ [showClear]="true" appendTo="body" id="firstPolicy" optionLabel="name" optionValue="id" placeholder="Select Policy">
+
+
+ + +
+
+ + +
+
+
+ +
+
+
+ {{token}} +
+ : +
+
+ +
+
+
+
+
@@ -42,7 +81,7 @@ {{document.id}} {{document.owner}} + styleClass="p-button-link" (onClick)="viewDocument(document)"> @@ -70,6 +109,7 @@ Owner Schema Document + Operation @@ -79,9 +119,12 @@ {{document.id}} {{document.owner}} - {{getSchemaName(srcSchemas, document.schema)}} + + {{getSchemaName(srcSchemas, document.schema)}} + styleClass="p-button-link" (onClick)="viewDocument(document)"> + @@ -99,10 +142,12 @@
-
+
- {{getSchemaName(srcSchemas, schema)}} + {{getSchemaName(srcSchemas, + schema)}}
:
@@ -121,7 +166,7 @@
- {{role}} + {{role}}
:
@@ -135,10 +180,11 @@ There are no roles to map
-
+
- {{group}} + {{group}}
:
@@ -151,6 +197,46 @@
There are no groups to map
+
+
+
+
+ {{token}} +
+ : +
+
+ +
+
+
+
+ There are no tokens to map +
+
+ +
+
+
+ {{getBlockName(srcBlocks, block)}} +
+ : +
+
+ +
+
+
+
+ There are no blocks to map +
@@ -206,10 +292,8 @@ (onClick)="prevStep()">
- - +
@@ -219,10 +303,30 @@ (onClick)="prevStep()">
- - + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ +
diff --git a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.scss b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.scss index c028334a0e..990745513f 100644 --- a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.scss +++ b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.scss @@ -21,6 +21,7 @@ } .action-buttons { + margin-top: 5px; display: flex; justify-content: space-between; } @@ -57,12 +58,32 @@ font-weight: 500; } +.source-policy-selector { + display: flex; + align-items: center; + + &__dropdown { + width: 100%; + padding-right: 5px; + } +} + +.policy-migration-options { + display: grid; + grid-template-columns: 1fr 1fr; +} + +.p-field-checkbox { + display: flex; + gap: 10px; +} + .dialog-body { height: 50vh; overflow-y: auto; padding-top: 5px; - width: 600px; - min-width: 600px; + width: 700px; + min-width: 700px; } ::ng-deep { diff --git a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.ts b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.ts index 775db57f0d..a7277077dc 100644 --- a/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.ts +++ b/frontend/src/app/modules/policy-engine/dialogs/migrate-data/migrate-data.component.ts @@ -6,9 +6,41 @@ import { DynamicDialogRef, } from 'primeng/dynamicdialog'; import { forkJoin } from 'rxjs'; -import { VCViewerDialog } from 'src/app/modules/schema-engine/vc-dialog/vc-dialog.component'; import { PolicyEngineService } from 'src/app/services/policy-engine.service'; import { SchemaService } from 'src/app/services/schema.service'; +import { JsonEditorDialogComponent } from '../../helpers/json-editor-dialog/json-editor-dialog.component'; + +function findAllEntities( + obj: { [key: string]: any }, + names: string[] +): string[] { + const result: any[] = []; + + const finder = (o: { [key: string]: any }): void => { + if (!o) { + return; + } + + for (const name of names) { + if (o.hasOwnProperty(name)) { + result.push(o[name]); + } + } + + if (o.hasOwnProperty('children')) { + for (const child of o.children) { + finder(child); + } + } + }; + finder(obj); + + const map: any = {}; + for (const item of result) { + map[item] = item; + } + return Object.values(map); +} class MigrationConfig { private readonly _systemSchemas = [ @@ -32,6 +64,14 @@ class MigrationConfig { private _schemas: { [key: string]: string | undefined } = {}; private _groups: { [key: string]: string | undefined } = {}; private _roles: { [key: string]: string | undefined } = {}; + private _blocks: { [key: string]: string | undefined } = {}; + private _tokens: { [key: string]: string | undefined } = {}; + private _tokensMap: { [key: string]: string | undefined } = {}; + private _editedVCs: { [key: string]: string | undefined } = {}; + + public migrateState = false; + public migrateRetirePools: boolean = false; + public retireContractId: string = ''; private _policiesValidity: boolean = false; private _vcsValidity: boolean = false; @@ -66,6 +106,14 @@ class MigrationConfig { this.updateSchemasValidity(); } + clearBlocks() { + this._blocks = {}; + } + + clearEditedVCs() { + this._editedVCs = {}; + } + setRole(key: string, value?: string) { this._roles[key] = value; } @@ -74,6 +122,14 @@ class MigrationConfig { this._groups[key] = value; } + setToken(key: string, value?: string) { + this._tokens[key] = value; + } + + setTokenMap(key: string, value?: string) { + this._tokensMap[key] = value; + } + clearRoles() { this._roles = {}; } @@ -82,8 +138,17 @@ class MigrationConfig { this._groups = {}; } + clearTokens() { + this._tokens = {}; + } + + clearTokensMap() { + this._tokensMap = {}; + } + clearVCs() { this._vcs = []; + this.clearEditedVCs(); this.updateVcValidity(); this.clearSchemas(); } @@ -123,6 +188,14 @@ class MigrationConfig { return this._schemas; } + get blocks() { + return this._blocks; + } + + get editedVCs() { + return this._editedVCs; + } + get roles() { return this._roles; } @@ -131,6 +204,14 @@ class MigrationConfig { return this._groups; } + get tokens() { + return this._tokens; + } + + get tokensMap() { + return this._tokensMap; + } + get policiesValidity() { return this._policiesValidity; } @@ -154,6 +235,13 @@ class MigrationConfig { schemas: this._schemas, groups: this._groups, roles: this._roles, + migrateState: this.migrateState, + editedVCs: this.editedVCs, + blocks: this._blocks, + tokens: this._tokens, + tokensMap: this._tokensMap, + migrateRetirePools: this.migrateRetirePools, + retireContractId: this.retireContractId, }; } @@ -207,13 +295,16 @@ export class MigrateData { vps: false, vcs: false, schemas: false, + blocks: false, }; migrationConfig: MigrationConfig; + contracts: any[]; policies: any[]; pList1: any[]; pList2: any[]; + uploadedPolicy: any; activeIndex: number = 0; items: MenuItem[] = [ @@ -241,6 +332,10 @@ export class MigrateData { id: 'groups', label: 'Groups', }, + { + id: 'tokens', + label: 'Tokens', + }, ]; vps: any[] = []; @@ -261,9 +356,17 @@ export class MigrateData { srcSchemas: any[] = []; dstSchemas: any[] = []; + srcBlocks: any[] = []; + dstBlocks: any[] = []; + srcGroups: string[] = []; dstGroups: string[] = []; + srcTokens: string[] = []; + dstTokens: string[] = []; + + dstTokenMap: string[] = []; + constructor( public ref: DynamicDialogRef, public config: DynamicDialogConfig, @@ -275,7 +378,9 @@ export class MigrateData { this.migrationConfig = new MigrationConfig( this.config.data?.policy?.id ); + this.contracts = this.config.data.contracts || []; this.policies = this.config.data.policies || []; + this.policies = JSON.parse(JSON.stringify(this.policies)); this.pList1 = this.policies; this.pList2 = this.policies; } @@ -366,37 +471,78 @@ export class MigrateData { }); } - onChange() { + loadBlocks() { + if (!this.migrationConfig.policiesValidity) { + return; + } + forkJoin([ + this._policyEngineService.getTagBlockMap(this.migrationConfig.src!), + this._policyEngineService.getTagBlockMap(this.migrationConfig.dst!), + ]).subscribe((blocks) => { + const srcBlocks = blocks[0]; + const dstBlocks = blocks[1]; + this.migrationConfig.clearBlocks(); + for (const srcBlockTag of Object.keys(srcBlocks)) { + this.migrationConfig.blocks[srcBlocks[srcBlockTag]] = + dstBlocks[srcBlockTag]; + } + this.srcBlocks = Object.entries(srcBlocks).map((item) => ({ + tag: item[0], + id: item[1], + })); + this.dstBlocks = Object.entries(dstBlocks).map((item) => ({ + tag: item[0], + id: item[1], + })); + }); + } + + async onChange() { + this.migrationConfig.clearTokensMap(); + this.migrationConfig.clearTokens(); this.migrationConfig.clearGroups(); this.migrationConfig.clearRoles(); if (this.migrationConfig.dst) { this.pList1 = this.policies.filter( (s) => s.id !== this.migrationConfig.dst ); - this.dstRoles = - this.policies.find( - (item) => item.id === this.migrationConfig.dst - ).policyRoles || []; + const dstPolicy = await this._policyEngineService + .policy(this.migrationConfig.dst) + .toPromise(); + this.dstRoles = dstPolicy.policyRoles || []; this.dstGroups = - this.policies - .find((item) => item.id === this.migrationConfig.dst) - .policyGroups?.map( - (group: { name: string }) => group.name - ) || []; + dstPolicy.policyGroups?.map( + (group: { name: string }) => group.name + ) || []; + this.dstTokens = this.dstGroups = + dstPolicy.policyTokens?.map( + (token: { templateTokenTag: string }) => + token.templateTokenTag + ) || []; + this.dstTokenMap = findAllEntities(dstPolicy.config, ['tokenId']); } else { this.pList1 = this.policies; } + if (this.uploadedPolicy) { + this.pList1 = [this.uploadedPolicy, ...this.pList1]; + } + if (this.migrationConfig.src) { this.pList2 = this.policies.filter( (s) => s.id !== this.migrationConfig.src ); this.loadVCs(); this.loadVPs(); - this.srcRoles = - this.policies.find( - (item) => item.id === this.migrationConfig.src - ).policyRoles || []; + + const srcPolicy = + this.migrationConfig.src === this.uploadedPolicy?.id + ? this.uploadedPolicy + : await this._policyEngineService + .policy(this.migrationConfig.src) + .toPromise(); + + this.srcRoles = srcPolicy.policyRoles || []; if (this.dstRoles.length > 0) { this.srcRoles?.forEach((role) => { this.migrationConfig.setRole(role); @@ -404,19 +550,38 @@ export class MigrateData { } this.srcGroups = - this.policies - .find((item) => item.id === this.migrationConfig.src) - .policyGroups?.map( - (group: { name: string }) => group.name - ) || []; + srcPolicy.policyGroups?.map( + (group: { name: string }) => group.name + ) || []; if (this.dstGroups.length > 0) { this.srcGroups?.forEach((group) => { this.migrationConfig.setGroup(group); }); } + + this.srcTokens = + srcPolicy.policyTokens?.map( + (token: { templateTokenTag: string }) => + token.templateTokenTag + ) || []; + if (this.dstTokens.length > 0) { + this.srcTokens?.forEach((token) => { + this.migrationConfig.setToken(token); + }); + } + + const srcTokensMap = findAllEntities(srcPolicy.config, ['tokenId']); + if (srcTokensMap.length > 0) { + srcTokensMap?.forEach((token) => { + this.migrationConfig.setTokenMap(token); + }); + } + } else { + this.pList2 = this.policies; } this.loadSchemas(); + this.loadBlocks(); setTimeout(() => { this._changeDetector.detectChanges(); @@ -441,36 +606,19 @@ export class MigrateData { this.activeIndex--; } - viewVP(document: any) { - this._dialogService.open(VCViewerDialog, { - width: '850px', - closable: true, - header: 'VP', - styleClass: 'custom-dialog', - data: { - id: document.id, - dryRun: false, - viewDocument: true, - document: document.document, - title: 'View VP', - type: 'VP', - }, - }); - } - - viewVC(document: any) { - this._dialogService.open(VCViewerDialog, { - width: '850px', + viewDocument(document: any) { + if (!document) { + return; + } + this._dialogService.open(JsonEditorDialogComponent, { closable: true, - header: 'VC', - styleClass: 'custom-dialog', + modal: true, + width: '70vw', + styleClass: 'custom-json-dialog', + header: 'View document', data: { - id: document.id, - dryRun: false, - viewDocument: true, - document: document.document, - title: 'View VC', - type: 'VC', + data: JSON.stringify(document, null, 4), + readOnly: true, }, }); } @@ -562,4 +710,91 @@ export class MigrateData { getSchemaName(schemas: { iri: string; name: string }[], iri: string) { return schemas.find((item) => item.iri === iri)?.name || iri; } + + getBlockName(blocks: { tag: string; id: string }[], id: string) { + return blocks.find((item) => item.id === id)?.tag || id; + } + + editDocument(doc: any) { + if (!doc.id) { + return; + } + const editedDoc = this.migrationConfig.editedVCs[doc.id]; + if (!editedDoc && !doc?.document?.credentialSubject) { + return; + } + this._dialogService + .open(JsonEditorDialogComponent, { + closable: true, + modal: true, + width: '70vw', + styleClass: 'custom-json-dialog', + header: 'Edit document', + data: { + data: JSON.stringify( + editedDoc || doc.document.credentialSubject[0], + null, + 4 + ), + }, + }) + .onClose.subscribe((result: any) => { + if (!result) { + return; + } + try { + const editedVC = JSON.parse(result); + if ( + JSON.stringify(editedVC) === + JSON.stringify(doc.document.credentialSubject[0]) + ) { + delete this.migrationConfig.editedVCs[doc.id]; + } else { + this.migrationConfig.editedVCs[doc.id] = editedVC; + } + } catch {} + }); + } + + private _input?: any; + onUploadData() { + const handler = () => { + input.removeEventListener('change', handler); + this._input = null; + this.loading = true; + this._policyEngineService + .importData(input.files![0]) + .subscribe((result: any) => { + this.uploadedPolicy = result; + this.migrationConfig.src = result.id; + this.loading = false; + this.onChange(); + }); + }; + if (this._input) { + this._input.removeEventListener('change', handler); + this._input = null; + } + const input = document.createElement('input'); + this._input = input; + input.type = 'file'; + input.accept = '.data'; + input.click(); + input.addEventListener('change', handler); + } + + onMigrateState() { + const migrateState = this.migrationConfig.migrateState; + if (migrateState) { + this.items = [ + ...this.items, + { + id: 'blocks', + label: 'Blocks', + }, + ]; + } else { + this.items = this.items.filter((item) => item.id !== 'blocks'); + } + } } diff --git a/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.html b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.html new file mode 100644 index 0000000000..693eba3527 --- /dev/null +++ b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.html @@ -0,0 +1,10 @@ +
+
+ +
+ +
diff --git a/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.scss b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.scss new file mode 100644 index 0000000000..614e300667 --- /dev/null +++ b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.scss @@ -0,0 +1,54 @@ +::ng-deep { + .custom-json-dialog { + .p-dialog-title { + font-family: Poppins, sans-serif; + font-size: 24px; + font-style: normal; + font-weight: 600; + } + + &.p-dialog { + height: 90%; + box-shadow: none; + } + + .p-dialog-header { + border-top-left-radius: 16px !important; + border-top-right-radius: 16px !important; + } + + .p-dialog-content { + border-bottom-left-radius: 16px; + border-bottom-right-radius: 16px; + } + } +} + +.modal-header { + color: #000; + font-family: Poppins, sans-serif; + font-size: 24px; + font-style: normal; + font-weight: 600; + line-height: 32px; +} + +.dialog-footer { + margin-top: 15px; + display: flex; + justify-content: flex-end; + gap: 10px; +} + +.dialog-content { + display: flex; + max-height: 100%; + flex-direction: column; + justify-content: space-between; + height: 100%; +} + +.editor { + overflow-y: auto; + border: 1px solid black; +} diff --git a/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.ts b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.ts new file mode 100644 index 0000000000..167dde683d --- /dev/null +++ b/frontend/src/app/modules/policy-engine/helpers/json-editor-dialog/json-editor-dialog.component.ts @@ -0,0 +1,47 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog'; + +@Component({ + selector: 'app-json-editor-dialog', + templateUrl: './json-editor-dialog.component.html', + styleUrls: ['./json-editor-dialog.component.scss'], +}) +export class JsonEditorDialogComponent implements OnInit { + result: any; + readOnly: boolean = false; + + codeMirrorOptions: any = { + theme: 'default', + mode: 'application/ld+json', + styleActiveLine: true, + lineNumbers: true, + gutters: ['CodeMirror-linenumbers'], + autoCloseBrackets: true, + matchBrackets: true, + lint: true, + readOnly: false, + viewportMargin: Infinity, + }; + + constructor( + public dialogRef: DynamicDialogRef, + public dialogConfig: DynamicDialogConfig + ) {} + + ngOnInit(): void { + this.readOnly = !!this.dialogConfig.data.readOnly; + if (this.readOnly) { + this.codeMirrorOptions.readOnly = true; + } + } + + ngAfterViewInit() { + setTimeout(() => { + ( + document.getElementsByClassName('CodeMirror-gutters')[0] as any + ).style.left = '0px'; + this.result = this.dialogConfig.data.data || ''; + }, 100); + } +} diff --git a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.html b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.html index 670f7309b8..a301e93d83 100644 --- a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.html +++ b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.html @@ -67,6 +67,16 @@
Similar Policies
{{ similar }}
+ +
+
Tools
+
+
+ + +
+
+
@@ -97,6 +107,21 @@
Creator
{{ tool.owner }}
+ +
+
Tools
+
{{ tools }}
+
+ +
+
Tools
+
+
+ + +
+
+
@@ -134,7 +159,7 @@
- +
diff --git a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.scss b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.scss index 240a39a45d..77c98af3a6 100644 --- a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.scss +++ b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.scss @@ -17,6 +17,14 @@ align-content: center; } +.field-input { + margin: 30px 5px; +} + +.input { + width: 100%; +} + .field-value { color: #181818; font-family: Inter, sans-serif; @@ -145,4 +153,4 @@ .error-type-error>div { color: var(--color-accent-red-1, #FF432A); } -} \ No newline at end of file +} diff --git a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.ts b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.ts index d6d0071940..1c59c7c1ff 100644 --- a/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.ts +++ b/frontend/src/app/modules/policy-engine/helpers/preview-policy-dialog/preview-policy-dialog.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog'; /** @@ -15,6 +16,7 @@ export class PreviewPolicyDialog { public schemas!: string; public tokens!: string; public tools!: string; + public toolConfigs!: { name: string, messageId: string }[]; public policyGroups!: string; public newVersions: any[] = []; public versionOfTopicId: any; @@ -24,6 +26,8 @@ export class PreviewPolicyDialog { public tool!: any; public xlsx!: any; public errors!: any; + public toolForm?: FormGroup; + public isFile?: boolean; constructor( public ref: DynamicDialogRef, @@ -62,6 +66,18 @@ export class PreviewPolicyDialog { return s.name; }) .join(', '); + + this.toolConfigs = importFile.tools || []; + this.toolForm = new FormGroup({}); + for (const toolConfigs of this.toolConfigs) { + this.toolForm.addControl( + toolConfigs.messageId, + new FormControl(toolConfigs.messageId, [ + Validators.required, + Validators.pattern(/^[0-9]{10}\.[0-9]{9}$/), + ]) + ); + } } if (this.config.data.module) { @@ -70,6 +86,21 @@ export class PreviewPolicyDialog { if (this.config.data.tool) { this.tool = this.config.data.tool?.tool; + this.isFile = this.config.data.isFile; + this.toolConfigs = this.config.data.tool.tools || []; + if (this.isFile) { + this.toolForm = new FormGroup({}); + for (const toolConfigs of this.toolConfigs) { + this.toolForm.addControl( + toolConfigs.messageId, + new FormControl(toolConfigs.messageId, [ + Validators.required, + Validators.pattern(/^[0-9]{10}\.[0-9]{9}$/), + ]) + ); + } + } + this.tools = this.toolConfigs.map((tool) => tool.name).join(', '); } if (this.config.data.xlsx) { @@ -121,12 +152,14 @@ export class PreviewPolicyDialog { onImport() { this.ref.close({ versionOfTopicId: this.versionOfTopicId, + tools: this.toolForm?.value, }); } onNewVersionClick(messageId: string) { this.ref.close({ messageId, + tools: this.toolForm?.value, }); } } diff --git a/frontend/src/app/modules/policy-engine/policies/policies.component.html b/frontend/src/app/modules/policy-engine/policies/policies.component.html index 32787021b1..d7365e0809 100644 --- a/frontend/src/app/modules/policy-engine/policies/policies.component.html +++ b/frontend/src/app/modules/policy-engine/policies/policies.component.html @@ -28,9 +28,9 @@ class="tags-dropdown" formControlName="tag" placeholder="Tags"> - @@ -350,9 +411,9 @@

Profile

- \ No newline at end of file + diff --git a/frontend/src/app/views/root-config/root-config.component.scss b/frontend/src/app/views/root-config/root-config.component.scss index beaacedbd0..94776c6a97 100644 --- a/frontend/src/app/views/root-config/root-config.component.scss +++ b/frontend/src/app/views/root-config/root-config.component.scss @@ -13,6 +13,10 @@ align-content: center; } +.hide-block { + display: none !important; +} + .loading-progress { width: 80%; height: 80%; @@ -531,4 +535,4 @@ mat-radio-button { .p-button:disabled { pointer-events: none !important; -} \ No newline at end of file +} diff --git a/frontend/src/app/views/root-config/root-config.component.ts b/frontend/src/app/views/root-config/root-config.component.ts index 9438b279ad..e9fbb9fe6c 100644 --- a/frontend/src/app/views/root-config/root-config.component.ts +++ b/frontend/src/app/views/root-config/root-config.component.ts @@ -1,12 +1,7 @@ -import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; -import { - FormBuilder, - FormControl, - FormGroup, - Validators, -} from '@angular/forms'; +import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators, } from '@angular/forms'; import { AuthService } from '../../services/auth.service'; -import { forkJoin } from 'rxjs'; +import { forkJoin, Subscription } from 'rxjs'; import { ProfileService } from '../../services/profile.service'; import { SchemaService } from '../../services/schema.service'; import { IUser, Schema, SchemaEntity } from '@guardian/interfaces'; @@ -17,6 +12,7 @@ import { InformService } from '../../services/inform.service'; import { TasksService } from '../../services/tasks.service'; import { Router } from '@angular/router'; import { DialogService } from 'primeng/dynamicdialog'; +import { ValidateIfFieldEqual } from '../../validators/validate-if-field-equal'; enum OperationMode { None, @@ -32,7 +28,7 @@ enum OperationMode { templateUrl: './root-config.component.html', styleUrls: ['./root-config.component.scss'], }) -export class RootConfigComponent implements OnInit { +export class RootConfigComponent implements OnInit, OnDestroy{ @ViewChild('actionMenu') actionMenu: any; public loading: boolean = true; @@ -48,7 +44,17 @@ export class RootConfigComponent implements OnInit { public schema!: Schema; public hederaForm = this.fb.group({ hederaAccountId: ['', Validators.required], - hederaAccountKey: ['', Validators.required] + hederaAccountKey: ['', Validators.required], + useFireblocksSigning: [false], + fireBlocksVaultId: ['', [ValidateIfFieldEqual('useFireblocksSigning', true, [Validators.required])]], + fireBlocksAssetId: ['', [ValidateIfFieldEqual('useFireblocksSigning', true, [Validators.required])]], + fireBlocksApiKey: ['', [ValidateIfFieldEqual('useFireblocksSigning', true, [Validators.required])]], + fireBlocksPrivateiKey: [ + '', ValidateIfFieldEqual('useFireblocksSigning', true, + [ + Validators.required, + Validators.pattern(/^-----BEGIN PRIVATE KEY-----[\s\S]+-----END PRIVATE KEY-----$/gm) + ])] }); public selectedTokenId = new FormControl(null, Validators.required); public vcForm = new FormGroup({}); @@ -65,6 +71,7 @@ export class RootConfigComponent implements OnInit { private operationMode: OperationMode = OperationMode.None; private expectedTaskMessages: number = 0; + private subscriptions = new Subscription() public isRestore = false; constructor( @@ -80,6 +87,7 @@ export class RootConfigComponent implements OnInit { public dialog: DialogService, private cdRef: ChangeDetectorRef ) { + console.log(this); this.profile = null; this.balance = null; this.vcForm.statusChanges.subscribe((result) => { @@ -93,7 +101,12 @@ export class RootConfigComponent implements OnInit { this.loading = true; this.hederaForm.setValue({ hederaAccountId: '', - hederaAccountKey: '' + hederaAccountKey: '', + useFireblocksSigning: false, + fireBlocksVaultId: '', + fireBlocksAssetId: '', + fireBlocksApiKey: '', + fireBlocksPrivateiKey: '' }); this.vcForm.setValue({}); this.loadProfile(); @@ -101,6 +114,7 @@ export class RootConfigComponent implements OnInit { } ngOnDestroy(): void { + this.subscriptions.unsubscribe(); } private loadProfile() { @@ -427,7 +441,7 @@ export class RootConfigComponent implements OnInit { switch (operationMode) { case OperationMode.Generate: { const { id, key } = task.result; - this.hederaForm.setValue({ + this.hederaForm.patchValue({ hederaAccountId: id, hederaAccountKey: key, }); @@ -536,8 +550,15 @@ export class RootConfigComponent implements OnInit { const data: any = { hederaAccountId: hederaForm.hederaAccountId?.trim(), hederaAccountKey: hederaForm.hederaAccountKey?.trim(), - vcDocument: vcDocument, + vcDocument, didDocument: JSON.parse(didDocument), + useFireblocksSigning: hederaForm.useFireblocksSigning, + fireblocksConfig: { + fireBlocksVaultId: hederaForm.fireBlocksVaultId, + fireBlocksAssetId: hederaForm.fireBlocksAssetId, + fireBlocksApiKey: hederaForm.fireBlocksApiKey, + fireBlocksPrivateiKey: hederaForm.fireBlocksPrivateiKey + }, didKeys }; this.loading = true; diff --git a/frontend/src/app/views/user-profile/user-profile.component.html b/frontend/src/app/views/user-profile/user-profile.component.html index fa3e6d40c5..8783dedf48 100644 --- a/frontend/src/app/views/user-profile/user-profile.component.html +++ b/frontend/src/app/views/user-profile/user-profile.component.html @@ -152,10 +152,10 @@

Profile

    -
@@ -199,6 +199,66 @@

Profile

type="text" /> +
+ +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
Profile DID Document: - + Invalid DID Document. diff --git a/frontend/src/app/views/user-profile/user-profile.component.ts b/frontend/src/app/views/user-profile/user-profile.component.ts index 933cde2dc6..bf8c383f12 100644 --- a/frontend/src/app/views/user-profile/user-profile.component.ts +++ b/frontend/src/app/views/user-profile/user-profile.component.ts @@ -1,27 +1,22 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; -import { AbstractControl, FormControl, FormGroup, Validators, } from '@angular/forms'; +import { FormControl, FormGroup, Validators, } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; -import { forkJoin, Subscription } from 'rxjs'; -import { IPolicy, IStandardRegistryResponse, IUser, Schema, SchemaEntity, SchemaHelper, TagType, Token, } from '@guardian/interfaces'; +import { forkJoin } from 'rxjs'; +import { IPolicy, IStandardRegistryResponse, IUser, Schema, SchemaEntity, } from '@guardian/interfaces'; import { ActivatedRoute, Router } from '@angular/router'; //services import { AuthService } from '../../services/auth.service'; import { ProfileService } from '../../services/profile.service'; -import { TokenService } from '../../services/token.service'; import { DemoService } from '../../services/demo.service'; import { SchemaService } from '../../services/schema.service'; import { HeaderPropsService } from '../../services/header-props.service'; import { InformService } from '../../services/inform.service'; import { TasksService } from '../../services/tasks.service'; -import { WebSocketService } from '../../services/web-socket.service'; -import { TagsService } from '../../services/tag.service'; -import { ContractService } from '../../services/contract.service'; //modules import { VCViewerDialog } from '../../modules/schema-engine/vc-dialog/vc-dialog.component'; import { noWhitespaceValidator } from 'src/app/validators/no-whitespace-validator'; import { DialogService } from 'primeng/dynamicdialog'; -import { UserRetirePoolsDialogComponent } from 'src/app/modules/contract-engine/dialogs/user-retire-pools-dialog/user-retire-pools-dialog.component'; -import { UserRetireRequestsDialogComponent } from 'src/app/modules/contract-engine/dialogs/user-retire-requests-dialog/user-retire-requests-dialog.component'; +import { ValidateIfFieldEqual } from '../../validators/validate-if-field-equal'; enum OperationMode { None, @@ -128,7 +123,16 @@ export class UserProfileComponent implements OnInit { this.standardRegistryForm = new FormControl('', [Validators.required]); this.hederaCredentialsForm = new FormGroup({ id: new FormControl('', [Validators.required, noWhitespaceValidator()]), - key: new FormControl('', [Validators.required, noWhitespaceValidator()]) + key: new FormControl('', [Validators.required, noWhitespaceValidator()]), + useFireblocksSigning: new FormControl(false), + fireBlocksVaultId: new FormControl('', [ValidateIfFieldEqual('useFireblocksSigning', true, [])]), + fireBlocksAssetId: new FormControl('', [ValidateIfFieldEqual('useFireblocksSigning', true, [])]), + fireBlocksApiKey: new FormControl('', [ValidateIfFieldEqual('useFireblocksSigning', true, [])]), + fireBlocksPrivateiKey: new FormControl('', [ + ValidateIfFieldEqual('useFireblocksSigning', true, + [ + Validators.pattern(/^-----BEGIN PRIVATE KEY-----[\s\S]+-----END PRIVATE KEY-----$/gm) + ])]) }); this.didDocumentType = new FormControl(false, [Validators.required]); this.didDocumentForm = new FormControl('', [Validators.required]); @@ -328,7 +332,7 @@ export class UserProfileComponent implements OnInit { case OperationMode.Generate: this.taskService.get(taskId).subscribe((task) => { const { id, key } = task.result; - this.hederaCredentialsForm.setValue({ id, key }); + this.hederaCredentialsForm.patchValue({id, key}); this.loading = false; }); break; @@ -664,6 +668,13 @@ export class UserProfileComponent implements OnInit { profile.parent = data.standardRegistry; profile.hederaAccountId = data.hederaCredentials.id?.trim(); profile.hederaAccountKey = data.hederaCredentials.key?.trim(); + profile.useFireblocksSigning = data.hederaCredentials.useFireblocksSigning; + profile.fireblocksConfig = { + fireBlocksVaultId: data.hederaCredentials.fireBlocksVaultId, + fireBlocksAssetId: data.hederaCredentials.fireBlocksAssetId, + fireBlocksApiKey: data.hederaCredentials.fireBlocksApiKey, + fireBlocksPrivateiKey: data.hederaCredentials.fireBlocksPrivateiKey + } if (data.didDocumentType) { profile.didDocument = data.didDocument; profile.didKeys = []; diff --git a/guardian-cli/helpers/contract-publisher.helper.ts b/guardian-cli/helpers/contract-publisher.helper.ts new file mode 100644 index 0000000000..41536dab97 --- /dev/null +++ b/guardian-cli/helpers/contract-publisher.helper.ts @@ -0,0 +1,195 @@ +import path from 'path'; +import fs from 'fs'; +import solc from 'solc'; +import { + Client, + ContractCreateTransaction, + FileAppendTransaction, + FileCreateTransaction, + PrivateKey, + Status, +} from '@hashgraph/sdk'; + +/** + * Network + */ +export enum Network { + TESTNET = 'testnet', + MAINNET = 'mainnet', + PREVIEWNET = 'previewnet', +} + +/** + * Contract publisher + */ +export class ContractPublisher { + /** + * Chunk size + */ + public static readonly CHUNK_SIZE = 20000; + + /** + * Split contract bytecode + * @param bytecode Contract bytecode + * @returns Chunks + */ + private static _splitContractBytecode(bytecode: string) { + const chunks = []; + let chuckedSize = 0; + while (chuckedSize < bytecode.length) { + const chunk = bytecode.slice( + chuckedSize, + chuckedSize + ContractPublisher.CHUNK_SIZE + ); + chunks.push(chunk); + chuckedSize += chunk.length; + } + return chunks; + } + + /** + * Deploy contract file + * @param bytecode Bytecode + * @param credentials Credentials + * @param network Nework + * @returns Contract file identifier + */ + public static async deployContractFile( + bytecode: string, + credentials: { operatorId: string; operatorKey: string }, + network?: Network + ) { + let client: Client; + switch (network) { + case Network.MAINNET: + client = Client.forMainnet(); + break; + case Network.PREVIEWNET: + client = Client.forPreviewnet(); + break; + default: + client = Client.forTestnet(); + } + const operatorKey = PrivateKey.fromString(credentials.operatorKey); + client = client.setOperator(credentials.operatorId, operatorKey); + try { + const fileCreateTx = new FileCreateTransaction().setKeys([ + operatorKey, + ]); + const fileCreateEx = await fileCreateTx.execute(client); + const fileCreateTr = await fileCreateEx.getReceipt(client); + const bytecodeFileId = fileCreateTr.fileId; + + const chunks = ContractPublisher._splitContractBytecode(bytecode); + for (const chunk of chunks) { + const fileAppendTx = new FileAppendTransaction() + .setFileId(bytecodeFileId) + .setContents(chunk) + .setMaxChunks(Number.MAX_SAFE_INTEGER) + .setTransactionValidDuration(180); + const fileAppendEx = await fileAppendTx.execute(client); + const fileAppendTr = await fileAppendEx.getReceipt(client); + if (fileAppendTr.status !== Status.Success) { + throw new Error('Error while uploading contract code'); + } + } + return bytecodeFileId.toString(); + } catch (error) { + throw error; + } finally { + client.close(); + } + } + + /** + * Deploy contract + * @param contractFileId Contract file identifier + * @param gas Gas + * @param credentials Credentials + * @param network Network + * @returns Contract identifier + */ + public static async deployContract( + contractFileId: string, + gas: number = 5000000, + credentials: { operatorId: string; operatorKey: string }, + network?: Network + ) { + let client: Client; + switch (network) { + case Network.MAINNET: + client = Client.forMainnet(); + break; + case Network.PREVIEWNET: + client = Client.forPreviewnet(); + break; + default: + client = Client.forTestnet(); + } + const operatorKey = PrivateKey.fromString(credentials.operatorKey); + client = client.setOperator(credentials.operatorId, operatorKey); + try { + const contractTx = await new ContractCreateTransaction() + .setBytecodeFileId(contractFileId) + .setGas(gas); + const contractResponse = await contractTx.execute(client); + const contractReceipt = await contractResponse.getReceipt(client); + const newContractId = contractReceipt.contractId; + return newContractId.toString(); + } catch (error) { + throw error; + } finally { + client.close(); + } + } + + /** + * Compile contract + * @param filePath Contract file path + * @param contractName Contract name + * @param output Output path + * @returns Contract bytecode + */ + public static async compileContract( + filePath: string, + contractName: string + ) { + if (!fs.existsSync(filePath)) { + throw new Error(`${filePath} is not exists`); + } + if (!contractName) { + throw new Error('Invalid contract name'); + } + const stat = fs.lstatSync(filePath); + if (!stat.isFile()) { + throw new Error(`${filePath} is not file`); + } + const sources: any = {}; + sources[filePath] = { + content: await fs.readFileSync(filePath, { + encoding: 'utf8', + }), + }; + const solcOptions = { + language: 'Solidity', + sources, + settings: { + outputSelection: { + '*': { + '*': ['*'], + }, + }, + }, + }; + const compileStringResult = solc.compile(JSON.stringify(solcOptions), { + import: (relativePath) => { + const source = fs.readFileSync(relativePath, 'utf8'); + return { contents: source }; + }, + }); + const compileResult = JSON.parse(compileStringResult); + const bytecode = + compileResult.contracts[filePath][contractName].evm.bytecode.object; + return bytecode; + } +} diff --git a/guardian-cli/helpers/policy-publisher.helper.ts b/guardian-cli/helpers/policy-publisher.helper.ts index 7701838607..a34321e749 100644 --- a/guardian-cli/helpers/policy-publisher.helper.ts +++ b/guardian-cli/helpers/policy-publisher.helper.ts @@ -3,15 +3,20 @@ import fs from 'fs'; import WebSocket from 'ws'; import Path from 'path'; +interface Task { + action: string; options?: any; resolve: Function +} export class PolicyPublisher { private _policiesConfig: Map = new Map(); private _accessToken: string; private _refreshToken: string; private _pingInterval; private _updateTokenInterval; - private _tasks: Map = new Map(); + private _tasks: Map< + string, + Task + > = new Map(); private _ws: WebSocket; - private _resolver: Function; private constructor( private _policiesDirectory: string, @@ -58,7 +63,6 @@ export class PolicyPublisher { if (task.action === 'Publish policy') { this.onPolicyPublished(taskId, result.policyId); } - return; } else if (error) { this._tasks.delete(taskId); return; @@ -118,6 +122,7 @@ export class PolicyPublisher { this._tasks.set(taskId, { action, options: task.options, + resolve: task.resolve, }); } catch (error) { this._policiesConfig.delete(task.options.file); @@ -141,15 +146,8 @@ export class PolicyPublisher { } catch (error) { console.error(error); } finally { - this._policiesConfig.delete(task.options.file); this._tasks.delete(publishTaskId); - await this.checkFinish(); - } - } - - private async checkFinish() { - if (this._policiesConfig.size === 0) { - await this.finish(); + task.resolve(); } } @@ -157,9 +155,6 @@ export class PolicyPublisher { if (this._ws) { this._ws?.close(); } - if (this._resolver) { - this._resolver(); - } if (this._pingInterval) { clearInterval(this._pingInterval); } @@ -221,17 +216,11 @@ export class PolicyPublisher { await policyPublisher.authorize(); await policyPublisher.parseConfigFile(configFilePath); await policyPublisher.start(); + await policyPublisher.finish(); } - private start(): Promise { - return new Promise(async (resolve, reject) => { - try { - this._resolver = resolve; - await this.read(this._policiesDirectory); - } catch (error) { - reject(error); - } - }); + private async start(): Promise { + await this.read(this._policiesDirectory); } private async read(dirPath) { @@ -250,13 +239,16 @@ export class PolicyPublisher { await fs.readFileSync(dirPath) ); console.log(`Import policy ${file} is started`); - this._tasks.set(taskId, { - action, - options: { - version, - file, - }, - }); + await new Promise((resolve) => + this._tasks.set(taskId, { + action, + options: { + version, + file, + }, + resolve, + }) + ); } if (stat.isDirectory()) { const dirs = fs.readdirSync(dirPath); diff --git a/guardian-cli/index.ts b/guardian-cli/index.ts index f5b1d1c7ac..87e543d5df 100644 --- a/guardian-cli/index.ts +++ b/guardian-cli/index.ts @@ -2,7 +2,13 @@ import { spawnSync } from 'child_process'; import { Command } from 'commander'; -import { PolicyPublisher } from './helpers/policy-publisher.helper'; + +import { PolicyPublisher } from './helpers/policy-publisher.helper.js'; +import { + ContractPublisher, + Network, +} from './helpers/contract-publisher.helper.js'; + const GUARDIAN_REPOSITORY = 'https://github.com/hashgraph/guardian'; @@ -719,8 +725,16 @@ function main() { .command('publish-policies') .description('Import and publish policies') .argument('', 'Path to policiy files') - .option('-c --config-file-path ', 'Path to config file', './config.json') - .option('-b --base-url ', 'Base guardian URL', 'http://localhost:3002/') + .option( + '-c --config-file-path ', + 'Path to config file', + './config.json' + ) + .option( + '-b --base-url ', + 'Base guardian URL', + 'http://localhost:3002/' + ) .option('-u --user ', 'User', 'StandardRegistry') .option('-p --password ', 'Password', 'test') .option('-o --output ', 'Output information file path') @@ -740,6 +754,67 @@ function main() { process.exit(1); } }); + + program + .command('deploy-contract-file') + .description('Deploy contract file') + .argument('', 'Path to contract file') + .argument('', 'Contract name') + .argument('', 'Hedera account id') + .argument('', 'Hedera private key') + .option('-n --network ', 'Network', Network.TESTNET) + .action(async (contractPath, contractName, account, key, options) => { + try { + const contractByteCode = + await ContractPublisher.compileContract( + contractPath, + contractName + ); + const contractFileId = + await ContractPublisher.deployContractFile( + contractByteCode, + { + operatorId: account, + operatorKey: key, + }, + options.network + ); + console.log( + `${contractName} contract file identifier - ${contractFileId}` + ); + } catch (error) { + console.error(error); + process.exit(1); + } + }); + + program + .command('deploy-contract') + .description('Deploy contract file') + .argument('', 'Contract file identifier') + .argument('', 'Hedera account id') + .argument('', 'Hedera private key') + .option('-g --gas ', 'Gas') + .option('-n --network ', 'Network', Network.TESTNET) + .action(async (contractFileId, account, key, options) => { + try { + const contractId = await ContractPublisher.deployContract( + contractFileId, + options.gas && parseInt(options.gas, 10), + { + operatorId: account, + operatorKey: key, + }, + options.network + ); + console.log( + `${contractFileId} contract identifier - ${contractId}` + ); + } catch (error) { + console.error(error); + process.exit(1); + } + }); program.parse(); } diff --git a/guardian-cli/package.json b/guardian-cli/package.json index 0c77b3b6aa..ad91e4b597 100644 --- a/guardian-cli/package.json +++ b/guardian-cli/package.json @@ -21,8 +21,11 @@ "typescript": "^5.0.2" }, "dependencies": { + "@hashgraph/sdk": "^2.43.0", "axios": "^1.6.7", "commander": "^10.0.0", + "solc": "0.8.11", "ws": "^8.16.0" - } + }, + "type": "module" } diff --git a/guardian-cli/tsconfig.json b/guardian-cli/tsconfig.json index 84490ce56d..821cf66a38 100644 --- a/guardian-cli/tsconfig.json +++ b/guardian-cli/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6", diff --git a/guardian-cli/tsconfig.production.json b/guardian-cli/tsconfig.production.json index 54aa4591d3..507803fbc1 100644 --- a/guardian-cli/tsconfig.production.json +++ b/guardian-cli/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6", diff --git a/guardian-service/.dockerignore b/guardian-service/.dockerignore index 25ab276c1d..57c7a935a9 100644 --- a/guardian-service/.dockerignore +++ b/guardian-service/.dockerignore @@ -1,4 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile node_modules npm-debug.log -dist -.env diff --git a/guardian-service/Dockerfile b/guardian-service/Dockerfile index c54a05844a..8188f79ea3 100644 --- a/guardian-service/Dockerfile +++ b/guardian-service/Dockerfile @@ -1,56 +1,60 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS guardianServiceBuilder -WORKDIR /usr/local/guardian-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./guardian-service/package.json ./ -COPY ./guardian-service/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./guardian-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/guardian-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=guardianServiceBuilder /usr/local/guardian-service/yarn.lock ./ -ADD ./guardian-service/src/migrations/artifacts ./src/migrations/artifacts/. -COPY ./guardian-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -COPY ./guardian-service/system-schemas ./system-schemas/. -COPY ./guardian-service/artifacts ./artifacts/. +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=guardianServiceBuilder /usr/local/guardian-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link guardian-service/package.json guardian-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link guardian-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link guardian-service/src/migrations/artifacts src/migrations/artifacts/ +COPY --link guardian-service/system-schemas system-schemas/ +COPY --link guardian-service/artifacts artifacts/ + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/guardian-service/Gulpfile.js b/guardian-service/Gulpfile.mjs similarity index 88% rename from guardian-service/Gulpfile.js rename to guardian-service/Gulpfile.mjs index 4be1d2ab2c..bc72367a0b 100644 --- a/guardian-service/Gulpfile.js +++ b/guardian-service/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { return gulp diff --git a/guardian-service/package.json b/guardian-service/package.json index 62a020fa18..703af657a5 100644 --- a/guardian-service/package.json +++ b/guardian-service/package.json @@ -13,17 +13,16 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", "@hashgraph/sdk": "2.34.1", "@mattrglobal/jsonld-signatures-bbs": "^1.1.2", "@meeco/cryppo": "^2.0.2", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -38,7 +37,7 @@ "ajv-formats": "^2.1.1", "axios": "^1.3.6", "bs58": "^4.0.1", - "bson": "^5.3.0", + "bson": "^6.5.0", "cors": "^2.8.5", "cron": "^2.0.0", "deep-equal": "^2.0.5", @@ -52,7 +51,7 @@ "mathjs": "^10.1.0", "module-alias": "^2.2.2", "moment": "^2.29.2", - "mongodb": "5.6.0", + "mongodb": "^6.5.0", "prom-client": "^14.1.1", "prometheus-api-metrics": "3.2.2", "reflect-metadata": "^0.1.13", @@ -95,9 +94,10 @@ "dev": "tsc -w", "lint": "tslint --config ../tslint.json --project .", "start": "node dist/index.js", - "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/guardian-service.xml --exit", - "test:local": "mocha tests/**/*.test.js --exit", - "test:stability": "mocha tests/stability.test.js" + "test": "mocha tests/**/*.test.mjs --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/guardian-service.xml --exit", + "test:local": "mocha tests/**/*.test.mjs --exit", + "test:stability": "mocha tests/stability.test.mjs" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/guardian-service/src/analytics/compare/comparators/document-comparator.ts b/guardian-service/src/analytics/compare/comparators/document-comparator.ts index ee873146a8..9f12956532 100644 --- a/guardian-service/src/analytics/compare/comparators/document-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/document-comparator.ts @@ -1,17 +1,17 @@ import { DatabaseServer } from '@guardian/common'; -import { CSV } from '../../table/csv'; -import { ReportTable } from '../../table/report-table'; -import { CompareOptions, IRefLvl } from '../interfaces/compare-options.interface'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface'; -import { IReportTable } from '../interfaces/report-table.interface'; -import { DocumentModel, VcDocumentModel, VpDocumentModel } from '../models/document.model'; -import { SchemaModel } from '../models/schema.model'; -import { DocumentsRate } from '../rates/documents-rate'; -import { ComparePolicyUtils } from '../utils/compare-policy-utils'; -import { MultiCompareUtils } from '../utils/multi-compare-utils'; -import { CompareUtils } from '../utils/utils'; -import { IRate } from '../interfaces/rate.interface'; +import { CSV } from '../../table/csv.js'; +import { ReportTable } from '../../table/report-table.js'; +import { CompareOptions, IRefLvl } from '../interfaces/compare-options.interface.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; +import { DocumentModel, VcDocumentModel, VpDocumentModel } from '../models/document.model.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { DocumentsRate } from '../rates/documents-rate.js'; +import { ComparePolicyUtils } from '../utils/compare-policy-utils.js'; +import { MultiCompareUtils } from '../utils/multi-compare-utils.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IRate } from '../interfaces/rate.interface.js'; /** * Component for comparing two documents diff --git a/guardian-service/src/analytics/compare/comparators/hash-comparator.ts b/guardian-service/src/analytics/compare/comparators/hash-comparator.ts index adbdd2adf2..9ed54e1ba6 100644 --- a/guardian-service/src/analytics/compare/comparators/hash-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/hash-comparator.ts @@ -1,13 +1,13 @@ import { Logger, Policy } from '@guardian/common'; -import { PolicyModel } from '../models/policy.model'; -import { SchemaModel } from '../models/schema.model'; -import { TokenModel } from '../models/token.model'; -import { FileModel } from '../models/file.model'; -import { IWeightBlock } from '../interfaces/weight-block.interface'; -import { IWeightItem } from '../interfaces/weight-item.interface'; -import { CompareUtils } from '../utils/utils'; -import { PolicyComparator } from './policy-comparator'; -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface'; +import { PolicyModel } from '../models/policy.model.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { TokenModel } from '../models/token.model.js'; +import { FileModel } from '../models/file.model.js'; +import { IWeightBlock } from '../interfaces/weight-block.interface.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; +import { CompareUtils } from '../utils/utils.js'; +import { PolicyComparator } from './policy-comparator.js'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface.js'; /** * Weight Types @@ -57,21 +57,20 @@ export class HashComparator { const { policy, schemas, tokens, artifacts } = file; //Policy - const policyModel = (new PolicyModel(policy, HashComparator.options)); + const policyModel = new PolicyModel(policy, HashComparator.options); //Schemas - const schemaModels: SchemaModel[] = []; - for (const schema of schemas) { + const schemaModels = schemas.map(schema => { const m = new SchemaModel(schema, HashComparator.options); m.setPolicy(policy); m.update(HashComparator.options); - schemaModels.push(m); - } + return m; + }); + policyModel.setSchemas(schemaModels); //Tokens - const tokenModels: TokenModel[] = []; - for (const row of tokens) { + const tokenModels = tokens.map(row => { const token: any = { tokenId: row.tokenId, tokenName: row.tokenName, @@ -86,17 +85,16 @@ export class HashComparator { } const t = new TokenModel(token, HashComparator.options); t.update(HashComparator.options); - tokenModels.push(t); - } + return t; + }); policyModel.setTokens(tokenModels); //Artifacts - const artifactsModels: FileModel[] = []; - for (const artifact of artifacts) { + const artifactsModels = artifacts.map(artifact => { const f = new FileModel(artifact, artifact.data, HashComparator.options); f.update(HashComparator.options); - artifactsModels.push(f); - } + return f; + }); policyModel.setArtifacts(artifactsModels); //Compare @@ -463,4 +461,4 @@ export class HashComparator { return Math.min(rate1, rate2); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/comparators/module-comparator.ts b/guardian-service/src/analytics/compare/comparators/module-comparator.ts index be135291d3..02ed7d1fbf 100644 --- a/guardian-service/src/analytics/compare/comparators/module-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/module-comparator.ts @@ -1,17 +1,17 @@ -import { BlockModel } from '../models/block.model'; -import { BlocksRate } from '../rates/blocks-rate'; -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface'; -import { ReportTable } from '../../table/report-table'; -import { Status } from '../types/status.type'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { MergeUtils } from '../utils/merge-utils'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { ObjectRate } from '../rates/object-rate'; -import { CompareUtils } from '../utils/utils'; -import { CSV } from '../../table/csv'; -import { ModuleModel } from '../models/module.model'; +import { BlockModel } from '../models/block.model.js'; +import { BlocksRate } from '../rates/blocks-rate.js'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface.js'; +import { ReportTable } from '../../table/report-table.js'; +import { Status } from '../types/status.type.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { MergeUtils } from '../utils/merge-utils.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { ObjectRate } from '../rates/object-rate.js'; +import { CompareUtils } from '../utils/utils.js'; +import { CSV } from '../../table/csv.js'; +import { ModuleModel } from '../models/module.model.js'; /** * Component for comparing two modules @@ -419,4 +419,4 @@ export class ModuleComparator { return csv.result(); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/comparators/policy-comparator.ts b/guardian-service/src/analytics/compare/comparators/policy-comparator.ts index d51bfdd751..632fc342f4 100644 --- a/guardian-service/src/analytics/compare/comparators/policy-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/policy-comparator.ts @@ -1,20 +1,20 @@ import { DatabaseServer } from '@guardian/common'; -import { CSV } from '../../table/csv'; -import { ReportTable } from '../../table/report-table'; -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { IReportTable } from '../interfaces/report-table.interface'; -import { FileModel } from '../models/file.model'; -import { PolicyModel } from '../models/policy.model'; -import { SchemaModel } from '../models/schema.model'; -import { TokenModel } from '../models/token.model'; -import { BlocksRate } from '../rates/blocks-rate'; -import { PropertyType } from '../types/property.type'; -import { ComparePolicyUtils } from '../utils/compare-policy-utils'; -import { MultiCompareUtils } from '../utils/multi-compare-utils'; -import { CompareUtils } from '../utils/utils'; +import { CSV } from '../../table/csv.js'; +import { ReportTable } from '../../table/report-table.js'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; +import { FileModel } from '../models/file.model.js'; +import { PolicyModel } from '../models/policy.model.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { TokenModel } from '../models/token.model.js'; +import { BlocksRate } from '../rates/blocks-rate.js'; +import { PropertyType } from '../types/property.type.js'; +import { ComparePolicyUtils } from '../utils/compare-policy-utils.js'; +import { MultiCompareUtils } from '../utils/multi-compare-utils.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Component for comparing two policies @@ -570,4 +570,4 @@ export class PolicyComparator { return policyModel; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/comparators/record-comparator.ts b/guardian-service/src/analytics/compare/comparators/record-comparator.ts index 68f44d104a..7c079fbbf1 100644 --- a/guardian-service/src/analytics/compare/comparators/record-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/record-comparator.ts @@ -1,19 +1,19 @@ import { DatabaseServer, IRecordResult } from '@guardian/common'; -import { CSV } from '../../table/csv'; -import { ReportTable } from '../../table/report-table'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface'; -import { IReportTable } from '../interfaces/report-table.interface'; -import { DocumentModel, VcDocumentModel, VpDocumentModel } from '../models/document.model'; -import { SchemaModel } from '../models/schema.model'; -import { DocumentsRate } from '../rates/documents-rate'; -import { ComparePolicyUtils } from '../utils/compare-policy-utils'; -import { MultiCompareUtils } from '../utils/multi-compare-utils'; -import { CompareUtils } from '../utils/utils'; -import { IRate } from '../interfaces/rate.interface'; -import { RecordModel } from '../models/record.model'; -import { RecordRate } from '../rates/record-rate'; +import { CSV } from '../../table/csv.js'; +import { ReportTable } from '../../table/report-table.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; +import { DocumentModel, VcDocumentModel, VpDocumentModel } from '../models/document.model.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { DocumentsRate } from '../rates/documents-rate.js'; +import { ComparePolicyUtils } from '../utils/compare-policy-utils.js'; +import { MultiCompareUtils } from '../utils/multi-compare-utils.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { RecordModel } from '../models/record.model.js'; +import { RecordRate } from '../rates/record-rate.js'; /** * Component for comparing two record @@ -465,4 +465,4 @@ export class RecordComparator { return model; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/comparators/schema-comparator.ts b/guardian-service/src/analytics/compare/comparators/schema-comparator.ts index 4387dad4d8..868c809535 100644 --- a/guardian-service/src/analytics/compare/comparators/schema-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/schema-comparator.ts @@ -1,15 +1,15 @@ -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface'; -import { ReportTable } from '../../table/report-table'; -import { Status } from '../types/status.type'; -import { SchemaModel } from '../models/schema.model'; -import { FieldModel } from '../models/field.model'; -import { FieldsRate } from '../rates/fields-rate'; -import { IRate } from '../interfaces/rate.interface'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { MergeUtils } from '../utils/merge-utils'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { CSV } from '../../table/csv'; -import { CompareUtils } from '../utils/utils'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface.js'; +import { ReportTable } from '../../table/report-table.js'; +import { Status } from '../types/status.type.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { FieldModel } from '../models/field.model.js'; +import { FieldsRate } from '../rates/fields-rate.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { MergeUtils } from '../utils/merge-utils.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { CSV } from '../../table/csv.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Component for comparing two schemas @@ -275,4 +275,4 @@ export class SchemaComparator { return csv.result(); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/comparators/tool-comparator.ts b/guardian-service/src/analytics/compare/comparators/tool-comparator.ts index a2d6c77d94..c5ac35fbb6 100644 --- a/guardian-service/src/analytics/compare/comparators/tool-comparator.ts +++ b/guardian-service/src/analytics/compare/comparators/tool-comparator.ts @@ -1,18 +1,18 @@ import { DatabaseServer } from '@guardian/common'; -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface'; -import { ToolModel } from '../models/tool.model'; -import { SchemaModel } from '../models/schema.model'; -import { ICompareResult } from '../interfaces/compare-result.interface'; -import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface'; -import { FileModel } from '../models/file.model'; -import { ReportTable } from '../../table/report-table'; -import { ComparePolicyUtils } from '../utils/compare-policy-utils'; -import { BlocksRate } from '../rates/blocks-rate'; -import { IRate } from '../interfaces/rate.interface'; -import { CompareUtils } from '../utils/utils'; -import { CSV } from '../../table/csv'; -import { IReportTable } from '../interfaces/report-table.interface'; -import { MultiCompareUtils } from '../utils/multi-compare-utils'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IPropertiesLvl, IRefLvl } from '../interfaces/compare-options.interface.js'; +import { ToolModel } from '../models/tool.model.js'; +import { SchemaModel } from '../models/schema.model.js'; +import { ICompareResult } from '../interfaces/compare-result.interface.js'; +import { IMultiCompareResult } from '../interfaces/multi-compare-result.interface.js'; +import { FileModel } from '../models/file.model.js'; +import { ReportTable } from '../../table/report-table.js'; +import { ComparePolicyUtils } from '../utils/compare-policy-utils.js'; +import { BlocksRate } from '../rates/blocks-rate.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { CompareUtils } from '../utils/utils.js'; +import { CSV } from '../../table/csv.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; +import { MultiCompareUtils } from '../utils/multi-compare-utils.js'; /** * Component for comparing tools @@ -540,4 +540,4 @@ export class ToolComparator { return toolModel; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/index.ts b/guardian-service/src/analytics/compare/index.ts index 158c2b9e97..426af94354 100644 --- a/guardian-service/src/analytics/compare/index.ts +++ b/guardian-service/src/analytics/compare/index.ts @@ -1,24 +1,24 @@ -export { PolicyComparator } from './comparators/policy-comparator'; -export { SchemaComparator } from './comparators/schema-comparator'; -export { IArtifacts } from './interfaces/artifacts.interface'; -export { CompareOptions as ICompareOptions } from './interfaces/compare-options.interface'; -export { ICompareResult } from './interfaces/compare-result.interface'; -export { IKeyMap } from './interfaces/key-map.interface'; -export { IModel } from './interfaces/model.interface'; -export { IProperties } from './interfaces/properties.interface'; -export { IRateMap } from './interfaces/rate-map.interface'; -export { IRate } from './interfaces/rate.interface'; -export { IReportTable } from './interfaces/report-table.interface'; -export { IWeightModel } from './interfaces/weight-model.interface'; -export { ArtifactModel } from './models/artifact.model'; -export { BlockPropertiesModel } from './models/block-properties.model'; -export { BlockModel } from './models/block.model'; -export { ConditionModel } from './models/condition.model'; -export { EventModel } from './models/event.model'; -export { FieldModel } from './models/field.model'; -export { GroupModel } from './models/group.model'; -export { PolicyModel } from './models/policy.model'; -export { PropertiesModel } from './models/properties.model'; +export { PolicyComparator } from './comparators/policy-comparator.js'; +export { SchemaComparator } from './comparators/schema-comparator.js'; +export { IArtifacts } from './interfaces/artifacts.interface.js'; +export { CompareOptions as ICompareOptions } from './interfaces/compare-options.interface.js'; +export { ICompareResult } from './interfaces/compare-result.interface.js'; +export { IKeyMap } from './interfaces/key-map.interface.js'; +export { IModel } from './interfaces/model.interface.js'; +export { IProperties } from './interfaces/properties.interface.js'; +export { IRateMap } from './interfaces/rate-map.interface.js'; +export { IRate } from './interfaces/rate.interface.js'; +export { IReportTable } from './interfaces/report-table.interface.js'; +export { IWeightModel } from './interfaces/weight-model.interface.js'; +export { ArtifactModel } from './models/artifact.model.js'; +export { BlockPropertiesModel } from './models/block-properties.model.js'; +export { BlockModel } from './models/block.model.js'; +export { ConditionModel } from './models/condition.model.js'; +export { EventModel } from './models/event.model.js'; +export { FieldModel } from './models/field.model.js'; +export { GroupModel } from './models/group.model.js'; +export { PolicyModel } from './models/policy.model.js'; +export { PropertiesModel } from './models/properties.model.js'; export { PropertyModel, AnyPropertyModel, @@ -27,36 +27,36 @@ export { SchemaPropertyModel, TokenPropertyModel, UUIDPropertyModel -} from './models/property.model'; -export { RoleModel } from './models/role.model'; -export { SchemaModel } from './models/schema.model'; -export { SchemaDocumentModel as SubSchemaModel } from './models/schema-document.model'; -export { TemplateTokenModel } from './models/template-token.model'; -export { TokenModel } from './models/token.model'; -export { TopicModel } from './models/topic.model'; -export { ArtifactsRate } from './rates/artifacts-rate'; -export { BlocksRate } from './rates/blocks-rate'; -export { EventsRate } from './rates/events-rate'; -export { FieldsRate } from './rates/fields-rate'; -export { ObjectRate } from './rates/object-rate'; -export { PermissionsRate } from './rates/permissions-rate'; -export { PropertiesRate } from './rates/properties-rate'; -export { Rate } from './rates/rate'; -export { PropertyType } from './types/property.type'; -export { Status } from './types/status.type'; -export { WeightType } from './types/weight.type'; -export { MergeUtils } from './utils/merge-utils'; -export { CompareUtils } from './utils/utils'; -export { ModuleModel } from './models/module.model'; -export { ModuleComparator } from './comparators/module-comparator'; -export { HashComparator } from './comparators/hash-comparator'; -export { FileModel } from './models/file.model'; -export { DocumentComparator } from './comparators/document-comparator'; -export { RecordComparator } from './comparators/record-comparator'; -export { ToolComparator } from './comparators/tool-comparator'; -export { ToolModel } from './models/tool.model'; -export { DocumentModel } from './models/document.model'; -export { RateMap, RateKeyMap } from './utils/rate-map'; +} from './models/property.model.js'; +export { RoleModel } from './models/role.model.js'; +export { SchemaModel } from './models/schema.model.js'; +export { SchemaDocumentModel as SubSchemaModel } from './models/schema-document.model.js'; +export { TemplateTokenModel } from './models/template-token.model.js'; +export { TokenModel } from './models/token.model.js'; +export { TopicModel } from './models/topic.model.js'; +export { ArtifactsRate } from './rates/artifacts-rate.js'; +export { BlocksRate } from './rates/blocks-rate.js'; +export { EventsRate } from './rates/events-rate.js'; +export { FieldsRate } from './rates/fields-rate.js'; +export { ObjectRate } from './rates/object-rate.js'; +export { PermissionsRate } from './rates/permissions-rate.js'; +export { PropertiesRate } from './rates/properties-rate.js'; +export { Rate } from './rates/rate.js'; +export { PropertyType } from './types/property.type.js'; +export { Status } from './types/status.type.js'; +export { WeightType } from './types/weight.type.js'; +export { MergeUtils } from './utils/merge-utils.js'; +export { CompareUtils } from './utils/utils.js'; +export { ModuleModel } from './models/module.model.js'; +export { ModuleComparator } from './comparators/module-comparator.js'; +export { HashComparator } from './comparators/hash-comparator.js'; +export { FileModel } from './models/file.model.js'; +export { DocumentComparator } from './comparators/document-comparator.js'; +export { RecordComparator } from './comparators/record-comparator.js'; +export { ToolComparator } from './comparators/tool-comparator.js'; +export { ToolModel } from './models/tool.model.js'; +export { DocumentModel } from './models/document.model.js'; +export { RateMap, RateKeyMap } from './utils/rate-map.js'; export { CompareOptions, IChildrenLvl, @@ -65,4 +65,4 @@ export { IKeyLvl, IPropertiesLvl, IRefLvl -} from './interfaces/compare-options.interface'; +} from './interfaces/compare-options.interface.js'; diff --git a/guardian-service/src/analytics/compare/interfaces/compare-result.interface.ts b/guardian-service/src/analytics/compare/interfaces/compare-result.interface.ts index e540e0ca1a..fa7a5e7b53 100644 --- a/guardian-service/src/analytics/compare/interfaces/compare-result.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/compare-result.interface.ts @@ -1,4 +1,4 @@ -import { IReportTable } from './report-table.interface'; +import { IReportTable } from './report-table.interface.js'; /** * Compare Result @@ -56,4 +56,4 @@ export interface ICompareResult { * Documents rates (Document) */ documents?: IReportTable; -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/interfaces/multi-compare-result.interface.ts b/guardian-service/src/analytics/compare/interfaces/multi-compare-result.interface.ts index cd4793f1ff..d7f409a5a0 100644 --- a/guardian-service/src/analytics/compare/interfaces/multi-compare-result.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/multi-compare-result.interface.ts @@ -1,4 +1,4 @@ -import { IReportTable } from './report-table.interface'; +import { IReportTable } from './report-table.interface.js'; /** * Multi Compare Result diff --git a/guardian-service/src/analytics/compare/interfaces/properties.interface.ts b/guardian-service/src/analytics/compare/interfaces/properties.interface.ts index dc251a3637..184dc0d101 100644 --- a/guardian-service/src/analytics/compare/interfaces/properties.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/properties.interface.ts @@ -1,4 +1,4 @@ -import { PropertyType } from '../types/property.type'; +import { PropertyType } from '../types/property.type.js'; /** * Properties model interface diff --git a/guardian-service/src/analytics/compare/interfaces/rate.interface.ts b/guardian-service/src/analytics/compare/interfaces/rate.interface.ts index c4b929fa87..cd637fdb3a 100644 --- a/guardian-service/src/analytics/compare/interfaces/rate.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/rate.interface.ts @@ -1,5 +1,5 @@ -import { Status } from '../types/status.type'; -import { CompareOptions } from './compare-options.interface'; +import { Status } from '../types/status.type.js'; +import { CompareOptions } from './compare-options.interface.js'; /** * Rate Model interface diff --git a/guardian-service/src/analytics/compare/interfaces/report-table.interface.ts b/guardian-service/src/analytics/compare/interfaces/report-table.interface.ts index 207d77ec26..0c15ce523a 100644 --- a/guardian-service/src/analytics/compare/interfaces/report-table.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/report-table.interface.ts @@ -1,4 +1,4 @@ -import { IColumn } from 'analytics/table/report-column'; +import { IColumn } from 'analytics/table/report-column.js'; /** * Report Table @@ -12,4 +12,4 @@ export interface IReportTable { * Rows */ report: any[]; -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/interfaces/weight-model.interface.ts b/guardian-service/src/analytics/compare/interfaces/weight-model.interface.ts index b651ac47da..d6487b9fa0 100644 --- a/guardian-service/src/analytics/compare/interfaces/weight-model.interface.ts +++ b/guardian-service/src/analytics/compare/interfaces/weight-model.interface.ts @@ -1,5 +1,5 @@ -import { CompareOptions } from './compare-options.interface'; -import { IModel } from './model.interface'; +import { CompareOptions } from './compare-options.interface.js'; +import { IModel } from './model.interface.js'; /** * Weight Model interface @@ -57,4 +57,4 @@ export interface IWeightModel extends IModel { */ export interface IWeightTreeModel extends IWeightModel { children: IWeightTreeModel[]; -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/artifact.model.ts b/guardian-service/src/analytics/compare/models/artifact.model.ts index 2a041477c4..f8285aec3d 100644 --- a/guardian-service/src/analytics/compare/models/artifact.model.ts +++ b/guardian-service/src/analytics/compare/models/artifact.model.ts @@ -1,6 +1,6 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions, IEventsLvl } from '../interfaces/compare-options.interface'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { CompareOptions, IEventsLvl } from '../interfaces/compare-options.interface.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Artifact Model @@ -115,4 +115,4 @@ export class ArtifactModel { weight: this._hash } } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/block-properties.model.ts b/guardian-service/src/analytics/compare/models/block-properties.model.ts index a3d35b4c1f..4f594a994f 100644 --- a/guardian-service/src/analytics/compare/models/block-properties.model.ts +++ b/guardian-service/src/analytics/compare/models/block-properties.model.ts @@ -1,4 +1,4 @@ -import { PropertiesModel } from './properties.model'; +import { PropertiesModel } from './properties.model.js'; /** * Block Properties Model diff --git a/guardian-service/src/analytics/compare/models/block-tool.model.ts b/guardian-service/src/analytics/compare/models/block-tool.model.ts index 04597a2909..1613c3322e 100644 --- a/guardian-service/src/analytics/compare/models/block-tool.model.ts +++ b/guardian-service/src/analytics/compare/models/block-tool.model.ts @@ -1,4 +1,4 @@ -import { BlockModel } from './block.model'; +import { BlockModel } from './block.model.js'; /** * Block Tool Model @@ -45,4 +45,4 @@ export class BlockToolModel extends BlockModel { public override get key(): string { return this._key; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/block.model.ts b/guardian-service/src/analytics/compare/models/block.model.ts index 2659069468..59788ca4df 100644 --- a/guardian-service/src/analytics/compare/models/block.model.ts +++ b/guardian-service/src/analytics/compare/models/block.model.ts @@ -1,18 +1,18 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions, IChildrenLvl, IPropertiesLvl } from '../interfaces/compare-options.interface'; -import { EventModel } from './event.model'; -import { BlockPropertiesModel } from './block-properties.model'; -import { WeightType } from '../types/weight.type'; -import { ArtifactModel } from './artifact.model'; -import { IArtifacts } from '../interfaces/artifacts.interface'; -import { SchemaModel } from './schema.model'; -import { PropertyModel } from './property.model'; -import { PropertyType } from '../types/property.type'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { TokenModel } from './token.model'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { CompareUtils } from '../utils/utils'; -import { IWeightBlock } from '../interfaces/weight-block.interface'; +import { CompareOptions, IChildrenLvl, IPropertiesLvl } from '../interfaces/compare-options.interface.js'; +import { EventModel } from './event.model.js'; +import { BlockPropertiesModel } from './block-properties.model.js'; +import { WeightType } from '../types/weight.type.js'; +import { ArtifactModel } from './artifact.model.js'; +import { IArtifacts } from '../interfaces/artifacts.interface.js'; +import { SchemaModel } from './schema.model.js'; +import { PropertyModel } from './property.model.js'; +import { PropertyType } from '../types/property.type.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { TokenModel } from './token.model.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IWeightBlock } from '../interfaces/weight-block.interface.js'; /** * Block Model diff --git a/guardian-service/src/analytics/compare/models/condition.model.ts b/guardian-service/src/analytics/compare/models/condition.model.ts index a6a30bf30e..adb5f87149 100644 --- a/guardian-service/src/analytics/compare/models/condition.model.ts +++ b/guardian-service/src/analytics/compare/models/condition.model.ts @@ -1,15 +1,9 @@ -import { FieldModel } from './field.model'; +import { FieldModel } from './field.model.js'; /** * Condition Model */ export class ConditionModel { - /** - * Condition index - * @public - */ - public readonly index: number; - /** * Field name * @public @@ -50,10 +44,8 @@ export class ConditionModel { field: FieldModel, fieldValue: any, thenFields: FieldModel[], - elseFields: FieldModel[], - index: number + elseFields: FieldModel[] ) { - this.index = index; this.field = field; this.fieldValue = fieldValue; this.thenFields = thenFields; diff --git a/guardian-service/src/analytics/compare/models/document-fields.model.ts b/guardian-service/src/analytics/compare/models/document-fields.model.ts index 14a381d166..24bb42d386 100644 --- a/guardian-service/src/analytics/compare/models/document-fields.model.ts +++ b/guardian-service/src/analytics/compare/models/document-fields.model.ts @@ -1,6 +1,6 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { ArrayPropertyModel, DocumentPropertyModel, ObjectPropertyModel, PropertyModel } from './property.model'; -import { SchemaModel } from './schema.model'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { ArrayPropertyModel, DocumentPropertyModel, ObjectPropertyModel, PropertyModel } from './property.model.js'; +import { SchemaModel } from './schema.model.js'; /** * Document fields model diff --git a/guardian-service/src/analytics/compare/models/document.model.ts b/guardian-service/src/analytics/compare/models/document.model.ts index 7044152185..ba68698991 100644 --- a/guardian-service/src/analytics/compare/models/document.model.ts +++ b/guardian-service/src/analytics/compare/models/document.model.ts @@ -1,14 +1,14 @@ import { VcDocument, VpDocument } from '@guardian/common'; -import { CompareOptions, IChildrenLvl } from '../interfaces/compare-options.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { WeightType } from '../types/weight.type'; -import { CompareUtils } from '../utils/utils'; -import { SchemaModel } from './schema.model'; -import { DocumentFieldsModel } from './document-fields.model'; -import { PropertyModel } from './property.model'; -import { HashUtils } from '../utils/hash-utils'; -import { PropertiesModel } from './properties.model'; +import { CompareOptions, IChildrenLvl } from '../interfaces/compare-options.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { WeightType } from '../types/weight.type.js'; +import { CompareUtils } from '../utils/utils.js'; +import { SchemaModel } from './schema.model.js'; +import { DocumentFieldsModel } from './document-fields.model.js'; +import { PropertyModel } from './property.model.js'; +import { HashUtils } from '../utils/hash-utils.js'; +import { PropertiesModel } from './properties.model.js'; /** * Document Type diff --git a/guardian-service/src/analytics/compare/models/event.model.ts b/guardian-service/src/analytics/compare/models/event.model.ts index b17eb35766..8d097a5dbd 100644 --- a/guardian-service/src/analytics/compare/models/event.model.ts +++ b/guardian-service/src/analytics/compare/models/event.model.ts @@ -1,8 +1,8 @@ import MurmurHash3 from 'imurmurhash'; -import { BlockModel } from './block.model'; -import { CompareOptions, IEventsLvl } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { BlockModel } from './block.model.js'; +import { CompareOptions, IEventsLvl } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Event Model diff --git a/guardian-service/src/analytics/compare/models/field.model.ts b/guardian-service/src/analytics/compare/models/field.model.ts index 5fb05fb394..a74746431d 100644 --- a/guardian-service/src/analytics/compare/models/field.model.ts +++ b/guardian-service/src/analytics/compare/models/field.model.ts @@ -1,11 +1,11 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions, IIdLvl, IPropertiesLvl } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { AnyPropertyModel, ArrayPropertyModel, PropertyModel, UUIDPropertyModel } from './property.model'; -import { SchemaDocumentModel } from './schema-document.model'; +import { CompareOptions, IIdLvl, IPropertiesLvl } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { AnyPropertyModel, ArrayPropertyModel, PropertyModel, UUIDPropertyModel } from './property.model.js'; +import { SchemaDocumentModel } from './schema-document.model.js'; /** * Field Model @@ -180,8 +180,7 @@ export class FieldModel implements IWeightModel { constructor( name: string, prop: any, - required: boolean, - index: number + required: boolean ) { let _property = prop; if (_property.oneOf && _property.oneOf.length) { diff --git a/guardian-service/src/analytics/compare/models/file.model.ts b/guardian-service/src/analytics/compare/models/file.model.ts index aa409222f4..d85b3046d5 100644 --- a/guardian-service/src/analytics/compare/models/file.model.ts +++ b/guardian-service/src/analytics/compare/models/file.model.ts @@ -1,5 +1,5 @@ import { Artifact } from '@guardian/common'; -import { CompareOptions } from '../interfaces/compare-options.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; import MurmurHash3 from 'imurmurhash'; import * as crypto from 'crypto'; diff --git a/guardian-service/src/analytics/compare/models/group.model.ts b/guardian-service/src/analytics/compare/models/group.model.ts index 9a08ec480e..53c8dc8644 100644 --- a/guardian-service/src/analytics/compare/models/group.model.ts +++ b/guardian-service/src/analytics/compare/models/group.model.ts @@ -1,12 +1,12 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { PropertiesModel } from './properties.model'; -import { PropertyModel } from './property.model'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { PropertiesModel } from './properties.model.js'; +import { PropertyModel } from './property.model.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Group Model diff --git a/guardian-service/src/analytics/compare/models/module.model.ts b/guardian-service/src/analytics/compare/models/module.model.ts index f0675886a8..d8e668c683 100644 --- a/guardian-service/src/analytics/compare/models/module.model.ts +++ b/guardian-service/src/analytics/compare/models/module.model.ts @@ -1,11 +1,11 @@ import { PolicyModule } from '@guardian/common'; -import { BlockModel } from './block.model'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { PropertyModel } from './property.model'; -import { PropertyType } from '../types/property.type'; -import { VariableModel } from './variable.model'; -import { CompareUtils } from '../utils/utils'; +import { BlockModel } from './block.model.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { PropertyModel } from './property.model.js'; +import { PropertyType } from '../types/property.type.js'; +import { VariableModel } from './variable.model.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Policy Model diff --git a/guardian-service/src/analytics/compare/models/policy.model.ts b/guardian-service/src/analytics/compare/models/policy.model.ts index 7e70b1be51..3b2d7e050e 100644 --- a/guardian-service/src/analytics/compare/models/policy.model.ts +++ b/guardian-service/src/analytics/compare/models/policy.model.ts @@ -1,17 +1,17 @@ import { Policy } from '@guardian/common'; -import { BlockModel } from './block.model'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { SchemaModel } from './schema.model'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { PropertyModel } from './property.model'; -import { PropertyType } from '../types/property.type'; -import { TokenModel } from './token.model'; -import { GroupModel } from './group.model'; -import { TopicModel } from './topic.model'; -import { TemplateTokenModel } from './template-token.model'; -import { RoleModel } from './role.model'; -import { FileModel } from './file.model'; -import { CompareUtils } from '../utils/utils'; +import { BlockModel } from './block.model.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { SchemaModel } from './schema.model.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { PropertyModel } from './property.model.js'; +import { PropertyType } from '../types/property.type.js'; +import { TokenModel } from './token.model.js'; +import { GroupModel } from './group.model.js'; +import { TopicModel } from './topic.model.js'; +import { TemplateTokenModel } from './template-token.model.js'; +import { RoleModel } from './role.model.js'; +import { FileModel } from './file.model.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Policy Model diff --git a/guardian-service/src/analytics/compare/models/properties.model.ts b/guardian-service/src/analytics/compare/models/properties.model.ts index f6e99f3948..8723d6f7ee 100644 --- a/guardian-service/src/analytics/compare/models/properties.model.ts +++ b/guardian-service/src/analytics/compare/models/properties.model.ts @@ -1,9 +1,9 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { AnyPropertyModel, ArrayPropertyModel, ObjectPropertyModel, PropertyModel, SchemaPropertyModel, TokenPropertyModel } from './property.model'; -import { PropertyType } from '../types/property.type'; -import { SchemaModel } from './schema.model'; -import { TokenModel } from './token.model'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { AnyPropertyModel, ArrayPropertyModel, ObjectPropertyModel, PropertyModel, SchemaPropertyModel, TokenPropertyModel } from './property.model.js'; +import { PropertyType } from '../types/property.type.js'; +import { SchemaModel } from './schema.model.js'; +import { TokenModel } from './token.model.js'; /** * Properties Model diff --git a/guardian-service/src/analytics/compare/models/property.model.ts b/guardian-service/src/analytics/compare/models/property.model.ts index 413146e2cb..6b84b24068 100644 --- a/guardian-service/src/analytics/compare/models/property.model.ts +++ b/guardian-service/src/analytics/compare/models/property.model.ts @@ -1,8 +1,8 @@ -import { CompareOptions, IIdLvl, IKeyLvl, IPropertiesLvl } from '../interfaces/compare-options.interface'; -import { IProperties } from '../interfaces/properties.interface'; -import { PropertyType } from '../types/property.type'; -import { SchemaModel } from './schema.model'; -import { TokenModel } from './token.model'; +import { CompareOptions, IIdLvl, IKeyLvl, IPropertiesLvl } from '../interfaces/compare-options.interface.js'; +import { IProperties } from '../interfaces/properties.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { SchemaModel } from './schema.model.js'; +import { TokenModel } from './token.model.js'; /** * Property Model @@ -533,4 +533,4 @@ export class DocumentPropertyModel extends PropertyModel { public override ignore(options: CompareOptions): boolean { return this.isSystem && options.idLvl === IIdLvl.None; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/record.model.ts b/guardian-service/src/analytics/compare/models/record.model.ts index 600a259a19..29d4fad73c 100644 --- a/guardian-service/src/analytics/compare/models/record.model.ts +++ b/guardian-service/src/analytics/compare/models/record.model.ts @@ -1,9 +1,9 @@ import { IRecordResult } from '@guardian/common'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { WeightType } from '../types/weight.type'; -import { DocumentModel } from './document.model'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { WeightType } from '../types/weight.type.js'; +import { DocumentModel } from './document.model.js'; /** * Document Model @@ -265,4 +265,4 @@ export class RecordModel implements IWeightModel { tokens: this._tokens, } } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/role.model.ts b/guardian-service/src/analytics/compare/models/role.model.ts index 2bc271a432..0c5db3ef98 100644 --- a/guardian-service/src/analytics/compare/models/role.model.ts +++ b/guardian-service/src/analytics/compare/models/role.model.ts @@ -1,11 +1,11 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { AnyPropertyModel, PropertyModel } from './property.model'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { AnyPropertyModel, PropertyModel } from './property.model.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Role Model diff --git a/guardian-service/src/analytics/compare/models/schema-document.model.ts b/guardian-service/src/analytics/compare/models/schema-document.model.ts index 16a83ea9ac..1373d2bd36 100644 --- a/guardian-service/src/analytics/compare/models/schema-document.model.ts +++ b/guardian-service/src/analytics/compare/models/schema-document.model.ts @@ -1,8 +1,9 @@ -import { FieldModel } from './field.model'; -import { ConditionModel } from './condition.model'; -import { CompareOptions } from '../interfaces/compare-options.interface'; +import { FieldModel } from './field.model.js'; +import { ConditionModel } from './condition.model.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; import MurmurHash3 from 'imurmurhash'; -import { ComparePolicyUtils } from '../utils/compare-policy-utils'; +import { ComparePolicyUtils } from '../utils/compare-policy-utils.js'; +import { ISchemaDocument } from '@guardian/interfaces'; /** * Schema Model @@ -26,47 +27,46 @@ export class SchemaDocumentModel { */ private _weight: string; - constructor(document: any, index: number, defs?: any) { + constructor( + document: ISchemaDocument, + defs: { [x: string]: ISchemaDocument }, + cache: Map + ) { this._weight = ''; - this.fields = this.parseFields(document, index + 1, defs); - this.conditions = this.parseConditions(document, index + 1, this.fields, defs); + this.fields = this.parseFields(document, defs, cache); + this.conditions = this.parseConditions(document, this.fields, defs, cache); this.fields = this.updateConditions(); } /** * Parse fields * @param document - * @param contextURL * @param defs + * @param cache * @private */ - private parseFields(document: any, index: number, defs?: any): FieldModel[] { - const fields: FieldModel[] = []; - - if (!document || !document.properties) { - return fields; - } - - const required = {}; - if (document.required) { - for (const element of document.required) { - required[element] = true; - } + private parseFields( + document: ISchemaDocument, + defs: { [x: string]: ISchemaDocument }, + cache: Map = new Map() + ): FieldModel[] { + if (!document?.properties) { + return []; } - const properties = Object.keys(document.properties); - for (const name of properties) { - if (name === '@context' || name === 'type') { - continue; - } - - const property = document.properties[name]; - - const field = new FieldModel(name, property, !!required[name], index); + const required = new Set(document.required || []); + const subSchemas = defs || document.$defs || {}; + const fields: FieldModel[] = []; + const properties = Object.entries(document.properties).filter(([name]) => name !== '@context' && name !== 'type'); + for (const [name, property] of properties) { + const field = new FieldModel(name, property, required.has(name)); if (field.isRef) { - const subSchemas = defs || document.$defs; - const subDocument = subSchemas[field.type]; - const subSchema = new SchemaDocumentModel(subDocument, index + 1, subSchemas); + let subSchema = cache.get(field.type); + if (!subSchema) { + const subDocument = subSchemas[field.type]; + subSchema = new SchemaDocumentModel(subDocument, subSchemas, cache); + cache.set(field.type, subSchema); + } field.setSubSchema(subSchema); } fields.push(field); @@ -78,38 +78,47 @@ export class SchemaDocumentModel { /** * Parse conditions * @param document - * @param index * @param fields * @param defs + * @param cache * @private */ private parseConditions( - document: any, - index: number, + document: ISchemaDocument, fields: FieldModel[], - defs: any = null + defs: { [x: string]: ISchemaDocument }, + cache?: Map ): ConditionModel[] { - const conditions: ConditionModel[] = []; if (!document || !document.allOf) { - return conditions; + return []; } - const allOf = Object.keys(document.allOf); - for (const oneOf of allOf) { - const condition = document.allOf[oneOf]; + + const conditions: ConditionModel[] = []; + const fieldsMap = new Map(fields.map(field => [field.name, field])); + const combinedDefs = document.$defs || defs; + + for (const condition of document.allOf) { if (!condition.if) { continue; } const ifConditionFieldName = Object.keys(condition.if.properties)[0]; + const field = fieldsMap.get(ifConditionFieldName); + if (!field) { + continue; + } + const ifFieldValue = condition.if.properties[ifConditionFieldName].const; + const thenFields = this.parseFields(condition.then, combinedDefs, cache); + const elseFields = this.parseFields(condition.else, combinedDefs, cache); conditions.push(new ConditionModel( - fields.find(field => field.name === ifConditionFieldName), - condition.if.properties[ifConditionFieldName].const, - this.parseFields(condition.then, index, document.$defs || defs), - this.parseFields(condition.else, index, document.$defs || defs), - index + field, + ifFieldValue, + thenFields, + elseFields )); } return conditions; } + /** * Update conditions * @private @@ -206,4 +215,14 @@ export class SchemaDocumentModel { return Math.floor(total / rates.length); } -} + + /** + * Create model + * @param document + * @public + */ + public static from(document: ISchemaDocument): SchemaDocumentModel { + const cache = new Map(); + return new SchemaDocumentModel(document, document?.$defs, cache); + } +} \ No newline at end of file diff --git a/guardian-service/src/analytics/compare/models/schema.model.ts b/guardian-service/src/analytics/compare/models/schema.model.ts index da0092ded1..98a643cf90 100644 --- a/guardian-service/src/analytics/compare/models/schema.model.ts +++ b/guardian-service/src/analytics/compare/models/schema.model.ts @@ -1,8 +1,8 @@ -import { CompareOptions, IIdLvl } from '../interfaces/compare-options.interface'; -import { FieldModel } from './field.model'; -import { SchemaDocumentModel } from './schema-document.model'; +import { CompareOptions, IIdLvl } from '../interfaces/compare-options.interface.js'; +import { FieldModel } from './field.model.js'; +import { SchemaDocumentModel } from './schema-document.model.js'; import { Policy, PolicyTool, Schema as SchemaCollection } from '@guardian/common'; -import { HashUtils } from '../utils/hash-utils'; +import { HashUtils } from '../utils/hash-utils.js'; /** * Schema Model @@ -101,38 +101,44 @@ export class SchemaModel { * Compare Map * @private */ - private readonly _compareMap: Map; + private readonly _compareMap: Map = new Map(); constructor( schema: SchemaCollection, options: CompareOptions ) { this.options = options; - this.id = ''; - this.name = ''; - this.uuid = ''; - this.description = ''; - this.topicId = ''; - this.version = ''; - this.iri = ''; - this._weight = ''; - this._weightDocument = ''; - this._compareMap = new Map(); - if (schema) { - this.id = schema.id; - this.name = schema.name; - this.uuid = schema.uuid - this.description = schema.description; - this.topicId = schema.topicId; - this.version = schema.version || schema.sourceVersion; - this.iri = schema.iri; - if (schema.document) { - const document = (typeof schema.document === 'string') ? - JSON.parse(schema.document) : - schema.document; - this.document = new SchemaDocumentModel(document, 0, document?.$defs); - this.document.update(this.options); - } + + this._weight = this._weightDocument = ''; + + if (!schema) { + this.id = this.name = this.uuid = this.description = this.topicId = this.version = this.iri = ''; + return; + } + + const { + id = '', + name = '', + uuid = '', + description = '', + topicId = '', + version = '', + sourceVersion = '', + iri = '', + document = null + } = schema; + + this.id = id; + this.name = name; + this.uuid = uuid; + this.description = description; + this.topicId = topicId; + this.version = version || sourceVersion; + this.iri = iri; + if (document) { + const parsedDocument = typeof document === 'string' ? JSON.parse(document) : document; + this.document = SchemaDocumentModel.from(parsedDocument); + this.document.update(this.options); } } @@ -280,4 +286,4 @@ export class SchemaModel { iri: this.iri }; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/models/template-token.model.ts b/guardian-service/src/analytics/compare/models/template-token.model.ts index b6b04e08fc..36c5488a4b 100644 --- a/guardian-service/src/analytics/compare/models/template-token.model.ts +++ b/guardian-service/src/analytics/compare/models/template-token.model.ts @@ -1,12 +1,12 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { PropertiesModel } from './properties.model'; -import { PropertyModel } from './property.model'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { PropertiesModel } from './properties.model.js'; +import { PropertyModel } from './property.model.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Template Token Model diff --git a/guardian-service/src/analytics/compare/models/token.model.ts b/guardian-service/src/analytics/compare/models/token.model.ts index 1a1881fed4..a4822e62d5 100644 --- a/guardian-service/src/analytics/compare/models/token.model.ts +++ b/guardian-service/src/analytics/compare/models/token.model.ts @@ -1,7 +1,7 @@ import { Token } from '@guardian/common'; -import { CompareOptions, IIdLvl } from '../interfaces/compare-options.interface'; +import { CompareOptions, IIdLvl } from '../interfaces/compare-options.interface.js'; import MurmurHash3 from 'imurmurhash'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Token Model diff --git a/guardian-service/src/analytics/compare/models/tool.model.ts b/guardian-service/src/analytics/compare/models/tool.model.ts index 5b59a6b3d6..d9404d064b 100644 --- a/guardian-service/src/analytics/compare/models/tool.model.ts +++ b/guardian-service/src/analytics/compare/models/tool.model.ts @@ -1,11 +1,11 @@ import { PolicyTool } from '@guardian/common'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { BlockModel } from './block.model'; -import { VariableModel } from './variable.model'; -import { CompareUtils } from '../utils/utils'; -import { SchemaModel } from './schema.model'; -import { FileModel } from './file.model'; -import { IKeyMap } from '../interfaces/key-map.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { BlockModel } from './block.model.js'; +import { VariableModel } from './variable.model.js'; +import { CompareUtils } from '../utils/utils.js'; +import { SchemaModel } from './schema.model.js'; +import { FileModel } from './file.model.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; /** * Tool Model diff --git a/guardian-service/src/analytics/compare/models/topic.model.ts b/guardian-service/src/analytics/compare/models/topic.model.ts index cf91623301..b65c195beb 100644 --- a/guardian-service/src/analytics/compare/models/topic.model.ts +++ b/guardian-service/src/analytics/compare/models/topic.model.ts @@ -1,12 +1,12 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { PropertiesModel } from './properties.model'; -import { PropertyModel } from './property.model'; -import { IWeightItem } from '../interfaces/weight-item.interface'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { PropertiesModel } from './properties.model.js'; +import { PropertyModel } from './property.model.js'; +import { IWeightItem } from '../interfaces/weight-item.interface.js'; /** * Topic Model diff --git a/guardian-service/src/analytics/compare/models/variable.model.ts b/guardian-service/src/analytics/compare/models/variable.model.ts index aa470b3cde..9b2acbb704 100644 --- a/guardian-service/src/analytics/compare/models/variable.model.ts +++ b/guardian-service/src/analytics/compare/models/variable.model.ts @@ -1,11 +1,11 @@ import MurmurHash3 from 'imurmurhash'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IKeyMap } from '../interfaces/key-map.interface'; -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { PropertyType } from '../types/property.type'; -import { WeightType } from '../types/weight.type'; -import { PropertiesModel } from './properties.model'; -import { PropertyModel } from './property.model'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IKeyMap } from '../interfaces/key-map.interface.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { PropertyType } from '../types/property.type.js'; +import { WeightType } from '../types/weight.type.js'; +import { PropertiesModel } from './properties.model.js'; +import { PropertyModel } from './property.model.js'; /** * Variable Model diff --git a/guardian-service/src/analytics/compare/rates/artifacts-rate.ts b/guardian-service/src/analytics/compare/rates/artifacts-rate.ts index 0a5e86c17b..b39c942aa5 100644 --- a/guardian-service/src/analytics/compare/rates/artifacts-rate.ts +++ b/guardian-service/src/analytics/compare/rates/artifacts-rate.ts @@ -1,6 +1,6 @@ -import { Status } from '../types/status.type'; -import { ArtifactModel } from '../models/artifact.model'; -import { Rate } from './rate'; +import { Status } from '../types/status.type.js'; +import { ArtifactModel } from '../models/artifact.model.js'; +import { Rate } from './rate.js'; /** * Calculates the difference between two Artifacts diff --git a/guardian-service/src/analytics/compare/rates/blocks-rate.ts b/guardian-service/src/analytics/compare/rates/blocks-rate.ts index bba1a90333..1656d4ed28 100644 --- a/guardian-service/src/analytics/compare/rates/blocks-rate.ts +++ b/guardian-service/src/analytics/compare/rates/blocks-rate.ts @@ -1,17 +1,17 @@ -import { BlockModel } from '../models/block.model'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { Status } from '../types/status.type'; -import { EventModel } from '../models/event.model'; -import { PropertiesRate } from './properties-rate'; -import { EventsRate } from './events-rate'; -import { PermissionsRate } from './permissions-rate'; -import { ArtifactsRate } from './artifacts-rate'; -import { IRate } from '../interfaces/rate.interface'; -import { ArtifactModel } from '../models/artifact.model'; -import { Rate } from './rate'; -import { AnyPropertyModel, PropertyModel } from '../models/property.model'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { CompareUtils } from '../utils/utils'; +import { BlockModel } from '../models/block.model.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { Status } from '../types/status.type.js'; +import { EventModel } from '../models/event.model.js'; +import { PropertiesRate } from './properties-rate.js'; +import { EventsRate } from './events-rate.js'; +import { PermissionsRate } from './permissions-rate.js'; +import { ArtifactsRate } from './artifacts-rate.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { ArtifactModel } from '../models/artifact.model.js'; +import { Rate } from './rate.js'; +import { AnyPropertyModel, PropertyModel } from '../models/property.model.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Calculates the difference between two Blocks @@ -326,4 +326,4 @@ export class BlocksRate extends Rate { } return this.totalRate; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/rates/documents-rate.ts b/guardian-service/src/analytics/compare/rates/documents-rate.ts index 5598e83fb8..b517bc0464 100644 --- a/guardian-service/src/analytics/compare/rates/documents-rate.ts +++ b/guardian-service/src/analytics/compare/rates/documents-rate.ts @@ -1,12 +1,12 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { Rate } from './rate'; -import { DocumentModel } from '../models/document.model'; -import { CompareUtils } from '../utils/utils'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { Status } from '../types/status.type'; -import { PropertyModel } from '../models/property.model'; -import { PropertiesRate } from './properties-rate'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { Rate } from './rate.js'; +import { DocumentModel } from '../models/document.model.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { Status } from '../types/status.type.js'; +import { PropertyModel } from '../models/property.model.js'; +import { PropertiesRate } from './properties-rate.js'; /** * Calculates the difference between two Documents @@ -239,4 +239,4 @@ export class DocumentsRate extends Rate { } return this.totalRate; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/rates/events-rate.ts b/guardian-service/src/analytics/compare/rates/events-rate.ts index aaa77974fe..8945a07e9e 100644 --- a/guardian-service/src/analytics/compare/rates/events-rate.ts +++ b/guardian-service/src/analytics/compare/rates/events-rate.ts @@ -1,6 +1,6 @@ -import { Status } from '../types/status.type'; -import { EventModel } from '../models/event.model'; -import { Rate } from './rate'; +import { Status } from '../types/status.type.js'; +import { EventModel } from '../models/event.model.js'; +import { Rate } from './rate.js'; /** * Calculates the difference between two Events diff --git a/guardian-service/src/analytics/compare/rates/fields-rate.ts b/guardian-service/src/analytics/compare/rates/fields-rate.ts index 557de1852b..370516e790 100644 --- a/guardian-service/src/analytics/compare/rates/fields-rate.ts +++ b/guardian-service/src/analytics/compare/rates/fields-rate.ts @@ -1,12 +1,12 @@ -import { Status } from '../types/status.type'; -import { IRate } from '../interfaces/rate.interface'; -import { FieldModel } from '../models/field.model'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { PropertiesRate } from './properties-rate'; -import { Rate } from './rate'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { PropertyModel } from '../models/property.model'; -import { CompareUtils } from '../utils/utils'; +import { Status } from '../types/status.type.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { FieldModel } from '../models/field.model.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { PropertiesRate } from './properties-rate.js'; +import { Rate } from './rate.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { PropertyModel } from '../models/property.model.js'; +import { CompareUtils } from '../utils/utils.js'; /** * Calculates the difference between two Fields diff --git a/guardian-service/src/analytics/compare/rates/object-rate.ts b/guardian-service/src/analytics/compare/rates/object-rate.ts index 310cbdf133..9c7af10077 100644 --- a/guardian-service/src/analytics/compare/rates/object-rate.ts +++ b/guardian-service/src/analytics/compare/rates/object-rate.ts @@ -1,12 +1,12 @@ -import { Status } from '../types/status.type'; -import { IRate } from '../interfaces/rate.interface'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { PropertiesRate } from './properties-rate'; -import { Rate } from './rate'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { PropertyModel } from '../models/property.model'; -import { CompareUtils } from '../utils/utils'; -import { IWeightModel } from '../interfaces/weight-model.interface'; +import { Status } from '../types/status.type.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { PropertiesRate } from './properties-rate.js'; +import { Rate } from './rate.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { PropertyModel } from '../models/property.model.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; /** * Calculates the difference between two Object diff --git a/guardian-service/src/analytics/compare/rates/permissions-rate.ts b/guardian-service/src/analytics/compare/rates/permissions-rate.ts index 0fb06d9a54..cb54036eba 100644 --- a/guardian-service/src/analytics/compare/rates/permissions-rate.ts +++ b/guardian-service/src/analytics/compare/rates/permissions-rate.ts @@ -1,7 +1,7 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IRateTable } from '../interfaces/rate-table.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { Status } from '../types/status.type'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IRateTable } from '../interfaces/rate-table.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { Status } from '../types/status.type.js'; /** * Calculates the difference between two Permissions @@ -103,4 +103,4 @@ export class PermissionsRate implements IRate { public total(): number { return this.totalRate; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/rates/properties-rate.ts b/guardian-service/src/analytics/compare/rates/properties-rate.ts index 69daacdc86..544161c1e6 100644 --- a/guardian-service/src/analytics/compare/rates/properties-rate.ts +++ b/guardian-service/src/analytics/compare/rates/properties-rate.ts @@ -1,11 +1,11 @@ -import { Status } from '../types/status.type'; -import { IRate } from '../interfaces/rate.interface'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { PropertyModel } from '../models/property.model'; -import { CompareUtils } from '../utils/utils'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { IRateTable } from '../interfaces/rate-table.interface'; -import { IProperties } from '../interfaces/properties.interface'; +import { Status } from '../types/status.type.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { PropertyModel } from '../models/property.model.js'; +import { CompareUtils } from '../utils/utils.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { IRateTable } from '../interfaces/rate-table.interface.js'; +import { IProperties } from '../interfaces/properties.interface.js'; /** * Calculates the difference between two Properties diff --git a/guardian-service/src/analytics/compare/rates/rate.ts b/guardian-service/src/analytics/compare/rates/rate.ts index 5059291a36..b702a7d2a8 100644 --- a/guardian-service/src/analytics/compare/rates/rate.ts +++ b/guardian-service/src/analytics/compare/rates/rate.ts @@ -1,8 +1,8 @@ -import { Status } from '../types/status.type'; -import { IRate } from '../interfaces/rate.interface'; -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IModel } from '../interfaces/model.interface'; -import { IRateTable } from '../interfaces/rate-table.interface'; +import { Status } from '../types/status.type.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IModel } from '../interfaces/model.interface.js'; +import { IRateTable } from '../interfaces/rate-table.interface.js'; /** * Calculates the difference between two objects diff --git a/guardian-service/src/analytics/compare/rates/record-rate.ts b/guardian-service/src/analytics/compare/rates/record-rate.ts index ce2b2950c4..3add91e012 100644 --- a/guardian-service/src/analytics/compare/rates/record-rate.ts +++ b/guardian-service/src/analytics/compare/rates/record-rate.ts @@ -1,8 +1,8 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { Rate } from './rate'; -import { DocumentsRate } from './documents-rate'; -import { RecordModel } from '../models/record.model'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { Rate } from './rate.js'; +import { DocumentsRate } from './documents-rate.js'; +import { RecordModel } from '../models/record.model.js'; /** * Calculates the difference between two Documents @@ -59,4 +59,4 @@ export class RecordRate extends Rate { public override getRateValue(name: string): number { return this.totalRate; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/rates/root-rate.ts b/guardian-service/src/analytics/compare/rates/root-rate.ts index 9a17e9c2aa..08b737929c 100644 --- a/guardian-service/src/analytics/compare/rates/root-rate.ts +++ b/guardian-service/src/analytics/compare/rates/root-rate.ts @@ -1,7 +1,7 @@ -import { Status } from '../types/status.type'; -import { IRate } from '../interfaces/rate.interface'; -import { Rate } from './rate'; -import { IModel } from '../interfaces/model.interface'; +import { Status } from '../types/status.type.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { Rate } from './rate.js'; +import { IModel } from '../interfaces/model.interface.js'; /** * Root rate diff --git a/guardian-service/src/analytics/compare/utils/compare-policy-utils.ts b/guardian-service/src/analytics/compare/utils/compare-policy-utils.ts index 7b827ec8c6..eccaccd8d8 100644 --- a/guardian-service/src/analytics/compare/utils/compare-policy-utils.ts +++ b/guardian-service/src/analytics/compare/utils/compare-policy-utils.ts @@ -1,19 +1,19 @@ -import { CompareOptions } from '../interfaces/compare-options.interface'; -import { IModel } from '../interfaces/model.interface'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { IRate } from '../interfaces/rate.interface'; -import { IWeightModel, IWeightTreeModel } from '../interfaces/weight-model.interface'; -import { BlockModel } from '../models/block.model'; -import { DocumentModel } from '../models/document.model'; -import { FieldModel } from '../models/field.model'; -import { RecordModel } from '../models/record.model'; -import { BlocksRate } from '../rates/blocks-rate'; -import { DocumentsRate } from '../rates/documents-rate'; -import { RecordRate } from '../rates/record-rate'; -import { FieldsRate } from '../rates/fields-rate'; -import { ObjectRate } from '../rates/object-rate'; -import { Status } from '../types/status.type'; -import { MergeUtils } from './merge-utils'; +import { CompareOptions } from '../interfaces/compare-options.interface.js'; +import { IModel } from '../interfaces/model.interface.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; +import { IWeightModel, IWeightTreeModel } from '../interfaces/weight-model.interface.js'; +import { BlockModel } from '../models/block.model.js'; +import { DocumentModel } from '../models/document.model.js'; +import { FieldModel } from '../models/field.model.js'; +import { RecordModel } from '../models/record.model.js'; +import { BlocksRate } from '../rates/blocks-rate.js'; +import { DocumentsRate } from '../rates/documents-rate.js'; +import { RecordRate } from '../rates/record-rate.js'; +import { FieldsRate } from '../rates/fields-rate.js'; +import { ObjectRate } from '../rates/object-rate.js'; +import { Status } from '../types/status.type.js'; +import { MergeUtils } from './merge-utils.js'; /** * Compare Utils @@ -315,4 +315,4 @@ export class ComparePolicyUtils { } return rates; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/utils/merge-utils.ts b/guardian-service/src/analytics/compare/utils/merge-utils.ts index 80f3c8e6bb..f8eaf76ad4 100644 --- a/guardian-service/src/analytics/compare/utils/merge-utils.ts +++ b/guardian-service/src/analytics/compare/utils/merge-utils.ts @@ -1,5 +1,5 @@ -import { IWeightModel } from '../interfaces/weight-model.interface'; -import { IRateMap } from '../interfaces/rate-map.interface'; +import { IWeightModel } from '../interfaces/weight-model.interface.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; import { IMultiRateMap } from '../interfaces/multi-rate-map.interface.ts'; /** @@ -306,4 +306,4 @@ export class MergeUtils { } return Math.floor(Math.max(0, result) * 100); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/utils/multi-compare-utils.ts b/guardian-service/src/analytics/compare/utils/multi-compare-utils.ts index e3c835f1e7..e6c3e49df0 100644 --- a/guardian-service/src/analytics/compare/utils/multi-compare-utils.ts +++ b/guardian-service/src/analytics/compare/utils/multi-compare-utils.ts @@ -1,5 +1,5 @@ -import { IRateTable } from '../interfaces/rate-table.interface'; -import { IReportTable } from '../interfaces/report-table.interface'; +import { IRateTable } from '../interfaces/rate-table.interface.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; interface IMergeResult { mainIndex: number; @@ -127,4 +127,4 @@ export class MultiCompareUtils { } return mapper.list(); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/utils/rate-map.ts b/guardian-service/src/analytics/compare/utils/rate-map.ts index 8dc3e1ae46..a6dddb8680 100644 --- a/guardian-service/src/analytics/compare/utils/rate-map.ts +++ b/guardian-service/src/analytics/compare/utils/rate-map.ts @@ -1,5 +1,5 @@ -import { IRateMap } from '../interfaces/rate-map.interface'; -import { CompareUtils } from './utils'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { CompareUtils } from './utils.js'; /** * Mapping items @@ -143,4 +143,4 @@ export class RateKeyMap { } return result; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/compare/utils/utils.ts b/guardian-service/src/analytics/compare/utils/utils.ts index ea0237eb68..c9960c3dfd 100644 --- a/guardian-service/src/analytics/compare/utils/utils.ts +++ b/guardian-service/src/analytics/compare/utils/utils.ts @@ -1,14 +1,14 @@ -import { CSV } from '../../table/csv'; -import { IReportTable } from '../interfaces/report-table.interface'; -import { IRateMap } from '../interfaces/rate-map.interface'; -import { IRate } from '../interfaces/rate.interface'; +import { CSV } from '../../table/csv.js'; +import { IReportTable } from '../interfaces/report-table.interface.js'; +import { IRateMap } from '../interfaces/rate-map.interface.js'; +import { IRate } from '../interfaces/rate.interface.js'; import MurmurHash3 from 'imurmurhash'; import * as crypto from 'crypto'; import { Hashing } from '@guardian/common'; -import { SchemaModel } from '../models/schema.model'; -import { BlockModel } from '../models/block.model'; +import { SchemaModel } from '../models/schema.model.js'; +import { BlockModel } from '../models/block.model.js'; import { BlockType } from '@guardian/interfaces'; -import { BlockToolModel } from '../models/block-tool.model'; +import { BlockToolModel } from '../models/block-tool.model.js'; /** * Compare Utils @@ -264,4 +264,4 @@ export class CompareUtils { return 100; } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/index.ts b/guardian-service/src/analytics/index.ts index 84f7067dfd..b5be968f04 100644 --- a/guardian-service/src/analytics/index.ts +++ b/guardian-service/src/analytics/index.ts @@ -1,3 +1,3 @@ -export * from './table'; -export * from './compare'; -export * from './search'; \ No newline at end of file +export * from './table/index.js'; +export * from './compare/index.js'; +export * from './search/index.js'; diff --git a/guardian-service/src/analytics/search/index.ts b/guardian-service/src/analytics/search/index.ts index 98a06c4b86..5ab63f6e2c 100644 --- a/guardian-service/src/analytics/search/index.ts +++ b/guardian-service/src/analytics/search/index.ts @@ -1,7 +1,7 @@ -export { PolicySearchModel } from './models/policy.model'; -export { ToolSearchModel } from './models/tool.model'; -export { ModuleSearchModel } from './models/module.model'; -export { RootSearchModel } from './models/root.model'; -export { BlockSearchModel } from './models/block.model'; -export { PairSearchModel } from './models/pair.model'; -export { ChainSearchModel } from './models/chain.model'; \ No newline at end of file +export { PolicySearchModel } from './models/policy.model.js'; +export { ToolSearchModel } from './models/tool.model.js'; +export { ModuleSearchModel } from './models/module.model.js'; +export { RootSearchModel } from './models/root.model.js'; +export { BlockSearchModel } from './models/block.model.js'; +export { PairSearchModel } from './models/pair.model.js'; +export { ChainSearchModel } from './models/chain.model.js'; diff --git a/guardian-service/src/analytics/search/models/block.model.ts b/guardian-service/src/analytics/search/models/block.model.ts index b0c05abe0c..d619545aa1 100644 --- a/guardian-service/src/analytics/search/models/block.model.ts +++ b/guardian-service/src/analytics/search/models/block.model.ts @@ -1,6 +1,6 @@ import { BlockType } from '@guardian/interfaces'; -import { ChainSearchModel } from './chain.model'; -import { ArtifactModel, BlockPropertiesModel, EventModel, PropertyModel } from '../../compare'; +import { ChainSearchModel } from './chain.model.js'; +import { ArtifactModel, BlockPropertiesModel, EventModel, PropertyModel } from '../../compare/index.js'; export interface BlockSearchJson { /** @@ -332,4 +332,4 @@ export class BlockSearchModel { path: [...this._path] } } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/search/models/chain.model.ts b/guardian-service/src/analytics/search/models/chain.model.ts index fd4e860a38..db48e30209 100644 --- a/guardian-service/src/analytics/search/models/chain.model.ts +++ b/guardian-service/src/analytics/search/models/chain.model.ts @@ -1,6 +1,6 @@ -import { SearchUtils } from '../utils/utils'; -import { BlockSearchModel } from './block.model'; -import { PairSearchModel } from './pair.model'; +import { SearchUtils } from '../utils/utils.js'; +import { BlockSearchModel } from './block.model.js'; +import { PairSearchModel } from './pair.model.js'; /** * Chain model diff --git a/guardian-service/src/analytics/search/models/module.model.ts b/guardian-service/src/analytics/search/models/module.model.ts index 6a9fd80857..496a1921b6 100644 --- a/guardian-service/src/analytics/search/models/module.model.ts +++ b/guardian-service/src/analytics/search/models/module.model.ts @@ -1,6 +1,6 @@ import { PolicyModule } from '@guardian/common'; -import { RootSearchModel } from './root.model'; +import { RootSearchModel } from './root.model.js'; /** * Module model @@ -14,4 +14,4 @@ export class ModuleSearchModel extends RootSearchModel { super(module); this.init(module.config); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/search/models/pair.model.ts b/guardian-service/src/analytics/search/models/pair.model.ts index 4014751fe7..92e7b7f779 100644 --- a/guardian-service/src/analytics/search/models/pair.model.ts +++ b/guardian-service/src/analytics/search/models/pair.model.ts @@ -14,9 +14,9 @@ import { PropertiesRate, RateKeyMap, RateMap -} from '../../compare'; -import { SearchUtils } from '../utils/utils'; -import { BlockSearchJson, BlockSearchModel } from './block.model'; +} from '../../compare/index.js'; +import { SearchUtils } from '../utils/utils.js'; +import { BlockSearchJson, BlockSearchModel } from './block.model.js'; export interface PairSearchJson { /** diff --git a/guardian-service/src/analytics/search/models/policy.model.ts b/guardian-service/src/analytics/search/models/policy.model.ts index f4fbc4b6a2..3ccc848bd4 100644 --- a/guardian-service/src/analytics/search/models/policy.model.ts +++ b/guardian-service/src/analytics/search/models/policy.model.ts @@ -1,5 +1,5 @@ import { Policy } from '@guardian/common'; -import { RootSearchModel } from './root.model'; +import { RootSearchModel } from './root.model.js'; /** * Policy model @@ -20,4 +20,4 @@ export class PolicySearchModel extends RootSearchModel { this.version = policy.version; this.init(policy.config); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/search/models/root.model.ts b/guardian-service/src/analytics/search/models/root.model.ts index ddbf8fc7e2..6d3835d12f 100644 --- a/guardian-service/src/analytics/search/models/root.model.ts +++ b/guardian-service/src/analytics/search/models/root.model.ts @@ -1,7 +1,7 @@ import { Policy, PolicyTool, PolicyModule } from '@guardian/common'; import { BlockType } from '@guardian/interfaces'; -import { BlockSearchModel } from './block.model'; -import { ChainSearchModel } from './chain.model'; +import { BlockSearchModel } from './block.model.js'; +import { ChainSearchModel } from './chain.model.js'; /** * Root model @@ -158,4 +158,4 @@ export class RootSearchModel { const root = new RootSearchModel(); return root.init(config); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/search/models/tool.model.ts b/guardian-service/src/analytics/search/models/tool.model.ts index c33b19bcc4..822918294d 100644 --- a/guardian-service/src/analytics/search/models/tool.model.ts +++ b/guardian-service/src/analytics/search/models/tool.model.ts @@ -1,6 +1,6 @@ import { PolicyTool } from '@guardian/common'; -import { RootSearchModel } from './root.model'; +import { RootSearchModel } from './root.model.js'; /** * Tool model @@ -14,4 +14,4 @@ export class ToolSearchModel extends RootSearchModel { super(tool); this.init(tool.config); } -} \ No newline at end of file +} diff --git a/guardian-service/src/analytics/table/index.ts b/guardian-service/src/analytics/table/index.ts index 9424d07afb..6f9357c7fa 100644 --- a/guardian-service/src/analytics/table/index.ts +++ b/guardian-service/src/analytics/table/index.ts @@ -1,4 +1,4 @@ -export { CSV } from './csv'; -export { IColumn } from './report-column'; -export { ReportRow } from './report-row'; -export { ReportTable } from './report-table'; \ No newline at end of file +export { CSV } from './csv.js'; +export { IColumn } from './report-column.js'; +export { ReportRow } from './report-row.js'; +export { ReportTable } from './report-table.js'; diff --git a/guardian-service/src/analytics/table/report-row.ts b/guardian-service/src/analytics/table/report-row.ts index 141119cdd3..bf9751b151 100644 --- a/guardian-service/src/analytics/table/report-row.ts +++ b/guardian-service/src/analytics/table/report-row.ts @@ -1,4 +1,4 @@ -import { ReportTable } from './report-table'; +import { ReportTable } from './report-table.js'; /** * Row diff --git a/guardian-service/src/analytics/table/report-table.ts b/guardian-service/src/analytics/table/report-table.ts index 052fc36b85..22299c8bbd 100644 --- a/guardian-service/src/analytics/table/report-table.ts +++ b/guardian-service/src/analytics/table/report-table.ts @@ -1,6 +1,6 @@ -import { IKeyMap } from 'analytics/compare/interfaces/key-map.interface'; -import { IColumn } from './report-column'; -import { ReportRow } from './report-row'; +import { IKeyMap } from 'analytics/compare/interfaces/key-map.interface.js'; +import { IColumn } from './report-column.js'; +import { ReportRow } from './report-row.js'; /** * Table diff --git a/guardian-service/src/api/analytics.service.ts b/guardian-service/src/api/analytics.service.ts index 8e77b20afb..80fa7ed1e3 100644 --- a/guardian-service/src/api/analytics.service.ts +++ b/guardian-service/src/api/analytics.service.ts @@ -1,6 +1,6 @@ -import { CompareOptions, DocumentComparator, DocumentModel, HashComparator, IChildrenLvl, IEventsLvl, IPropertiesLvl, ModuleComparator, ModuleModel, PolicyComparator, PolicyModel, PolicySearchModel, RootSearchModel, SchemaComparator, SchemaModel, ToolComparator, ToolModel } from '@analytics'; +import { CompareOptions, DocumentComparator, DocumentModel, HashComparator, IChildrenLvl, IEventsLvl, IPropertiesLvl, ModuleComparator, ModuleModel, PolicyComparator, PolicyModel, PolicySearchModel, RootSearchModel, SchemaComparator, SchemaModel, ToolComparator, ToolModel } from '../analytics/index.js'; import { DatabaseServer, Logger, MessageError, MessageResponse } from '@guardian/common'; -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { MessageAPI, PolicyType, UserRole } from '@guardian/interfaces'; import { Controller, Module } from '@nestjs/common'; import { ClientsModule, Transport } from '@nestjs/microservices'; diff --git a/guardian-service/src/api/artifact.service.ts b/guardian-service/src/api/artifact.service.ts index f3db21e651..8f9c3f44b8 100644 --- a/guardian-service/src/api/artifact.service.ts +++ b/guardian-service/src/api/artifact.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DatabaseServer, getArtifactExtention, getArtifactType, Logger, MessageError, MessageResponse, } from '@guardian/common'; import { MessageAPI, ModuleStatus, PolicyType } from '@guardian/interfaces'; @@ -58,17 +58,17 @@ export async function artifactAPI(): Promise { } } - const extention = getArtifactExtention(msg.artifact.name); + const extention = getArtifactExtention(msg.artifact.originalname); const type = getArtifactType(extention); const artifact = await DatabaseServer.saveArtifact({ - name: msg.artifact.name.split('.')[0], + name: msg.artifact.originalname.split('.')[0], extention, type, policyId: msg.parentId, owner: msg.owner, category } as any); - await DatabaseServer.saveArtifactFile(artifact.uuid, Buffer.from(msg.artifact.data)); + await DatabaseServer.saveArtifactFile(artifact.uuid, Buffer.from(msg.artifact.buffer)); return new MessageResponse(artifact); } catch (error) { new Logger().error(error, ['GUARDIAN_SERVICE']); diff --git a/guardian-service/src/api/branding.service.ts b/guardian-service/src/api/branding.service.ts index 72d9ff0dca..fe845b2c1e 100644 --- a/guardian-service/src/api/branding.service.ts +++ b/guardian-service/src/api/branding.service.ts @@ -1,5 +1,5 @@ import { MessageAPI } from '@guardian/interfaces'; -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { Branding, DataBaseHelper, MessageResponse } from '@guardian/common'; const termsAndConditions = `Lorem Ipsum Version Introduction diff --git a/guardian-service/src/api/config.service.ts b/guardian-service/src/api/config.service.ts index c4e84b26bf..bfa678c24d 100644 --- a/guardian-service/src/api/config.service.ts +++ b/guardian-service/src/api/config.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DataBaseHelper, Environment, Logger, MessageError, MessageResponse, SecretManager, Settings, Topic, ValidateConfiguration, Workers } from '@guardian/common'; import { CommonSettings, MessageAPI } from '@guardian/interfaces'; import { AccountId, PrivateKey } from '@hashgraph/sdk'; diff --git a/guardian-service/src/api/contract.service.ts b/guardian-service/src/api/contract.service.ts index 79482161d4..a519d595bf 100644 --- a/guardian-service/src/api/contract.service.ts +++ b/guardian-service/src/api/contract.service.ts @@ -1,6 +1,7 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { Contract, + ContractMessage, DataBaseHelper, DatabaseServer, KeyType, @@ -13,6 +14,7 @@ import { RetirePool, RetireRequest, Schema as SchemaCollection, + Topic, TopicConfig, TopicHelper, Users, @@ -20,36 +22,15 @@ import { VcDocument as VcDocumentCollection, VcHelper, VCMessage, - ContractMessage, Wallet, WiperRequest, Workers, - Topic, } from '@guardian/common'; -import { - ContractParamType, - ContractType, - ContractAPI, - Schema, - SchemaEntity, - SchemaHelper, - TopicType, - WorkerTaskType, - UserRole, - RetireTokenPool, - RetireTokenRequest, - TokenType, -} from '@guardian/interfaces'; +import { ContractAPI, ContractParamType, ContractType, RetireTokenPool, RetireTokenRequest, Schema, SchemaEntity, SchemaHelper, TokenType, TopicType, UserRole, WorkerTaskType, } from '@guardian/interfaces'; import { AccountId, TokenId } from '@hashgraph/sdk'; import { proto } from '@hashgraph/proto'; import * as ethers from 'ethers'; -import { - contractCall, - contractQuery, - createContract, - customContractCall, - publishSystemSchema, -} from './helpers'; +import { contractCall, contractQuery, createContract, customContractCall, publishSystemSchema, } from './helpers/index.js'; const retireAbi = new ethers.Interface([ 'function retire(tuple(address, int64, int64[])[])', @@ -235,7 +216,7 @@ async function setContractWiperPermissions( ); } -async function setPoolContract( +export async function setPoolContract( workers: Workers, contractId: string, hederaAccountId: string, @@ -1087,8 +1068,9 @@ export async function contractAPI( KeyType.KEY, did ); + const signOptions = await wallet.getUserSignOptions(root); - const topicHelper = new TopicHelper(root.hederaAccountId, rootKey); + const topicHelper = new TopicHelper(root.hederaAccountId, rootKey, signOptions); const topic = await topicHelper.create( { type: TopicType.ContractTopic, @@ -1132,7 +1114,8 @@ export async function contractAPI( contractMessage.setDocument(contract); const messageServer = new MessageServer( root.hederaAccountId, - rootKey + rootKey, + signOptions ); await messageServer .setTopicObject(topic) diff --git a/guardian-service/src/api/demo.service.ts b/guardian-service/src/api/demo.service.ts index d550400ad7..7e4af96609 100644 --- a/guardian-service/src/api/demo.service.ts +++ b/guardian-service/src/api/demo.service.ts @@ -1,7 +1,7 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DataBaseHelper, DatabaseServer, Logger, MessageError, MessageResponse, Policy, RunFunctionAsync, SecretManager, Settings, Workers } from '@guardian/common'; import { MessageAPI, WorkerTaskType } from '@guardian/interfaces'; -import { emptyNotifier, initNotifier, INotifier } from '@helpers/notifier'; +import { emptyNotifier, initNotifier, INotifier } from '../helpers/notifier.js'; /** * Demo key diff --git a/guardian-service/src/api/documents.service.ts b/guardian-service/src/api/documents.service.ts index f7a51d28a3..cd324663db 100644 --- a/guardian-service/src/api/documents.service.ts +++ b/guardian-service/src/api/documents.service.ts @@ -1,5 +1,5 @@ import { IDidObject, IVCDocument, MessageAPI, PolicyType, } from '@guardian/interfaces'; -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DataBaseHelper, DidDocument, MessageError, MessageResponse, Policy, VcDocument, VpDocument } from '@guardian/common'; /** diff --git a/guardian-service/src/api/helpers/api-response.ts b/guardian-service/src/api/helpers/api-response.ts index bb46202b01..2be616ce4d 100644 --- a/guardian-service/src/api/helpers/api-response.ts +++ b/guardian-service/src/api/helpers/api-response.ts @@ -1,6 +1,6 @@ import { ApplicationState, MessageInitialization, MessageResponse } from '@guardian/common'; import { ApplicationStates } from '@guardian/interfaces'; -import { GuardiansService } from '@helpers/guardians'; +import { GuardiansService } from '../../helpers/guardians.js'; /** * API response diff --git a/guardian-service/src/api/helpers/artifact-import-export-helper.ts b/guardian-service/src/api/helpers/artifact-import-export-helper.ts index bcb4818157..a87f7a2cc5 100644 --- a/guardian-service/src/api/helpers/artifact-import-export-helper.ts +++ b/guardian-service/src/api/helpers/artifact-import-export-helper.ts @@ -1,6 +1,6 @@ import { Artifact, DatabaseServer, getArtifactType } from '@guardian/common'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { INotifier } from '@helpers/notifier'; +import { INotifier } from '../../helpers/notifier.js'; /** * Import Result @@ -52,4 +52,4 @@ export async function importArtifactsByFiles( notifier.completed(); return { artifactsMap, errors, artifacts: addedArtifacts }; -} \ No newline at end of file +} diff --git a/guardian-service/src/api/helpers/index.ts b/guardian-service/src/api/helpers/index.ts index 9d8a2d8c88..65621be313 100644 --- a/guardian-service/src/api/helpers/index.ts +++ b/guardian-service/src/api/helpers/index.ts @@ -1,11 +1,11 @@ -export * from './api-helper'; -export * from './api-response'; -export * from './policy-wizard-helper'; -export * from './schema-helper'; -export * from './schema-import-export-helper'; -export * from './schema-publish-helper'; -export * from './tool-import-export-helper'; -export * from './token-import-export-helper'; -export * from './artifact-import-export-helper'; -export * from './tag-import-export-helper'; -export * from './contract-api'; \ No newline at end of file +export * from './api-helper.js'; +export * from './api-response.js'; +export * from './policy-wizard-helper.js'; +export * from './schema-helper.js'; +export * from './schema-import-export-helper.js'; +export * from './schema-publish-helper.js'; +export * from './tool-import-export-helper.js'; +export * from './token-import-export-helper.js'; +export * from './artifact-import-export-helper.js'; +export * from './tag-import-export-helper.js'; +export * from './contract-api.js'; diff --git a/guardian-service/src/api/helpers/schema-helper.ts b/guardian-service/src/api/helpers/schema-helper.ts index 402d435db6..d54a733014 100644 --- a/guardian-service/src/api/helpers/schema-helper.ts +++ b/guardian-service/src/api/helpers/schema-helper.ts @@ -1,9 +1,12 @@ import { GenerateUUIDv4, IRootConfig, ISchema, ModuleStatus, Schema, SchemaCategory, SchemaEntity, SchemaHelper, SchemaStatus, TopicType } from '@guardian/interfaces'; import path from 'path'; -import { readJSON } from 'fs-extra'; +import fs from 'fs-extra'; + import { DatabaseServer, MessageAction, MessageServer, Schema as SchemaCollection, SchemaConverterUtils, SchemaMessage, TopicConfig, TopicHelper, Users, } from '@guardian/common'; -import { INotifier } from '@helpers/notifier'; -import { importTag } from '@api/helpers/tag-import-export-helper'; +import { INotifier } from '../../helpers/notifier.js'; +import { importTag } from '../../api/helpers/tag-import-export-helper.js'; + +const { readJSON } = fs; /** * Import Result @@ -321,7 +324,8 @@ export async function sendSchemaMessage( ) { const messageServer = new MessageServer( root.hederaAccountId, - root.hederaAccountKey + root.hederaAccountKey, + root.signOptions ); const message = new SchemaMessage(action); message.setDocument(schema); @@ -476,7 +480,7 @@ export async function createSchema( } if (!topic && newSchema.topicId !== 'draft') { - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); topic = await topicHelper.create({ type: TopicType.SchemaTopic, name: TopicType.SchemaTopic, diff --git a/guardian-service/src/api/helpers/schema-import-export-helper.ts b/guardian-service/src/api/helpers/schema-import-export-helper.ts index a736265dc8..579b98b3ad 100644 --- a/guardian-service/src/api/helpers/schema-import-export-helper.ts +++ b/guardian-service/src/api/helpers/schema-import-export-helper.ts @@ -1,10 +1,10 @@ import { GenerateUUIDv4, ISchema, ModelHelper, ModuleStatus, Schema, SchemaCategory, SchemaEntity, SchemaHelper, SchemaStatus } from '@guardian/interfaces'; import { DatabaseServer, Logger, MessageAction, MessageServer, MessageType, replaceValueRecursive, Schema as SchemaCollection, SchemaConverterUtils, SchemaMessage, Tag, TagMessage, UrlType } from '@guardian/common'; -import { emptyNotifier, INotifier } from '@helpers/notifier'; -import { importTag } from '@api/helpers/tag-import-export-helper'; -import { createSchema, fixSchemaDefsOnImport, getDefs, ImportResult, onlyUnique, SchemaImportResult } from './schema-helper'; -import geoJson from '@guardian/interfaces/dist/helpers/geojson-schema/geo-json'; -import sentinelHub from '@guardian/interfaces/dist/helpers/sentinel-hub/sentinel-hub-schema'; +import { emptyNotifier, INotifier } from '../../helpers/notifier.js'; +import { importTag } from '../../api/helpers/tag-import-export-helper.js'; +import { createSchema, fixSchemaDefsOnImport, getDefs, ImportResult, onlyUnique, SchemaImportResult } from './schema-helper.js'; +import geoJson from '@guardian/interfaces/dist/helpers/geojson-schema/geo-json.js'; +import sentinelHub from '@guardian/interfaces/dist/helpers/sentinel-hub/sentinel-hub-schema.js'; export class SchemaCache { /** @@ -180,7 +180,8 @@ export async function importSchemaByFiles( files: ISchema[], topicId: string, notifier: INotifier, - skipGenerateId = false + skipGenerateId = false, + outerSchemasMapping?: { name: string, iri: string }[] ): Promise { notifier.start('Import schemas'); @@ -212,6 +213,19 @@ export async function importSchemaByFiles( file.owner = owner; file.topicId = topicId || 'draft'; file.status = SchemaStatus.DRAFT; + if (file.document?.$defs && outerSchemasMapping) { + for (const def of Object.values(file.document.$defs)) { + if (!def || uuidMap.has(def.$id)) { + continue; + } + const subSchemaMapping = outerSchemasMapping.find( + (item) => item.name === def.title + ); + if (subSchemaMapping) { + uuidMap.set(def.$id, subSchemaMapping.iri); + } + } + } } notifier.info(`Found ${files.length} schemas`); diff --git a/guardian-service/src/api/helpers/schema-publish-helper.ts b/guardian-service/src/api/helpers/schema-publish-helper.ts index e53add367f..e84e42c6fc 100644 --- a/guardian-service/src/api/helpers/schema-publish-helper.ts +++ b/guardian-service/src/api/helpers/schema-publish-helper.ts @@ -1,10 +1,12 @@ -import { GeoJsonContext, IRootConfig, SchemaHelper, SchemaStatus, SentinelHubContext } from '@guardian/interfaces'; - -import { checkForCircularDependency, incrementSchemaVersion, updateSchemaDefs, updateSchemaDocument } from './schema-helper'; +import * as pkg from '@guardian/interfaces'; +import { checkForCircularDependency, incrementSchemaVersion, updateSchemaDefs, updateSchemaDocument } from './schema-helper.js'; import { DatabaseServer, MessageAction, MessageServer, Schema as SchemaCollection, SchemaMessage, schemasToContext, TopicConfig, UrlType } from '@guardian/common'; -import { emptyNotifier, INotifier } from '@helpers/notifier'; -import { publishSchemaTags } from './../tag.service'; -import { exportSchemas } from './schema-import-export-helper'; +import { emptyNotifier, INotifier } from '../../helpers/notifier.js'; +import { publishSchemaTags } from './../tag.service.js'; +import { exportSchemas } from './schema-import-export-helper.js'; +import { IRootConfig } from '../../interfaces/root-config.interface.js'; + +const { GeoJsonContext, SchemaHelper, SchemaStatus, SentinelHubContext } = pkg; /** * Publish schema @@ -133,7 +135,7 @@ export async function findAndPublishSchema( notifier.completedAndStart('Resolve topic'); const topic = await TopicConfig.fromObject(await DatabaseServer.getTopicById(item.topicId), true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(topic); notifier.completedAndStart('Publish schema'); diff --git a/guardian-service/src/api/helpers/token-import-export-helper.ts b/guardian-service/src/api/helpers/token-import-export-helper.ts index 8225f1a78f..358ecf43cf 100644 --- a/guardian-service/src/api/helpers/token-import-export-helper.ts +++ b/guardian-service/src/api/helpers/token-import-export-helper.ts @@ -1,6 +1,6 @@ import { DataBaseHelper, Token } from '@guardian/common'; import { GenerateUUIDv4 } from '@guardian/interfaces'; -import { INotifier } from '@helpers/notifier'; +import { INotifier } from '../../helpers/notifier.js'; /** * Import Result @@ -62,4 +62,4 @@ export async function importTokensByFiles( notifier.completed(); return { tokenMap, errors }; -} \ No newline at end of file +} diff --git a/guardian-service/src/api/helpers/tool-import-export-helper.ts b/guardian-service/src/api/helpers/tool-import-export-helper.ts index 882ad051fd..06d42d7fd5 100644 --- a/guardian-service/src/api/helpers/tool-import-export-helper.ts +++ b/guardian-service/src/api/helpers/tool-import-export-helper.ts @@ -1,33 +1,8 @@ -import { - DatabaseServer, - IToolComponents, - MessageAction, - MessageServer, - MessageType, - PolicyTool, - SchemaFields, - TagMessage, - ToolImportExport, - ToolMessage, - TopicConfig, - TopicHelper, - Users, - replaceAllEntities, - replaceAllVariables -} from '@guardian/common'; -import { - BlockType, - GenerateUUIDv4, - IRootConfig, - ModuleStatus, - SchemaCategory, - SchemaStatus, - TagType, - TopicType -} from '@guardian/interfaces'; -import { INotifier } from '@helpers/notifier'; -import { importTag } from './tag-import-export-helper'; -import { importSchemaByFiles } from './schema-import-export-helper'; +import { DatabaseServer, IToolComponents, MessageAction, MessageServer, MessageType, PolicyTool, replaceAllEntities, replaceAllVariables, SchemaFields, TagMessage, ToolImportExport, ToolMessage, TopicConfig, TopicHelper, Users } from '@guardian/common'; +import { BlockType, GenerateUUIDv4, IRootConfig, ModuleStatus, PolicyToolMetadata, SchemaCategory, SchemaStatus, TagType, TopicType } from '@guardian/interfaces'; +import { INotifier } from '../../helpers/notifier.js'; +import { importTag } from './tag-import-export-helper.js'; +import { importSchemaByFiles } from './schema-import-export-helper.js'; /** * Import Result @@ -64,7 +39,8 @@ interface ImportResults { */ export async function replaceConfig( tool: PolicyTool, - schemasMap: any[] + schemasMap: any[], + tools: { oldMessageId: string, messageId: string, oldHash: string, newHash?: string }[] ) { if (await DatabaseServer.getTool({ name: tool.name })) { tool.name = tool.name + '_' + Date.now(); @@ -74,6 +50,14 @@ export async function replaceConfig( replaceAllEntities(tool.config, SchemaFields, item.oldIRI, item.newIRI); replaceAllVariables(tool.config, 'Schema', item.oldIRI, item.newIRI); } + + for (const item of tools) { + if (!item.newHash || !item.messageId) { + continue; + } + replaceAllEntities(tool.config, ['messageId'], item.oldMessageId, item.messageId); + replaceAllEntities(tool.config, ['hash'], item.oldHash, item.newHash); + } } /** @@ -85,7 +69,6 @@ export async function replaceConfig( export async function importSubTools( hederaAccount: IRootConfig, messages: { - uuid?: string, name?: string, messageId?: string }[], @@ -116,7 +99,6 @@ export async function importSubTools( } catch (error) { errors.push({ type: 'tool', - hash: message.uuid, name: message.name, messageId: message.messageId, error: 'Invalid tool' @@ -181,7 +163,8 @@ export async function importToolByMessage( const messageServer = new MessageServer( hederaAccount.hederaAccountId, - hederaAccount.hederaAccountKey + hederaAccount.hederaAccountKey, + hederaAccount.signOptions ); if (!messageId || typeof messageId !== 'string') { throw new Error('Invalid Message Id'); @@ -331,7 +314,8 @@ export function importToolErrors(errors: any[]): string { export async function importToolByFile( owner: string, components: IToolComponents, - notifier: INotifier + notifier: INotifier, + metadata?: PolicyToolMetadata ): Promise { notifier.start('Import tool'); @@ -342,6 +326,33 @@ export async function importToolByFile( schemas } = components; + notifier.completedAndStart('Resolve Hedera account'); + const users = new Users(); + const root = await users.getHederaAccount(owner); + + const toolsMapping: { + oldMessageId: string; + messageId: string; + oldHash: string; + newHash?: string; + }[] = []; + if (metadata?.tools) { + // tslint:disable-next-line:no-shadowed-variable + for (const tool of tools) { + if ( + metadata.tools[tool.messageId] && + tool.messageId !== metadata.tools[tool.messageId] + ) { + toolsMapping.push({ + oldMessageId: tool.messageId, + messageId: metadata.tools[tool.messageId], + oldHash: tool.hash, + }); + tool.messageId = metadata.tools[tool.messageId]; + } + } + } + delete tool._id; delete tool.id; delete tool.messageId; @@ -353,15 +364,11 @@ export async function importToolByFile( await updateToolConfig(tool); - notifier.completedAndStart('Resolve Hedera account'); - const users = new Users(); - const root = await users.getHederaAccount(owner); - notifier.completedAndStart('Create topic'); const parent = await TopicConfig.fromObject( await DatabaseServer.getTopicByType(owner, TopicType.UserTopic), true ); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const topic = await topicHelper.create({ type: TopicType.ToolTopic, name: tool.name || TopicType.ToolTopic, @@ -373,7 +380,7 @@ export async function importToolByFile( await topic.saveKeys(); notifier.completedAndStart('Create tool in Hedera'); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = new ToolMessage(MessageType.Tool, MessageAction.CreateTool); message.setDocument(tool); const messageStatus = await messageServer @@ -401,20 +408,41 @@ export async function importToolByFile( const toolsResult = await importSubTools(root, tools, notifier); notifier.sub(true); + for (const toolMapping of toolsMapping) { + const toolByMessageId = toolsResult.tools.find( + // tslint:disable-next-line:no-shadowed-variable + (tool) => tool.messageId === toolMapping.messageId + ); + toolMapping.newHash = toolByMessageId?.hash; + } + + const toolsSchemas = (await DatabaseServer.getSchemas( + { + category: SchemaCategory.TOOL, + // tslint:disable-next-line:no-shadowed-variable + topicId: { $in: toolsResult.tools.map((tool) => tool.topicId) }, + }, + { + fields: ['name', 'iri'], + } + )) as { name: string; iri: string }[]; + // Import Schemas const schemasResult = await importSchemaByFiles( SchemaCategory.TOOL, owner, schemas, tool.topicId, - notifier + notifier, + false, + toolsSchemas ); const schemasMap = schemasResult.schemasMap; notifier.completedAndStart('Saving in DB'); // Replace id - await replaceConfig(tool, schemasMap); + await replaceConfig(tool, schemasMap, toolsMapping); const item = await DatabaseServer.createTool(tool); const _topicRow = await DatabaseServer.getTopicById(topic.topicId); @@ -504,4 +532,4 @@ export async function updateToolConfig(tool: PolicyTool): Promise { tool.tools = list; return tool; -} \ No newline at end of file +} diff --git a/guardian-service/src/api/ipfs.service.ts b/guardian-service/src/api/ipfs.service.ts index becd22900c..8bd348fd34 100644 --- a/guardian-service/src/api/ipfs.service.ts +++ b/guardian-service/src/api/ipfs.service.ts @@ -1,7 +1,7 @@ -import { ApiResponse, ApiResponseSubscribe } from '@api/helpers/api-response'; +import { ApiResponse, ApiResponseSubscribe } from '../api/helpers/api-response.js'; import { DataBaseHelper, DryRunFiles, IPFS, Logger, MessageError, MessageResponse } from '@guardian/common'; import { ExternalMessageEvents, MessageAPI } from '@guardian/interfaces'; -import { IPFSTaskManager } from '@helpers/ipfs-task-manager'; +import { IPFSTaskManager } from '../helpers/ipfs-task-manager.js'; /** * TODO diff --git a/guardian-service/src/api/loader.service.ts b/guardian-service/src/api/loader.service.ts index a857beaff9..fd0a6e5207 100644 --- a/guardian-service/src/api/loader.service.ts +++ b/guardian-service/src/api/loader.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DataBaseHelper, DidDocument, DidURL, Logger, MessageError, MessageResponse, Schema, } from '@guardian/common'; import { MessageAPI } from '@guardian/interfaces'; diff --git a/guardian-service/src/api/map.service.ts b/guardian-service/src/api/map.service.ts index f932de899d..2d37192ca6 100644 --- a/guardian-service/src/api/map.service.ts +++ b/guardian-service/src/api/map.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { Logger, MessageError, MessageResponse, } from '@guardian/common'; import { MessageAPI } from '@guardian/interfaces'; diff --git a/guardian-service/src/api/module.service.ts b/guardian-service/src/api/module.service.ts index 899f0a3b2b..16c74486cd 100644 --- a/guardian-service/src/api/module.service.ts +++ b/guardian-service/src/api/module.service.ts @@ -1,33 +1,10 @@ -import { ApiResponse } from '@api/helpers/api-response'; -import { - BinaryMessageResponse, - DatabaseServer, - Logger, - MessageAction, - MessageError, - MessageResponse, - MessageServer, - MessageType, - ModuleImportExport, - ModuleMessage, - PolicyModule, - TagMessage, - TopicConfig, - TopicHelper, - Users -} from '@guardian/common'; -import { - GenerateUUIDv4, - MessageAPI, - ModuleStatus, - SchemaCategory, - TagType, - TopicType -} from '@guardian/interfaces'; -import { emptyNotifier, INotifier } from '@helpers/notifier'; -import { ISerializedErrors } from '@policy-engine/policy-validation-results-container'; -import { ModuleValidator } from '@policy-engine/block-validators/module-validator'; -import { importTag } from './helpers/tag-import-export-helper'; +import { ApiResponse } from '../api/helpers/api-response.js'; +import { BinaryMessageResponse, DatabaseServer, Logger, MessageAction, MessageError, MessageResponse, MessageServer, MessageType, ModuleImportExport, ModuleMessage, PolicyModule, TagMessage, TopicConfig, TopicHelper, Users } from '@guardian/common'; +import { GenerateUUIDv4, MessageAPI, ModuleStatus, SchemaCategory, TagType, TopicType } from '@guardian/interfaces'; +import { emptyNotifier, INotifier } from '../helpers/notifier.js'; +import { ISerializedErrors } from '../policy-engine/policy-validation-results-container.js'; +import { ModuleValidator } from '../policy-engine/block-validators/module-validator.js'; +import { importTag } from './helpers/tag-import-export-helper.js'; /** * Check and update config file @@ -62,7 +39,7 @@ export async function preparePreviewMessage(messageId: string, owner: string, no const users = new Users(); const root = await users.getHederaAccount(owner); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = await messageServer.getMessage(messageId); if (message.type !== MessageType.Module) { throw new Error('Invalid Message Type'); @@ -140,11 +117,11 @@ export async function publishModule(model: PolicyModule, owner: string, notifier notifier.completedAndStart('Find topic'); const userTopic = await TopicConfig.fromObject(await DatabaseServer.getTopicByType(owner, TopicType.UserTopic), true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(userTopic); notifier.completedAndStart('Create module topic'); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const rootTopic = await topicHelper.create({ type: TopicType.ModuleTopic, name: model.name || TopicType.ModuleTopic, diff --git a/guardian-service/src/api/profile.service.ts b/guardian-service/src/api/profile.service.ts index 01e40e9362..01764455bc 100644 --- a/guardian-service/src/api/profile.service.ts +++ b/guardian-service/src/api/profile.service.ts @@ -1,5 +1,5 @@ -import { DidDocumentStatus, DocumentStatus, MessageAPI, Schema, SchemaEntity, SchemaHelper, TopicType, UserRole, WorkerTaskType } from '@guardian/interfaces'; -import { ApiResponse } from '@api/helpers/api-response'; +import { DidDocumentStatus, DocumentStatus, ISignOptions, MessageAPI, Schema, SchemaEntity, SchemaHelper, SignType, TopicType, UserRole, WorkerTaskType } from '@guardian/interfaces'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { CommonDidDocument, DataBaseHelper, @@ -30,13 +30,20 @@ import { Wallet, Workers } from '@guardian/common'; -import { emptyNotifier, initNotifier, INotifier } from '@helpers/notifier'; -import { RestoreDataFromHedera } from '@helpers/restore-data-from-hedera'; -import { publishSystemSchema } from './helpers/schema-publish-helper'; +import { emptyNotifier, initNotifier, INotifier } from '../helpers/notifier.js'; +import { RestoreDataFromHedera } from '../helpers/restore-data-from-hedera.js'; +import { publishSystemSchema } from './helpers/schema-publish-helper.js'; import { Controller, Module } from '@nestjs/common'; import { ClientsModule, Transport } from '@nestjs/microservices'; import { AccountId, PrivateKey } from '@hashgraph/sdk'; +interface IFireblocksConfig{ + fireBlocksVaultId: string; + fireBlocksAssetId: string; + fireBlocksApiKey: string; + fireBlocksPrivateiKey: string; +} + /** * User credentials */ @@ -47,7 +54,9 @@ interface ICredentials { hederaAccountKey: string, vcDocument: any, didDocument: any, - didKeys: IDidKey[] + didKeys: IDidKey[], + useFireblocksSigning: boolean, + fireblocksConfig: IFireblocksConfig, } /** @@ -111,10 +120,14 @@ async function setupUserProfile( await users.updateCurrentUser(username, { did, parent: profile.parent, - hederaAccountId: profile.hederaAccountId + hederaAccountId: profile.hederaAccountId, + useFireblocksSigning: profile.useFireblocksSigning }); notifier.completedAndStart('Set up wallet'); await wallet.setKey(user.walletToken, KeyType.KEY, did, profile.hederaAccountKey); + if (profile.useFireblocksSigning) { + await wallet.setKey(user.walletToken, KeyType.FIREBLOCKS_KEY, did, JSON.stringify(profile.fireblocksConfig)); + } notifier.completed(); return did; @@ -167,9 +180,25 @@ async function createUserProfile( vcDocument, didDocument, didKeys, - entity + entity, + useFireblocksSigning, + fireblocksConfig } = profile; - const messageServer = new MessageServer(hederaAccountId, hederaAccountKey); + let signOptions: ISignOptions = { + signType: SignType.INTERNAL + } + if (useFireblocksSigning) { + signOptions = { + signType: SignType.FIREBLOCKS, + data: { + apiKey: fireblocksConfig.fireBlocksApiKey, + privateKey: fireblocksConfig.fireBlocksPrivateiKey, + assetId: fireblocksConfig.fireBlocksAssetId, + vaultId: fireblocksConfig.fireBlocksVaultId + } + } + } + const messageServer = new MessageServer(hederaAccountId, hederaAccountKey, signOptions); // ------------------------ // <-- Check hedera key @@ -206,7 +235,7 @@ async function createUserProfile( if (!topicConfig) { notifier.info('Create user topic'); logger.info('Create User Topic', ['GUARDIAN_SERVICE']); - const topicHelper = new TopicHelper(hederaAccountId, hederaAccountKey); + const topicHelper = new TopicHelper(hederaAccountId, hederaAccountKey, signOptions); topicConfig = await topicHelper.create({ type: TopicType.UserTopic, name: TopicType.UserTopic, diff --git a/guardian-service/src/api/projects.service.ts b/guardian-service/src/api/projects.service.ts index fe05a75727..fc83dbda9a 100644 --- a/guardian-service/src/api/projects.service.ts +++ b/guardian-service/src/api/projects.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DatabaseServer, Logger, @@ -158,4 +158,4 @@ export async function projectsAPI(): Promise { return new MessageError(error); } }); -} \ No newline at end of file +} diff --git a/guardian-service/src/api/record.service.ts b/guardian-service/src/api/record.service.ts index f6d7850515..58e0ad98a1 100644 --- a/guardian-service/src/api/record.service.ts +++ b/guardian-service/src/api/record.service.ts @@ -1,5 +1,5 @@ -import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IRefLvl, IPropertiesLvl, RecordComparator } from '@analytics'; -import { ApiResponse } from '@api/helpers/api-response'; +import { CompareOptions, IChildrenLvl, IEventsLvl, IIdLvl, IKeyLvl, IRefLvl, IPropertiesLvl, RecordComparator } from '../analytics/index.js'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { BinaryMessageResponse, DatabaseServer, @@ -11,7 +11,7 @@ import { RecordImportExport, } from '@guardian/common'; import { MessageAPI, PolicyEvents, PolicyType } from '@guardian/interfaces'; -import { GuardiansService } from '@helpers/guardians'; +import { GuardiansService } from '../helpers/guardians.js'; /** * Compare results @@ -394,4 +394,4 @@ export async function recordAPI(): Promise { return new MessageError(error); } }); -} \ No newline at end of file +} diff --git a/guardian-service/src/api/schema.service.ts b/guardian-service/src/api/schema.service.ts index 422ae74ac5..15dbfd7dd3 100644 --- a/guardian-service/src/api/schema.service.ts +++ b/guardian-service/src/api/schema.service.ts @@ -1,5 +1,5 @@ -import { ApiResponse } from '@api/helpers/api-response'; -import { emptyNotifier, initNotifier } from '@helpers/notifier'; +import { ApiResponse } from '../api/helpers/api-response.js'; +import { emptyNotifier, initNotifier } from '../helpers/notifier.js'; import { Controller } from '@nestjs/common'; import { BinaryMessageResponse, DatabaseServer, GenerateBlocks, JsonToXlsx, Logger, MessageError, MessageResponse, RunFunctionAsync, Users, XlsxToJson } from '@guardian/common'; import { ISchema, MessageAPI, ModuleStatus, Schema, SchemaCategory, SchemaHelper, SchemaNode, SchemaStatus, TopicType } from '@guardian/interfaces'; @@ -22,8 +22,8 @@ import { previewToolByMessage, updateSchemaDefs, updateToolConfig -} from './helpers'; -import { PolicyImportExportHelper } from '@policy-engine/helpers/policy-import-export-helper'; +} from './helpers/index.js'; +import { PolicyImportExportHelper } from '../policy-engine/helpers/policy-import-export-helper.js'; import { readFile } from 'fs/promises'; import path from 'path'; import process from 'process'; @@ -278,6 +278,21 @@ export async function schemaAPI(): Promise { } if (msg.policyId) { filter.category = SchemaCategory.POLICY; + const userPolicy = await DatabaseServer.getPolicyCache({ + id: msg.policyId, + userId: msg.owner + }); + if (userPolicy) { + filter.cacheCollection = 'schemas'; + filter.cachePolicyId = msg.policyId; + // tslint:disable-next-line:no-shadowed-variable + const [items, count] = + await DatabaseServer.getAndCountPolicyCacheData( + filter, + otherOptions + ); + return new MessageResponse({ items, count }); + } const policy = await DatabaseServer.getPolicyById(msg.policyId); filter.topicId = policy?.topicId; } else if (msg.moduleId) { diff --git a/guardian-service/src/api/suggestions.service.ts b/guardian-service/src/api/suggestions.service.ts index 378c915080..7e77acf7be 100644 --- a/guardian-service/src/api/suggestions.service.ts +++ b/guardian-service/src/api/suggestions.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { MessageResponse, MessageError, diff --git a/guardian-service/src/api/tag.service.ts b/guardian-service/src/api/tag.service.ts index d2f0b0da62..451956b065 100644 --- a/guardian-service/src/api/tag.service.ts +++ b/guardian-service/src/api/tag.service.ts @@ -1,34 +1,6 @@ -import { ApiResponse } from '@api/helpers/api-response'; -import { - DatabaseServer, - Logger, - MessageAction, - MessageError, - MessageResponse, - MessageServer, - MessageType, - PolicyModule as ModuleCollection, - Policy as PolicyCollection, - PolicyTool as PolicyToolCollection, - Schema as SchemaCollection, - Token as TokenCollection, - Tag, - TagMessage, - TopicConfig, - UrlType, - Users, - VcHelper, -} from '@guardian/common'; -import { - GenerateUUIDv4, - IRootConfig, - MessageAPI, - Schema, - SchemaCategory, - SchemaHelper, - SchemaStatus, - TagType -} from '@guardian/interfaces'; +import { ApiResponse } from '../api/helpers/api-response.js'; +import { DatabaseServer, Logger, MessageAction, MessageError, MessageResponse, MessageServer, MessageType, Policy as PolicyCollection, PolicyModule as ModuleCollection, PolicyTool as PolicyToolCollection, Schema as SchemaCollection, Tag, TagMessage, Token as TokenCollection, TopicConfig, UrlType, Users, VcHelper, } from '@guardian/common'; +import { GenerateUUIDv4, IRootConfig, MessageAPI, Schema, SchemaCategory, SchemaHelper, SchemaStatus, TagType } from '@guardian/interfaces'; /** * Publish schema tags @@ -48,7 +20,7 @@ export async function publishSchemaTags( const topic = await DatabaseServer.getTopicById(schema.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey) + const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey, user.signOptions) .setTopicObject(topicConfig); for (const tag of tags) { @@ -76,7 +48,7 @@ export async function publishPolicyTags( const topic = await DatabaseServer.getTopicById(policy.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey) + const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey, user.signOptions) .setTopicObject(topicConfig); for (const tag of tags) { @@ -104,7 +76,7 @@ export async function publishTokenTags( const topic = await DatabaseServer.getTopicById(token.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey) + const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey, user.signOptions) .setTopicObject(topicConfig); for (const tag of tags) { @@ -131,7 +103,7 @@ export async function publishToolTags( const tags = await DatabaseServer.getTags(filter); const topic = await DatabaseServer.getTopicById(tool.tagsTopicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey) + const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey, user.signOptions) .setTopicObject(topicConfig); for (const tag of tags) { tag.target = tool.tagsTopicId; @@ -158,7 +130,7 @@ export async function publishModuleTags( const topic = await DatabaseServer.getTopicById(module.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey) + const messageServer = new MessageServer(user.hederaAccountId, user.hederaAccountKey, user.signOptions) .setTopicObject(topicConfig); for (const tag of tags) { @@ -389,7 +361,7 @@ export async function tagsAPI(): Promise { tag.status = 'Published'; const topic = await DatabaseServer.getTopicById(target.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(topicConfig); await publishTag(tag, messageServer); } else { @@ -541,7 +513,7 @@ export async function tagsAPI(): Promise { const root = await users.getHederaAccount(item.owner); const topic = await DatabaseServer.getTopicById(item.topicId); const topicConfig = await TopicConfig.fromObject(topic, true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(topicConfig); await deleteTag(item, messageServer); } diff --git a/guardian-service/src/api/theme.service.ts b/guardian-service/src/api/theme.service.ts index f5d1bc4bb4..e29ba96d59 100644 --- a/guardian-service/src/api/theme.service.ts +++ b/guardian-service/src/api/theme.service.ts @@ -1,4 +1,4 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { BinaryMessageResponse, DatabaseServer, diff --git a/guardian-service/src/api/token.service.ts b/guardian-service/src/api/token.service.ts index 6d2b009959..bbd1261fec 100644 --- a/guardian-service/src/api/token.service.ts +++ b/guardian-service/src/api/token.service.ts @@ -1,8 +1,8 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { ArrayMessageResponse, DataBaseHelper, DatabaseServer, KeyType, Logger, MessageError, MessageResponse, RunFunctionAsync, Token, TopicHelper, Users, Wallet, Workers, } from '@guardian/common'; import { GenerateUUIDv4, IRootConfig, IToken, MessageAPI, OrderDirection, TopicType, WorkerTaskType } from '@guardian/interfaces'; -import { emptyNotifier, initNotifier, INotifier } from '@helpers/notifier'; -import { publishTokenTags } from './tag.service'; +import { emptyNotifier, initNotifier, INotifier } from '../helpers/notifier.js'; +import { publishTokenTags } from './tag.service.js'; /** * Create token in Hedera network @@ -10,7 +10,7 @@ import { publishTokenTags } from './tag.service'; * @param user */ export async function createHederaToken(token: any, user: IRootConfig) { - const topicHelper = new TopicHelper(user.hederaAccountId, user.hederaAccountKey); + const topicHelper = new TopicHelper(user.hederaAccountId, user.hederaAccountKey, user.signOptions); const topic = await topicHelper.create({ type: TopicType.TokenTopic, name: TopicType.TokenTopic, @@ -603,6 +603,24 @@ export async function tokenAPI(tokenRepository: DataBaseHelper): Promise< return new MessageResponse(task); }); + ApiResponse(MessageAPI.UPDATE_TOKEN, async (msg) => { + try { + const { token } = msg; + if (!msg) { + throw new Error('Invalid Params'); + } + const item = await tokenRepository.findOne({ tokenId: token.tokenId }); + if (!item) { + throw new Error('Token not found'); + } + + return new MessageResponse(await updateToken(item, token, tokenRepository, emptyNotifier())); + } catch (error) { + new Logger().error(error, ['GUARDIAN_SERVICE']); + return new MessageError(error); + } + }); + ApiResponse(MessageAPI.UPDATE_TOKEN_ASYNC, async (msg) => { const { token, task } = msg; const notifier = await initNotifier(task); diff --git a/guardian-service/src/api/tool.service.ts b/guardian-service/src/api/tool.service.ts index 099e32b4d3..799fe47c96 100644 --- a/guardian-service/src/api/tool.service.ts +++ b/guardian-service/src/api/tool.service.ts @@ -1,41 +1,15 @@ -import { ApiResponse } from '@api/helpers/api-response'; -import { - BinaryMessageResponse, - DatabaseServer, - Logger, - MessageAction, - MessageError, - MessageResponse, - MessageServer, - MessageType, - ToolMessage, - PolicyTool, - TopicConfig, - TopicHelper, - Users, - ToolImportExport, - RunFunctionAsync, - SchemaFields, - replaceAllEntities, - replaceAllVariables, - Hashing -} from '@guardian/common'; -import { - IRootConfig, - MessageAPI, - ModuleStatus, - SchemaStatus, - TopicType -} from '@guardian/interfaces'; -import { emptyNotifier, initNotifier, INotifier } from '@helpers/notifier'; -import { findAndPublishSchema } from '@api/helpers/schema-publish-helper'; -import { incrementSchemaVersion } from '@api/helpers/schema-helper'; -import { ISerializedErrors } from '@policy-engine/policy-validation-results-container'; -import { ToolValidator } from '@policy-engine/block-validators/tool-validator'; -import { PolicyConverterUtils } from '@policy-engine/policy-converter-utils'; -import { importToolByFile, importToolByMessage, importToolErrors, updateToolConfig } from './helpers'; +import { ApiResponse } from '../api/helpers/api-response.js'; +import { BinaryMessageResponse, DatabaseServer, Hashing, Logger, MessageAction, MessageError, MessageResponse, MessageServer, MessageType, PolicyTool, replaceAllEntities, replaceAllVariables, RunFunctionAsync, SchemaFields, ToolImportExport, ToolMessage, TopicConfig, TopicHelper, Users } from '@guardian/common'; +import { IRootConfig, MessageAPI, ModuleStatus, SchemaStatus, TopicType } from '@guardian/interfaces'; +import { emptyNotifier, initNotifier, INotifier } from '../helpers/notifier.js'; +import { findAndPublishSchema } from '../api/helpers/schema-publish-helper.js'; +import { incrementSchemaVersion } from '../api/helpers/schema-helper.js'; +import { ISerializedErrors } from '../policy-engine/policy-validation-results-container.js'; +import { ToolValidator } from '../policy-engine/block-validators/tool-validator.js'; +import { PolicyConverterUtils } from '../policy-engine/policy-converter-utils.js'; +import { importToolByFile, importToolByMessage, importToolErrors, updateToolConfig } from './helpers/index.js'; import * as crypto from 'crypto'; -import { publishToolTags } from './tag.service'; +import { publishToolTags } from './tag.service.js'; /** * Sha256 @@ -74,7 +48,7 @@ export async function preparePreviewMessage( const users = new Users(); const root = await users.getHederaAccount(owner); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = await messageServer.getMessage(messageId); if (message.type !== MessageType.Tool) { throw new Error('Invalid Message Type'); @@ -157,14 +131,14 @@ export async function publishTool( notifier.completedAndStart('Find topic'); const topic = await TopicConfig.fromObject(await DatabaseServer.getTopicById(tool.topicId), true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(topic); notifier.completedAndStart('Publish schemas'); tool = await publishSchemas(tool, owner, root, notifier); notifier.completedAndStart('Create tags topic'); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const tagsTopic = await topicHelper.create({ type: TopicType.TagsTopic, name: tool.name || TopicType.TagsTopic, @@ -315,7 +289,7 @@ export async function createTool( const parent = await TopicConfig.fromObject( await DatabaseServer.getTopicByType(owner, TopicType.UserTopic), true ); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const topic = await topicHelper.create({ type: TopicType.ToolTopic, name: tool.name || TopicType.ToolTopic, @@ -327,7 +301,7 @@ export async function createTool( await topic.saveKeys(); notifier.completedAndStart('Create tool in Hedera'); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = new ToolMessage(MessageType.Tool, MessageAction.CreateTool); message.setDocument(tool); const messageStatus = await messageServer @@ -645,12 +619,12 @@ export async function toolsAPI(): Promise { ApiResponse(MessageAPI.TOOL_IMPORT_FILE, async (msg) => { try { - const { zip, owner } = msg; + const { zip, owner, metadata } = msg; if (!zip) { throw new Error('file in body is empty'); } const preview = await ToolImportExport.parseZipFile(Buffer.from(zip.data)); - const { tool, errors } = await importToolByFile(owner, preview, emptyNotifier()); + const { tool, errors } = await importToolByFile(owner, preview, emptyNotifier(), metadata); if (errors?.length) { const message = importToolErrors(errors); new Logger().warn(message, ['GUARDIAN_SERVICE']); @@ -688,14 +662,14 @@ export async function toolsAPI(): Promise { }); ApiResponse(MessageAPI.TOOL_IMPORT_FILE_ASYNC, async (msg) => { - const { zip, owner, task } = msg; + const { zip, owner, task, metadata} = msg; const notifier = await initNotifier(task); RunFunctionAsync(async () => { if (!zip) { throw new Error('file in body is empty'); } const preview = await ToolImportExport.parseZipFile(Buffer.from(zip.data)); - const { tool, errors } = await importToolByFile(owner, preview, notifier); + const { tool, errors } = await importToolByFile(owner, preview, notifier, metadata); if (errors?.length) { const message = importToolErrors(errors); notifier.error(message); diff --git a/guardian-service/src/api/trust-chain.service.ts b/guardian-service/src/api/trust-chain.service.ts index 0701ef35a2..7945deab7c 100644 --- a/guardian-service/src/api/trust-chain.service.ts +++ b/guardian-service/src/api/trust-chain.service.ts @@ -1,5 +1,5 @@ import { IChainItem, MessageAPI, SchemaEntity } from '@guardian/interfaces'; -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DataBaseHelper, DidDocument, Logger, MessageError, MessageResponse, VcDocument, VpDocument, VpDocumentDefinition as HVpDocument } from '@guardian/common'; /** diff --git a/guardian-service/src/api/wizard.service.ts b/guardian-service/src/api/wizard.service.ts index 7b7269553f..8866759b21 100644 --- a/guardian-service/src/api/wizard.service.ts +++ b/guardian-service/src/api/wizard.service.ts @@ -1,10 +1,10 @@ -import { ApiResponse } from '@api/helpers/api-response'; +import { ApiResponse } from '../api/helpers/api-response.js'; import { DatabaseServer, Logger, MessageError, MessageResponse, RunFunctionAsync, } from '@guardian/common'; import { IWizardConfig, MessageAPI, SchemaCategory } from '@guardian/interfaces'; -import { emptyNotifier, initNotifier } from '@helpers/notifier'; -import { PolicyEngine } from '@policy-engine/policy-engine'; -import { exportSchemas, importSchemaByFiles, } from './helpers/schema-import-export-helper'; -import { PolicyWizardHelper } from './helpers/policy-wizard-helper'; +import { emptyNotifier, initNotifier } from '../helpers/notifier.js'; +import { PolicyEngine } from '../policy-engine/policy-engine.js'; +import { exportSchemas, importSchemaByFiles, } from './helpers/schema-import-export-helper.js'; +import { PolicyWizardHelper } from './helpers/policy-wizard-helper.js'; /** * Create existing policy schemas diff --git a/guardian-service/src/app.module.ts b/guardian-service/src/app.module.ts index fb5d36643e..d3ac1c50bc 100644 --- a/guardian-service/src/app.module.ts +++ b/guardian-service/src/app.module.ts @@ -1,7 +1,7 @@ import { Module } from '@nestjs/common'; -import { AnalyticsModule } from '@api/analytics.service'; -import { ProfileModule } from '@api/profile.service'; -import { SchemaService } from '@api/schema.service'; +import { AnalyticsModule } from './api/analytics.service.js'; +import { ProfileModule } from './api/profile.service.js'; +import { SchemaService } from './api/schema.service.js'; import { NotificationService } from '@guardian/common'; @Module({ diff --git a/guardian-service/src/app.ts b/guardian-service/src/app.ts index 33c562e2fd..0cc27328c5 100644 --- a/guardian-service/src/app.ts +++ b/guardian-service/src/app.ts @@ -1,17 +1,18 @@ -import { configAPI } from '@api/config.service'; -import { documentsAPI } from '@api/documents.service'; -import { loaderAPI } from '@api/loader.service'; -import { profileAPI } from '@api/profile.service'; -import { schemaAPI } from '@api/schema.service'; -import { tokenAPI } from '@api/token.service'; -import { trustChainAPI } from '@api/trust-chain.service'; -import { PolicyEngineService } from '@policy-engine/policy-engine.service'; +import { configAPI } from './api/config.service.js'; +import { documentsAPI } from './api/documents.service.js'; +import { loaderAPI } from './api/loader.service.js'; +import { profileAPI } from './api/profile.service.js'; +import { schemaAPI } from './api/schema.service.js'; +import { tokenAPI } from './api/token.service.js'; +import { trustChainAPI } from './api/trust-chain.service.js'; +import { PolicyEngineService } from './policy-engine/policy-engine.service.js'; import { ApplicationState, Branding, COMMON_CONNECTION_CONFIG, Contract, DataBaseHelper, + DatabaseServer, DidDocument, entities, Environment, @@ -43,34 +44,34 @@ import { } from '@guardian/common'; import { ApplicationStates, PolicyEvents, PolicyType, WorkerTaskType } from '@guardian/interfaces'; import { AccountId, PrivateKey, TopicId } from '@hashgraph/sdk'; -import { ipfsAPI } from '@api/ipfs.service'; -import { artifactAPI } from '@api/artifact.service'; -import { sendKeysToVault } from '@helpers/send-keys-to-vault'; -import { contractAPI, syncRetireContracts, syncWipeContracts } from '@api/contract.service'; -import { PolicyServiceChannelsContainer } from '@helpers/policy-service-channels-container'; -import { PolicyEngine } from '@policy-engine/policy-engine'; -import { modulesAPI } from '@api/module.service'; -import { toolsAPI } from '@api/tool.service'; -import { GuardiansService } from '@helpers/guardians'; -import { mapAPI } from '@api/map.service'; -import { tagsAPI } from '@api/tag.service'; -import { setDefaultSchema } from '@api/helpers/schema-helper'; -import { demoAPI } from '@api/demo.service'; -import { themeAPI } from '@api/theme.service'; -import { brandingAPI } from '@api/branding.service'; -import { wizardAPI } from '@api/wizard.service'; -import { startMetricsServer } from './utils/metrics'; +import { ipfsAPI } from './api/ipfs.service.js'; +import { artifactAPI } from './api/artifact.service.js'; +import { sendKeysToVault } from './helpers/send-keys-to-vault.js'; +import { contractAPI, syncRetireContracts, syncWipeContracts } from './api/contract.service.js'; +import { PolicyServiceChannelsContainer } from './helpers/policy-service-channels-container.js'; +import { PolicyEngine } from './policy-engine/policy-engine.js'; +import { modulesAPI } from './api/module.service.js'; +import { toolsAPI } from './api/tool.service.js'; +import { GuardiansService } from './helpers/guardians.js'; +import { mapAPI } from './api/map.service.js'; +import { tagsAPI } from './api/tag.service.js'; +import { setDefaultSchema } from './api/helpers/schema-helper.js'; +import { demoAPI } from './api/demo.service.js'; +import { themeAPI } from './api/theme.service.js'; +import { brandingAPI } from './api/branding.service.js'; +import { wizardAPI } from './api/wizard.service.js'; +import { startMetricsServer } from './utils/metrics.js'; import { NestFactory } from '@nestjs/core'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; import process from 'process'; -import { AppModule } from './app.module'; -import { analyticsAPI } from '@api/analytics.service'; +import { AppModule } from './app.module.js'; +import { analyticsAPI } from './api/analytics.service.js'; import { GridFSBucket } from 'mongodb'; -import { suggestionsAPI } from '@api/suggestions.service'; -import { SynchronizationTask } from '@helpers/synchronization-task'; -import { recordAPI } from '@api/record.service'; -import { projectsAPI } from '@api/projects.service'; -import { AISuggestionsService } from '@helpers/ai-suggestions'; +import { suggestionsAPI } from './api/suggestions.service.js'; +import { SynchronizationTask } from './helpers/synchronization-task.js'; +import { recordAPI } from './api/record.service.js'; +import { projectsAPI } from './api/projects.service.js'; +import { AISuggestionsService } from './helpers/ai-suggestions.js'; export const obj = {}; @@ -97,6 +98,7 @@ Promise.all([ 'v2-17-0', 'v2-18-0', 'v2-20-0', + 'v2-23-1', ]), MessageBrokerChannel.connect('GUARDIANS_SERVICE'), NestFactory.createMicroservice(AppModule, { @@ -115,6 +117,7 @@ Promise.all([ app.listen(); DataBaseHelper.orm = db; + DataBaseHelper.gridFS = new GridFSBucket(db.em.getDriver().getConnection().getDb()); new PolicyServiceChannelsContainer().setConnection(cn); new TransactionLogger().initialization( @@ -390,6 +393,21 @@ Promise.all([ channel ); policyDiscontinueTask.start(true); + const clearPolicyCache = new SynchronizationTask( + 'clear-policy-cache-sync', + async () => { + const policyCaches = await DatabaseServer.getPolicyCaches(); + const now = Date.now(); + for (const policyCache of policyCaches) { + if (policyCache.createDate.addDays(1).getTime() <= now) { + await DatabaseServer.clearPolicyCaches(policyCache.id); + } + } + }, + process.env.CLEAR_POLICY_CACHE_INTERVAL || '0 * * * *', + channel + ); + clearPolicyCache.start(true); startMetricsServer(); }, (reason) => { diff --git a/guardian-service/src/config.ts b/guardian-service/src/config.ts index b6e0f2e638..a0846fb26a 100644 --- a/guardian-service/src/config.ts +++ b/guardian-service/src/config.ts @@ -1,21 +1,7 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import 'reflect-metadata'; import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@entity': __dirname + '/entity', - '@subscribers': __dirname + 'dist/subscribers', - '@helpers': __dirname + '/helpers', - '@auth': __dirname + '/auth', - '@policy-engine': __dirname + '/policy-engine', - '@hedera-modules': __dirname + '/hedera-modules/index', - '@database-modules': __dirname + '/database-modules/index', - '@document-loader': __dirname + '/document-loader', - '@analytics': __dirname + '/analytics/index' -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.guardian.${process.env.GUARDIAN_ENV}` : './configs/.env.guardian'; diff --git a/guardian-service/src/helpers/notifier.ts b/guardian-service/src/helpers/notifier.ts index cda9c76a41..d4de419ed8 100644 --- a/guardian-service/src/helpers/notifier.ts +++ b/guardian-service/src/helpers/notifier.ts @@ -6,7 +6,7 @@ import { StatusType, TaskAction, } from '@guardian/interfaces'; -import { GuardiansService } from '@helpers/guardians'; +import { GuardiansService } from '../helpers/guardians.js'; /** * Interface of notifier diff --git a/guardian-service/src/helpers/restore-data-from-hedera.ts b/guardian-service/src/helpers/restore-data-from-hedera.ts index e0d2042fbd..94047863f5 100644 --- a/guardian-service/src/helpers/restore-data-from-hedera.ts +++ b/guardian-service/src/helpers/restore-data-from-hedera.ts @@ -44,7 +44,7 @@ import { UserRole, WorkerTaskType } from '@guardian/interfaces'; -import { PolicyEngine } from '@policy-engine/policy-engine'; +import { PolicyEngine } from '../policy-engine/policy-engine.js'; /** * Restore data from hedera class @@ -660,4 +660,4 @@ export class RestoreDataFromHedera { }); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/index.ts b/guardian-service/src/index.ts index e851ecf56f..88f4363d63 100644 --- a/guardian-service/src/index.ts +++ b/guardian-service/src/index.ts @@ -1,3 +1,3 @@ -import './prototypes/date-prototype'; -import './config'; -import './app'; +import './prototypes/date-prototype.js'; +import './config.js'; +import './app.js'; diff --git a/guardian-service/src/interfaces/root-config.interface.ts b/guardian-service/src/interfaces/root-config.interface.ts new file mode 100644 index 0000000000..b9bfb972fe --- /dev/null +++ b/guardian-service/src/interfaces/root-config.interface.ts @@ -0,0 +1,27 @@ +import { ISignOptions } from '@guardian/interfaces'; + +/** + * Root config interface + */ +export interface IRootConfig { + /** + * ID + */ + id?: string; + /** + * Hedera account id + */ + hederaAccountId: string; + /** + * Hedera account private key + */ + hederaAccountKey: string; + /** + * Root DID + */ + did: string; + /** + * Sign options + */ + signOptions: ISignOptions; +} diff --git a/guardian-service/src/migrations/v2-16-0.ts b/guardian-service/src/migrations/v2-16-0.ts index 2d38f10e06..3d3ce00e04 100644 --- a/guardian-service/src/migrations/v2-16-0.ts +++ b/guardian-service/src/migrations/v2-16-0.ts @@ -6,7 +6,7 @@ import { PropertyType, SchemaModel, TokenModel -} from '@analytics'; +} from '../analytics/index.js'; import { GenerateUUIDv4 } from '@guardian/interfaces'; import { Migration } from '@mikro-orm/migrations-mongodb'; import { GridFSBucket, ObjectId } from 'mongodb'; @@ -173,4 +173,4 @@ export class ReleaseMigration extends Migration { ); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/migrations/v2-23-1.ts b/guardian-service/src/migrations/v2-23-1.ts new file mode 100644 index 0000000000..8f969fb15f --- /dev/null +++ b/guardian-service/src/migrations/v2-23-1.ts @@ -0,0 +1,43 @@ +import { Migration } from '@mikro-orm/migrations-mongodb'; + +/** + * Migration to version 2.23.1 + */ +export class ReleaseMigration extends Migration { + /** + * Up migration + */ + async up(): Promise { + await this.updateMintRequests(); + } + + /** + * Update mint requests + */ + async updateMintRequests() { + const mintRequestsCollection = this.getCollection('MintRequest'); + const tokenCollection = this.getCollection('Token'); + const mintRequests = mintRequestsCollection.find( + {}, + { session: this.ctx } + ); + while (await mintRequests.hasNext()) { + const mintRequest = await mintRequests.next(); + const token = await tokenCollection.findOne({ + tokenId: mintRequest.tokenId, + }); + if (token) { + await mintRequestsCollection.updateOne( + { _id: mintRequest._id }, + { + $set: { + tokenType: token.tokenType, + decimals: token.decimals, + }, + }, + { session: this.ctx, upsert: false } + ); + } + } + } +} diff --git a/guardian-service/src/policy-engine/block-validators/block-validator.ts b/guardian-service/src/policy-engine/block-validators/block-validator.ts index 04f52efbad..3a1da93d36 100644 --- a/guardian-service/src/policy-engine/block-validators/block-validator.ts +++ b/guardian-service/src/policy-engine/block-validators/block-validator.ts @@ -1,56 +1,56 @@ import * as mathjs from 'mathjs'; -import { PolicyValidator } from './policy-validator'; -import { IBlockErrors } from './interfaces/block-errors.interface'; -import { IBlockProp } from './interfaces/block-prop.interface'; -import { InterfaceDocumentActionBlock } from './blocks/action-block'; -import { AggregateBlock } from './blocks/aggregate-block'; -import { ButtonBlock } from './blocks/button-block'; -import { CalculateContainerBlock } from './blocks/calculate-block'; -import { CalculateMathAddon } from './blocks/calculate-math-addon'; -import { CalculateMathVariables } from './blocks/calculate-math-variables'; -import { InterfaceContainerBlock } from './blocks/container-block'; -import { CreateTokenBlock } from './blocks/create-token-block'; -import { CustomLogicBlock } from './blocks/custom-logic-block'; -import { DocumentValidatorBlock } from './blocks/document-validator-block'; -import { InterfaceDocumentsSource } from './blocks/documents-source'; -import { DocumentsSourceAddon } from './blocks/documents-source-addon'; -import { ExternalDataBlock } from './blocks/external-data-block'; -import { FiltersAddonBlock } from './blocks/filters-addon-block'; -import { GroupManagerBlock } from './blocks/group-manager'; -import { HistoryAddon } from './blocks/history-addon'; -import { HttpRequestBlock } from './blocks/http-request-block'; -import { TokenOperationAddon } from './blocks/impact-addon'; -import { InformationBlock } from './blocks/information-block'; -import { MintBlock } from './blocks/mint-block'; -import { MultiSignBlock } from './blocks/multi-sign-block'; -import { PaginationAddon } from './blocks/pagination-addon'; -import { PolicyRolesBlock } from './blocks/policy-roles'; -import { ReassigningBlock } from './blocks/reassigning.block'; -import { ReportBlock } from './blocks/report-block'; -import { ReportItemBlock } from './blocks/report-item-block'; -import { RequestVcDocumentBlock } from './blocks/request-vc-document-block'; -import { RetirementBlock } from './blocks/retirement-block'; -import { RevokeBlock } from './blocks/revoke-block'; -import { RevocationBlock } from './blocks/revocation-block'; -import { SelectiveAttributes } from './blocks/selective-attributes-addon'; -import { SendToGuardianBlock } from './blocks/send-to-guardian-block'; -import { SetRelationshipsBlock } from './blocks/set-relationships-block'; -import { SplitBlock } from './blocks/split-block'; -import { InterfaceStepBlock } from './blocks/step-block'; -import { SwitchBlock } from './blocks/switch-block'; -import { TimerBlock } from './blocks/timer-block'; -import { TokenActionBlock } from './blocks/token-action-block'; -import { TokenConfirmationBlock } from './blocks/token-confirmation-block'; -import { ModuleValidator } from './module-validator'; -import { ModuleBlock } from './blocks/module'; -import { TagsManagerBlock } from './blocks/tag-manager'; -import { ExternalTopicBlock } from './blocks/external-topic-block'; -import { MessagesReportBlock } from './blocks/messages-report-block'; -import { NotificationBlock } from './blocks/notification.block'; +import { PolicyValidator } from './policy-validator.js'; +import { IBlockErrors } from './interfaces/block-errors.interface.js'; +import { IBlockProp } from './interfaces/block-prop.interface.js'; +import { InterfaceDocumentActionBlock } from './blocks/action-block.js'; +import { AggregateBlock } from './blocks/aggregate-block.js'; +import { ButtonBlock } from './blocks/button-block.js'; +import { CalculateContainerBlock } from './blocks/calculate-block.js'; +import { CalculateMathAddon } from './blocks/calculate-math-addon.js'; +import { CalculateMathVariables } from './blocks/calculate-math-variables.js'; +import { InterfaceContainerBlock } from './blocks/container-block.js'; +import { CreateTokenBlock } from './blocks/create-token-block.js'; +import { CustomLogicBlock } from './blocks/custom-logic-block.js'; +import { DocumentValidatorBlock } from './blocks/document-validator-block.js'; +import { InterfaceDocumentsSource } from './blocks/documents-source.js'; +import { DocumentsSourceAddon } from './blocks/documents-source-addon.js'; +import { ExternalDataBlock } from './blocks/external-data-block.js'; +import { FiltersAddonBlock } from './blocks/filters-addon-block.js'; +import { GroupManagerBlock } from './blocks/group-manager.js'; +import { HistoryAddon } from './blocks/history-addon.js'; +import { HttpRequestBlock } from './blocks/http-request-block.js'; +import { TokenOperationAddon } from './blocks/impact-addon.js'; +import { InformationBlock } from './blocks/information-block.js'; +import { MintBlock } from './blocks/mint-block.js'; +import { MultiSignBlock } from './blocks/multi-sign-block.js'; +import { PaginationAddon } from './blocks/pagination-addon.js'; +import { PolicyRolesBlock } from './blocks/policy-roles.js'; +import { ReassigningBlock } from './blocks/reassigning.block.js'; +import { ReportBlock } from './blocks/report-block.js'; +import { ReportItemBlock } from './blocks/report-item-block.js'; +import { RequestVcDocumentBlock } from './blocks/request-vc-document-block.js'; +import { RetirementBlock } from './blocks/retirement-block.js'; +import { RevokeBlock } from './blocks/revoke-block.js'; +import { RevocationBlock } from './blocks/revocation-block.js'; +import { SelectiveAttributes } from './blocks/selective-attributes-addon.js'; +import { SendToGuardianBlock } from './blocks/send-to-guardian-block.js'; +import { SetRelationshipsBlock } from './blocks/set-relationships-block.js'; +import { SplitBlock } from './blocks/split-block.js'; +import { InterfaceStepBlock } from './blocks/step-block.js'; +import { SwitchBlock } from './blocks/switch-block.js'; +import { TimerBlock } from './blocks/timer-block.js'; +import { TokenActionBlock } from './blocks/token-action-block.js'; +import { TokenConfirmationBlock } from './blocks/token-confirmation-block.js'; +import { ModuleValidator } from './module-validator.js'; +import { ModuleBlock } from './blocks/module.js'; +import { TagsManagerBlock } from './blocks/tag-manager.js'; +import { ExternalTopicBlock } from './blocks/external-topic-block.js'; +import { MessagesReportBlock } from './blocks/messages-report-block.js'; +import { NotificationBlock } from './blocks/notification.block.js'; import { ISchema, SchemaField, SchemaHelper } from '@guardian/interfaces'; -import { ToolValidator } from './tool-validator'; -import { ToolBlock } from './blocks/tool'; -import { ExtractDataBlock } from './blocks/extract-data'; +import { ToolValidator } from './tool-validator.js'; +import { ToolBlock } from './blocks/tool.js'; +import { ExtractDataBlock } from './blocks/extract-data.js'; export const validators = [ InterfaceDocumentActionBlock, diff --git a/guardian-service/src/policy-engine/block-validators/blocks/action-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/action-block.ts index a2d5b529f9..6505cc5323 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/action-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/action-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/aggregate-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/aggregate-block.ts index 4ab699a84d..37586f5b11 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/aggregate-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/aggregate-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Aggregate block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/button-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/button-block.ts index 2cc1ae88bb..5582c4b0e1 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/button-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/button-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document Buttons with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/calculate-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/calculate-block.ts index c571ddfc12..78ff671625 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/calculate-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/calculate-block.ts @@ -1,8 +1,8 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CalculateMathAddon } from './calculate-math-addon'; -import { CalculateMathVariables } from './calculate-math-variables'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CalculateMathAddon } from './calculate-math-addon.js'; +import { CalculateMathVariables } from './calculate-math-variables.js'; import { Schema } from '@guardian/interfaces'; -import { CommonBlock } from './common'; +import { CommonBlock } from './common.js'; /** * Calculate block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts index 4628021d5e..47b64d39f6 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts b/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts index a09746b8e0..49bdd3e9fc 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math Variables diff --git a/guardian-service/src/policy-engine/block-validators/blocks/common.ts b/guardian-service/src/policy-engine/block-validators/blocks/common.ts index d4435d8b1f..44b0e2f47d 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/common.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/common.ts @@ -1,4 +1,4 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; /** * Common block @@ -25,4 +25,4 @@ export class CommonBlock { } return true; } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/container-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/container-block.ts index 50e3b1bc14..62367944b7 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/container-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/container-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Container block with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/create-token-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/create-token-block.ts index 174b339b70..b8aae2a36f 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/create-token-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/create-token-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Create Token block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts index 9984d8d259..c409df0595 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Custom logic block @@ -24,4 +24,4 @@ export class CustomLogicBlock { ); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/document-validator-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/document-validator-block.ts index 5939322b2b..bf419d3077 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/document-validator-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/document-validator-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document Validator diff --git a/guardian-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts index 14412542e8..93925368bd 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Documents source addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/documents-source.ts b/guardian-service/src/policy-engine/block-validators/blocks/documents-source.ts index 9817b10ef5..cd6baa7157 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/documents-source.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/documents-source.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document source block with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/external-data-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/external-data-block.ts index e52075049f..f28f2ce178 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/external-data-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/external-data-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * External data block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/external-topic-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/external-topic-block.ts index f4c0466acc..4648cf8940 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/external-topic-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/external-topic-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * External topic block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/extract-data.ts b/guardian-service/src/policy-engine/block-validators/blocks/extract-data.ts index 0cfcef2994..285ae4db9f 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/extract-data.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/extract-data.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts index 6d94a66691..61168cd108 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Filters addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/group-manager.ts b/guardian-service/src/policy-engine/block-validators/blocks/group-manager.ts index 3d3020d86d..c0a61eebee 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/group-manager.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/group-manager.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/history-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/history-addon.ts index e3af9943c3..11fe649dd7 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/history-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/history-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * History Addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/http-request-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/http-request-block.ts index fe8881f6f4..6a76108c99 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/http-request-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/http-request-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Http request block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/impact-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/impact-addon.ts index 09e74a4049..4b670903be 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/impact-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/impact-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp, PropertyValidator } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp, PropertyValidator } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/information-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/information-block.ts index 437e3b05ff..8611fc5f32 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/information-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/information-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/messages-report-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/messages-report-block.ts index 756a50e83b..f2e6216383 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/messages-report-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/messages-report-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Report block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/mint-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/mint-block.ts index a18476d696..293166e8af 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/mint-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/mint-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Mint block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/module.ts b/guardian-service/src/policy-engine/block-validators/blocks/module.ts index 3ab497a290..92c1755b94 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/module.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/module.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts index 7970be474e..dbebc219bd 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Switch block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/notification.block.ts b/guardian-service/src/policy-engine/block-validators/blocks/notification.block.ts index 390dabebeb..e941964384 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/notification.block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/notification.block.ts @@ -1,6 +1,6 @@ import { NotificationType, UserOption } from '@guardian/interfaces'; -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Notification Block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/pagination-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/pagination-addon.ts index cb3e698137..6cf632b414 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/pagination-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/pagination-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Pagination addon diff --git a/guardian-service/src/policy-engine/block-validators/blocks/policy-roles.ts b/guardian-service/src/policy-engine/block-validators/blocks/policy-roles.ts index c315cfd23d..6e520e68b0 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/policy-roles.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/policy-roles.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/reassigning.block.ts b/guardian-service/src/policy-engine/block-validators/blocks/reassigning.block.ts index 5640f4e3ba..7eec0d67e5 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/reassigning.block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/reassigning.block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Reassigning block @@ -24,4 +24,4 @@ export class ReassigningBlock { ); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/report-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/report-block.ts index 55f924a8d6..9a9449ac7b 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/report-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/report-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Report block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/report-item-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/report-item-block.ts index 8f7c5e659f..1feedb5193 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/report-item-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/report-item-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Report item block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts index 1c54909e50..17854d2fc0 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Request VC document block @@ -28,4 +28,4 @@ export class RequestVcDocumentBlock { validator.addError(`Unhandled exception ${validator.getErrorMessage(error)}`); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/retirement-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/retirement-block.ts index 0726411209..e46cead5c6 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/retirement-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/retirement-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Retirement block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/revocation-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/revocation-block.ts index 527bb12f00..2d382ab447 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/revocation-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/revocation-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Revoke document action with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/revoke-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/revoke-block.ts index ae6af7788d..8d3b226faa 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/revoke-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/revoke-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Revoke document action with UI diff --git a/guardian-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts b/guardian-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts index 81027a4cf5..52077d8553 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Selective Attributes diff --git a/guardian-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts index d8490cdf8c..6c8f59bcc0 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Send to guardian @@ -42,4 +42,4 @@ export class SendToGuardianBlock { validator.addError(`Unhandled exception ${validator.getErrorMessage(error)}`); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts index 7bbefda878..355847807e 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Set document relationships action diff --git a/guardian-service/src/policy-engine/block-validators/blocks/split-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/split-block.ts index b6879f5919..f67a87c422 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/split-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/split-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Split block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/step-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/step-block.ts index 6a755e464b..2348860a19 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/step-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/step-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Step block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/switch-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/switch-block.ts index 18eb437c42..429f6bba2b 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/switch-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/switch-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Switch block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/tag-manager.ts b/guardian-service/src/policy-engine/block-validators/blocks/tag-manager.ts index c43c0f8807..7766f007e6 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/tag-manager.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/tag-manager.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Container block with UI @@ -24,4 +24,4 @@ export class TagsManagerBlock { ); } } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/blocks/timer-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/timer-block.ts index dee5d2e8a5..1dc7d43341 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/timer-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/timer-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Timer block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/token-action-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/token-action-block.ts index d58b27c1d7..c0f284513a 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/token-action-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/token-action-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts b/guardian-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts index 524b650d78..87a8104158 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/guardian-service/src/policy-engine/block-validators/blocks/tool.ts b/guardian-service/src/policy-engine/block-validators/blocks/tool.ts index 78d92f0f70..06853a441b 100644 --- a/guardian-service/src/policy-engine/block-validators/blocks/tool.ts +++ b/guardian-service/src/policy-engine/block-validators/blocks/tool.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/guardian-service/src/policy-engine/block-validators/index.ts b/guardian-service/src/policy-engine/block-validators/index.ts index d80c833861..32dd5a61a6 100644 --- a/guardian-service/src/policy-engine/block-validators/index.ts +++ b/guardian-service/src/policy-engine/block-validators/index.ts @@ -1,7 +1,7 @@ -export { PolicyValidator, } from './policy-validator'; -export { BlockValidator } from './block-validator'; -export { PropertyValidator } from './property-validator'; -export { ISerializedErrors } from './interfaces/serialized-errors.interface'; -export { IBlockErrors } from './interfaces/block-errors.interface'; -export { IBlockProp } from './interfaces/block-prop.interface'; -export { IModulesErrors } from './interfaces/modules-errors.interface'; +export { PolicyValidator, } from './policy-validator.js'; +export { BlockValidator } from './block-validator.js'; +export { PropertyValidator } from './property-validator.js'; +export { ISerializedErrors } from './interfaces/serialized-errors.interface.js'; +export { IBlockErrors } from './interfaces/block-errors.interface.js'; +export { IBlockProp } from './interfaces/block-prop.interface.js'; +export { IModulesErrors } from './interfaces/modules-errors.interface.js'; diff --git a/guardian-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts b/guardian-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts index 442d31409a..13e12f24af 100644 --- a/guardian-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts +++ b/guardian-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts @@ -1,4 +1,4 @@ -import { IBlockErrors } from './block-errors.interface'; +import { IBlockErrors } from './block-errors.interface.js'; /** * Module errors diff --git a/guardian-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts b/guardian-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts index 7885f2b17b..b15e00ed7c 100644 --- a/guardian-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts +++ b/guardian-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts @@ -1,5 +1,5 @@ -import { IBlockErrors } from './block-errors.interface'; -import { IModulesErrors } from './modules-errors.interface'; +import { IBlockErrors } from './block-errors.interface.js'; +import { IModulesErrors } from './modules-errors.interface.js'; /** * Serialized errors @@ -29,4 +29,4 @@ export interface ISerializedErrors { * Is valid */ isValid: boolean; -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/module-validator.ts b/guardian-service/src/policy-engine/block-validators/module-validator.ts index 66df4bfc68..fb15b544ca 100644 --- a/guardian-service/src/policy-engine/block-validators/module-validator.ts +++ b/guardian-service/src/policy-engine/block-validators/module-validator.ts @@ -1,12 +1,12 @@ /** * Module Validator */ -import { BlockValidator } from './block-validator'; -import { IModulesErrors } from './interfaces/modules-errors.interface'; +import { BlockValidator } from './block-validator.js'; +import { IModulesErrors } from './interfaces/modules-errors.interface.js'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; import { DatabaseServer } from '@guardian/common'; -import { ToolValidator } from './tool-validator'; -import { SchemaValidator } from './schema-validator'; +import { ToolValidator } from './tool-validator.js'; +import { SchemaValidator } from './schema-validator.js'; /** * Module Validator diff --git a/guardian-service/src/policy-engine/block-validators/policy-validator.ts b/guardian-service/src/policy-engine/block-validators/policy-validator.ts index 24887fb0fc..a77a8bb87c 100644 --- a/guardian-service/src/policy-engine/block-validators/policy-validator.ts +++ b/guardian-service/src/policy-engine/block-validators/policy-validator.ts @@ -1,10 +1,10 @@ import { DatabaseServer, Policy } from '@guardian/common'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; -import { BlockValidator } from './block-validator'; -import { ModuleValidator } from './module-validator'; -import { ISerializedErrors } from './interfaces/serialized-errors.interface'; -import { ToolValidator } from './tool-validator'; -import { SchemaValidator } from './schema-validator'; +import { BlockValidator } from './block-validator.js'; +import { ModuleValidator } from './module-validator.js'; +import { ISerializedErrors } from './interfaces/serialized-errors.interface.js'; +import { ToolValidator } from './tool-validator.js'; +import { SchemaValidator } from './schema-validator.js'; /** * Policy Validator diff --git a/guardian-service/src/policy-engine/block-validators/schema-validator.ts b/guardian-service/src/policy-engine/block-validators/schema-validator.ts index 4840082bac..1a5d997ad3 100644 --- a/guardian-service/src/policy-engine/block-validators/schema-validator.ts +++ b/guardian-service/src/policy-engine/block-validators/schema-validator.ts @@ -3,7 +3,7 @@ */ import { ISchema, SchemaCategory } from '@guardian/interfaces'; import { DatabaseServer, Schema } from '@guardian/common'; -import { IBlockErrors } from './interfaces/block-errors.interface'; +import { IBlockErrors } from './interfaces/block-errors.interface.js'; /** * Schema Validator @@ -196,4 +196,4 @@ export class SchemaValidator { public static fromSystem(name: string): SchemaValidator { return new SchemaValidator(name, null, true); } -} \ No newline at end of file +} diff --git a/guardian-service/src/policy-engine/block-validators/tool-validator.ts b/guardian-service/src/policy-engine/block-validators/tool-validator.ts index c399203d6e..07d9393c81 100644 --- a/guardian-service/src/policy-engine/block-validators/tool-validator.ts +++ b/guardian-service/src/policy-engine/block-validators/tool-validator.ts @@ -1,8 +1,8 @@ import { DatabaseServer, PolicyTool } from '@guardian/common'; -import { BlockValidator } from './block-validator'; -import { IModulesErrors } from './interfaces/modules-errors.interface'; +import { BlockValidator } from './block-validator.js'; +import { IModulesErrors } from './interfaces/modules-errors.interface.js'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; -import { SchemaValidator } from './schema-validator'; +import { SchemaValidator } from './schema-validator.js'; /** * Policy Validator diff --git a/guardian-service/src/policy-engine/helpers/policy-data-migrator.ts b/guardian-service/src/policy-engine/helpers/policy-data-migrator.ts index 09e453218a..8a6ab4008d 100644 --- a/guardian-service/src/policy-engine/helpers/policy-data-migrator.ts +++ b/guardian-service/src/policy-engine/helpers/policy-data-migrator.ts @@ -1,9 +1,28 @@ import { + AggregateVC, + BaseEntity, + BlockState, + Contract, + ContractMessage, + DataBaseHelper, DatabaseServer, + DidDocument, + DocumentState, + IAuthUser, KeyType, MessageAction, MessageServer, + MintRequest, + MintTransaction, + MultiDocuments, + PolicyRoles, + RetirePool, + RoleMessage, + SplitDocuments, + Token, + Topic, TopicConfig, + TopicHelper, Users, VCMessage, VPMessage, @@ -13,315 +32,1350 @@ import { VpDocument, VpDocumentDefinition, Wallet, + Workers, + findAllEntities, } from '@guardian/common'; import { + ContractAPI, + ContractType, DocumentStatus, MigrationConfig, + PolicyType, Schema, SchemaCategory, SchemaHelper, + TopicType, + ISignOptions, } from '@guardian/interfaces'; -import { INotifier } from '@helpers/notifier'; +import { INotifier } from '../../helpers/notifier.js'; +import { BlockStateLoader } from './policy-data/loaders/block-state.loader.js'; +import { RolesLoader } from './policy-data/loaders/roles.loader.js'; +import { DidLoader } from './policy-data/loaders/did.loader.js'; +import { MintRequestLoader } from './policy-data/loaders/mint-request.loader.js'; +import { MintTransactionLoader } from './policy-data/loaders/mint-transaction.loader.js'; +import { MultiSignDocumentLoader } from './policy-data/loaders/multi-sign-document.loader.js'; +import { + AggregateVCLoader, + DocumentStateLoader, +} from './policy-data/loaders/index.js'; +import { SplitDocumentLoader } from './policy-data/loaders/split-document.loader.js'; +import { TokensLoader } from './policy-data/loaders/tokens.loader.js'; +import { RetirePoolLoader } from './policy-data/loaders/retire-pool.loader.js'; +import { createHederaToken } from '../../api/token.service.js'; +import { createContract } from '../../api/helpers/contract-api.js'; +import { setPoolContract } from '../../api/contract.service.js'; + +/** + * Document error + */ +export interface DocumentError { + id?: string; + message?: string; +} +/** + * Policy data migrator + */ export class PolicyDataMigrator { - constructor( + /** + * Vc message identifiers mapping + */ + private readonly vcMessageIds: Map = new Map(); + + /** + * VP identifiers mapping + */ + private readonly vpIds = new Map(); + + /** + * VC identifiers mapping + */ + private readonly vcIds = new Map(); + + /** + * Created tokens + */ + private readonly _createdTokens = new Map(); + + /** + * Created wipe contract identifier + */ + private _createdWipeContractId; + + /** + * Database server instance + */ + private readonly _db!: DatabaseServer; + + /** + * Message server instance + */ + private readonly _ms!: MessageServer; + + private constructor( + private readonly _root: IAuthUser, + private readonly _rootKey: string, + private readonly _signOptions: ISignOptions, private readonly _users: Users, - private readonly _wallet: Wallet, + private readonly _owner: string, + private readonly _policyId: string, + private readonly _policyTopicId: string, + private readonly _policyInstanceTopic: TopicConfig, + private readonly _oldPolicyOwner: string, + private readonly _oldPolicyTopicId: string, + private readonly _oldUserTopicId: string, + private readonly _userTopic: Topic, + private readonly _roles: any, + private readonly _groups: any, + private readonly _schemas: any, + private readonly _blocks: any, + private readonly _tokens: any, + private readonly _tokensMap: any, + private readonly _editedVCs: any, + private readonly _dids: DidDocument[], + private readonly _dryRunId?: string, private readonly _notifier?: INotifier - ) { } + ) { + this._db = new DatabaseServer(_dryRunId); + this._ms = new MessageServer( + _root.hederaAccountId, + _rootKey, + _signOptions, + _dryRunId, + ); + for (const [oldTokenId, newTokenId] of Object.entries( + this._tokensMap + )) { + this._createdTokens.set(oldTokenId, newTokenId); + } + } - async migratePolicyData(owner: string, migrationConfig: MigrationConfig) { - if (!owner) { - throw new Error('Invalid owner'); + /** + * Migrate policy data + * @param owner Owner + * @param migrationConfig Migration config + * @param notifier Notifier + * @returns Migration errors + */ + static async migrate( + owner: string, + migrationConfig: MigrationConfig, + notifier?: INotifier + ) { + try { + const { + policies, + vcs, + vps, + schemas, + groups, + roles, + tokens, + tokensMap, + blocks, + editedVCs, + migrateState, + migrateRetirePools, + retireContractId, + } = migrationConfig; + const { src, dst } = policies; + const users = new Users(); + const userTopic = await DatabaseServer.getTopicByType( + owner, + TopicType.UserTopic + ); + let policyUsers; + let policyRoles; + let policyStates; + let oldUserTopic; + let srcModel; + let srcSystemSchemas; + let srcVCs; + let srcRoleVcs; + let srcVPs; + let srcDids; + let srcMintRequests; + let srcMintTransactions; + let srcMultiDocuments; + let srcAggregateVCs; + let srcSplitDocuments; + let srcDocumentStates; + let srcTokens; + let srcRetirePools; + + const userPolicy = await DatabaseServer.getPolicyCache({ + id: src, + userId: owner, + }); + if (userPolicy) { + srcModel = userPolicy.policy; + oldUserTopic = userPolicy.userTopic.topicId; + policyUsers = userPolicy.users; + policyRoles = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'roles', + cachePolicyId: userPolicy.id, + }); + policyStates = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'states', + cachePolicyId: userPolicy.id, + }); + srcSystemSchemas = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'schemas', + cachePolicyId: userPolicy.id, + category: SchemaCategory.SYSTEM, + }); + srcVCs = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'vcs', + cachePolicyId: userPolicy.id, + oldId: { $in: vcs }, + }); + srcRoleVcs = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'vcs', + cachePolicyId: userPolicy.id, + schema: '#UserRole', + }); + srcVPs = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'vps', + cachePolicyId: userPolicy.id, + oldId: { $in: vps }, + }); + srcDids = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'dids', + cachePolicyId: userPolicy.id, + }); + srcMintRequests = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'mintRequests', + cachePolicyId: userPolicy.id, + vpMessageId: { $in: srcVPs.map((item) => item.messageId) }, + }); + srcMintTransactions = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'mintTransactions', + cachePolicyId: userPolicy.id, + mintRequestId: { + $in: srcMintRequests.map((item) => item.id), + }, + }); + srcMultiDocuments = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'multiDocuments', + cachePolicyId: userPolicy.id, + documentId: { $in: vcs }, + }); + srcAggregateVCs = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'aggregateVCs', + cachePolicyId: userPolicy.id, + }); + srcSplitDocuments = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'splitDocuments', + cachePolicyId: userPolicy.id, + }); + srcDocumentStates = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'documentStates', + cachePolicyId: userPolicy.id, + documentId: { $in: vcs }, + }); + srcTokens = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'tokens', + cachePolicyId: userPolicy.id, + }); + srcRetirePools = await DatabaseServer.getPolicyCacheData({ + cacheCollection: 'retirePools', + cachePolicyId: userPolicy.id, + }); + } else { + srcModel = await DatabaseServer.getPolicy({ + id: src, + owner, + }); + if (!srcModel) { + throw new Error(`Can't find source policy`); + } + policyUsers = await users.getUsersBySrId(owner); + policyRoles = await new RolesLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + policyStates = await new BlockStateLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + srcSystemSchemas = await DatabaseServer.getSchemas({ + category: SchemaCategory.SYSTEM, + topicId: srcModel.topicId, + }); + srcVCs = await DatabaseServer.getVCs({ + policyId: src, + id: { $in: vcs }, + }); + srcRoleVcs = await DatabaseServer.getVCs({ + policyId: src, + schema: '#UserRole', + }); + srcVPs = await DatabaseServer.getVPs({ + policyId: src, + id: { $in: vps }, + }); + srcDids = await new DidLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + srcMintRequests = await new MintRequestLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(srcVPs.map((item) => item.messageId)); + srcMintTransactions = await new MintTransactionLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(srcMintRequests.map((item) => item.id)); + srcMultiDocuments = await new MultiSignDocumentLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(vcs); + srcAggregateVCs = await new AggregateVCLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + srcSplitDocuments = await new SplitDocumentLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + srcDocumentStates = await new DocumentStateLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(vcs); + srcTokens = await new TokensLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get(); + const policyTokens = findAllEntities(srcModel.config, [ + 'tokenId', + ]); + srcRetirePools = await new RetirePoolLoader( + srcModel.id, + srcModel.topicId, + srcModel.instanceTopicId, + srcModel.status === PolicyType.DRY_RUN + ).get( + srcTokens.map((token) => token.tokenId).concat(policyTokens) + ); + } + + const dstModel = await DatabaseServer.getPolicy({ + id: dst, + owner, + }); + if (!dstModel) { + throw new Error(`Can't find destination policy`); + } + + const dstSystemSchemas = await DatabaseServer.getSchemas({ + category: SchemaCategory.SYSTEM, + topicId: dstModel.topicId, + }); + for (const schema of srcSystemSchemas) { + const dstSchema = dstSystemSchemas.find( + (item) => item.entity === schema.entity + ); + if (dstSchema) { + schemas[schema.iri] = dstSchema.iri; + } + } + + const wallet = new Wallet(); + const root = await users.getUserById(owner); + const rootKey = await wallet.getKey( + root.walletToken, + KeyType.KEY, + owner + ); + const signOptions = await wallet.getUserSignOptions(root); + + const instanceTopicConfig = await TopicConfig.fromObject( + await new DatabaseServer( + dstModel.status === PolicyType.DRY_RUN + ? dstModel.id + : undefined + ).getTopic({ + topicId: dstModel.instanceTopicId, + }) + ); + + const policyDataMigrator = new PolicyDataMigrator( + root, + rootKey, + signOptions, + users, + owner, + dst, + dstModel.topicId, + instanceTopicConfig, + srcModel.owner, + srcModel.topicId, + oldUserTopic || userTopic.topicId, + userTopic, + roles, + groups, + schemas, + blocks || {}, + tokens || {}, + tokensMap || {}, + editedVCs || {}, + srcDids, + dstModel.status === PolicyType.DRY_RUN ? dstModel.id : null, + notifier + ); + const migrationErrors = await policyDataMigrator._migrateData( + srcVCs, + srcVPs, + policyUsers, + srcRoleVcs, + policyRoles, + policyStates, + srcMintRequests, + srcMintTransactions, + srcMultiDocuments, + srcAggregateVCs, + srcSplitDocuments, + srcDocumentStates, + srcTokens, + srcRetirePools, + migrateState, + migrateRetirePools, + retireContractId + ); + + return migrationErrors; + } catch (error) { + console.log(error); + throw error; } - if (!migrationConfig) { - throw new Error('Invalid migration config'); + } + + /** + * Migrate policy data + * @param vcs VCs + * @param vps VPs + * @param users Users + * @param roleVcs Role VCs + * @param roles Roles + * @param states States + * @param mintRequests Mint requests + * @param mintTransactions Mint transactions + * @param multiSignDocuments Multi sign documents + * @param aggregateVCs Aggregate VCs + * @param splitDocuments Split documents + * @param documentStates Document states + * @param migrateState Migrate state + * @returns Migration errors + */ + private async _migrateData( + vcs: VcDocument[], + vps: VpDocument[], + users: { + username: string; + did: string; + hederaAccountId: string; + hederaAccountKey?: string; + }[], + roleVcs: VcDocument[], + roles: PolicyRoles[], + states: BlockState[], + mintRequests: MintRequest[], + mintTransactions: MintTransaction[], + multiSignDocuments: MultiDocuments[], + aggregateVCs: AggregateVC[], + splitDocuments: SplitDocuments[], + documentStates: DocumentState[], + dynamicTokens: Token[], + retirePools: RetirePool[], + migrateState = false, + migrateRetirePools = false, + retireContractId?: string + ) { + const errors = new Array(); + this._notifier?.start(`Migrate policy state`); + if (migrateState) { + if (this._dryRunId) { + await this._createVirtualUsers(users); + } + await this._migratePolicyRoles(roles); + await this._migrateDocument( + roleVcs, + this._migrateRoleVc.bind(this), + this._db.saveVC.bind(this._db), + errors + ); + await this._migratePolicyStates(states); + } else { + this._notifier?.info('Migrate policy state skipped'); } + this._notifier?.completedAndStart(`Migrate ${vcs.length} VC documents`); + await this._migrateDocument( + vcs, + (vc: VcDocument) => + this._migrateVcDocument(vc, vcs, roles, dynamicTokens, errors), + this._db.saveVC.bind(this._db), + errors + ); + if (migrateState) { + await this._migrateDocument( + multiSignDocuments, + this._migrateMultiSignDocument.bind(this), + this._db.setMultiSigDocument.bind(this._db), + errors + ); + await this._migrateDocument( + documentStates, + this._migrateDocumentState.bind(this), + this._db.saveDocumentState.bind(this._db), + errors + ); + await this._migrateDocument( + aggregateVCs, + this._migrateAggregateVC.bind(this), + async (doc) => { + await this._db.createAggregateDocuments( + doc as any, + doc.blockId + ); + }, + errors + ); + await this._migrateDocument( + splitDocuments, + this._migrateSplitDocument.bind(this), + async (doc) => { + await this._db.setResidue(doc as any); + }, + errors + ); + } + this._notifier?.completedAndStart(`Migrate ${vps.length} VP documents`); + await this._migrateDocument( + vps, + this._migrateVpDocument.bind(this), + this._db.saveVP.bind(this._db), + errors + ); + await this._migrateMintRequests(mintRequests, mintTransactions); - const { policies, vcs, vps, schemas, groups, roles } = migrationConfig; - const { src, dst } = policies; + if (migrateRetirePools && migrateState) { + await this.migrateTokenPools(retireContractId, retirePools, errors); + } + return errors; + } - const srcModel = await DatabaseServer.getPolicy({ - id: src, - owner, - }); - if (!srcModel) { - throw new Error(`Can't find source policy`); + /** + * Migrate token pools + * @param contractId Contract identifier + * @param pools Pools + * @param errors Errors + */ + async migrateTokenPools( + contractId: string, + pools: RetirePool[], + errors: DocumentError[] + ) { + if (!contractId) { + return; + } + for (const pool of pools) { + try { + await setPoolContract( + new Workers(), + contractId, + this._root.hederaAccountId, + this._rootKey, + this.replacePoolTokens(pool.tokens), + pool.immediately + ); + } catch (error) { + errors.push({ + id: pool.id, + message: error?.toString(), + }); + } } + } - const dstModel = await DatabaseServer.getPolicy({ - id: dst, - owner, - }); - if (!dstModel) { - throw new Error(`Can't find destination policy`); + /** + * Replace pool tokens + * @param tokens Tokens + * @returns Replaces tokens + */ + replacePoolTokens(tokens: { token: string }[]) { + const result = []; + for (const token of tokens) { + const newTokenId = + this._tokensMap.get(token.token) || + this._createdTokens.get(token.token); + if (!newTokenId) { + continue; + } + result.push(Object.assign(token, { token: newTokenId })); } - const srcSystemSchemas = await DatabaseServer.getSchemas({ - category: SchemaCategory.SYSTEM, - topicId: srcModel.topicId, - }); - const dstSystemSchemas = await DatabaseServer.getSchemas({ - category: SchemaCategory.SYSTEM, - topicId: dstModel.topicId, - }); - for (const schema of srcSystemSchemas) { - const dstSchema = dstSystemSchemas.find( - (item) => item.entity === schema.entity + return result; + } + + /** + * Migrate tokens + * @param dynamicTokens Dynamic tokens + * @param tokenTemplates Token templates + */ + async migrateTokenTemplates( + dynamicTokens: Token[], + tokenTemplates: { [key: string]: string } + ) { + const result: any = {}; + for (const [tokenTemplate, tokenId] of Object.entries(tokenTemplates)) { + const newTokenTemplate = this._tokens[tokenTemplate]; + if (!newTokenTemplate) { + continue; + } + + const existingToken = await DatabaseServer.getTokenById(tokenId); + if (existingToken) { + result[newTokenTemplate] = tokenId; + delete existingToken._id; + delete existingToken.id; + existingToken.policyId = this._policyId; + await new DataBaseHelper(Token).save(existingToken); + continue; + } + const tokenConfig = dynamicTokens.find( + (item) => item.tokenId === tokenId ); - if (dstSchema) { - schemas[schema.iri] = dstSchema.iri; + if (!tokenConfig) { + continue; } + + tokenConfig.wipeContractId = await this.createWipeContract( + tokenConfig.wipeContractId + ); + + const tokenObject = await createHederaToken( + tokenConfig, + Object.assign(this._root, { + hederaAccountKey: this._rootKey, + }) as any + ); + tokenObject.policyId = this._policyId; + await new DataBaseHelper(Token).save(tokenObject); + result[newTokenTemplate] = tokenObject.tokenId; + this._createdTokens.set(tokenId, tokenObject.tokenId); } + return result; + } - const srcVCs = await DatabaseServer.getVCs({ - policyId: src, - id: { $in: vcs }, - }); - const srcVPs = await DatabaseServer.getVPs({ - policyId: src, - id: { $in: vps }, - }); - const publishedDocuments = new Map(); - const errors = []; - - const republishDocument = async ( - doc: VcDocument | (VpDocument & { group?: string }) - ) => { - if (!doc) { - return doc; + /** + * Create wipe contract + * @param wipeContractId Wipe contract identifier + * @returns Wipe contract identifier + */ + async createWipeContract(wipeContractId: string) { + const existingWipeContract = await new DataBaseHelper(Contract).findOne( + { + type: ContractType.WIPE, + wipeContractId, + owner: this._owner, } - doc.relationships = doc.relationships || []; - for (let i = 0; i < doc.relationships.length; i++) { - const relationship = doc.relationships[i]; - let republishedDocument = publishedDocuments.get(relationship); - if (!republishedDocument) { - const rs = srcVCs.find( - (item) => item.messageId === relationship - ); - if (!rs) { - if (doc instanceof VcDocument) { - doc.relationships.splice(i, 1); - i--; - } - continue; - } - republishedDocument = await republishDocument(rs); - } - if (republishedDocument) { - doc.relationships[i] = republishedDocument.messageId; - } else { - if (doc instanceof VcDocument) { - doc.relationships.splice(i, 1); - i--; - } + ); + if (existingWipeContract) { + return wipeContractId; + } + + if (this._createdWipeContractId) { + return this._createdWipeContractId; + } + + const topicHelper = new TopicHelper( + this._root.hederaAccountId, + this._rootKey, + this._signOptions, + this._dryRunId + ); + const topic = await topicHelper.create( + { + type: TopicType.ContractTopic, + name: TopicType.ContractTopic, + description: TopicType.ContractTopic, + owner: this._owner, + policyId: null, + policyUUID: null, + }, + { + admin: true, + submit: false, + } + ); + + const contractId = await createContract( + ContractAPI.CREATE_CONTRACT, + new Workers(), + ContractType.WIPE, + this._root.hederaAccountId, + this._rootKey, + topic.topicId + ); + + await topic.saveKeys(); + await DatabaseServer.saveTopic(topic.toObject()); + + const contract = await new DataBaseHelper(Contract).save({ + contractId, + owner: this._owner, + description: `Migration ${this._policyId} wipe contract`, + permissions: 15, + type: ContractType.WIPE, + topicId: topic.topicId, + wipeContractIds: [], + }); + + const contractMessage = new ContractMessage( + MessageAction.CreateContract + ); + contractMessage.setDocument(contract); + await this._ms.setTopicObject(topic).sendMessage(contractMessage); + + this._createdWipeContractId = contract.contractId; + return this._createdWipeContractId; + } + + /** + * Migrate document state + * @param documentState Document state + * @returns Document state + */ + private async _migrateDocumentState(documentState: DocumentState) { + const vc = this.vcIds.get(documentState.documentId); + if (!vc) { + return null; + } + documentState.documentId = vc.id; + return documentState; + } + + /** + * Migrate split document + * @param doc Split document + * @returns Split document + */ + private async _migrateSplitDocument(doc: SplitDocuments) { + if (!this._blocks[doc.blockId]) { + return null; + } + + doc.userId = await this._replaceDidTopicId(doc.userId); + doc.policyId = this._policyId; + + const _vcHelper = new VcHelper(); + const didDocument = await _vcHelper.loadDidDocument(this._owner); + const svc = await _vcHelper.issueVerifiableCredential( + VcDocumentDefinition.fromJsonTree(doc.document), + didDocument, + null + ); + + doc.document = svc.toJsonTree(); + + return doc; + } + + /** + * Migrate aggregate VC + * @param doc Aggregate VC + * @returns Aggregate VC + */ + async _migrateAggregateVC(doc: AggregateVC) { + if (!this._blocks[doc.blockId]) { + return null; + } + const vc = this.vcIds.get(doc.sourceDocumentId.toString()); + if (!vc) { + return null; + } + doc.blockId = this._blocks[doc.blockId]; + doc.sourceDocumentId = doc._id; + return Object.assign(doc, vc); + } + + /** + * Migrate multi sign document + * @param doc Multi document + * @returns Multi document + */ + async _migrateMultiSignDocument(doc: MultiDocuments) { + doc.userId = await this._replaceDidTopicId(doc.userId); + doc.did = await this._replaceDidTopicId(doc.did); + + const vc = this.vcIds.get(doc.documentId); + if (!vc) { + return null; + } + + doc.documentId = vc.id; + + const _vcHelper = new VcHelper(); + const didDocument = await _vcHelper.loadDidDocument(this._owner); + const svc = await _vcHelper.issueVerifiableCredential( + VcDocumentDefinition.fromJsonTree(doc.document), + didDocument, + null + ); + + doc.document = svc.toJsonTree(); + return doc; + } + + /** + * Migrate DID document + * @param did did + * @returns did + */ + private async _migrateDidDocument(did: string) { + const didObj = this._dids.find((item) => item.did === did); + if (!didObj) { + return did; + } + const existingDid = await this._db.getDidDocument(didObj.did); + if (existingDid) { + return did; + } + this._notifier?.info(`Migrating DID ${did}`); + await this._db.saveDid(didObj); + return did; + } + + /** + * Migrate document wrapper + * @param documents Documents + * @param migrateFn Migrate function + * @param saveFn Save function + * @param errors Errors + */ + private async _migrateDocument( + documents: T[], + migrateFn: (document: T) => Promise, + saveFn: (document: Partial) => Promise, + errors: DocumentError[] + ) { + const notEmptyDocuments = (documents as any[]).filter((item) => !!item); + for (const document of notEmptyDocuments) { + try { + const newDocument = await migrateFn(document); + if (!newDocument) { continue; } + delete newDocument.id; + delete newDocument._id; + delete newDocument.createDate; + delete newDocument.updateDate; + await saveFn(newDocument); + } catch (error) { + console.log(error); + errors.push({ + id: document?.id, + message: error?.toString(), + }); } + } + } - if (publishedDocuments.has(doc.messageId)) { - return doc; + /** + * Create virtual users + * @param users Users + */ + private async _createVirtualUsers( + users: { + username: string; + did: string; + hederaAccountId: string; + }[] + ) { + for (const user of users) { + user.did = await this._replaceDidTopicId(user.did); + if (user.did === this._owner) { + continue; } - if (doc.messageId) { - publishedDocuments.set(doc.messageId, doc); - } + await DatabaseServer.createVirtualUser( + this._policyId, + user.username, + user.did, + user.hederaAccountId, + null + ); + } + } - const root = await this._users.getUserById(owner); - const rootKey = await this._wallet.getKey( - root.walletToken, - KeyType.KEY, - owner + /** + * Migrate role vc + * @param doc VC + * @returns VC + */ + private async _migrateRoleVc(doc: VcDocument) { + if (!doc) { + return doc; + } + + doc.owner = await this._replaceDidTopicId(doc.owner); + + let role; + if (doc.group) { + const groups = await this._db.getGroupsByUser( + this._policyId, + doc.owner + ); + role = groups.find((group) => group.uuid === doc.group); + doc.group = role?.uuid; + } + + let vc: VcDocumentDefinition; + const schema = await DatabaseServer.getSchema({ + topicId: this._policyTopicId, + iri: this._schemas[doc.schema], + }); + if ( + doc.schema !== schema.iri || + this._policyTopicId !== this._oldPolicyTopicId + ) { + this._notifier?.info(`Resigning VC ${doc.id}`); + const _vcHelper = new VcHelper(); + const didDocument = await _vcHelper.loadDidDocument(this._owner); + const credentialSubject = SchemaHelper.updateObjectContext( + new Schema(schema), + doc.document.credentialSubject[0] ); - const topic = await TopicConfig.fromObject( - await DatabaseServer.getTopicById(dstModel.instanceTopicId), - true + const res = await _vcHelper.verifySubject(credentialSubject); + if (!res.ok) { + throw new Error(res.error.type); + } + vc = await _vcHelper.createVerifiableCredential( + credentialSubject, + didDocument, + null, + { uuid: role?.uuid } ); + doc.hash = vc.toCredentialHash(); + doc.document = vc.toJsonTree(); + doc.schema = schema.iri; + } else { + vc = VcDocumentDefinition.fromJsonTree(doc.document); + } + doc.policyId = this._policyId; - let userRole; - if (doc.group) { - const srcGroup = await DatabaseServer.getGroupByID( - src, - doc.group - ); - const dstUserGroup = await DatabaseServer.getGroupsByUser( - dst, - doc.owner - ); - userRole = dstUserGroup.find( - (item) => - item.groupName === groups[srcGroup.groupName] || - item.role === roles[srcGroup.role] - ); - doc.group = userRole ? userRole.uuid : null; + if (doc.messageId) { + this._notifier?.info(`Publishing VC ${doc.id}`); + + const vcMessage = new RoleMessage(MessageAction.MigrateVC); + vcMessage.setDocument(vc); + if (role) { + vcMessage.setRole(role); } + const relationships = [doc.messageId]; + if (doc.relationships) { + relationships.push(...doc.relationships); + } + vcMessage.setRelationships(relationships); + if (role) { + vcMessage.setUser(role.messageId); + } + const message = vcMessage; + const vcMessageResult = await this._ms + .setTopicObject(this._policyInstanceTopic) + .sendMessage(message, true); + doc.messageId = vcMessageResult.getId(); + doc.topicId = vcMessageResult.getTopicId(); + doc.messageHash = vcMessageResult.toHash(); + this.vcMessageIds.set(doc.messageId, doc); + if (role) { + role.messageId = this.vcMessageIds.get( + role.messageId + ).messageId; + await this._db.setUserInGroup(role); + } + } - if (doc instanceof VcDocument) { - let vc: VcDocumentDefinition; - const schema = await DatabaseServer.getSchema({ - topicId: dstModel.topicId, - iri: schemas[doc.schema], - }); - if (doc.schema !== schema.iri) { - this._notifier?.info(`Resigning VC ${doc.id}`); - - const _vcHelper = new VcHelper(); - const didDocument = await _vcHelper.loadDidDocument(root.did); - const credentialSubject = SchemaHelper.updateObjectContext( - new Schema(schema), - doc.document.credentialSubject[0] - ); - const res = await _vcHelper.verifySubject( - credentialSubject - ); - if (!res.ok) { - errors.push({ - error: res.error.type, - id: doc.id, - }); - return; + return doc; + } + + /** + * Migrate policy states + * @param states States + */ + private async _migratePolicyStates(states: BlockState[]) { + for (const state of states) { + const data = JSON.parse(state.blockState); + if (data.state) { + const dataKeys = Object.keys(data); + for (const key of dataKeys) { + const newKey = await this._replaceDidTopicId(key); + data[newKey] = data[key]; + if (data[newKey] !== data[key]) { + delete data[key]; } - vc = await _vcHelper.createVerifiableCredential( - credentialSubject, - didDocument, - null, - { uuid: doc.document.id } - ); - doc.hash = vc.toCredentialHash(); - doc.document = vc.toJsonTree(); - doc.schema = schema.iri; - } else { - vc = VcDocumentDefinition.fromJsonTree(doc.document); } - doc.policyId = dst; + } - if (doc.messageId) { - this._notifier?.info(`Publishing VC ${doc.id}`); + await this._db.saveBlockState( + this._policyId, + this._blocks[state.blockId], + data + ); + } + } - const messageServer = new MessageServer( - root.hederaAccountId, - rootKey - ); - const vcMessage = new VCMessage(MessageAction.MigrateVC); - vcMessage.setDocument(vc); - vcMessage.setDocumentStatus( - doc.option?.status || DocumentStatus.NEW - ); - vcMessage.setRelationships([ - ...doc.relationships, - doc.messageId, - ]); - if (userRole && schema.category === SchemaCategory.POLICY) { - vcMessage.setUser(userRole.messageId); - } - const message = vcMessage; - const vcMessageResult = await messageServer - .setTopicObject(topic) - .sendMessage(message, true); - doc.messageId = vcMessageResult.getId(); - doc.topicId = vcMessageResult.getTopicId(); - doc.messageHash = vcMessageResult.toHash(); + /** + * Migrate policy roles + * @param roles Roles + */ + private async _migratePolicyRoles(roles: PolicyRoles[]) { + for (const role of roles) { + role.owner = await this._replaceDidTopicId(role.owner); + role.did = await this._replaceDidTopicId(role.did); + if (role.role) { + role.role = this._roles[role.role]; + } + if (role.groupName) { + role.groupName = this._groups[role.groupName]; + } + if (role.username && !this._dryRunId) { + const newUser = await this._users.getUserById(role.did); + if (newUser) { + role.username = newUser.username; } } + if (role.policyId) { + role.policyId = this._policyId; + } - if (doc instanceof VpDocument) { - // tslint:disable-next-line:no-shadowed-variable - const vcs = doc.document.verifiableCredential.map((item) => - VcDocumentDefinition.fromJsonTree(item) - ); - let vpChanged = false; - // tslint:disable-next-line:prefer-for-of - for (let i = 0; i < doc.relationships.length; i++) { - const relationship = doc.relationships[i]; - // tslint:disable-next-line:no-shadowed-variable - const vc = publishedDocuments.get(relationship); - if (vc && vc instanceof VcDocument) { - for (let j = 0; j < vcs.length; j++) { - const element = vcs[j]; - const vcDef = VcDocumentDefinition.fromJsonTree( - vc.document - ); - if ( - element.getId() === vcDef.getId() && - element.toCredentialHash() !== - vcDef.toCredentialHash() - ) { - vpChanged = true; - vcs[j] = vcDef; - } - } - } - } + delete role.id; + delete role._id; - let vp; - if (vpChanged) { - this._notifier?.info(`Resigning VP ${doc.id}`); - const _vcHelper = new VcHelper(); - const didDocument = await _vcHelper.loadDidDocument(root.did); - vp = await _vcHelper.createVerifiablePresentation( - vcs, - didDocument, - null, - { uuid: doc.document.id } + await this._db.setUserInGroup(role); + } + } + + /** + * Replace did topic identifier + * @param did did + * @returns did + */ + private async _replaceDidTopicId(did: string) { + if (!did) { + return did; + } + + if (did === this._oldPolicyOwner) { + return this._owner; + } + + const didParts = did.split('_'); + if (didParts[1] === this._oldUserTopicId) { + didParts[1] = this._userTopic.topicId; + } + + return await this._migrateDidDocument(did); + } + + /** + * Migrate VP document + * @param doc VP + * @returns VP + */ + private async _migrateVpDocument(doc: VpDocument & { group: string }) { + doc.owner = await this._replaceDidTopicId(doc.owner); + if (doc.group) { + const srcGroup = await this._db.getGroupByID( + this._policyId, + doc.group + ); + const dstUserGroup = await this._db.getGroupsByUser( + this._policyId, + doc.owner + ); + const userRole = dstUserGroup.find( + (item) => + item.groupName === this._groups[srcGroup.groupName] || + item.role === this._roles[srcGroup.role] + ); + doc.group = userRole ? userRole.uuid : null; + } + + // tslint:disable-next-line:no-shadowed-variable + const vcs = doc.document.verifiableCredential.map((item) => + VcDocumentDefinition.fromJsonTree(item) + ); + let vpChanged = false; + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < doc.relationships.length; i++) { + const relationship = doc.relationships[i]; + // tslint:disable-next-line:no-shadowed-variable + const vc = this.vcMessageIds.get(relationship); + if (vc) { + for (let j = 0; j < vcs.length; j++) { + const element = vcs[j]; + const vcDef = VcDocumentDefinition.fromJsonTree( + vc.document ); - doc.hash = vp.toCredentialHash(); - doc.document = vp.toJsonTree() as any; - } else { - vp = VpDocumentDefinition.fromJsonTree(doc.document); + if ( + element.getId() === vcDef.getId() && + element.toCredentialHash() !== vcDef.toCredentialHash() + ) { + vpChanged = true; + vcs[j] = vcDef; + } } + } + } + + let vp; + if (vpChanged || this._oldPolicyOwner !== this._owner) { + this._notifier?.info(`Resigning VP ${doc.id}`); + const _vcHelper = new VcHelper(); + const didDocument = await _vcHelper.loadDidDocument(this._owner); + vp = await _vcHelper.createVerifiablePresentation( + vcs, + didDocument, + null, + { uuid: doc.document.id } + ); + doc.hash = vp.toCredentialHash(); + doc.document = vp.toJsonTree() as any; + } else { + vp = VpDocumentDefinition.fromJsonTree(doc.document); + } + + doc.policyId = this._policyId; + if (doc.messageId) { + this._notifier?.info(`Publishing VP ${doc.id}`); + const vpMessage = new VPMessage(MessageAction.MigrateVP); + vpMessage.setDocument(vp); + vpMessage.setUser(null); + vpMessage.setRelationships([...doc.relationships, doc.messageId]); + const vpMessageResult = await this._ms + .setTopicObject(this._policyInstanceTopic) + .sendMessage(vpMessage); + const vpMessageId = vpMessageResult.getId(); + this.vpIds.set(doc.messageId, vpMessageId); + doc.messageId = vpMessageId; + doc.topicId = vpMessageResult.getTopicId(); + doc.messageHash = vpMessageResult.toHash(); + } + + return doc; + } + + /** + * Migrate mint requests + * @param mintRequests Mint requests + * @param mintTransactions Mint transactions + */ + private async _migrateMintRequests( + mintRequests: MintRequest[], + mintTransactions: MintTransaction[] + ) { + const mintRequestsMapping = new Map(); + for (const mintRequest of mintRequests) { + const newVpMessageId = this.vpIds.get(mintRequest.vpMessageId); + if (!newVpMessageId) { + continue; + } + mintRequest.vpMessageId = newVpMessageId; + const oldMintRequestId = mintRequest.id; + delete mintRequest.id; + delete mintRequest._id; + const newMintRequest = await this._db.saveMintRequest(mintRequest); + mintRequestsMapping.set(oldMintRequestId, newMintRequest.id); + } + for (const mintTransaction of mintTransactions) { + const newMintRequestId = mintRequestsMapping.get( + mintTransaction.mintRequestId + ); + if (!newMintRequestId) { + continue; + } + mintTransaction.mintRequestId = newMintRequestId; + delete mintTransaction.id; + delete mintTransaction._id; + await this._db.saveMintTransaction(mintTransaction); + } + } + + /** + * Migrate VC document + * @param doc VC + * @param vcs VCs + * @param roles Roles + * @param errors Errors + * @returns VC + */ + private async _migrateVcDocument( + doc: VcDocument, + vcs: VcDocument[], + roles: PolicyRoles[], + tokens: Token[], + errors: DocumentError[] + ) { + if (!doc) { + return doc; + } - doc.policyId = dst; - if (doc.messageId) { - this._notifier?.info(`Publishing VP ${doc.id}`); - const messageServer = new MessageServer( - root.hederaAccountId, - rootKey + doc.relationships = doc.relationships || []; + for (let i = 0; i < doc.relationships.length; i++) { + const relationship = doc.relationships[i]; + let republishedDocument = this.vcMessageIds.get(relationship); + if (republishedDocument) { + doc.relationships[i] = republishedDocument.messageId; + } else { + const rs = vcs.find((item) => item.messageId === relationship); + try { + republishedDocument = await this._migrateVcDocument( + rs, + vcs, + roles, + tokens, + errors ); - const vpMessage = new VPMessage(MessageAction.MigrateVP); - vpMessage.setDocument(vp); - vpMessage.setRelationships([ - ...doc.relationships, - doc.messageId, - ]); - const vpMessageResult = await messageServer - .setTopicObject(topic) - .sendMessage(vpMessage); - const vpMessageId = vpMessageResult.getId(); - doc.messageId = vpMessageId; - doc.topicId = vpMessageResult.getTopicId(); - doc.messageHash = vpMessageResult.toHash(); + doc.relationships[i] = republishedDocument.messageId; + } catch (error) { + doc.relationships.splice(i, 1); + i--; } } + } + + if (this.vcMessageIds.has(doc.messageId)) { + return doc; + } + + if (doc.messageId) { + this.vcMessageIds.set(doc.messageId, doc); + } + + const oldDocOwner = doc.owner; + doc.owner = await this._replaceDidTopicId(doc.owner); + doc.assignedTo = await this._replaceDidTopicId(doc.assignedTo); + + let role; + if (doc.group) { + const srcGroup = roles.find( + (item) => item.uuid === doc.group && item.did === oldDocOwner + ); + const groups = await this._db.getGroupsByUser( + this._policyId, + doc.owner + ); + role = groups.find( + (item) => + item.groupName === this._groups[srcGroup.groupName] || + item.role === this._roles[srcGroup.role] + ); + doc.group = role?.uuid; + } + + if (doc.assignedToGroup) { + const srcGroup = roles.find( + (item) => + item.uuid === doc.assignedToGroup && + item.did === oldDocOwner + ); + const groups = await this._db.getGroupsByUser( + this._policyId, + doc.owner + ); + role = groups.find( + (item) => item.groupName === this._groups[srcGroup.groupName] + ); + doc.assignedToGroup = role?.uuid; + } - if (doc.messageId) { - publishedDocuments.set(doc.messageId, doc); + let vc: VcDocumentDefinition; + const schema = await DatabaseServer.getSchema({ + topicId: this._policyTopicId, + iri: this._schemas[doc.schema], + }); + if ( + this._editedVCs[doc.id] || + doc.schema !== schema.iri || + this._policyTopicId !== this._oldPolicyTopicId + ) { + this._notifier?.info(`Resigning VC ${doc.id}`); + + const _vcHelper = new VcHelper(); + const didDocument = await _vcHelper.loadDidDocument(this._owner); + const credentialSubject = SchemaHelper.updateObjectContext( + new Schema(schema), + this._editedVCs[doc.id] || doc.document.credentialSubject[0] + ); + const res = await _vcHelper.verifySubject(credentialSubject); + if (!res.ok) { + throw new Error(res.error.type); } + vc = await _vcHelper.createVerifiableCredential( + credentialSubject, + didDocument, + null, + { + uuid: await this._replaceDidTopicId(doc.document.id), + } + ); + doc.hash = vc.toCredentialHash(); + doc.document = vc.toJsonTree(); + doc.schema = schema.iri; + } else { + vc = VcDocumentDefinition.fromJsonTree(doc.document); + } + doc.policyId = this._policyId; - return doc; - }; - - this._notifier?.start(`Migrate ${srcVCs.length} VC documents`); - for (const vc of srcVCs as VcDocument[]) { - const doc = await republishDocument(vc); - if (doc) { - delete doc.id; - delete doc._id; + if (doc.messageId) { + this._notifier?.info(`Publishing VC ${doc.id}`); + + const vcMessage = new VCMessage(MessageAction.MigrateVC); + vcMessage.setDocument(vc); + vcMessage.setDocumentStatus( + doc.option?.status || DocumentStatus.NEW + ); + vcMessage.setRelationships([...doc.relationships, doc.messageId]); + if (role && schema.category === SchemaCategory.POLICY) { + vcMessage.setUser(role.messageId); } + const message = vcMessage; + const vcMessageResult = await this._ms + .setTopicObject(this._policyInstanceTopic) + .sendMessage(message, true); + doc.messageId = vcMessageResult.getId(); + doc.topicId = vcMessageResult.getTopicId(); + doc.messageHash = vcMessageResult.toHash(); + this.vcMessageIds.set(doc.messageId, doc); } - this._notifier?.completedAndStart(`Save migrated VC documents`); - await DatabaseServer.saveVCs(srcVCs); - this._notifier?.completedAndStart( - `Migrate ${srcVPs.length} VP documents` - ); - for (const vp of srcVPs as VpDocument[]) { - const doc = await republishDocument(vp); - delete doc.id; - delete doc._id; + this.vcIds.set(doc.id, doc); + + if (doc.tokens) { + doc.tokens = await this.migrateTokenTemplates(tokens, doc.tokens); } - this._notifier?.completedAndStart(`Save migrated VP documents`); - await DatabaseServer.saveVPs(srcVPs); - return errors; + return doc; } } diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/aggregate-vc.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/aggregate-vc.loader.ts new file mode 100644 index 0000000000..242131eadd --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/aggregate-vc.loader.ts @@ -0,0 +1,13 @@ +import { AggregateVC } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Aggregate VC loader + */ +export class AggregateVCLoader extends PolicyDataLoader { + async get() { + return (await this.db.getAggregateDocumentsByPolicy( + this.policyId + )) as AggregateVC[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/block-state.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/block-state.loader.ts new file mode 100644 index 0000000000..3fca816ee4 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/block-state.loader.ts @@ -0,0 +1,23 @@ + +import { BlockState } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Block state loader + */ +export class BlockStateLoader extends PolicyDataLoader { + async get() { + const blockStates = await this.db.getBlockStates(this.policyId); + blockStates.sort((a: any, b: any) => { + return b.updateDate - a.updateDate + }) + const result = new Map(); + for (const state of blockStates) { + const existingState = result.get(state.blockId); + if (!existingState) { + result.set(state.blockId, state) + } + } + return [...result.values()]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/did.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/did.loader.ts new file mode 100644 index 0000000000..e7104d5b64 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/did.loader.ts @@ -0,0 +1,13 @@ +import { DidDocument } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * DID loader + */ +export class DidLoader extends PolicyDataLoader { + async get() { + return (await this.db.getDidDocuments({ + topicId: this.policyInstanceTopicId, + })) as DidDocument[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/document-state.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/document-state.loader.ts new file mode 100644 index 0000000000..7f95f631ef --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/document-state.loader.ts @@ -0,0 +1,13 @@ +import { DocumentState } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Document state loader + */ +export class DocumentStateLoader extends PolicyDataLoader { + async get(documentIds: string[]) { + return (await this.db.getDocumentStates({ + documentId: { $in: documentIds }, + })) as DocumentState[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/index.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/index.ts new file mode 100644 index 0000000000..e2b7f0355f --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/index.ts @@ -0,0 +1,13 @@ +export * from './aggregate-vc.loader.js'; +export * from './block-state.loader.js'; +export * from './did.loader.js'; +export * from './document-state.loader.js'; +export * from './loader.js'; +export * from './mint-request.loader.js'; +export * from './mint-transaction.loader.js'; +export * from './multi-sign-document.loader.js'; +export * from './roles.loader.js'; +export * from './schemas.loader.js'; +export * from './split-document.loader.js'; +export * from './vc-document.loader.js'; +export * from './vp-document.loader.js'; diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/loader.ts new file mode 100644 index 0000000000..7f021c2c32 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/loader.ts @@ -0,0 +1,50 @@ +import { DatabaseServer } from '@guardian/common'; +import JSZip from 'jszip'; + +/** + * Policy data loader + */ +export abstract class PolicyDataLoader { + /** + * Database server instance + */ + protected db!: DatabaseServer; + + constructor( + protected policyId: string, + protected policyTopicId: string, + protected policyInstanceTopicId: string, + protected isDryRun = false + ) { + this.db = isDryRun + ? new DatabaseServer(policyId) + : new DatabaseServer(); + } + + /** + * Get data + * @param args Parameters + */ + abstract get(...args: any): Promise; + + /** + * Get data from file + * @param content File content + * @param path Path + * @returns Data + */ + static async getFromFile(content: JSZip, path: string): Promise { + const filesStringArray = await Promise.all( + Object.entries(content.files) + .filter((file) => !file[1].dir) + .filter((file) => new RegExp(`^${path}/.+`).test(file[0])) + .map((file) => file[1].async('string')) + ); + + return ( + filesStringArray + .map((item) => JSON.parse(item)) + .sort((a, b) => b.createDate - a.createDate) || [] + ); + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-request.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-request.loader.ts new file mode 100644 index 0000000000..dcf71d76e2 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-request.loader.ts @@ -0,0 +1,13 @@ +import { MintRequest } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Mint request loader + */ +export class MintRequestLoader extends PolicyDataLoader { + async get(vpIds: string[]) { + return (await this.db.getMintRequests({ + vpMessageId: { $in: vpIds }, + })) as MintRequest[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-transaction.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-transaction.loader.ts new file mode 100644 index 0000000000..b7cabf27a1 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/mint-transaction.loader.ts @@ -0,0 +1,13 @@ +import { MintTransaction } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Mint transaction loader + */ +export class MintTransactionLoader extends PolicyDataLoader { + async get(mintRequestsIds: string[]) { + return (await this.db.getMintTransactions({ + mintRequestId: { $in: mintRequestsIds }, + })) as MintTransaction[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/multi-sign-document.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/multi-sign-document.loader.ts new file mode 100644 index 0000000000..6e37ff7208 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/multi-sign-document.loader.ts @@ -0,0 +1,13 @@ +import { MultiDocuments } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Multi sign document loader + */ +export class MultiSignDocumentLoader extends PolicyDataLoader { + async get(vcIds: string[]) { + return (await this.db.getMultiSignDocumentsByDocumentIds( + vcIds + )) as MultiDocuments[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/retire-pool.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/retire-pool.loader.ts new file mode 100644 index 0000000000..e1cb5ec1a0 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/retire-pool.loader.ts @@ -0,0 +1,11 @@ +import { DatabaseServer, RetirePool } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Retire pool loader + */ +export class RetirePoolLoader extends PolicyDataLoader { + async get(tokenIds: string[]) { + return (await DatabaseServer.getRetirePools(tokenIds)) as RetirePool[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/roles.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/roles.loader.ts new file mode 100644 index 0000000000..74b56f397b --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/roles.loader.ts @@ -0,0 +1,11 @@ +import { PolicyRoles } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Roles loader + */ +export class RolesLoader extends PolicyDataLoader { + async get() { + return await this.db.getAllPolicyUsers(this.policyId); + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/schemas.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/schemas.loader.ts new file mode 100644 index 0000000000..ac478c6280 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/schemas.loader.ts @@ -0,0 +1,13 @@ +import { DatabaseServer, Schema } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Schemas loader + */ +export class SchemasLoader extends PolicyDataLoader { + async get() { + return await DatabaseServer.getSchemas({ + topicId: this.policyTopicId, + }); + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/split-document.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/split-document.loader.ts new file mode 100644 index 0000000000..ce22e1ead6 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/split-document.loader.ts @@ -0,0 +1,13 @@ +import { SplitDocuments } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Split document loader + */ +export class SplitDocumentLoader extends PolicyDataLoader { + async get() { + return (await this.db.getSplitDocumentsByPolicy( + this.policyId + )) as SplitDocuments[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/tokens.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/tokens.loader.ts new file mode 100644 index 0000000000..42958b77c7 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/tokens.loader.ts @@ -0,0 +1,13 @@ +import { DatabaseServer, Token } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * Tokens loader + */ +export class TokensLoader extends PolicyDataLoader { + async get() { + return (await DatabaseServer.getTokens({ + policyId: this.policyId, + })) as Token[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/vc-document.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/vc-document.loader.ts new file mode 100644 index 0000000000..2747973289 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/vc-document.loader.ts @@ -0,0 +1,21 @@ +import { VcDocument } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * VC document loader + */ +export class VcDocumentLoader extends PolicyDataLoader { + async get(filters?: any, options?: any, countResult = false) { + return (await this.db.getVcDocuments( + filters + ? Object.assign(filters, { + policyId: this.policyId, + }) + : { + policyId: this.policyId, + }, + options, + countResult + )) as VcDocument[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/loaders/vp-document.loader.ts b/guardian-service/src/policy-engine/helpers/policy-data/loaders/vp-document.loader.ts new file mode 100644 index 0000000000..c1659e4c6c --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/loaders/vp-document.loader.ts @@ -0,0 +1,21 @@ +import { VpDocument } from '@guardian/common'; +import { PolicyDataLoader } from './loader.js'; + +/** + * VP document loader + */ +export class VpDocumentLoader extends PolicyDataLoader { + async get(filters?: any, options?: any, countResult = false) { + return (await this.db.getVpDocuments( + filters + ? Object.assign(filters, { + policyId: this.policyId, + }) + : { + policyId: this.policyId, + }, + options, + countResult + )) as VpDocument[]; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-data/policy-data-import-export.ts b/guardian-service/src/policy-engine/helpers/policy-data/policy-data-import-export.ts new file mode 100644 index 0000000000..a5e47e8ec5 --- /dev/null +++ b/guardian-service/src/policy-engine/helpers/policy-data/policy-data-import-export.ts @@ -0,0 +1,369 @@ +import JSZip from 'jszip'; +import { + BlockStateLoader, + PolicyDataLoader, + RolesLoader, + VcDocumentLoader, + VpDocumentLoader, + DidLoader, + MultiSignDocumentLoader, + MintRequestLoader, + MintTransactionLoader, + AggregateVCLoader, + SplitDocumentLoader, + DocumentStateLoader, +} from './loaders/index.js'; +import { GuardiansService } from '../../../helpers/guardians.js'; +import { PolicyEvents, PolicyType, TopicType } from '@guardian/interfaces'; +import { + DatabaseServer, + DidDocument, + Policy, + Users, + findAllEntities, +} from '@guardian/common'; +import { SchemasLoader } from './loaders/schemas.loader.js'; +import { ObjectId } from 'bson'; +import { TokensLoader } from './loaders/tokens.loader.js'; +import { RetirePoolLoader } from './loaders/retire-pool.loader.js'; + +/** + * Static loaders + */ +type StaticLoaders = + | typeof SchemasLoader + | typeof VcDocumentLoader + | typeof VpDocumentLoader + | typeof BlockStateLoader + | typeof RolesLoader + | typeof AggregateVCLoader + | typeof DidLoader + | typeof MultiSignDocumentLoader + | typeof MintRequestLoader + | typeof MintTransactionLoader + | typeof DocumentStateLoader; +/** + * Policy data import export + */ +export class PolicyDataImportExport { + /** + * Static loaders + */ + private static readonly _loaders = new Map([ + ['vcs', VcDocumentLoader], + ['vps', VpDocumentLoader], + ['states', BlockStateLoader], + ['schemas', SchemasLoader], + ['roles', RolesLoader], + ['dids', DidLoader], + ['aggregateVCs', AggregateVCLoader], + ['splitDocuments', SplitDocumentLoader], + ['multiDocuments', MultiSignDocumentLoader], + ['mintRequests', MintRequestLoader], + ['mintTransactions', MintTransactionLoader], + ['documentStates', DocumentStateLoader], + ['tokens', TokensLoader], + ['retirePools', RetirePoolLoader], + ]); + + /** + * Is dry run + */ + private readonly _isDryRun!: boolean; + /** + * Loader instances + */ + private readonly _loaderInstances = new Map(); + + constructor(private readonly _policy: Policy) { + this._isDryRun = _policy.status === PolicyType.DRY_RUN; + for (const [name, Loader] of PolicyDataImportExport._loaders) { + if ( + ![ + 'multiDocuments', + 'mintRequests', + 'mintTransactions', + 'documentStates', + 'retirePools', + ].includes(name) + ) { + this._loaderInstances.set( + name, + new Loader( + _policy.id, + _policy.topicId, + _policy.instanceTopicId, + this._isDryRun + ) + ); + } + } + } + + /** + * Export data + * @returns Data + */ + async exportData() { + const zip = new JSZip(); + zip.file('policy.json', JSON.stringify(this._policy)); + + for (const [loaderName, loader] of this._loaderInstances) { + zip.folder(loaderName); + const files = await loader.get(); + for (const file of files) { + zip.file(`${loaderName}/${file.id}.json`, JSON.stringify(file)); + } + if (loaderName === 'vcs') { + const vcIds = files.map((item) => item.id); + const multiSignDocuments = await new MultiSignDocumentLoader( + this._policy.id, + this._policy.topicId, + this._policy.instanceTopicId, + this._isDryRun + ).get(vcIds); + zip.folder('multiDocuments'); + for (const multiSignDocument of multiSignDocuments) { + zip.file( + `multiDocuments/${multiSignDocument.id}.json`, + JSON.stringify(multiSignDocument) + ); + } + + const documentStates = await new DocumentStateLoader( + this._policy.id, + this._policy.topicId, + this._policy.instanceTopicId, + this._isDryRun + ).get(vcIds); + zip.folder('documentStates'); + for (const documentState of documentStates) { + delete documentState?.document?.document; + zip.file( + `documentStates/${documentState.id}.json`, + JSON.stringify(documentState) + ); + } + } + + if (loaderName === 'vps') { + const mintRequests = await new MintRequestLoader( + this._policy.id, + this._policy.topicId, + this._policy.instanceTopicId, + this._isDryRun + ).get(files.map((item) => item.messageId)); + zip.folder('mintRequests'); + for (const mintRequest of mintRequests) { + zip.file( + `mintRequests/${mintRequest.id}.json`, + JSON.stringify(mintRequest) + ); + } + + const mintTransactions = await new MintTransactionLoader( + this._policy.id, + this._policy.topicId, + this._policy.instanceTopicId, + this._isDryRun + ).get(mintRequests.map((item) => item.id)); + zip.folder('mintTransactions'); + for (const mintTransaction of mintTransactions) { + zip.file( + `mintTransactions/${mintTransaction.id}.json`, + JSON.stringify(mintTransaction) + ); + } + } + + if (loaderName === 'tokens') { + const policyTokens = findAllEntities(this._policy.config, [ + 'tokenId', + ]); + const retirePools = await new RetirePoolLoader( + this._policy.id, + this._policy.topicId, + this._policy.instanceTopicId, + this._isDryRun + ).get(policyTokens.concat(files.map((item) => item.tokenId))); + zip.folder('retirePools'); + for (const retirePool of retirePools) { + zip.file( + `retirePools/${retirePool.id}.json`, + JSON.stringify(retirePool) + ); + } + } + } + + const blocks = await new GuardiansService().sendPolicyMessage( + PolicyEvents.GET_TAG_BLOCK_MAP, + this._policy.id, + null + ); + zip.file('blocks.json', JSON.stringify(blocks)); + + const users = this._isDryRun + ? await DatabaseServer.getVirtualUsers(this._policy.id) + : await new Users().getUsersBySrId(this._policy.owner); + zip.file( + 'users.json', + JSON.stringify( + users.map((item) => { + return { + username: item.username, + did: item.did, + hederaAccountId: item.hederaAccountId, + hederaAccountKey: this._isDryRun + ? item.hederaAccountKey + : undefined, + }; + }) + ) + ); + + const userTopic = await DatabaseServer.getTopicByType( + this._policy.owner, + TopicType.UserTopic + ); + zip.file('userTopic.json', JSON.stringify(userTopic)); + + return zip; + } + + /** + * Export virtual keys + * @param owner Owner + * @param dryRunId Dry run identifier + * @returns Virtual keys + */ + static async exportVirtualKeys(owner: string, dryRunId: string) { + const zip = new JSZip(); + const virtualKeys = await new DatabaseServer(dryRunId).getVirtualKeys({ + did: { $ne: owner }, + }); + zip.folder('virtualKeys'); + for (const virtualKey of virtualKeys) { + zip.file( + `virtualKeys/${virtualKey.id}.json`, + JSON.stringify(virtualKey) + ); + } + const dids = (await new DatabaseServer(dryRunId).getDidDocuments( + {} + )) as DidDocument[]; + zip.folder('dids'); + for (const did of dids) { + zip.file(`dids/${did.id}.json`, JSON.stringify(did)); + } + return zip; + } + + static async importVirtualKeys(data: Buffer, dryRunId: string) { + const zip = new JSZip(); + const content = await zip.loadAsync(data); + const keysStringArray = await Promise.all( + Object.entries(content.files) + .filter((file) => !file[1].dir) + .filter((file) => new RegExp(`^virtualKeys/.+`).test(file[0])) + .map((file) => file[1].async('string')) + ); + const keys = keysStringArray.map((item) => JSON.parse(item)); + for (const key of keys) { + const existingDid = await new DatabaseServer( + dryRunId + ).getVirtualKey(key.did, key.type); + if (existingDid) { + continue; + } + await new DatabaseServer(dryRunId).setVirtualKey( + key.did, + key.type, + key.hederaAccountKey + ); + } + + const didsStringArray = await Promise.all( + Object.entries(content.files) + .filter((file) => !file[1].dir) + .filter((file) => new RegExp(`^dids/.+`).test(file[0])) + .map((file) => file[1].async('string')) + ); + const dids = didsStringArray.map((item) => JSON.parse(item)); + for (const did of dids) { + const existingDid = await new DatabaseServer( + dryRunId + ).getDidDocument(did.did); + if (existingDid) { + continue; + } + delete did.id; + delete did._id; + await new DatabaseServer(dryRunId).saveDid(did); + } + } + + /** + * Import data + * @param userId Owner + * @param data Data + * @returns Imported policy + */ + static async importData(userId: string, data: Buffer) { + await DatabaseServer.clearPolicyCaches({ + userId, + }); + + const zip = new JSZip(); + const content = await zip.loadAsync(data); + + const blocksString = await Object.entries(content.files) + .filter((file) => !file[1].dir) + .find((file) => /^blocks.json$/.test(file[0]))[1] + .async('string'); + const usersString = await Object.entries(content.files) + .filter((file) => !file[1].dir) + .find((file) => /^users.json$/.test(file[0]))[1] + .async('string'); + const policyConfigString = await Object.entries(content.files) + .filter((file) => !file[1].dir) + .find((file) => /^policy.json$/.test(file[0]))[1] + .async('string'); + const userTopicString = await Object.entries(content.files) + .filter((file) => !file[1].dir) + .find((file) => /^userTopic.json$/.test(file[0]))[1] + .async('string'); + + const generatedId = new ObjectId(ObjectId.generate()); + const policy = JSON.parse(policyConfigString); + policy.id = generatedId.toString(); + policy._id = policy.id; + const blocks = JSON.parse(blocksString); + const users = JSON.parse(usersString); + const userTopic = JSON.parse(userTopicString); + + const result: any = { + _id: generatedId, + id: generatedId.toString(), + userId, + policy, + blocks, + users, + userTopic, + }; + const policyCache = await DatabaseServer.savePolicyCache(result); + for (const [name, Loader] of PolicyDataImportExport._loaders) { + const collection = await Loader.getFromFile(content, name); + for (const item of collection) { + item.cacheCollection = name; + item.cachePolicyId = policyCache.id; + item.oldId = item.id; + delete item._id; + delete item.id; + await DatabaseServer.savePolicyCacheData(item); + } + } + + return policy; + } +} diff --git a/guardian-service/src/policy-engine/helpers/policy-import-export-helper.ts b/guardian-service/src/policy-engine/helpers/policy-import-export-helper.ts index 44d62b669f..eb91a6241a 100644 --- a/guardian-service/src/policy-engine/helpers/policy-import-export-helper.ts +++ b/guardian-service/src/policy-engine/helpers/policy-import-export-helper.ts @@ -1,47 +1,12 @@ - -import { - BlockType, - ConfigType, - GenerateUUIDv4, - ModuleStatus, - PolicyType, - SchemaCategory, - SchemaEntity, - TagType, - TopicType -} from '@guardian/interfaces'; -import { publishSystemSchemas } from '@api/helpers/schema-publish-helper'; -import { PolicyConverterUtils } from '@policy-engine/policy-converter-utils'; -import { INotifier } from '@helpers/notifier'; -import { - DataBaseHelper, - DatabaseServer, - IPolicyComponents, - MessageAction, - MessageServer, - MessageType, - Policy, - PolicyMessage, - regenerateIds, - replaceAllEntities, - replaceAllVariables, - replaceArtifactProperties, - Schema, - SchemaFields, - Topic, - TopicConfig, - TopicHelper, - Users -} from '@guardian/common'; -import { importTag } from '@api/helpers/tag-import-export-helper'; -import { SchemaImportResult } from '@api/helpers/schema-helper'; -import { HashComparator } from '@analytics'; -import { - importSubTools, - importSchemaByFiles, - importTokensByFiles, - importArtifactsByFiles -} from '@api/helpers'; +import { BlockType, ConfigType, GenerateUUIDv4, ModuleStatus, PolicyToolMetadata, PolicyType, SchemaCategory, SchemaEntity, TagType, TopicType } from '@guardian/interfaces'; +import { publishSystemSchemas } from '../../api/helpers/schema-publish-helper.js'; +import { PolicyConverterUtils } from '../policy-converter-utils.js'; +import { INotifier } from '../../helpers/notifier.js'; +import { DataBaseHelper, DatabaseServer, IPolicyComponents, MessageAction, MessageServer, MessageType, Policy, PolicyMessage, regenerateIds, replaceAllEntities, replaceAllVariables, replaceArtifactProperties, Schema, SchemaFields, Topic, TopicConfig, TopicHelper, Users } from '@guardian/common'; +import { importTag } from '../../api/helpers/tag-import-export-helper.js'; +import { SchemaImportResult } from '../../api/helpers/schema-helper.js'; +import { HashComparator } from '../../analytics/index.js'; +import { importArtifactsByFiles, importSchemaByFiles, importSubTools, importTokensByFiles } from '../../api/helpers/index.js'; /** * Policy import export helper @@ -89,6 +54,7 @@ export class PolicyImportExportHelper { versionOfTopicId: string, notifier: INotifier, additionalPolicyConfig?: Partial, + metadata?: PolicyToolMetadata, ): Promise<{ /** * New Policy @@ -108,6 +74,32 @@ export class PolicyImportExportHelper { tools } = policyToImport; + const users = new Users(); + notifier.start('Resolve Hedera account'); + const root = await users.getHederaAccount(policyOwner); + + const toolsMapping: { + oldMessageId: string; + messageId: string; + oldHash: string; + newHash?: string; + }[] = []; + if (metadata?.tools) { + for (const tool of tools) { + if ( + metadata.tools[tool.messageId] && + tool.messageId !== metadata.tools[tool.messageId] + ) { + toolsMapping.push({ + oldMessageId: tool.messageId, + messageId: metadata.tools[tool.messageId], + oldHash: tool.hash, + }); + tool.messageId = metadata.tools[tool.messageId]; + } + } + } + delete policy._id; delete policy.id; delete policy.messageId; @@ -126,14 +118,11 @@ export class PolicyImportExportHelper { policy.topicDescription = additionalPolicyConfig?.topicDescription || policy.topicDescription; policy.description = additionalPolicyConfig?.description || policy.description; - const users = new Users(); - notifier.start('Resolve Hedera account'); - const root = await users.getHederaAccount(policyOwner); notifier.completedAndStart('Resolve topic'); const parent = await TopicConfig.fromObject( await DatabaseServer.getTopicByType(policyOwner, TopicType.UserTopic), true ); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); let topicRow: TopicConfig; if (versionOfTopicId) { @@ -155,7 +144,7 @@ export class PolicyImportExportHelper { if (!versionOfTopicId) { notifier.completedAndStart('Publish Policy in Hedera'); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = new PolicyMessage(MessageType.Policy, MessageAction.CreatePolicy); message.setDocument(policy); const messageStatus = await messageServer @@ -186,17 +175,37 @@ export class PolicyImportExportHelper { const toolsResult = await importSubTools(root, tools, notifier); notifier.sub(false); + for (const toolMapping of toolsMapping) { + const toolByMessageId = toolsResult.tools.find( + // tslint:disable-next-line:no-shadowed-variable + (tool) => tool.messageId === toolMapping.messageId + ); + toolMapping.newHash = toolByMessageId?.hash; + } + // Import Tokens const tokensResult = await importTokensByFiles(policyOwner, tokens, notifier); const tokenMap = tokensResult.tokenMap; + const toolsSchemas = (await DatabaseServer.getSchemas( + { + category: SchemaCategory.TOOL, + topicId: { $in: toolsResult.tools.map((tool) => tool.topicId) }, + }, + { + fields: ['name', 'iri'], + } + )) as { name: string; iri: string }[]; + // Import Schemas const schemasResult = await importSchemaByFiles( SchemaCategory.POLICY, policyOwner, schemas, topicRow.topicId, - notifier + notifier, + false, + toolsSchemas ); const schemasMap = schemasResult.schemasMap; @@ -207,7 +216,13 @@ export class PolicyImportExportHelper { notifier.completedAndStart('Saving in DB'); // Replace id - await PolicyImportExportHelper.replaceConfig(policy, schemasMap, artifactsMap, tokenMap); + await PolicyImportExportHelper.replaceConfig( + policy, + schemasMap, + artifactsMap, + tokenMap, + toolsMapping + ); // Save const model = new DataBaseHelper(Policy).create(policy as Policy); @@ -288,7 +303,8 @@ export class PolicyImportExportHelper { policy: Policy, schemasMap: SchemaImportResult[], artifactsMap: Map, - tokenMap: any[] + tokenMap: any[], + tools: { oldMessageId: string, messageId: string, oldHash: string, newHash?: string }[] ) { if (await new DataBaseHelper(Policy).findOne({ name: policy.name })) { policy.name = policy.name + '_' + Date.now(); @@ -308,6 +324,14 @@ export class PolicyImportExportHelper { replaceAllVariables(policy.config, 'Token', item.oldTokenID, item.newTokenID); } + for (const item of tools) { + if (!item.newHash || !item.messageId) { + continue; + } + replaceAllEntities(policy.config, ['messageId'], item.oldMessageId, item.messageId); + replaceAllEntities(policy.config, ['hash'], item.oldHash, item.newHash); + } + // compatibility with older versions policy = PolicyConverterUtils.PolicyConverter(policy); policy.codeVersion = PolicyConverterUtils.VERSION; diff --git a/guardian-service/src/policy-engine/interfaces/event-config.ts b/guardian-service/src/policy-engine/interfaces/event-config.ts index d1c0d7c2bd..779c020982 100644 --- a/guardian-service/src/policy-engine/interfaces/event-config.ts +++ b/guardian-service/src/policy-engine/interfaces/event-config.ts @@ -1,4 +1,4 @@ -import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type'; +import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type.js'; /** * Event config diff --git a/guardian-service/src/policy-engine/interfaces/index.ts b/guardian-service/src/policy-engine/interfaces/index.ts index 49ff149895..4caf4ad471 100644 --- a/guardian-service/src/policy-engine/interfaces/index.ts +++ b/guardian-service/src/policy-engine/interfaces/index.ts @@ -1,10 +1,10 @@ export { PolicyInputEventType, PolicyOutputEventType -} from './policy-event-type'; +} from './policy-event-type.js'; export { EventConfig -} from './event-config'; +} from './event-config.js'; -export { EventActor } from './policy-event-type'; +export { EventActor } from './policy-event-type.js'; diff --git a/guardian-service/src/policy-engine/policy-components-utils.ts b/guardian-service/src/policy-engine/policy-components-utils.ts index 41c7beaa08..f913e0083f 100644 --- a/guardian-service/src/policy-engine/policy-components-utils.ts +++ b/guardian-service/src/policy-engine/policy-components-utils.ts @@ -1,7 +1,7 @@ import { PolicyType } from '@guardian/interfaces'; import { DatabaseServer, Policy } from '@guardian/common'; -import { IPolicyUser } from './policy-user'; -import { ExternalEvent } from './interfaces/external-event'; +import { IPolicyUser } from './policy-user.js'; +import { ExternalEvent } from './interfaces/external-event.js'; /** * Policy component utils diff --git a/guardian-service/src/policy-engine/policy-converter-utils.ts b/guardian-service/src/policy-engine/policy-converter-utils.ts index cff57e20c9..8ec4377325 100644 --- a/guardian-service/src/policy-engine/policy-converter-utils.ts +++ b/guardian-service/src/policy-engine/policy-converter-utils.ts @@ -1,6 +1,6 @@ import { Policy } from '@guardian/common'; import { BlockType, GenerateUUIDv4, UserType } from '@guardian/interfaces'; -import { EventConfig, PolicyInputEventType, PolicyOutputEventType, EventActor } from './interfaces'; +import { EventConfig, PolicyInputEventType, PolicyOutputEventType, EventActor } from './interfaces/index.js'; /** * Policy converter utils diff --git a/guardian-service/src/policy-engine/policy-engine.service.ts b/guardian-service/src/policy-engine/policy-engine.service.ts index d0baf43949..0cb4339cf6 100644 --- a/guardian-service/src/policy-engine/policy-engine.service.ts +++ b/guardian-service/src/policy-engine/policy-engine.service.ts @@ -1,4 +1,14 @@ -import { ExternalMessageEvents, GenerateUUIDv4, PolicyEngineEvents, PolicyEvents, PolicyType, Schema, SchemaField, TopicType } from '@guardian/interfaces'; +import { + DocumentCategoryType, + DocumentType, + ExternalMessageEvents, + GenerateUUIDv4, + PolicyEngineEvents, + PolicyEvents, PolicyType, + Schema, + SchemaField, + TopicType +} from '@guardian/interfaces'; import { BinaryMessageResponse, DatabaseServer, @@ -22,22 +32,23 @@ import { TopicConfig, Users, VcHelper, - Wallet, XlsxToJson } from '@guardian/common'; -import { PolicyImportExportHelper } from './helpers/policy-import-export-helper'; -import { PolicyComponentsUtils } from './policy-components-utils'; -import { IPolicyUser } from './policy-user'; -import { emptyNotifier, initNotifier } from '@helpers/notifier'; -import { PolicyEngine } from './policy-engine'; +import { PolicyImportExportHelper } from './helpers/policy-import-export-helper.js'; +import { PolicyComponentsUtils } from './policy-components-utils.js'; +import { IPolicyUser } from './policy-user.js'; +import { emptyNotifier, initNotifier } from '../helpers/notifier.js'; +import { PolicyEngine } from './policy-engine.js'; import { AccountId, PrivateKey } from '@hashgraph/sdk'; import { NatsConnection } from 'nats'; -import { GuardiansService } from '@helpers/guardians'; -import { Inject } from '@helpers/decorators/inject'; -import { BlockAboutString } from './block-about'; -import { HashComparator } from '@analytics'; -import { getSchemaCategory, importSchemaByFiles, importSubTools, previewToolByMessage } from '@api/helpers'; -import { PolicyDataMigrator } from './helpers/policy-data-migrator'; +import { GuardiansService } from '../helpers/guardians.js'; +import { BlockAboutString } from './block-about.js'; +import { HashComparator } from '../analytics/index.js'; +import { getSchemaCategory, importSchemaByFiles, importSubTools, previewToolByMessage } from '../api/helpers/index.js'; +import { PolicyDataMigrator } from './helpers/policy-data-migrator.js'; +import { Inject } from '../helpers/decorators/inject.js'; +import { PolicyDataImportExport } from './helpers/policy-data/policy-data-import-export.js'; +import { VpDocumentLoader, VcDocumentLoader, PolicyDataLoader } from './helpers/policy-data/loaders/index.js'; /** * PolicyEngineChannel @@ -68,13 +79,14 @@ export class PolicyEngineChannel extends NatsService { /** * Policy engine service */ + export class PolicyEngineService { /** * Users helper * @private */ @Inject() - private readonly users: Users; + declare private readonly users: Users; /** * Message broker service @@ -529,7 +541,7 @@ export class PolicyEngineService { } const root = await this.users.getHederaAccount(owner); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); let message: PolicyMessage; if (msg.date) { const date = new Date(msg.date); @@ -886,16 +898,7 @@ export class PolicyEngineService { try { const { policyId } = msg; const policy = await DatabaseServer.getPolicyById(policyId); - const components = await PolicyImportExport.loadPolicyComponents(policy); - const schemas = components.schemas; - const tools = components.tools; - const toolSchemas = []; - for (const tool of tools) { - const _schemas = await DatabaseServer.getSchemas({ topicId: tool.topicId }); - for (const schema of _schemas) { - toolSchemas.push(schema); - } - } + const { schemas, tools, toolSchemas } = await PolicyImportExport.loadAllSchemas(policy); const buffer = await JsonToXlsx.generate(schemas, tools, toolSchemas); return new BinaryMessageResponse(buffer); } catch (error) { @@ -926,14 +929,21 @@ export class PolicyEngineService { this.channel.getMessages(PolicyEngineEvents.POLICY_IMPORT_FILE, async (msg) => { try { - const { zip, user, versionOfTopicId } = msg; + const { zip, user, versionOfTopicId, metadata } = msg; if (!zip) { throw new Error('file in body is empty'); } new Logger().info(`Import policy by file`, ['GUARDIAN_SERVICE']); const did = await this.getUserDid(user.username); const policyToImport = await PolicyImportExport.parseZipFile(Buffer.from(zip.data), true); - const result = await PolicyImportExportHelper.importPolicy(policyToImport, did, versionOfTopicId, emptyNotifier()); + const result = await PolicyImportExportHelper.importPolicy( + policyToImport, + did, + versionOfTopicId, + emptyNotifier(), + undefined, + metadata + ); if (result?.errors?.length) { const message = PolicyImportExportHelper.errorsMessage(result.errors); new Logger().warn(message, ['GUARDIAN_SERVICE']); @@ -948,7 +958,7 @@ export class PolicyEngineService { }); this.channel.getMessages(PolicyEngineEvents.POLICY_IMPORT_FILE_ASYNC, async (msg) => { - const { zip, user, versionOfTopicId, task } = msg; + const { zip, user, versionOfTopicId, task, metadata } = msg; const notifier = await initNotifier(task); RunFunctionAsync(async () => { @@ -960,7 +970,14 @@ export class PolicyEngineService { notifier.start('File parsing'); const policyToImport = await PolicyImportExport.parseZipFile(Buffer.from(zip.data), true); notifier.completed(); - const result = await PolicyImportExportHelper.importPolicy(policyToImport, did, versionOfTopicId, notifier); + const result = await PolicyImportExportHelper.importPolicy( + policyToImport, + did, + versionOfTopicId, + notifier, + undefined, + metadata + ); if (result?.errors?.length) { const message = PolicyImportExportHelper.errorsMessage(result.errors); notifier.error(message); @@ -1142,7 +1159,7 @@ export class PolicyEngineService { this.channel.getMessages(PolicyEngineEvents.POLICY_IMPORT_MESSAGE, async (msg) => { try { - const { messageId, user, versionOfTopicId } = msg; + const { messageId, user, versionOfTopicId, metadata } = msg; const did = await this.getUserDid(user.username); if (!messageId) { throw new Error('Policy ID in body is empty'); @@ -1150,7 +1167,7 @@ export class PolicyEngineService { const root = await this.users.getHederaAccount(did); - const result = await this.policyEngine.importPolicyMessage(messageId, did, root, versionOfTopicId, emptyNotifier()); + const result = await this.policyEngine.importPolicyMessage(messageId, did, root, versionOfTopicId, emptyNotifier(), metadata); if (result?.errors?.length) { const message = PolicyImportExportHelper.errorsMessage(result.errors); new Logger().warn(message, ['GUARDIAN_SERVICE']); @@ -1166,7 +1183,7 @@ export class PolicyEngineService { }); this.channel.getMessages(PolicyEngineEvents.POLICY_IMPORT_MESSAGE_ASYNC, async (msg) => { - const { messageId, user, versionOfTopicId, task } = msg; + const { messageId, user, versionOfTopicId, task, metadata } = msg; const notifier = await initNotifier(task); RunFunctionAsync(async () => { @@ -1178,7 +1195,7 @@ export class PolicyEngineService { const did = await this.getUserDid(user.username); const root = await this.users.getHederaAccount(did); notifier.completed(); - const result = await this.policyEngine.importPolicyMessage(messageId, did, root, versionOfTopicId, notifier); + const result = await this.policyEngine.importPolicyMessage(messageId, did, root, versionOfTopicId, notifier, metadata); if (result?.errors?.length) { const message = PolicyImportExportHelper.errorsMessage(result.errors); notifier.error(message); @@ -1381,34 +1398,291 @@ export class PolicyEngineService { this.channel.getMessages(PolicyEngineEvents.GET_POLICY_DOCUMENTS, async (msg) => { try { - const { owner, policyId, includeDocument, type, pageIndex, pageSize } = msg; + const { + owner, + policyId, + includeDocument, + type, + pageIndex, + pageSize, + } = msg; + + const parsedPageSize = parseInt(pageSize, 10); + const parsedPageIndex = parseInt(pageIndex, 10); + const paginationNeeded = + Number.isInteger(parsedPageSize) && + Number.isInteger(parsedPageIndex); - const model = await DatabaseServer.getPolicyById(policyId); - if (!model) { - throw new Error('Unknown policy'); + const filters: any = {}; + const otherOptions: any = { + fields: ['id', 'owner'], + }; + if (includeDocument) { + otherOptions.fields.push('documentFileId'); } - if (![PolicyType.DISCONTINUED, PolicyType.PUBLISH].includes(model.status)) { - throw new Error(`Policy isn't published`); + if (paginationNeeded) { + otherOptions.limit = parsedPageSize; + otherOptions.offset = parsedPageIndex * parsedPageSize; } - if (model.owner !== owner) { - throw new Error(`You are not policy owner`); + + const userPolicy = await DatabaseServer.getPolicyCache({ + id: policyId, + userId: owner, + }); + if (userPolicy) { + otherOptions.fields.push('oldId'); + filters.cachePolicyId = policyId; + if (type === DocumentType.VC) { + filters.cacheCollection = 'vcs'; + otherOptions.fields.push('schema'); + filters.schema = { + $ne: null, + }; + filters.type = { + $ne: DocumentCategoryType.USER_ROLE, + }; + return new MessageResponse( + await DatabaseServer.getAndCountPolicyCacheData( + filters, + otherOptions + ) + ); + } else if (type === DocumentType.VP) { + filters.cacheCollection = 'vps'; + return new MessageResponse( + await DatabaseServer.getAndCountPolicyCacheData( + filters, + otherOptions + ) + ); + } else { + throw new Error(`Unknown type: ${type}`); + } } - const documents = await DatabaseServer.getDocuments(policyId, includeDocument, type, pageIndex, pageSize); - return new MessageResponse(documents); + const model = await DatabaseServer.getPolicy({ + id: policyId, + owner, + }); + if (!model) { + throw new Error('Unknown policy'); + } + if ( + ![ + PolicyType.DISCONTINUED, + PolicyType.PUBLISH, + PolicyType.DRY_RUN, + ].includes(model.status) + ) { + throw new Error(`Policy is not running`); + } + + filters.policyId = policyId; + + let loader: PolicyDataLoader; + if (type === DocumentType.VC) { + otherOptions.fields.push('schema'); + filters.schema = { + $ne: null, + }; + filters.type = { + $ne: DocumentCategoryType.USER_ROLE, + }; + loader = new VcDocumentLoader( + model.id, + model.topicId, + model.instanceTopicId, + model.status === PolicyType.DRY_RUN + ); + } else if (type === DocumentType.VP) { + loader = new VpDocumentLoader( + model.id, + model.topicId, + model.instanceTopicId, + model.status === PolicyType.DRY_RUN + ); + } else { + throw new Error(`Unknown type: ${type}`); + } + return new MessageResponse([ + await loader.get(filters, otherOptions), + await loader.get(filters, null, true), + ]); } catch (error) { return new MessageError(error); } }); + this.channel.getMessages( + PolicyEngineEvents.GET_TAG_BLOCK_MAP, + async (msg) => { + try { + const userPolicy = await DatabaseServer.getPolicyCache({ + id: msg?.policyId, + userId: msg?.owner, + }); + if (userPolicy) { + return new MessageResponse(userPolicy.blocks); + } + + const policy = await DatabaseServer.getPolicy({ + id: msg?.policyId, + owner: msg?.owner, + status: { + $in: [ + PolicyType.DRY_RUN, + PolicyType.PUBLISH, + PolicyType.DISCONTINUED, + ], + }, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + + const blocks = + await new GuardiansService().sendPolicyMessage( + PolicyEvents.GET_TAG_BLOCK_MAP, + msg.policyId, + null + ); + return new MessageResponse(blocks); + } catch (error) { + return new MessageError(error); + } + } + ); + + this.channel.getMessages( + PolicyEngineEvents.DOWNLOAD_VIRTUAL_KEYS, + async (msg) => { + try { + const policy = await DatabaseServer.getPolicy({ + id: msg?.policyId, + owner: msg?.owner, + status: PolicyType.DRY_RUN, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + const zip = await PolicyDataImportExport.exportVirtualKeys( + msg.owner, + policy.id + ); + const zippedData = await zip.generateAsync({ + type: 'arraybuffer', + compression: 'DEFLATE', + compressionOptions: { + level: 3, + }, + }); + return new BinaryMessageResponse(zippedData); + } catch (error) { + return new MessageError(error); + } + } + ); + + this.channel.getMessages( + PolicyEngineEvents.DOWNLOAD_POLICY_DATA, + async (msg) => { + try { + const policy = await DatabaseServer.getPolicy({ + id: msg?.policyId, + owner: msg?.owner, + status: { + $in: [ + PolicyType.DRY_RUN, + PolicyType.PUBLISH, + PolicyType.DISCONTINUED, + ], + }, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + const policyDataExportHelper = new PolicyDataImportExport( + policy + ); + const zip = await policyDataExportHelper.exportData(); + const zippedData = await zip.generateAsync({ + type: 'arraybuffer', + compression: 'DEFLATE', + compressionOptions: { + level: 3, + }, + }); + return new BinaryMessageResponse(zippedData); + } catch (error) { + return new MessageError(error); + } + } + ); + + this.channel.getMessages( + PolicyEngineEvents.UPLOAD_POLICY_DATA, + async (msg) => { + try { + if (!msg?.user) { + throw new Error('Invalid user'); + } + if (!msg?.data) { + throw new Error('Invalid policy data'); + } + return new MessageResponse( + await PolicyDataImportExport.importData( + msg?.user, + Buffer.from(msg?.data) + ) + ); + } catch (error) { + return new MessageError(error); + } + } + ); + + this.channel.getMessages( + PolicyEngineEvents.UPLOAD_VIRTUAL_KEYS, + async (msg) => { + try { + const policy = await DatabaseServer.getPolicy({ + id: msg?.policyId, + owner: msg?.owner, + status: PolicyType.DRY_RUN, + }); + if (!policy) { + throw new Error(`Policy doesn't exist`); + } + await PolicyDataImportExport.importVirtualKeys( + Buffer.from(msg?.data), + policy.id + ); + return new MessageResponse(null); + } catch (error) { + return new MessageError(error); + } + } + ); + this.channel.getMessages( PolicyEngineEvents.MIGRATE_DATA, async (msg) => { try { - const policyDataMigrator = new PolicyDataMigrator(new Users(), new Wallet()); - const migrationErrors = await policyDataMigrator.migratePolicyData(msg?.owner, msg?.migrationConfig); + const migrationErrors = await PolicyDataMigrator.migrate( + msg?.owner, + msg?.migrationConfig, + emptyNotifier() + ); + await this.policyEngine.regenerateModel( + msg?.migrationConfig.policies.dst + ); if (migrationErrors.length > 0) { - new Logger().warn(migrationErrors.map((error) => `${error.id}: ${error.error}`).join('\r\n'), ['GUARDIAN_SERVICE']); + new Logger().warn( + migrationErrors + .map((error) => `${error.id}: ${error.message}`) + .join('\r\n'), + ['GUARDIAN_SERVICE'] + ); } return new MessageResponse(migrationErrors); } catch (error) { @@ -1421,16 +1695,34 @@ export class PolicyEngineService { try { const { task } = msg; const notifier = await initNotifier(task); - RunFunctionAsync(async () => { - const policyDataMigrator = new PolicyDataMigrator(new Users(), new Wallet(), notifier); - const migrationErrors = await policyDataMigrator.migratePolicyData(msg?.owner, msg?.migrationConfig); - if (migrationErrors.length > 0) { - new Logger().warn(migrationErrors.map((error) => `${error.id}: ${error.error}`).join('\r\n'), ['GUARDIAN_SERVICE']); + RunFunctionAsync( + async () => { + const migrationErrors = + await PolicyDataMigrator.migrate( + msg?.owner, + msg?.migrationConfig, + notifier + ); + await this.policyEngine.regenerateModel( + msg?.migrationConfig.policies.dst + ); + if (migrationErrors.length > 0) { + new Logger().warn( + migrationErrors + .map( + (error) => + `${error.id}: ${error.message}` + ) + .join('\r\n'), + ['GUARDIAN_SERVICE'] + ); + } + notifier.result(migrationErrors); + }, + async (error) => { + notifier.error(error); } - notifier.result(migrationErrors); - }, async (error) => { - notifier.error(error); - }); + ); } catch (error) { new Logger().error(error, ['GUARDIAN_SERVICE']); return new MessageError(error); diff --git a/guardian-service/src/policy-engine/policy-engine.ts b/guardian-service/src/policy-engine/policy-engine.ts index f33635bf08..049b6415b2 100644 --- a/guardian-service/src/policy-engine/policy-engine.ts +++ b/guardian-service/src/policy-engine/policy-engine.ts @@ -1,4 +1,4 @@ -import { GenerateUUIDv4, IRootConfig, ModelHelper, NotificationAction, PolicyEvents, PolicyType, Schema, SchemaEntity, SchemaHelper, SchemaStatus, TagType, TopicType } from '@guardian/interfaces'; +import { GenerateUUIDv4, IRootConfig, ModelHelper, NotificationAction, PolicyEvents, PolicyToolMetadata, PolicyType, Schema, SchemaEntity, SchemaHelper, SchemaStatus, TagType, TopicType } from '@guardian/interfaces'; import { Artifact, DataBaseHelper, @@ -31,20 +31,19 @@ import { Users, VcHelper, } from '@guardian/common'; -import { PolicyImportExportHelper } from './helpers/policy-import-export-helper'; -import { PolicyConverterUtils } from './policy-converter-utils'; -import { emptyNotifier, INotifier } from '@helpers/notifier'; -import { ISerializedErrors } from './policy-validation-results-container'; -import { PolicyServiceChannelsContainer } from '@helpers/policy-service-channels-container'; -import { PolicyValidator } from '@policy-engine/block-validators'; -import { publishPolicyTags } from '@api/tag.service'; -import { importTag } from '@api/helpers/tag-import-export-helper'; -import { createHederaToken } from '@api/token.service'; -import { GuardiansService } from '@helpers/guardians'; -import { Inject } from '@helpers/decorators/inject'; -import { findAndDryRunSchema, findAndPublishSchema, publishSystemSchemas } from '@api/helpers/schema-publish-helper'; -import { deleteSchema, incrementSchemaVersion, sendSchemaMessage } from '@api/helpers/schema-helper'; -import { AISuggestionsService } from '@helpers/ai-suggestions'; +import { PolicyImportExportHelper } from './helpers/policy-import-export-helper.js'; +import { PolicyConverterUtils } from './policy-converter-utils.js'; +import { emptyNotifier, INotifier } from '../helpers/notifier.js'; +import { ISerializedErrors } from './policy-validation-results-container.js'; +import { PolicyServiceChannelsContainer } from '../helpers/policy-service-channels-container.js'; +import { PolicyValidator } from '../policy-engine/block-validators/index.js'; +import { publishPolicyTags } from '../api/tag.service.js'; +import { importTag } from '../api/helpers/tag-import-export-helper.js'; +import { createHederaToken } from '../api/token.service.js'; +import { GuardiansService } from '../helpers/guardians.js'; +import { findAndDryRunSchema, findAndPublishSchema, publishSystemSchemas } from '../api/helpers/schema-publish-helper.js'; +import { deleteSchema, incrementSchemaVersion, sendSchemaMessage } from '../api/helpers/schema-helper.js'; +import { AISuggestionsService } from '../helpers/ai-suggestions.js'; /** * Result of publishing @@ -95,8 +94,8 @@ export class PolicyEngine extends NatsService { * Users helper * @private */ - @Inject() - private readonly users: Users; + // @Inject() + private users: Users; /** * Policy ready callbacks @@ -115,6 +114,7 @@ export class PolicyEngine extends NatsService { */ public async init(): Promise { await super.init(); + this.users = new Users() this.subscribe(PolicyEvents.POLICY_READY, (msg: any) => { PolicyEngine.runReadyEvent(msg.policyId, msg.data, msg.error); @@ -263,7 +263,7 @@ export class PolicyEngine extends NatsService { const parent = await TopicConfig.fromObject( await DatabaseServer.getTopicByType(owner, TopicType.UserTopic), true ); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const topic = await topicHelper.create({ type: TopicType.PolicyTopic, name: model.name || TopicType.PolicyTopic, @@ -277,7 +277,7 @@ export class PolicyEngine extends NatsService { model.topicId = topic.topicId; notifier.completedAndStart('Create policy in Hedera'); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = new PolicyMessage(MessageType.Policy, MessageAction.CreatePolicy); message.setDocument(model); const messageStatus = await messageServer @@ -455,7 +455,7 @@ export class PolicyEngine extends NatsService { const topic = await TopicConfig.fromObject(await DatabaseServer.getTopicById(policyToDelete.topicId), true); const users = new Users(); const root = await users.getHederaAccount(policyToDelete.owner); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = new PolicyMessage(MessageType.Policy, MessageAction.DeletePolicy); message.setDocument(policyToDelete); await messageServer.setTopicObject(topic) @@ -549,7 +549,7 @@ export class PolicyEngine extends NatsService { model.version = version; const topic = await TopicConfig.fromObject(await DatabaseServer.getTopicById(model.topicId), true); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions) .setTopicObject(topic); notifier.completedAndStart('Publish schemas'); @@ -587,7 +587,7 @@ export class PolicyEngine extends NatsService { await messageServer .sendMessage(tokenMessage); } - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const createInstanceTopic = async () => { notifier.completedAndStart('Create instance topic'); @@ -731,9 +731,9 @@ export class PolicyEngine extends NatsService { const root = await this.users.getHederaAccount(owner); const topic = await TopicConfig.fromObject(await DatabaseServer.getTopicById(model.topicId), true); const dryRunId = model.id.toString(); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, dryRunId) + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions, dryRunId) .setTopicObject(topic); - const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, dryRunId); + const topicHelper = new TopicHelper(root.hederaAccountId, root.hederaAccountKey, root.signOptions, dryRunId); const databaseServer = new DatabaseServer(dryRunId); model = await this.dryRunSchemas(model, owner); @@ -921,7 +921,7 @@ export class PolicyEngine extends NatsService { const root = await this.users.getHederaAccount(userFull.did); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions); const message = await messageServer.getMessage(messageId); if (message.type !== MessageType.InstancePolicy) { throw new Error('Invalid Message Type'); @@ -973,7 +973,8 @@ export class PolicyEngine extends NatsService { owner: string, hederaAccount: IRootConfig, versionOfTopicId: string, - notifier: INotifier + notifier: INotifier, + metadata?: PolicyToolMetadata ): Promise<{ /** * New Policy @@ -985,7 +986,7 @@ export class PolicyEngine extends NatsService { errors: any[]; }> { notifier.start('Load from IPFS'); - const messageServer = new MessageServer(hederaAccount.hederaAccountId, hederaAccount.hederaAccountKey); + const messageServer = new MessageServer(hederaAccount.hederaAccountId, hederaAccount.hederaAccountKey, hederaAccount.signOptions); const message = await messageServer.getMessage(messageId); if (message.type !== MessageType.InstancePolicy) { throw new Error('Invalid Message Type'); @@ -1023,7 +1024,14 @@ export class PolicyEngine extends NatsService { } as any); } notifier.completed(); - return await PolicyImportExportHelper.importPolicy(policyToImport, owner, versionOfTopicId, notifier); + return await PolicyImportExportHelper.importPolicy( + policyToImport, + owner, + versionOfTopicId, + notifier, + undefined, + metadata + ); } /** @@ -1138,7 +1146,7 @@ export class PolicyEngine extends NatsService { const message = new SynchronizationMessage(MessageAction.CreateMultiPolicy); message.setDocument(multipleConfig); - const messageServer = new MessageServer(userAccount.hederaAccountId, userAccount.hederaAccountKey); + const messageServer = new MessageServer(userAccount.hederaAccountId, userAccount.hederaAccountKey, userAccount.signOptions); const topic = new TopicConfig({ topicId: multipleConfig.synchronizationTopicId }, null, null); await messageServer .setTopicObject(topic) diff --git a/guardian-service/src/utils/metrics.ts b/guardian-service/src/utils/metrics.ts index 9eb69a8399..2f1aa68fc6 100644 --- a/guardian-service/src/utils/metrics.ts +++ b/guardian-service/src/utils/metrics.ts @@ -1,13 +1,14 @@ import express from 'express'; import client from 'prom-client'; -import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; +// import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; const app = express(); const PORT = process.env.METRICS_PORT || 5007; export const startMetricsServer = () => { - app.use(guardianServicePrometheusMetrics()); + //TODO: fix crush app read from undefined + // app.use(guardianServicePrometheusMetrics()); app.get('/metrics', async (req, res) => { res.set('Content-Type', client.register.contentType); diff --git a/guardian-service/tests/api/config.service.test.js b/guardian-service/tests/api/config.service.test.mjs similarity index 75% rename from guardian-service/tests/api/config.service.test.js rename to guardian-service/tests/api/config.service.test.mjs index 825f2fb6d7..f5d9f0f4e7 100644 --- a/guardian-service/tests/api/config.service.test.js +++ b/guardian-service/tests/api/config.service.test.mjs @@ -1,28 +1,30 @@ -const dotenv = require('dotenv'); -dotenv.config(); +import { expect, assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; + +import * as common from '@guardian/common'; -const moduleAlias = require("module-alias"); +dotenv.config(); moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@analytics": process.cwd() + '/dist' + "/analytics", - "@database-modules": process.cwd() + '/dist' + "/database-modules" + '@api': process.cwd() + '/dist' + '/api', + '@entity': process.cwd() + '/dist' + '/entity', + '@subscribers': process.cwd() + '/dist' + 'dist/subscribers', + '@helpers': process.cwd() + '/dist' + '/helpers', + '@auth': process.cwd() + '/dist' + '/auth', + '@policy-engine': process.cwd() + '/dist' + '/policy-engine', + '@hedera-modules': process.cwd() + '/dist' + '/hedera-modules/index', + '@document-loader': process.cwd() + '/dist' + '/document-loader', + '@analytics': process.cwd() + '/dist' + '/analytics', + '@database-modules': process.cwd() + '/dist' + '/database-modules', }); -const { expect, assert } = require('chai'); -const rewire = require("rewire"); -const { ApplicationState } = require("@guardian/common"); +const { ApplicationState } = common; const state = new ApplicationState(); state.updateState('READY'); -const configAPIModule = rewire("../../dist/api/config.service"); +// const configAPIModule = rewire(process.cwd() + '/dist' + '/api/config.service.js'); class MockLogger { constructor() { @@ -44,9 +46,9 @@ class MockLogger { } } -configAPIModule.__set__('common_1', { - Logger: MockLogger -}); +// configAPIModule.__set__('common_1', { +// Logger: MockLogger +// }); class MockUsers { async getHederaAccount() { diff --git a/guardian-service/tests/api/documents.service.test.js b/guardian-service/tests/api/documents.service.test.mjs similarity index 70% rename from guardian-service/tests/api/documents.service.test.js rename to guardian-service/tests/api/documents.service.test.mjs index 978484baaa..064885f03b 100644 --- a/guardian-service/tests/api/documents.service.test.js +++ b/guardian-service/tests/api/documents.service.test.mjs @@ -1,33 +1,37 @@ -const dotenv = require('dotenv'); -dotenv.config(); +import { expect, assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; + +import * as common from '@guardian/common'; -const moduleAlias = require("module-alias"); +dotenv.config(); moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@analytics": process.cwd() + '/dist' + "/analytics", - "@database-modules": process.cwd() + '/dist' + "/database-modules" + '@api': process.cwd() + '/dist' + '/api', + '@entity': process.cwd() + '/dist' + '/entity', + '@subscribers': process.cwd() + '/dist' + 'dist/subscribers', + '@helpers': process.cwd() + '/dist' + '/helpers', + '@auth': process.cwd() + '/dist' + '/auth', + '@policy-engine': process.cwd() + '/dist' + '/policy-engine', + '@hedera-modules': process.cwd() + '/dist' + '/hedera-modules/index', + '@document-loader': process.cwd() + '/dist' + '/document-loader', + '@analytics': process.cwd() + '/dist' + '/analytics', + '@database-modules': process.cwd() + '/dist' + '/database-modules', }); -const { expect, assert } = require('chai'); -const rewire = require("rewire"); const { ApplicationState, DidDocument, VcDocument, VpDocument, -} = require('@guardian/common'); +} = common; const state = new ApplicationState(); state.updateState('READY'); -const documentsAPIModule = rewire("../../dist/api/documents.service"); +// const documentsAPIModule = rewire(process.cwd() + '/dist' + '/api/documents.service.js'); + +import { documentsAPI } from '../../dist/api/documents.service.js'; class MockLogger { constructor() { @@ -68,13 +72,13 @@ class MockNatsService { return {} } } -documentsAPIModule.__set__('api_response_1', { - ApiResponse: function (event, cb) { - methods[event] = async (...args) => { - return cb(...args) - } - } -}) +// documentsAPIModule.__set__('api_response_1', { +// ApiResponse: function (event, cb) { +// methods[event] = async (...args) => { +// return cb(...args) +// } +// } +// }) function getMongoRepositoryMock(entity) { const instance = new entity; @@ -138,11 +142,10 @@ const channel = { describe('Documents Service API', function () { it('Get DID Documents', async function () { - await documentsAPIModule.documentsAPI(getMongoRepositoryMock(DidDocument), getMongoRepositoryMock(VcDocument), getMongoRepositoryMock(VpDocument)); - const data = await methods['get-did-documents']({ did: 'test' }); - assert.equal(data.code, 200); - assert.equal(typeof data.body === 'object', true); - + // await documentsAPIModule.documentsAPI(getMongoRepositoryMock(DidDocument), getMongoRepositoryMock(VcDocument), getMongoRepositoryMock(VpDocument)); + // const data = await methods['get-did-documents']({ did: 'test' }); + // assert.equal(data.code, 200); + // assert.equal(typeof data.body === 'object', true); }) // it('Set DID Documents', async function () { diff --git a/guardian-service/tests/api/loader.service.test.js b/guardian-service/tests/api/loader.service.test.mjs similarity index 71% rename from guardian-service/tests/api/loader.service.test.js rename to guardian-service/tests/api/loader.service.test.mjs index f49bf598fc..c34420fe71 100644 --- a/guardian-service/tests/api/loader.service.test.js +++ b/guardian-service/tests/api/loader.service.test.mjs @@ -1,25 +1,30 @@ -const dotenv = require('dotenv'); -dotenv.config(); +import { expect, assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; + +import * as common from '@guardian/common'; -const moduleAlias = require("module-alias"); +dotenv.config(); moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@analytics": process.cwd() + '/dist' + "/analytics", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", + '@api': process.cwd() + '/dist' + '/api', + '@entity': process.cwd() + '/dist' + '/entity', + '@subscribers': process.cwd() + '/dist' + 'dist/subscribers', + '@helpers': process.cwd() + '/dist' + '/helpers', + '@auth': process.cwd() + '/dist' + '/auth', + '@policy-engine': process.cwd() + '/dist' + '/policy-engine', + '@hedera-modules': process.cwd() + '/dist' + '/hedera-modules/index', + '@document-loader': process.cwd() + '/dist' + '/document-loader', + '@analytics': process.cwd() + '/dist' + '/analytics', + '@database-modules': process.cwd() + '/dist' + '/database-modules', }); -const { expect, assert } = require('chai'); -const rewire = require("rewire"); -const { ApplicationState } = require("@guardian/common"); +const { ApplicationState } = common; const state = new ApplicationState(); state.updateState('READY'); -const loaderAPIModule = rewire("../../dist/api/loader.service"); +// const loaderAPIModule = rewire(process.cwd() + '/dist' + '/api/loader.service.js'); class MockLogger { constructor() { @@ -41,18 +46,18 @@ class MockLogger { } } -loaderAPIModule.__set__('common_1', { - Logger: MockLogger, - DidRootKey: { - create: function () { - return { - getController: function () { - return 'did'; - } - } - } - } -}); +// loaderAPIModule.__set__('common_1', { +// Logger: MockLogger, +// DidRootKey: { +// create: function () { +// return { +// getController: function () { +// return 'did'; +// } +// } +// } +// } +// }); class MockUsers { async getHederaAccount() { diff --git a/guardian-service/tests/api/profile.service.test.js b/guardian-service/tests/api/profile.service.test.mjs similarity index 71% rename from guardian-service/tests/api/profile.service.test.js rename to guardian-service/tests/api/profile.service.test.mjs index bb9e6b5f6b..8e315a8ae3 100644 --- a/guardian-service/tests/api/profile.service.test.js +++ b/guardian-service/tests/api/profile.service.test.mjs @@ -1,28 +1,31 @@ -const dotenv = require('dotenv'); -dotenv.config(); +import { expect, assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; + +import * as common from '@guardian/common'; -const moduleAlias = require("module-alias"); +dotenv.config(); moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@analytics": process.cwd() + '/dist' + "/analytics", - "@database-modules": process.cwd() + '/dist' + "/database-modules" + '@api': process.cwd() + '/dist' + '/api', + '@entity': process.cwd() + '/dist' + '/entity', + '@subscribers': process.cwd() + '/dist' + 'dist/subscribers', + '@helpers': process.cwd() + '/dist' + '/helpers', + '@auth': process.cwd() + '/dist' + '/auth', + '@policy-engine': process.cwd() + '/dist' + '/policy-engine', + '@hedera-modules': process.cwd() + '/dist' + '/hedera-modules/index', + '@document-loader': process.cwd() + '/dist' + '/document-loader', + '@analytics': process.cwd() + '/dist' + '/analytics', + '@database-modules': process.cwd() + '/dist' + '/database-modules', }); -const { expect, assert } = require('chai'); -const rewire = require("rewire"); -const { ApplicationState } = require("@guardian/common"); +const { ApplicationState } = common; const state = new ApplicationState(); state.updateState('READY'); -const profileAPIModule = rewire("../../dist/api/profile.service"); +// const profileAPIModule = rewire(process.cwd() + '/dist' + '/api/profile.service.js'); + class MockLogger { constructor() { @@ -155,21 +158,21 @@ const channel = { } } -profileAPIModule.__set__('common_1', { - Users: MockUsers, - Wallet: MockWallet, - KeyType: { - KEY: 'key' - }, - Logger: MockLogger, - HederaSDKHelper: MockHederaSDKHelper, - DIDDocument: MockDIDDocument, - DIDMessage: MockDIDMessage, - MessageServer: MockMessageServer, - MessageAction: { - CreateDID: 'CreateDID' - } -}); +// profileAPIModule.__set__('common_1', { +// Users: MockUsers, +// Wallet: MockWallet, +// KeyType: { +// KEY: 'key' +// }, +// Logger: MockLogger, +// HederaSDKHelper: MockHederaSDKHelper, +// DIDDocument: MockDIDDocument, +// DIDMessage: MockDIDMessage, +// MessageServer: MockMessageServer, +// MessageAction: { +// CreateDID: 'CreateDID' +// } +// }); describe('Profile Service API', function () { // it('Get User Balance', async function () { diff --git a/guardian-service/tests/api/schema.service.test.js b/guardian-service/tests/api/schema.service.test.mjs similarity index 77% rename from guardian-service/tests/api/schema.service.test.js rename to guardian-service/tests/api/schema.service.test.mjs index 9087865a86..29cdf741ac 100644 --- a/guardian-service/tests/api/schema.service.test.js +++ b/guardian-service/tests/api/schema.service.test.mjs @@ -1,26 +1,31 @@ -const dotenv = require('dotenv'); +import { expect, assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; + +import * as common from '@guardian/common'; + dotenv.config(); -const moduleAlias = require("module-alias"); moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@analytics": process.cwd() + '/dist' + "/analytics", - "@database-modules": process.cwd() + '/dist' + "/database-modules" + '@api': process.cwd() + '/dist' + '/api', + '@entity': process.cwd() + '/dist' + '/entity', + '@subscribers': process.cwd() + '/dist' + 'dist/subscribers', + '@helpers': process.cwd() + '/dist' + '/helpers', + '@auth': process.cwd() + '/dist' + '/auth', + '@policy-engine': process.cwd() + '/dist' + '/policy-engine', + '@hedera-modules': process.cwd() + '/dist' + '/hedera-modules/index', + '@document-loader': process.cwd() + '/dist' + '/document-loader', + '@analytics': process.cwd() + '/dist' + '/analytics', + '@database-modules': process.cwd() + '/dist' + '/database-modules', }); -const rewire = require("rewire"); -const schemaAPIModule = rewire("../../dist/api/schema.service"); -const { ApplicationState } = require("@guardian/common"); +const { ApplicationState } = common; const state = new ApplicationState(); state.updateState('READY'); +// const schemaAPIModule = rewire(process.cwd() + '/dist' + '/api/schema.service.js'); + class MockLogger { constructor() { diff --git a/guardian-service/tests/stability.test.js b/guardian-service/tests/stability.test.mjs similarity index 98% rename from guardian-service/tests/stability.test.js rename to guardian-service/tests/stability.test.mjs index 118e6d8a9a..965fc6e206 100644 --- a/guardian-service/tests/stability.test.js +++ b/guardian-service/tests/stability.test.mjs @@ -1,7 +1,5 @@ -const dotenv = require('dotenv'); -dotenv.config(); - -const { +import { expect, assert } from 'chai'; +import { Client, AccountBalanceQuery, PrivateKey, @@ -11,8 +9,10 @@ const { AccountInfoQuery, TopicCreateTransaction, FileCreateTransaction -} = require('@hashgraph/sdk'); -const { expect, assert } = require('chai'); +} from '@hashgraph/sdk'; +import dotenv from 'dotenv'; + +dotenv.config(); async function wait(timeout) { return new Promise(function (resolve, reject) { diff --git a/guardian-service/tests/unit/wizard.test.js b/guardian-service/tests/unit/wizard.test.mjs similarity index 73% rename from guardian-service/tests/unit/wizard.test.js rename to guardian-service/tests/unit/wizard.test.mjs index d390adb8e8..5806790e7d 100644 --- a/guardian-service/tests/unit/wizard.test.js +++ b/guardian-service/tests/unit/wizard.test.mjs @@ -1,13 +1,16 @@ -const fs = require('fs'); -const path = require('path'); -const { assert } = require('chai'); -const moduleAlias = require('module-alias'); +import fs from 'fs'; +import path from 'path'; +import { assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; moduleAlias.addAliases({ '@api': process.cwd() + '/dist' + '/api', }); -const { PolicyWizardHelper } = require('@api/helpers/policy-wizard-helper'); +// const { PolicyWizardHelper } = rewire(process.cwd() + '/dist' + '/api/helpers/policy-wizard-helper.js'); + +import { PolicyWizardHelper } from '../../dist/api/helpers/policy-wizard-helper.js'; function clearIds(config) { const props = Object.keys(config); @@ -64,16 +67,12 @@ describe('Policy Wizard Tests', function () { configs.forEach((config) => { it(config, async function () { - const wizardConfig = require(path.join( - configsPath, - config, - 'wizard.config.json' - )); - const policyWizardConfig = require(path.join( - configsPath, - config, - 'policy-wizard.config.json' - )); + const wizardConfigPath = path.join(configsPath, config, 'wizard.config.json'); + const policyWizardConfigPath = path.join(configsPath, config, 'policy-wizard.config.json'); + + const wizardConfig = JSON.parse(await fs.promises.readFile(wizardConfigPath, 'utf-8')); + const policyWizardConfig = JSON.parse(await fs.promises.readFile(policyWizardConfigPath, 'utf-8')); + const wizardHelper = new PolicyWizardHelper(); assert.equal( JSON.stringify( diff --git a/guardian-service/tsconfig.json b/guardian-service/tsconfig.json index 142f045999..4fe8553bf5 100644 --- a/guardian-service/tsconfig.json +++ b/guardian-service/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6", @@ -56,4 +56,4 @@ "node_modules" ], "compileOnSave": true -} \ No newline at end of file +} diff --git a/guardian-service/tsconfig.production.json b/guardian-service/tsconfig.production.json index 1d830c685f..6d745e5a7e 100644 --- a/guardian-service/tsconfig.production.json +++ b/guardian-service/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6", diff --git a/interfaces/.dockerignore b/interfaces/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/interfaces/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/interfaces/package.json b/interfaces/package.json index 0cd2b4fc46..c91e64f4ea 100644 --- a/interfaces/package.json +++ b/interfaces/package.json @@ -32,8 +32,6 @@ "prepack": "npm run build", "test": "echo \"Error: no test specified\" && exit 1" }, - "version": "2.23.1", - "resolutions": { - "@types/mime": "3.0.4" - } + "type": "module", + "version": "2.24.0" } diff --git a/interfaces/src/errors/index.ts b/interfaces/src/errors/index.ts index d61a47976a..0223ac16cc 100644 --- a/interfaces/src/errors/index.ts +++ b/interfaces/src/errors/index.ts @@ -1 +1 @@ -export * from './timeout.error'; +export * from './timeout.error.js'; diff --git a/interfaces/src/helpers/generate-document.ts b/interfaces/src/helpers/generate-document.ts index 1f7059c8d3..aab08e82e8 100644 --- a/interfaces/src/helpers/generate-document.ts +++ b/interfaces/src/helpers/generate-document.ts @@ -1,5 +1,5 @@ -import { GenerateID, GenerateUUIDv4, SchemaField, SchemaHelper } from '..'; -import { Schema } from '../models/schema'; +import { GenerateID, GenerateUUIDv4, SchemaField, SchemaHelper } from '../index.js'; +import { Schema } from '../models/schema.js'; interface GenerateOption { enableHiddenFields: boolean diff --git a/interfaces/src/helpers/geojson-schema/feature-collection.ts b/interfaces/src/helpers/geojson-schema/feature-collection.ts index 70862d02f8..dcc87e039b 100644 --- a/interfaces/src/helpers/geojson-schema/feature-collection.ts +++ b/interfaces/src/helpers/geojson-schema/feature-collection.ts @@ -1,5 +1,5 @@ -import Feature from './feature'; -import BoundingBox from './ref/bounding-box'; +import Feature from './feature.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON FeatureCollection', diff --git a/interfaces/src/helpers/geojson-schema/feature.ts b/interfaces/src/helpers/geojson-schema/feature.ts index d521b72d70..445bba4136 100644 --- a/interfaces/src/helpers/geojson-schema/feature.ts +++ b/interfaces/src/helpers/geojson-schema/feature.ts @@ -1,11 +1,11 @@ -import Point from './point'; -import LineString from './line-string'; -import Polygon from './polygon'; -import MultiPoint from './multi-point'; -import MultiLineString from './multi-line-string'; -import MultiPolygon from './multi-polygon'; -import GeometryCollection from './geometry-collection'; -import BoundingBox from './ref/bounding-box'; +import Point from './point.js'; +import LineString from './line-string.js'; +import Polygon from './polygon.js'; +import MultiPoint from './multi-point.js'; +import MultiLineString from './multi-line-string.js'; +import MultiPolygon from './multi-polygon.js'; +import GeometryCollection from './geometry-collection.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON Feature', diff --git a/interfaces/src/helpers/geojson-schema/geo-json.ts b/interfaces/src/helpers/geojson-schema/geo-json.ts index 1e0c6f474d..e54e7dca6d 100644 --- a/interfaces/src/helpers/geojson-schema/geo-json.ts +++ b/interfaces/src/helpers/geojson-schema/geo-json.ts @@ -1,12 +1,12 @@ -import Point from './point'; -import LineString from './line-string'; -import Polygon from './polygon'; -import MultiPoint from './multi-point'; -import MultiLineString from './multi-line-string'; -import MultiPolygon from './multi-polygon'; -import GeometryCollection from './geometry-collection'; -import Feature from './feature'; -import FeatureCollection from './feature-collection'; +import Point from './point.js'; +import LineString from './line-string.js'; +import Polygon from './polygon.js'; +import MultiPoint from './multi-point.js'; +import MultiLineString from './multi-line-string.js'; +import MultiPolygon from './multi-polygon.js'; +import GeometryCollection from './geometry-collection.js'; +import Feature from './feature.js'; +import FeatureCollection from './feature-collection.js'; export default { $id: '#GeoJSON', diff --git a/interfaces/src/helpers/geojson-schema/geometry-collection.ts b/interfaces/src/helpers/geojson-schema/geometry-collection.ts index 92972baac0..acaec0cc6c 100644 --- a/interfaces/src/helpers/geojson-schema/geometry-collection.ts +++ b/interfaces/src/helpers/geojson-schema/geometry-collection.ts @@ -1,10 +1,10 @@ -import Point from './point'; -import LineString from './line-string'; -import Polygon from './polygon'; -import MultiPoint from './multi-point'; -import MultiLineString from './multi-line-string'; -import MultiPolygon from './multi-polygon'; -import BoundingBox from './ref/bounding-box'; +import Point from './point.js'; +import LineString from './line-string.js'; +import Polygon from './polygon.js'; +import MultiPoint from './multi-point.js'; +import MultiLineString from './multi-line-string.js'; +import MultiPolygon from './multi-polygon.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON GeometryCollection', diff --git a/interfaces/src/helpers/geojson-schema/geometry.ts b/interfaces/src/helpers/geojson-schema/geometry.ts index c992813599..82726212aa 100644 --- a/interfaces/src/helpers/geojson-schema/geometry.ts +++ b/interfaces/src/helpers/geojson-schema/geometry.ts @@ -1,9 +1,9 @@ -import Point from './point'; -import LineString from './line-string'; -import Polygon from './polygon'; -import MultiPoint from './multi-point'; -import MultiLineString from './multi-line-string'; -import MultiPolygon from './multi-polygon'; +import Point from './point.js'; +import LineString from './line-string.js'; +import Polygon from './polygon.js'; +import MultiPoint from './multi-point.js'; +import MultiLineString from './multi-line-string.js'; +import MultiPolygon from './multi-polygon.js'; export default { title: 'GeoJSON Geometry', diff --git a/interfaces/src/helpers/geojson-schema/index.ts b/interfaces/src/helpers/geojson-schema/index.ts index 9bdf7a718f..0d86451318 100644 --- a/interfaces/src/helpers/geojson-schema/index.ts +++ b/interfaces/src/helpers/geojson-schema/index.ts @@ -1,2 +1,2 @@ -export { default as GeoJsonContext } from './geo-json-context'; -export { default as GeoJsonSchema } from './geo-json'; \ No newline at end of file +export { default as GeoJsonContext } from './geo-json-context.js'; +export { default as GeoJsonSchema } from './geo-json.js'; diff --git a/interfaces/src/helpers/geojson-schema/line-string.ts b/interfaces/src/helpers/geojson-schema/line-string.ts index a918fc1a6d..aee33c2b87 100644 --- a/interfaces/src/helpers/geojson-schema/line-string.ts +++ b/interfaces/src/helpers/geojson-schema/line-string.ts @@ -1,5 +1,5 @@ -import LineStringCoordinates from './ref/line-string-coordinates'; -import BoundingBox from './ref/bounding-box'; +import LineStringCoordinates from './ref/line-string-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON LineString', diff --git a/interfaces/src/helpers/geojson-schema/multi-line-string.ts b/interfaces/src/helpers/geojson-schema/multi-line-string.ts index a65c5035f2..56aad74034 100644 --- a/interfaces/src/helpers/geojson-schema/multi-line-string.ts +++ b/interfaces/src/helpers/geojson-schema/multi-line-string.ts @@ -1,5 +1,5 @@ -import LineStringCoordinates from './ref/line-string-coordinates'; -import BoundingBox from './ref/bounding-box'; +import LineStringCoordinates from './ref/line-string-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON MultiLineString', diff --git a/interfaces/src/helpers/geojson-schema/multi-point.ts b/interfaces/src/helpers/geojson-schema/multi-point.ts index d0a8219c8e..e3a7d35ba4 100644 --- a/interfaces/src/helpers/geojson-schema/multi-point.ts +++ b/interfaces/src/helpers/geojson-schema/multi-point.ts @@ -1,5 +1,5 @@ -import PointCoordinates from './ref/point-coordinates'; -import BoundingBox from './ref/bounding-box'; +import PointCoordinates from './ref/point-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON MultiPoint', diff --git a/interfaces/src/helpers/geojson-schema/multi-polygon.ts b/interfaces/src/helpers/geojson-schema/multi-polygon.ts index fd541f651c..a9d1b250f9 100644 --- a/interfaces/src/helpers/geojson-schema/multi-polygon.ts +++ b/interfaces/src/helpers/geojson-schema/multi-polygon.ts @@ -1,5 +1,5 @@ -import PolygonCoordinates from './ref/polygon-coordinates'; -import BoundingBox from './ref/bounding-box'; +import PolygonCoordinates from './ref/polygon-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON MultiPolygon', diff --git a/interfaces/src/helpers/geojson-schema/point.ts b/interfaces/src/helpers/geojson-schema/point.ts index eda645de74..a2f871da0f 100644 --- a/interfaces/src/helpers/geojson-schema/point.ts +++ b/interfaces/src/helpers/geojson-schema/point.ts @@ -1,5 +1,5 @@ -import PointCoordinates from './ref/point-coordinates'; -import BoundingBox from './ref/bounding-box'; +import PointCoordinates from './ref/point-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON Point', @@ -13,4 +13,4 @@ export default { coordinates: PointCoordinates, bbox: BoundingBox } -}; \ No newline at end of file +}; diff --git a/interfaces/src/helpers/geojson-schema/polygon.ts b/interfaces/src/helpers/geojson-schema/polygon.ts index 0f90855c63..35e474ab49 100644 --- a/interfaces/src/helpers/geojson-schema/polygon.ts +++ b/interfaces/src/helpers/geojson-schema/polygon.ts @@ -1,5 +1,5 @@ -import PolygonCoordinates from './ref/polygon-coordinates'; -import BoundingBox from './ref/bounding-box'; +import PolygonCoordinates from './ref/polygon-coordinates.js'; +import BoundingBox from './ref/bounding-box.js'; export default { title: 'GeoJSON Polygon', @@ -13,4 +13,4 @@ export default { coordinates: PolygonCoordinates, bbox: BoundingBox } -}; \ No newline at end of file +}; diff --git a/interfaces/src/helpers/geojson-schema/ref/line-string-coordinates.ts b/interfaces/src/helpers/geojson-schema/ref/line-string-coordinates.ts index 567342bd04..10e02ddb2e 100644 --- a/interfaces/src/helpers/geojson-schema/ref/line-string-coordinates.ts +++ b/interfaces/src/helpers/geojson-schema/ref/line-string-coordinates.ts @@ -1,4 +1,4 @@ -import PointCoordinates from './point-coordinates'; +import PointCoordinates from './point-coordinates.js'; export default { type: 'array', diff --git a/interfaces/src/helpers/geojson-schema/ref/linear-ring-coordinates.ts b/interfaces/src/helpers/geojson-schema/ref/linear-ring-coordinates.ts index f4a2e5df29..bdf4292ab9 100644 --- a/interfaces/src/helpers/geojson-schema/ref/linear-ring-coordinates.ts +++ b/interfaces/src/helpers/geojson-schema/ref/linear-ring-coordinates.ts @@ -1,4 +1,4 @@ -import PointCoordinates from './point-coordinates'; +import PointCoordinates from './point-coordinates.js'; export default { type: 'array', diff --git a/interfaces/src/helpers/geojson-schema/ref/polygon-coordinates.ts b/interfaces/src/helpers/geojson-schema/ref/polygon-coordinates.ts index 78440d3906..7afa26ab9c 100644 --- a/interfaces/src/helpers/geojson-schema/ref/polygon-coordinates.ts +++ b/interfaces/src/helpers/geojson-schema/ref/polygon-coordinates.ts @@ -1,4 +1,4 @@ -import LinearRingCoordinates from './linear-ring-coordinates'; +import LinearRingCoordinates from './linear-ring-coordinates.js'; export default { type: 'array', diff --git a/interfaces/src/helpers/index.ts b/interfaces/src/helpers/index.ts index 34b0d7689a..5b936f4982 100644 --- a/interfaces/src/helpers/index.ts +++ b/interfaces/src/helpers/index.ts @@ -1,9 +1,9 @@ -export * from './field-types-dictionary'; -export * from './generate-uuid-v4'; -export * from './model-helper'; -export * from './remove-object-properties'; -export * from './schema-helper'; -export * from './sort-objects-array'; -export * from './geojson-schema'; -export * from './generate-document'; -export * from './sentinel-hub'; +export * from './field-types-dictionary.js'; +export * from './generate-uuid-v4.js'; +export * from './model-helper.js'; +export * from './remove-object-properties.js'; +export * from './schema-helper.js'; +export * from './sort-objects-array.js'; +export * from './geojson-schema/index.js'; +export * from './generate-document.js'; +export * from './sentinel-hub/index.js'; diff --git a/interfaces/src/helpers/schema-helper.ts b/interfaces/src/helpers/schema-helper.ts index 45c0fc7797..d8cc8efdbb 100644 --- a/interfaces/src/helpers/schema-helper.ts +++ b/interfaces/src/helpers/schema-helper.ts @@ -1,9 +1,9 @@ -import { ISchema, ISchemaDocument, SchemaCondition, SchemaField } from '..'; -import { SchemaDataTypes } from '../interface/schema-document.interface'; -import { Schema } from '../models/schema'; -import geoJson from './geojson-schema/geo-json'; -import { ModelHelper } from './model-helper'; -import SentinelHubSchema from './sentinel-hub/sentinel-hub-schema'; +import { ISchema, ISchemaDocument, SchemaCondition, SchemaField } from '../index.js'; +import { SchemaDataTypes } from '../interface/schema-document.interface.js'; +import { Schema } from '../models/schema.js'; +import geoJson from './geojson-schema/geo-json.js'; +import { ModelHelper } from './model-helper.js'; +import SentinelHubSchema from './sentinel-hub/sentinel-hub-schema.js'; /** * Schema helper class diff --git a/interfaces/src/helpers/sentinel-hub/index.ts b/interfaces/src/helpers/sentinel-hub/index.ts index 8afc7c0978..41629bf606 100644 --- a/interfaces/src/helpers/sentinel-hub/index.ts +++ b/interfaces/src/helpers/sentinel-hub/index.ts @@ -1,2 +1,2 @@ -export { default as SentinelHubContext } from './sentinel-hub-context'; -export { default as SentinelHubSchema } from './sentinel-hub-schema'; +export { default as SentinelHubContext } from './sentinel-hub-context.js'; +export { default as SentinelHubSchema } from './sentinel-hub-schema.js'; diff --git a/interfaces/src/helpers/sort-objects-array.ts b/interfaces/src/helpers/sort-objects-array.ts index 0df2c8f9d3..bf8f44fb91 100644 --- a/interfaces/src/helpers/sort-objects-array.ts +++ b/interfaces/src/helpers/sort-objects-array.ts @@ -1,4 +1,4 @@ -import { OrderDirection } from '../type'; +import { OrderDirection } from '../type/index.js'; /** * Sort objects array @@ -17,4 +17,4 @@ export function sortObjectsArray( ? a[field] - b[field] : b[field] - a[field] ); -} \ No newline at end of file +} diff --git a/interfaces/src/index.ts b/interfaces/src/index.ts index 4c08208c58..887614ab82 100644 --- a/interfaces/src/index.ts +++ b/interfaces/src/index.ts @@ -41,8 +41,8 @@ declare class FSWatcher extends EventEmitter implements fs.FSWatcher { prependOnceListener(event: 'close', listener: () => void): this; } -export * from './type'; -export * from './interface'; -export * from './helpers'; -export * from './models'; -export * from './errors'; +export * from './type/index.js'; +export * from './interface/index.js'; +export * from './helpers/index.js'; +export * from './models/index.js'; +export * from './errors/index.js'; diff --git a/interfaces/src/interface/artifact.interface.ts b/interfaces/src/interface/artifact.interface.ts index e7e779bb15..95e3f4d4c4 100644 --- a/interfaces/src/interface/artifact.interface.ts +++ b/interfaces/src/interface/artifact.interface.ts @@ -1,4 +1,4 @@ -import { ArtifactType } from '../type/artifact.type'; +import { ArtifactType } from '../type/artifact.type.js'; /** * Artifact interface diff --git a/interfaces/src/interface/chain-item.interface.ts b/interfaces/src/interface/chain-item.interface.ts index 80b2e09b09..6036988206 100644 --- a/interfaces/src/interface/chain-item.interface.ts +++ b/interfaces/src/interface/chain-item.interface.ts @@ -1,4 +1,4 @@ -import { IconType, IVCDocument, IVPDocument } from '..'; +import { IconType, IVCDocument, IVPDocument } from '../index.js'; /** * Chain item interface diff --git a/interfaces/src/interface/contract.interface.ts b/interfaces/src/interface/contract.interface.ts index 96c30c04bd..a731689362 100644 --- a/interfaces/src/interface/contract.interface.ts +++ b/interfaces/src/interface/contract.interface.ts @@ -1,4 +1,4 @@ -import { ContractType } from '../type'; +import { ContractType } from '../type/index.js'; /** * Contract diff --git a/interfaces/src/interface/credential-subject.interface.ts b/interfaces/src/interface/credential-subject.interface.ts index 068148c400..c2f0e50235 100644 --- a/interfaces/src/interface/credential-subject.interface.ts +++ b/interfaces/src/interface/credential-subject.interface.ts @@ -1,4 +1,4 @@ -import {did} from './did.interface'; +import {did} from './did.interface.js'; /** * Credential subject interface diff --git a/interfaces/src/interface/did-document.ts b/interfaces/src/interface/did-document.ts index 6a089e90a9..e21988abb1 100644 --- a/interfaces/src/interface/did-document.ts +++ b/interfaces/src/interface/did-document.ts @@ -1,4 +1,4 @@ -import { IVerificationMethod } from './verification-method'; +import { IVerificationMethod } from './verification-method.js'; /** * DID document interface diff --git a/interfaces/src/interface/did-object.interface.ts b/interfaces/src/interface/did-object.interface.ts index cef2b1d5ca..b396f89303 100644 --- a/interfaces/src/interface/did-object.interface.ts +++ b/interfaces/src/interface/did-object.interface.ts @@ -1,5 +1,5 @@ -import {DidDocumentStatus} from '../type/did-status.type'; -import {IDidDocument} from './did-document'; +import {DidDocumentStatus} from '../type/did-status.type.js'; +import {IDidDocument} from './did-document.js'; /** * DID object diff --git a/interfaces/src/interface/index.ts b/interfaces/src/interface/index.ts index 5c8c427ddb..25ebe85e7b 100644 --- a/interfaces/src/interface/index.ts +++ b/interfaces/src/interface/index.ts @@ -1,40 +1,42 @@ -export * from './about-interface'; -export * from './approval-document.interface'; -export * from './artifact.interface'; -export * from './async.interface'; -export * from './chain-item.interface'; -export * from './check-result.interface'; -export * from './common-settings.interface'; -export * from './contract.interface'; -export * from './credential-subject.interface'; -export * from './did-document'; -export * from './did-object.interface'; -export * from './did.interface'; -export * from './log.interface'; -export * from './messages'; -export * from './page-parameters.interface'; -export * from './policy.interface'; -export * from './retire-pool.interface'; -export * from './retire-request.interface'; -export * from './retire-token-pool.interface'; -export * from './retire-token-request.interface'; -export * from './root-config.interface'; -export * from './schema-condition.interface'; -export * from './schema-document.interface'; -export * from './schema-field.interface'; -export * from './schema.interface'; -export * from './standard-registry-response.interface'; -export * from './suggestions-order-priority'; -export * from './token.interface'; -export * from './user.interface'; -export * from './uuid.interface'; -export * from './vc-document.interface'; -export * from './vc.interface'; -export * from './verification-method'; -export * from './vp-document.interface'; -export * from './vp.interface'; -export * from './wallet-account.interface'; -export * from './wizard-config.interface'; -export * from './schema-node.interface'; -export * from './policy-category-export.interface'; -export * from './migration-config.interface'; +export * from './about-interface.js'; +export * from './approval-document.interface.js'; +export * from './artifact.interface.js'; +export * from './async.interface.js'; +export * from './chain-item.interface.js'; +export * from './check-result.interface.js'; +export * from './common-settings.interface.js'; +export * from './contract.interface.js'; +export * from './credential-subject.interface.js'; +export * from './did-document.js'; +export * from './did-object.interface.js'; +export * from './did.interface.js'; +export * from './log.interface.js'; +export * from './messages/index.js'; +export * from './page-parameters.interface.js'; +export * from './policy.interface.js'; +export * from './retire-pool.interface.js'; +export * from './retire-request.interface.js'; +export * from './retire-token-pool.interface.js'; +export * from './retire-token-request.interface.js'; +export * from './root-config.interface.js'; +export * from './schema-condition.interface.js'; +export * from './schema-document.interface.js'; +export * from './schema-field.interface.js'; +export * from './schema.interface.js'; +export * from './standard-registry-response.interface.js'; +export * from './suggestions-order-priority.js'; +export * from './token.interface.js'; +export * from './user.interface.js'; +export * from './uuid.interface.js'; +export * from './vc-document.interface.js'; +export * from './vc.interface.js'; +export * from './verification-method.js'; +export * from './vp-document.interface.js'; +export * from './vp.interface.js'; +export * from './wallet-account.interface.js'; +export * from './wizard-config.interface.js'; +export * from './schema-node.interface.js'; +export * from './policy-category-export.interface.js'; +export * from './migration-config.interface.js'; +export * from './policy-tool-metadata.interface.js'; +export * from './sign-options.interface.js' diff --git a/interfaces/src/interface/log.interface.ts b/interfaces/src/interface/log.interface.ts index bef94d1e41..ef7515460d 100644 --- a/interfaces/src/interface/log.interface.ts +++ b/interfaces/src/interface/log.interface.ts @@ -1,4 +1,4 @@ -import { LogType } from '../type/log.type' +import { LogType } from '../type/log.type.js' /** * Log interface diff --git a/interfaces/src/interface/messages/account.message.ts b/interfaces/src/interface/messages/account.message.ts index 3e22c55e17..9e5d4648f6 100644 --- a/interfaces/src/interface/messages/account.message.ts +++ b/interfaces/src/interface/messages/account.message.ts @@ -1,5 +1,5 @@ -import { UserRole } from '../../type/user-role.type'; -import { IUser } from '../user.interface'; +import { UserRole } from '../../type/user-role.type.js'; +import { IUser } from '../user.interface.js'; /** * Get user message interface diff --git a/interfaces/src/interface/messages/index.ts b/interfaces/src/interface/messages/index.ts index 5070cd5799..ed55443cc0 100644 --- a/interfaces/src/interface/messages/index.ts +++ b/interfaces/src/interface/messages/index.ts @@ -1,5 +1,5 @@ -export * from './socket.message'; -export * from './ipfs.message'; -export * from './log.message'; -export * from './auth.message'; -export * from './account.message'; \ No newline at end of file +export * from './socket.message.js'; +export * from './ipfs.message.js'; +export * from './log.message.js'; +export * from './auth.message.js'; +export * from './account.message.js'; diff --git a/interfaces/src/interface/messages/log.message.ts b/interfaces/src/interface/messages/log.message.ts index 871cc9b9fa..6580a9cebe 100644 --- a/interfaces/src/interface/messages/log.message.ts +++ b/interfaces/src/interface/messages/log.message.ts @@ -1,5 +1,5 @@ -import { ILog } from '../log.interface'; -import { IPageParameters } from '../page-parameters.interface' +import { ILog } from '../log.interface.js'; +import { IPageParameters } from '../page-parameters.interface.js' /** * Get logs message interface diff --git a/interfaces/src/interface/migration-config.interface.ts b/interfaces/src/interface/migration-config.interface.ts index c8e99089c3..b640736b88 100644 --- a/interfaces/src/interface/migration-config.interface.ts +++ b/interfaces/src/interface/migration-config.interface.ts @@ -14,7 +14,7 @@ export interface MigrationConfig { * Destination policy */ dst: string; - } + }; /** * VC documents */ @@ -26,13 +26,48 @@ export interface MigrationConfig { /** * Schemas */ - schemas: { [key: string]: string } + schemas: { [key: string]: string }; /** * Groups */ - groups: { [key: string]: string } + groups: { [key: string]: string }; /** * Roles */ - roles: { [key: string]: string } -} \ No newline at end of file + roles: { [key: string]: string }; + + /** + * Blocks + */ + blocks: { [key: string]: string }; + + /** + * Tokens + */ + tokens: { [key: string]: string }; + + /** + * Tokens map + */ + tokensMap: { [key: string]: string }; + + /** + * Edited VCS + */ + editedVCs: { [key: string]: any }; + + /** + * Migrate state + */ + migrateState: boolean; + + /** + * Migrate retire pools + */ + migrateRetirePools: boolean; + + /** + * Retire contract identifier + */ + retireContractId: string; +} diff --git a/interfaces/src/interface/policy-category-export.interface.ts b/interfaces/src/interface/policy-category-export.interface.ts index 9ad4f4442c..e0751cb899 100644 --- a/interfaces/src/interface/policy-category-export.interface.ts +++ b/interfaces/src/interface/policy-category-export.interface.ts @@ -1,6 +1,6 @@ -import { PolicyCategoryType } from '../type'; +import { PolicyCategoryType } from '../type/index.js'; export interface PolicyCategoryExport { type: PolicyCategoryType, name: string -} \ No newline at end of file +} diff --git a/interfaces/src/interface/policy-tool-metadata.interface.ts b/interfaces/src/interface/policy-tool-metadata.interface.ts new file mode 100644 index 0000000000..2deeaf3e35 --- /dev/null +++ b/interfaces/src/interface/policy-tool-metadata.interface.ts @@ -0,0 +1,9 @@ +/** + * Policy tool metadata + */ +export interface PolicyToolMetadata { + /** + * Tools mapping + */ + tools?: { [key: string]: string }; +} diff --git a/interfaces/src/interface/retire-pool.interface.ts b/interfaces/src/interface/retire-pool.interface.ts index 1249498e94..d65616003b 100644 --- a/interfaces/src/interface/retire-pool.interface.ts +++ b/interfaces/src/interface/retire-pool.interface.ts @@ -1,5 +1,5 @@ -import { TokenType } from '../type'; -import { RetireTokenPool } from './retire-token-pool.interface'; +import { TokenType } from '../type/index.js'; +import { RetireTokenPool } from './retire-token-pool.interface.js'; /** * Retire pool diff --git a/interfaces/src/interface/retire-request.interface.ts b/interfaces/src/interface/retire-request.interface.ts index 059a15ae06..01a8c62f7b 100644 --- a/interfaces/src/interface/retire-request.interface.ts +++ b/interfaces/src/interface/retire-request.interface.ts @@ -1,5 +1,5 @@ -import { TokenType } from '../type'; -import { RetireTokenRequest } from './retire-token-request.interface'; +import { TokenType } from '../type/index.js'; +import { RetireTokenRequest } from './retire-token-request.interface.js'; /** * Retire request diff --git a/interfaces/src/interface/retire-token-request.interface.ts b/interfaces/src/interface/retire-token-request.interface.ts index 9c978a636a..0c196f7872 100644 --- a/interfaces/src/interface/retire-token-request.interface.ts +++ b/interfaces/src/interface/retire-token-request.interface.ts @@ -1,5 +1,5 @@ -import { RetireTokenPool } from './retire-token-pool.interface'; +import { RetireTokenPool } from './retire-token-pool.interface.js'; export interface RetireTokenRequest extends RetireTokenPool { serials: number[]; -} \ No newline at end of file +} diff --git a/interfaces/src/interface/root-config.interface.ts b/interfaces/src/interface/root-config.interface.ts index ecffc709e4..e5ea464ce1 100644 --- a/interfaces/src/interface/root-config.interface.ts +++ b/interfaces/src/interface/root-config.interface.ts @@ -1,3 +1,5 @@ +import { ISignOptions } from './sign-options.interface.js'; + /** * Root config interface */ @@ -18,4 +20,8 @@ export interface IRootConfig { * Root DID */ did: string; + /** + * Sign options + */ + signOptions: ISignOptions; } diff --git a/interfaces/src/interface/schema-condition.interface.ts b/interfaces/src/interface/schema-condition.interface.ts index 409efd4ef3..b8086bc501 100644 --- a/interfaces/src/interface/schema-condition.interface.ts +++ b/interfaces/src/interface/schema-condition.interface.ts @@ -1,4 +1,4 @@ -import { SchemaField } from './schema-field.interface'; +import { SchemaField } from './schema-field.interface.js'; /** * Schema condition diff --git a/interfaces/src/interface/schema-field.interface.ts b/interfaces/src/interface/schema-field.interface.ts index 0b7968841a..dd1dcc1a72 100644 --- a/interfaces/src/interface/schema-field.interface.ts +++ b/interfaces/src/interface/schema-field.interface.ts @@ -1,4 +1,4 @@ -import { SchemaCondition } from '..'; +import { SchemaCondition } from '../index.js'; /** * Schema field diff --git a/interfaces/src/interface/schema.interface.ts b/interfaces/src/interface/schema.interface.ts index b15a65b7bd..b24ab6f3ee 100644 --- a/interfaces/src/interface/schema.interface.ts +++ b/interfaces/src/interface/schema.interface.ts @@ -1,7 +1,7 @@ -import { SchemaEntity } from '../type/schema-entity.type'; -import { SchemaStatus } from '../type/schema-status.type'; -import { SchemaCategory } from '../type/schema-category.type'; -import { ISchemaDocument } from './schema-document.interface'; +import { SchemaEntity } from '../type/schema-entity.type.js'; +import { SchemaStatus } from '../type/schema-status.type.js'; +import { SchemaCategory } from '../type/schema-category.type.js'; +import { ISchemaDocument } from './schema-document.interface.js'; /** * Schema interface diff --git a/interfaces/src/interface/sign-options.interface.ts b/interfaces/src/interface/sign-options.interface.ts new file mode 100644 index 0000000000..cac4bd692b --- /dev/null +++ b/interfaces/src/interface/sign-options.interface.ts @@ -0,0 +1,18 @@ +export interface FireblocksCreds{ + apiKey: string; + privateKey: string; + vaultId: string; + assetId: string; +} + +export enum SignType{ + INTERNAL = 'INTERNAL', + FIREBLOCKS = 'FIREBLOCKS' +} + +export type ISignOptions = { + signType: SignType.INTERNAL +} | { + signType: SignType.FIREBLOCKS + data: FireblocksCreds +}; diff --git a/interfaces/src/interface/standard-registry-response.interface.ts b/interfaces/src/interface/standard-registry-response.interface.ts index 64c08e39b8..7a9a41359d 100644 --- a/interfaces/src/interface/standard-registry-response.interface.ts +++ b/interfaces/src/interface/standard-registry-response.interface.ts @@ -1,5 +1,5 @@ -import { IPolicy } from './policy.interface'; -import { IVCDocument } from './vc-document.interface'; +import { IPolicy } from './policy.interface.js'; +import { IVCDocument } from './vc-document.interface.js'; /** * StandardRegistryAccountResponse - Related to response diff --git a/interfaces/src/interface/suggestions-order-priority.ts b/interfaces/src/interface/suggestions-order-priority.ts index 49f76fa646..6af2e50f05 100644 --- a/interfaces/src/interface/suggestions-order-priority.ts +++ b/interfaces/src/interface/suggestions-order-priority.ts @@ -1,4 +1,4 @@ -import { ConfigType } from '../type'; +import { ConfigType } from '../type/index.js'; /** * Suggestions order priority diff --git a/interfaces/src/interface/token.interface.ts b/interfaces/src/interface/token.interface.ts index 3138f112b6..50fd4add04 100644 --- a/interfaces/src/interface/token.interface.ts +++ b/interfaces/src/interface/token.interface.ts @@ -1,4 +1,4 @@ -import { TokenType } from '../type/token.type'; +import { TokenType } from '../type/token.type.js'; /** * Token interface diff --git a/interfaces/src/interface/user.interface.ts b/interfaces/src/interface/user.interface.ts index 0677b00bee..0e51ecfb24 100644 --- a/interfaces/src/interface/user.interface.ts +++ b/interfaces/src/interface/user.interface.ts @@ -1,6 +1,6 @@ -import { UserRole } from '../type/user-role.type'; -import { IDidObject } from './did-object.interface'; -import { IVCDocument } from './vc-document.interface'; +import { UserRole } from '../type/user-role.type.js'; +import { IDidObject } from './did-object.interface.js'; +import { IVCDocument } from './vc-document.interface.js'; /** * Session interface diff --git a/interfaces/src/interface/vc-document.interface.ts b/interfaces/src/interface/vc-document.interface.ts index 3130ef49f2..18f1772d68 100644 --- a/interfaces/src/interface/vc-document.interface.ts +++ b/interfaces/src/interface/vc-document.interface.ts @@ -1,5 +1,5 @@ -import { DocumentStatus } from '../type/document-status.type'; -import { IVC } from './vc.interface'; +import { DocumentStatus } from '../type/document-status.type.js'; +import { IVC } from './vc.interface.js'; /** * VC document interface diff --git a/interfaces/src/interface/vc.interface.ts b/interfaces/src/interface/vc.interface.ts index 2f82ca8e8a..046d01762f 100644 --- a/interfaces/src/interface/vc.interface.ts +++ b/interfaces/src/interface/vc.interface.ts @@ -1,6 +1,6 @@ -import { ICredentialSubject } from './credential-subject.interface'; -import { did } from './did.interface'; -import { uuid } from './uuid.interface'; +import { ICredentialSubject } from './credential-subject.interface.js'; +import { did } from './did.interface.js'; +import { uuid } from './uuid.interface.js'; /** * VC interface diff --git a/interfaces/src/interface/vp-document.interface.ts b/interfaces/src/interface/vp-document.interface.ts index 300cbc743c..548bc2fdd7 100644 --- a/interfaces/src/interface/vp-document.interface.ts +++ b/interfaces/src/interface/vp-document.interface.ts @@ -1,6 +1,6 @@ -import {DocumentSignature} from '../type/document-signature.type'; -import {DocumentStatus} from '../type/document-status.type'; -import {IVP} from './vp.interface'; +import {DocumentSignature} from '../type/document-signature.type.js'; +import {DocumentStatus} from '../type/document-status.type.js'; +import {IVP} from './vp.interface.js'; /** * VP document interface diff --git a/interfaces/src/interface/vp.interface.ts b/interfaces/src/interface/vp.interface.ts index b680a93ee7..0e263d5b22 100644 --- a/interfaces/src/interface/vp.interface.ts +++ b/interfaces/src/interface/vp.interface.ts @@ -1,5 +1,5 @@ -import {uuid} from './uuid.interface'; -import {IVC} from './vc.interface'; +import {uuid} from './uuid.interface.js'; +import {IVC} from './vc.interface.js'; /** * VP interface diff --git a/interfaces/src/models/index.ts b/interfaces/src/models/index.ts index 1957720bad..cc9ee9372b 100644 --- a/interfaces/src/models/index.ts +++ b/interfaces/src/models/index.ts @@ -1,2 +1,2 @@ -export * from './schema'; -export * from './token'; +export * from './schema.js'; +export * from './token.js'; diff --git a/interfaces/src/models/schema.ts b/interfaces/src/models/schema.ts index 60aabd6106..18d7ebb073 100644 --- a/interfaces/src/models/schema.ts +++ b/interfaces/src/models/schema.ts @@ -1,13 +1,13 @@ -import { ModelHelper } from '../helpers/model-helper'; -import { SchemaHelper } from '../helpers/schema-helper'; -import { SchemaCondition } from '../interface/schema-condition.interface'; -import { ISchemaDocument } from '../interface/schema-document.interface'; -import { ISchema } from '../interface/schema.interface'; -import { SchemaEntity } from '../type/schema-entity.type'; -import { SchemaStatus } from '../type/schema-status.type'; -import { GenerateUUIDv4 } from '../helpers/generate-uuid-v4'; -import { SchemaField } from '../interface/schema-field.interface'; -import { SchemaCategory } from '../type/schema-category.type'; +import { ModelHelper } from '../helpers/model-helper.js'; +import { SchemaHelper } from '../helpers/schema-helper.js'; +import { SchemaCondition } from '../interface/schema-condition.interface.js'; +import { ISchemaDocument } from '../interface/schema-document.interface.js'; +import { ISchema } from '../interface/schema.interface.js'; +import { SchemaEntity } from '../type/schema-entity.type.js'; +import { SchemaStatus } from '../type/schema-status.type.js'; +import { GenerateUUIDv4 } from '../helpers/generate-uuid-v4.js'; +import { SchemaField } from '../interface/schema-field.interface.js'; +import { SchemaCategory } from '../type/schema-category.type.js'; /** * Schema class diff --git a/interfaces/src/models/token.ts b/interfaces/src/models/token.ts index be98ac1008..ad09d15922 100644 --- a/interfaces/src/models/token.ts +++ b/interfaces/src/models/token.ts @@ -1,4 +1,4 @@ -import { IToken, ITokenInfo } from '..'; +import { IToken, ITokenInfo } from '../index.js'; /** * Token class diff --git a/interfaces/src/type/document-category.type.ts b/interfaces/src/type/document-category.type.ts new file mode 100644 index 0000000000..2af20c6786 --- /dev/null +++ b/interfaces/src/type/document-category.type.ts @@ -0,0 +1,11 @@ +/** + * Document category type + */ +export enum DocumentCategoryType { + MRV = 'mrv', + REPORT = 'report', + MINT = 'mint', + RETIREMENT = 'retirement', + USER_ROLE = 'user-role', + MULTI_SIGN = 'MULTI_SIGN', +} diff --git a/interfaces/src/type/index.ts b/interfaces/src/type/index.ts index dc007355d0..b7985df899 100644 --- a/interfaces/src/type/index.ts +++ b/interfaces/src/type/index.ts @@ -1,41 +1,42 @@ -export * from './application-states.type'; -export * from './approve-status.type'; -export * from './artifact.type'; -export * from './auth-events'; -export * from './block-error-actions'; -export * from './block.type'; -export * from './config.type'; -export * from './did-status.type'; -export * from './document-signature.type'; -export * from './document-status.type'; -export * from './geojson.type'; -export * from './hedera-response-code.type'; -export * from './icon.type'; -export * from './import.type'; -export * from './log.type'; -export * from './messages'; -export * from './module-status.type'; -export * from './notification-action.type'; -export * from './notification.type'; -export * from './order-direction.type'; -export * from './policy.type'; -export * from './root-state.type'; -export * from './schema-category.type'; -export * from './schema-entity.type'; -export * from './schema-status.type'; -export * from './signature.type'; -export * from './tag.type'; -export * from './task-action.type'; -export * from './token.type'; -export * from './topic.type'; -export * from './unit-system.type'; -export * from './user-group.type'; -export * from './user-option.type'; -export * from './user-role.type'; -export * from './user.type'; -export * from './contract.type'; -export * from './contract-param.type'; -export * from './w3s-events'; -export * from './policy-category-type'; -export * from './document.type'; -export * from './mint-transaction-status.type'; +export * from './application-states.type.js'; +export * from './approve-status.type.js'; +export * from './artifact.type.js'; +export * from './auth-events.js'; +export * from './block-error-actions.js'; +export * from './block.type.js'; +export * from './config.type.js'; +export * from './did-status.type.js'; +export * from './document-signature.type.js'; +export * from './document-status.type.js'; +export * from './geojson.type.js'; +export * from './hedera-response-code.type.js'; +export * from './icon.type.js'; +export * from './import.type.js'; +export * from './log.type.js'; +export * from './messages/index.js'; +export * from './module-status.type.js'; +export * from './notification-action.type.js'; +export * from './notification.type.js'; +export * from './order-direction.type.js'; +export * from './policy.type.js'; +export * from './root-state.type.js'; +export * from './schema-category.type.js'; +export * from './schema-entity.type.js'; +export * from './schema-status.type.js'; +export * from './signature.type.js'; +export * from './tag.type.js'; +export * from './task-action.type.js'; +export * from './token.type.js'; +export * from './topic.type.js'; +export * from './unit-system.type.js'; +export * from './user-group.type.js'; +export * from './user-option.type.js'; +export * from './user-role.type.js'; +export * from './user.type.js'; +export * from './contract.type.js'; +export * from './contract-param.type.js'; +export * from './w3s-events.js'; +export * from './policy-category-type.js'; +export * from './document.type.js'; +export * from './mint-transaction-status.type.js'; +export * from './document-category.type.js'; diff --git a/interfaces/src/type/messages/index.ts b/interfaces/src/type/messages/index.ts index 51b331520c..f355ef7443 100644 --- a/interfaces/src/type/messages/index.ts +++ b/interfaces/src/type/messages/index.ts @@ -1,8 +1,8 @@ -export * from './message-api.type'; -export * from './notify-api.events'; -export * from './policy-engine-events'; -export * from './policy-events'; -export * from './wallet-events'; -export * from './worker-events'; -export * from './workers.type'; -export * from './contract-api.type'; +export * from './message-api.type.js'; +export * from './notify-api.events.js'; +export * from './policy-engine-events.js'; +export * from './policy-events.js'; +export * from './wallet-events.js'; +export * from './worker-events.js'; +export * from './workers.type.js'; +export * from './contract-api.type.js'; diff --git a/interfaces/src/type/messages/message-api.type.ts b/interfaces/src/type/messages/message-api.type.ts index ce212ce27b..1a077ca129 100644 --- a/interfaces/src/type/messages/message-api.type.ts +++ b/interfaces/src/type/messages/message-api.type.ts @@ -14,6 +14,7 @@ export enum MessageAPI { SET_TOKEN = 'set-token', SET_TOKEN_ASYNC = 'set-token-async', SET_ACCESS_TOKEN = 'SET_ACCESS_TOKEN', + UPDATE_TOKEN = 'update-token', UPDATE_TOKEN_ASYNC = 'update-token-async', DELETE_TOKEN_ASYNC = 'delete-token-async', IMPORT_TOKENS = 'import-tokens', diff --git a/interfaces/src/type/messages/policy-engine-events.ts b/interfaces/src/type/messages/policy-engine-events.ts index de35682069..7681448285 100644 --- a/interfaces/src/type/messages/policy-engine-events.ts +++ b/interfaces/src/type/messages/policy-engine-events.ts @@ -56,4 +56,9 @@ export enum PolicyEngineEvents { GET_POLICY_DOCUMENTS = 'policy-engine-event-get-policy-documents', MIGRATE_DATA = 'policy-engine-event-migrate-data', MIGRATE_DATA_ASYNC = 'policy-engine-event-migrate-data-async', + DOWNLOAD_POLICY_DATA = 'policy-engine-event-download-policy-data', + DOWNLOAD_VIRTUAL_KEYS = 'policy-engine-event-download-virtual-keys', + UPLOAD_POLICY_DATA = 'policy-engine-event-upload-policy-data', + UPLOAD_VIRTUAL_KEYS = 'policy-engine-event-upload-virtual-keys', + GET_TAG_BLOCK_MAP = 'policy-engine-event-get-tag-block-map', } diff --git a/interfaces/src/type/messages/policy-events.ts b/interfaces/src/type/messages/policy-events.ts index 296b8bf434..4d2b77d7f1 100644 --- a/interfaces/src/type/messages/policy-events.ts +++ b/interfaces/src/type/messages/policy-events.ts @@ -39,4 +39,5 @@ export enum PolicyEvents { RECORD_RETRY_STEP = 'policy-event-retry-step', RECORD_SKIP_STEP = 'policy-event-skip-step', REFRESH_MODEL = 'policy-event-refresh-model', + GET_TAG_BLOCK_MAP = 'policy-event-get-tag-block-map' } diff --git a/interfaces/tsconfig.json b/interfaces/tsconfig.json index 58fccdc6ab..0a20c54ada 100644 --- a/interfaces/tsconfig.json +++ b/interfaces/tsconfig.json @@ -1,18 +1,18 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es5", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" ], "moduleResolution": "node", "sourceMap": true, + "skipLibCheck": true, "outDir": "dist/", "emitDecoratorMetadata": true, "experimentalDecorators": true, "esModuleInterop": true, - "skipLibCheck": true, "declaration": true }, "include": [ diff --git a/interfaces/tsconfig.production.json b/interfaces/tsconfig.production.json index a8349858b8..8d4ae572e3 100644 --- a/interfaces/tsconfig.production.json +++ b/interfaces/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es5", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" diff --git a/interfaces/tsconfig.tsbuildinfo b/interfaces/tsconfig.tsbuildinfo deleted file mode 100644 index 895213f52e..0000000000 --- a/interfaces/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/reflect-metadata/index.d.ts","./src/decorators/inject.ts","./src/decorators/singleton.ts","./src/decorators/index.ts","./src/type/approve-status.type.ts","./src/type/did-status.type.ts","./src/type/document-signature.type.ts","./src/type/document-status.type.ts","./src/type/schema-entity.type.ts","./src/interface/approval-document.interface.ts","./src/interface/chain-item.interface.ts","./src/interface/did.interface.ts","./src/interface/credential-subject.interface.ts","./src/interface/did-document.interface.ts","./src/type/policy.type.ts","./src/interface/policy.interface.ts","./src/type/root-state.type.ts","./src/interface/uuid.interface.ts","./src/interface/vc.interface.ts","./src/interface/vc-document.interface.ts","./src/interface/root-config.interface.ts","./src/interface/schema.interface.ts","./src/interface/token.interface.ts","./src/type/user-role.type.ts","./src/type/user-state.type.ts","./src/interface/user.interface.ts","./src/interface/vp.interface.ts","./src/interface/vp-document.interface.ts","./src/interface/wallet-account.interface.ts","./src/models/mrv.ts","./src/type/message-api.type.ts","./src/errors/mq-error-codes.ts","./src/errors/mq-transaction-error.ts","./src/errors/index.ts","./src/models/policy.ts","./src/models/schema.ts","./src/models/sensor.ts","./src/models/token.ts","./src/index.ts","./src/type/vc.type.ts","../node_modules/@types/asn1js/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/connect/index.d.ts","../node_modules/@types/body-parser/index.d.ts","../node_modules/@types/crypto-js/index.d.ts","../node_modules/@types/range-parser/index.d.ts","../node_modules/@types/qs/index.d.ts","../node_modules/@types/express-serve-static-core/index.d.ts","../node_modules/@types/mime/index.d.ts","../node_modules/@types/serve-static/index.d.ts","../node_modules/@types/express/index.d.ts","../node_modules/@types/fs-extra/index.d.ts","../node_modules/@types/js-yaml/index.d.ts","../node_modules/@types/jsonwebtoken/index.d.ts","../node_modules/@types/long/index.d.ts","../node_modules/@types/utf8/index.d.ts","../node_modules/@types/ws/index.d.ts","../node_modules/@types/zen-observable/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"a2a8c5ca8595f073327bef59aa165b0d96810ccbb3188f75b67673b47000fb49","ae68f1571a84d31ee9b969d5afc6b8dcf1361f049765619da2fa9c0480f31bef","3f8a464b278175ee4366e690ee59c2c0aa94728436b3dab87812016f830bbded","a96854953abcbf895cc14e74f4668ff9fcbf9ea8a8523a10b20852bc00e0293c","ff173bc5ddefaf769043b544415a97139b31e626d5a2b7a21da3a3741c314b34","4de12e77f76e672c92dde0651e695a93ab5d5524a741480e4907f5130565fd97","d3bba056e9b6465d3e3ff8de3b90ff02a87eb219b00a56ed568d425456591a13","e153774172743924de1b570314ef49e40371b7baf3afb47b2d1d783eef8bded1","7b6acf6e5beade7d57b82ddc8546ecb53bc0fd84e7e6470bfd3d151675eb2f0a","7d7a4f100a5c5681fa7bfa49278227b34c255827d1a55d9a3e2f3008e155292e","fefe84c45fcd6ee9eabb6507401b85dfd670221a29b8f6ce6c10c68840866a8a","4d0d247eb9f6840dbebd5d911bfa80782190b8ab8122cf819dc6d19eb926fdd2","082dbc48b581a5d22dca8f645eba3a557c564dbfc3fffdfaf4662031fa31bd0b","d691d74dde19c825672c3ee1573b0efa55be00c6d24a9fd631fa3d9b25bf5ffa","d962cf19e846cd2ee2d87c7cc12a045dee7137d7fdf41fbbb35d6141838cd79e","853e51b52d2d3d03381df9d66723215d1481b8ae458ea7740d00eff94c5a7333","9eba193c5aabc2c0c70f287dc40460100be9ee807e2f60793372f95dd95e8705","524c4bc4f70ee74b3a2c2b3c76c377a920283f3b03d8405b471e7b87eb2ace7b","ccaff040369e029cd4867052e25e90e2b7c091ca4e621027b30d2547fd9cbcf7","ff50e536dbbb345f9779590a5883183ed29ab25066675a601d1a70030f5a76ce","bb2bb4d84205afa2f900195b63e8fe3af9fb76d843b4f1bf5f3dc0f660535cdc","77589af295ec1159067eb53366d9cc930b874ebb4d371e6727e50256657935e7","f8ae380fdd296eb6c2bbb152a8d4d325ddd6dd540540622f752dfbccd4076f65","e96d2ac03b0ffb494c8912b42b56242af84a5512f29d9a710ed81573f0b24929","de28e348345670a5410931d653aa6b8ef48290b3b5db87593600d332537ad51a","d42c82cece35524dcdfe15baaeb57c5f2b9d0370a9740d31d645364bb1920091","62eb8a9e88e27d6568bebc5e827981fd28dc4b64d03c7c4180a2e079ecf51856","20d8fb5864e584abe40b99ee0f57936a57d08936cced8dfa36667aa4524a5045","9c9006305882d78bb34696b01d71f93fcaef0536e3e49f30fc67ef9a6908b7dd","14cda3b9f981ce14989cca5971536ef077006c5218e66d56ecd425bd04b42a59","75b15d98a069b2da97da8f9fd432835b55e3b86974a5c3e2b589217880067049","725938d7f3ecfab48844ee405ac2fc51f7ce9f2ce6e7b3fc96425ed294e1d586","829fffc4929a6f3498f32ab8d5b406c4cf56ec77ef6d2a97f756d8cab5dda3b3","80b1b81eb9ab03f9b571e4e80f98f09c0306a6dc2213174d37502433f144835e","8447bdf2f93b0bbedcc27b6c1f8acb730ad8ba67573d41c7b274ceeb0f678f44","9f2d8d523926e025d903f35dcc490d005e16c6c9ea42cf73afcd8a0782d46a8a","cba3b94457e5be057c9aa99b4684e9819b5b5a8de02e7d8d7ba454604d41b0e6","2c67468bfbffd9505efe8759c0595d75a0872ae7fd00c46917dd12a795f996a4","ee32dda529b1d70d0b756511ecdd42ea5e713da77b8bb4afd182e1c3898228b4","c53cdb0195a9103489a97d79baf26c1d8d4e695476be311a932b54a68363cbae","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"43978f18d1165eea81040bc9bfac1a551717f5cc9bd0f13b31bf490c5fcdc75f","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"c3ad91d23259b68e10a9bef08c5f9fa1d19f27ef740ac9af98ed226b030c09c6","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","57a558a99ab24fdff45a2c2db0c34285de2dcbc66149d9a3d83fcde844426e37","260aad3a6bd3fc510b7f97cfb05859bfc045ce185f8c2b4d73ddb9c43b0eb3c0","cb428529763c6c8e38e42db2a39f333ffcc6d3aab396b24ac84b22da752c1de0","ad4b60488fb1e562bf375dac9299815f7028bf667d9b5887b2d01d501b7d1ddd","246341c3a7a2638cf830d690e69de1e6085a102c6a30596435b050e6ac86c11a","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"fd5d2f531376b1e84df315df0fe724445353a0ae2e2c4de7bae01e24c6c2047a","84214d474bed6e36b7608ba8a39d463ff90061b8af47cbd1a8f7ecb775e21fac","944660c079e97f62f513c33ec64cebc44154374053d3a9adb04bf02f67ee1066","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","62a00c9cc0c78d9f282dcd7b0a7776aefe220106c3bc327e259e5f6484c6f556",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f3e8bcce378a26bc672fce0ec05affabbbbfa18493b76f24c39136dea87100d0","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"e51bee3200733b1f58818b5a9ea90fcd61c5b8afa3a0378391991f3696826a65","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","e70339a3d63f806c43f24250c42aa0000093923457b0ed7dfc10e0ac910ebca9","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","b810390059fc34122556c644f586e7a2b4598ded8afe5ba70bb82fc2e50577b1","ba9de5c5823e06ee3314f959c138cdaf4477d3a1a0769f0d24e62911020e8088","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"893f4b8552c248f6542174b53d1519f739b20428c970dda89cd90485dab059d0","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","65cfd1c0bc729fbc2b49fe66bc5ebddba5aa3a978c748e1d2e0d07f502238ce2",{"version":"070fafc332546049324c5eb0559b40974f700aa78eee7a12d1486035baa39558","affectsGlobalScope":true},"16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"61b60d145059c3c8e3c7b484713191b6d0b70999bcb11f2b26286b15926a2b5f","affectsGlobalScope":true},"84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","0b85cb069d0e427ba946e5eb2d86ef65ffd19867042810516d16919f6c1a5aec","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","5b89c37ff5dfea00195f8ea5e6fc8e086be68613297fc8152c08900a1d1fdb83","7aa2c4361d1f3243c262813fec18366e89578c527f44b1ec60fdc8fc7977d551","e8465811693dfe4e96ef2b3dffda539d6edfe896961b7af37b44db2c0e48532b","ceffc958ebea94978cde2ad88e75fcdf3f89556ea4eafdc03fc7e2aece9bae77","bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31",{"version":"09bba86d90385c19f2b69c0bf72d447ef6e5738964e3a344cb1f9e0270632be8","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"inlineSourceMap":true,"module":1,"outDir":"./dist","rootDir":"./src","target":2},"fileIdsList":[[40,41,123],[123],[70,71,123],[70,123],[39,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,123],[43,47,123],[50,123],[44,123],[53,123],[52,55,58,123],[47,123],[52,58,62,63,123],[46,47,57,123],[50,51,56,123],[45,46,47,65,123],[56,57,123],[57,58,123],[54,123],[47,60,123],[61,123],[98,123,130,131],[98,123,130],[95,98,123,130,134,135],[123,132,135,136,138],[96,123,130],[123,130],[80,123],[83,123],[84,89,123],[85,95,96,103,112,122,123],[85,86,95,103,123],[87,123],[88,89,96,104,123],[89,112,119,123],[90,92,95,103,123],[91,123],[92,93,123],[94,95,123],[95,123],[95,96,97,112,122,123],[95,96,97,112,123],[98,103,112,122,123],[95,96,98,99,103,112,119,122,123],[98,100,112,119,122,123],[80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129],[95,101,123],[102,122,123],[92,95,103,112,123],[104,123],[105,123],[83,106,123],[107,121,123,127],[108,123],[109,123],[95,110,123],[110,111,123,125],[95,112,113,114,123],[112,114,123],[112,113,123],[115,123],[116,123],[95,117,118,123],[117,118,123],[89,103,119,123],[120,123],[103,121,123],[84,98,109,122,123],[89,123],[112,123,124],[123,125],[123,126],[84,89,95,97,106,112,122,123,125,127],[112,123,128],[98,123,130,137],[95,98,100,103,112,119,122,123,128,130]],"referencedMap":[[42,1],[40,2],[41,2],[72,3],[70,2],[71,4],[77,5],[48,6],[49,2],[51,7],[52,8],[50,2],[54,9],[59,10],[60,11],[61,2],[64,12],[56,2],[58,13],[57,14],[66,15],[65,16],[67,2],[68,17],[73,18],[74,19],[75,17],[76,20],[43,2],[44,2],[45,2],[46,2],[69,2],[53,2],[55,2],[47,2],[62,2],[63,2],[78,2],[79,2],[132,21],[131,22],[133,2],[136,23],[139,24],[140,25],[141,2],[142,26],[143,2],[137,2],[80,27],[81,27],[83,28],[84,29],[85,30],[86,31],[87,32],[88,33],[89,34],[90,35],[91,36],[92,37],[93,37],[94,38],[95,39],[96,40],[97,41],[82,2],[129,2],[98,42],[99,43],[100,44],[130,45],[101,46],[102,47],[103,48],[104,49],[105,50],[106,51],[107,52],[108,53],[109,54],[110,55],[111,56],[112,57],[114,58],[113,59],[115,60],[116,61],[117,62],[118,63],[119,64],[120,65],[121,66],[122,67],[123,68],[124,69],[125,70],[126,71],[127,72],[128,73],[135,2],[134,2],[138,74],[144,2],[145,75],[146,2],[39,2],[9,2],[8,2],[2,2],[10,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[3,2],[4,2],[21,2],[18,2],[19,2],[20,2],[22,2],[23,2],[24,2],[5,2],[25,2],[26,2],[27,2],[28,2],[6,2],[29,2],[30,2],[31,2],[32,2],[7,2],[37,2],[33,2],[34,2],[35,2],[36,2],[1,2],[38,2]],"exportedModulesMap":[[42,1],[40,2],[41,2],[72,3],[70,2],[71,4],[77,5],[48,6],[49,2],[51,7],[52,8],[50,2],[54,9],[59,10],[60,11],[61,2],[64,12],[56,2],[58,13],[57,14],[66,15],[65,16],[67,2],[68,17],[73,18],[74,19],[75,17],[76,20],[43,2],[44,2],[45,2],[46,2],[69,2],[53,2],[55,2],[47,2],[62,2],[63,2],[78,2],[79,2],[132,21],[131,22],[133,2],[136,23],[139,24],[140,25],[141,2],[142,26],[143,2],[137,2],[80,27],[81,27],[83,28],[84,29],[85,30],[86,31],[87,32],[88,33],[89,34],[90,35],[91,36],[92,37],[93,37],[94,38],[95,39],[96,40],[97,41],[82,2],[129,2],[98,42],[99,43],[100,44],[130,45],[101,46],[102,47],[103,48],[104,49],[105,50],[106,51],[107,52],[108,53],[109,54],[110,55],[111,56],[112,57],[114,58],[113,59],[115,60],[116,61],[117,62],[118,63],[119,64],[120,65],[121,66],[122,67],[123,68],[124,69],[125,70],[126,71],[127,72],[128,73],[135,2],[134,2],[138,74],[144,2],[145,75],[146,2],[39,2],[9,2],[8,2],[2,2],[10,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[3,2],[4,2],[21,2],[18,2],[19,2],[20,2],[22,2],[23,2],[24,2],[5,2],[25,2],[26,2],[27,2],[28,2],[6,2],[29,2],[30,2],[31,2],[32,2],[7,2],[37,2],[33,2],[34,2],[35,2],[36,2],[1,2],[38,2]],"semanticDiagnosticsPerFile":[42,40,41,72,70,71,77,48,49,51,52,50,54,59,60,61,64,56,58,57,66,65,67,68,73,74,75,76,43,44,45,46,69,53,55,47,62,63,78,79,132,131,133,136,139,140,141,142,143,137,80,81,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,82,129,98,99,100,130,101,102,103,104,105,106,107,108,109,110,111,112,114,113,115,116,117,118,119,120,121,122,123,124,125,126,127,128,135,134,138,144,145,146,39,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,6,29,30,31,32,7,37,33,34,35,36,1,38]},"version":"4.4.3"} \ No newline at end of file diff --git a/logger-service/.dockerignore b/logger-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/logger-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/logger-service/Dockerfile b/logger-service/Dockerfile index 4af46c1d18..b2ef0eabbe 100644 --- a/logger-service/Dockerfile +++ b/logger-service/Dockerfile @@ -1,53 +1,57 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS loggerServiceBuilder -WORKDIR /usr/local/logger-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./logger-service/package.json ./ -COPY ./logger-service/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./logger-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/logger-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=loggerServiceBuilder /usr/local/logger-service/yarn.lock ./ -COPY ./logger-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=loggerServiceBuilder /usr/local/logger-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link logger-service/package.json logger-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link logger-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ +RUN mkdir -p /usr/local/app/dist/migrations + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/logger-service/Gulpfile.js b/logger-service/Gulpfile.mjs similarity index 88% rename from logger-service/Gulpfile.js rename to logger-service/Gulpfile.mjs index 08e10ab127..1eb3265d9e 100644 --- a/logger-service/Gulpfile.js +++ b/logger-service/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { console.log('configure demo'); diff --git a/logger-service/package.json b/logger-service/package.json index f92504398a..789b6ffe9d 100644 --- a/logger-service/package.json +++ b/logger-service/package.json @@ -2,14 +2,13 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -54,5 +53,6 @@ "start": "node dist/index.js", "watch": "nodemon src/index.ts" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/logger-service/src/api/logger.service.ts b/logger-service/src/api/logger.service.ts index 226ff53d90..53705dbb46 100644 --- a/logger-service/src/api/logger.service.ts +++ b/logger-service/src/api/logger.service.ts @@ -1,4 +1,4 @@ -import { Log } from '@entity/log'; +import { Log } from '../entity/log.js'; import { DataBaseHelper, LargePayloadContainer, MessageError, MessageResponse } from '@guardian/common'; import { MessageAPI } from '@guardian/interfaces'; import { Controller, Module } from '@nestjs/common'; diff --git a/logger-service/src/app.module.ts b/logger-service/src/app.module.ts index 461b5c2da4..9c4f19f7a5 100644 --- a/logger-service/src/app.module.ts +++ b/logger-service/src/app.module.ts @@ -1,5 +1,5 @@ import { Module } from '@nestjs/common'; -import { LoggerModule } from '@api/logger.service'; +import { LoggerModule } from './api/logger.service.js'; @Module({ imports: [LoggerModule], diff --git a/logger-service/src/app.ts b/logger-service/src/app.ts index 0b16b69656..a179b73430 100644 --- a/logger-service/src/app.ts +++ b/logger-service/src/app.ts @@ -5,7 +5,7 @@ import { MongoDriver } from '@mikro-orm/mongodb'; import { NestFactory } from '@nestjs/core'; import { Deserializer, IncomingRequest, MicroserviceOptions, Serializer, Transport } from '@nestjs/microservices'; import process from 'process'; -import { AppModule } from './app.module'; +import { AppModule } from './app.module.js'; export class LoggerSerializer implements Serializer { serialize(value: any, options?: Record): any { diff --git a/logger-service/src/config.ts b/logger-service/src/config.ts index cc201c9062..fe52645dd0 100644 --- a/logger-service/src/config.ts +++ b/logger-service/src/config.ts @@ -1,12 +1,6 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@entity': __dirname + '/entity' -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.logger.${process.env.GUARDIAN_ENV}` : './configs/.env.logger'; diff --git a/logger-service/src/index.ts b/logger-service/src/index.ts index 3feaec3b2e..b0871927eb 100644 --- a/logger-service/src/index.ts +++ b/logger-service/src/index.ts @@ -1,3 +1,3 @@ -import 'module-alias/register'; -import './config'; -import './app'; +// import 'module-alias/register'; +import './config.js'; +import './app.js'; diff --git a/logger-service/tsconfig.json b/logger-service/tsconfig.json index f656f84026..5636d234b1 100644 --- a/logger-service/tsconfig.json +++ b/logger-service/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "experimentalDecorators": true, - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es6" ], diff --git a/logger-service/tsconfig.production.json b/logger-service/tsconfig.production.json index a056be45a3..f6f9075f23 100644 --- a/logger-service/tsconfig.production.json +++ b/logger-service/tsconfig.production.json @@ -1,8 +1,8 @@ { "compilerOptions": { "experimentalDecorators": true, - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es6" ], diff --git a/mrv-sender/.dockerignore b/mrv-sender/.dockerignore index a33ce683c4..995dcad415 100644 --- a/mrv-sender/.dockerignore +++ b/mrv-sender/.dockerignore @@ -1,3 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc dist +Dockerfile node_modules npm-debug.log \ No newline at end of file diff --git a/mrv-sender/Dockerfile b/mrv-sender/Dockerfile index bd66075ba9..7d705a1975 100644 --- a/mrv-sender/Dockerfile +++ b/mrv-sender/Dockerfile @@ -1,54 +1,58 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS mrvSenderBuilder -WORKDIR /usr/local/mrv-sender -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./mrv-sender/package.json ./ -COPY ./mrv-sender/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./mrv-sender/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/mrv-sender -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=mrvSenderBuilder /usr/local/mrv-sender/yarn.lock ./ -COPY ./mrv-sender/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY ./mrv-sender/public ./public -COPY --from=mrvSenderBuilder /usr/local/mrv-sender/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link mrv-sender/package.json mrv-sender/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link mrv-sender/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link mrv-sender/public public/ + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/mrv-sender/package.json b/mrv-sender/package.json index d19375e015..8c75f56eff 100644 --- a/mrv-sender/package.json +++ b/mrv-sender/package.json @@ -2,11 +2,10 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "^2.23.1", + "@guardian/common": "^2.24.0", "@transmute/credentials-context": "0.7.0-unstable.80", "@transmute/did-context": "0.7.0-unstable.80", "@transmute/ed25519-signature-2018": "0.7.0-unstable.80", @@ -44,5 +43,6 @@ "dev:docker": "nodemon .", "start": "node dist/index.js" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/mrv-sender/src/document-loader/document-loader-default.ts b/mrv-sender/src/document-loader/document-loader-default.ts index 0625091ad7..8ecd24dd4c 100644 --- a/mrv-sender/src/document-loader/document-loader-default.ts +++ b/mrv-sender/src/document-loader/document-loader-default.ts @@ -1,8 +1,8 @@ import didContexts from '@transmute/did-context'; import credentialsContexts from '@transmute/credentials-context'; import securityContexts from '@transmute/security-context'; -import { DocumentLoader } from './document-loader'; -import { IDocumentFormat } from './document-format'; +import { DocumentLoader } from './document-loader.js'; +import { IDocumentFormat } from './document-format.js'; /** * Default Documents Loader diff --git a/mrv-sender/src/document-loader/document-loader-function.ts b/mrv-sender/src/document-loader/document-loader-function.ts index f84b5c5a3a..54daa24d2d 100644 --- a/mrv-sender/src/document-loader/document-loader-function.ts +++ b/mrv-sender/src/document-loader/document-loader-function.ts @@ -1,4 +1,4 @@ -import { IDocumentFormat } from './document-format'; +import { IDocumentFormat } from './document-format.js'; export type DocumentLoaderFunction = (iri: string) => Promise; diff --git a/mrv-sender/src/document-loader/document-loader.ts b/mrv-sender/src/document-loader/document-loader.ts index 00256abe9d..7a0da6b475 100644 --- a/mrv-sender/src/document-loader/document-loader.ts +++ b/mrv-sender/src/document-loader/document-loader.ts @@ -1,5 +1,5 @@ -import { IDocumentFormat } from './document-format'; -import { DocumentLoaderFunction } from './document-loader-function'; +import { IDocumentFormat } from './document-format.js'; +import { DocumentLoaderFunction } from './document-loader-function.js'; /** * Documents Loader @@ -22,4 +22,4 @@ export abstract class DocumentLoader { throw new Error('IRI not found: ' + iri); }; } -} \ No newline at end of file +} diff --git a/mrv-sender/src/document-loader/vc-document-loader.ts b/mrv-sender/src/document-loader/vc-document-loader.ts index ffb5fac469..d9b0e78732 100644 --- a/mrv-sender/src/document-loader/vc-document-loader.ts +++ b/mrv-sender/src/document-loader/vc-document-loader.ts @@ -1,5 +1,5 @@ -import { IDocumentFormat } from "./document-format"; -import { DocumentLoader } from "./document-loader"; +import { IDocumentFormat } from "./document-format.js"; +import { DocumentLoader } from "./document-loader.js"; export class VCDocumentLoader extends DocumentLoader { private url: string; diff --git a/mrv-sender/src/index.ts b/mrv-sender/src/index.ts index 84cf584d86..8289bf4ccc 100644 --- a/mrv-sender/src/index.ts +++ b/mrv-sender/src/index.ts @@ -1,11 +1,15 @@ import express, { Request, Response } from 'express'; import axios from 'axios'; -import { VCDocumentLoader } from './document-loader/vc-document-loader'; -import { DefaultDocumentLoader } from './document-loader/document-loader-default'; -import { VCHelper } from './vc-helper'; +import { VCDocumentLoader } from './document-loader/vc-document-loader.js'; +import { DefaultDocumentLoader } from './document-loader/document-loader-default.js'; +import { VCHelper } from './vc-helper.js'; import path from 'path'; import fs from 'fs'; -import { startMetricsServer } from './utils/metrics'; +import { startMetricsServer } from './utils/metrics.js'; +import { fileURLToPath } from 'url'; + +const filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(filename); enum GenerateMode { TEMPLATES = "TEMPLATES", @@ -27,7 +31,7 @@ const PORT = process.env.PORT || 3005; vcHelper.buildDocumentLoader(); app.get('/templates', async (req: Request, res: Response) => { - const directoryPath = path.join(__dirname, '..', 'templates'); + const directoryPath = path.join(dirname, '..', 'templates'); fs.readdir(directoryPath, function (err, files) { res.status(200).json(files); }); diff --git a/mrv-sender/src/utils/metrics.ts b/mrv-sender/src/utils/metrics.ts index bb06b79340..8ac99ff7bd 100644 --- a/mrv-sender/src/utils/metrics.ts +++ b/mrv-sender/src/utils/metrics.ts @@ -1,13 +1,14 @@ import express from 'express'; import client from 'prom-client'; -import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; +// import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; const app = express(); const PORT = process.env.PORT || 5008; export const startMetricsServer = () => { - app.use(guardianServicePrometheusMetrics()); + //TODO: fix crush app read from undefined + // app.use(guardianServicePrometheusMetrics()); app.get('/metrics', async (req, res) => { res.set('Content-Type', client.register.contentType); diff --git a/mrv-sender/src/vc-helper.ts b/mrv-sender/src/vc-helper.ts index 277e58f45d..7140212ac5 100644 --- a/mrv-sender/src/vc-helper.ts +++ b/mrv-sender/src/vc-helper.ts @@ -1,5 +1,5 @@ -import { DocumentLoader } from "./document-loader/document-loader"; -import { DocumentLoaderFunction } from "./document-loader/document-loader-function"; +import { DocumentLoader } from "./document-loader/document-loader.js"; +import { DocumentLoaderFunction } from "./document-loader/document-loader-function.js"; import { Ed25519Signature2018, Ed25519VerificationKey2018 } from '@transmute/ed25519-signature-2018'; import { ld as vcjs } from '@transmute/vc.js'; diff --git a/mrv-sender/tsconfig.json b/mrv-sender/tsconfig.json index d1cee8788f..48317315e3 100644 --- a/mrv-sender/tsconfig.json +++ b/mrv-sender/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" diff --git a/mrv-sender/tsconfig.production.json b/mrv-sender/tsconfig.production.json index 88f07af920..85063eeddf 100644 --- a/mrv-sender/tsconfig.production.json +++ b/mrv-sender/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" diff --git a/notification-service/.dockerignore b/notification-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/notification-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/notification-service/Dockerfile b/notification-service/Dockerfile index 71e86d9364..8db3708ca1 100644 --- a/notification-service/Dockerfile +++ b/notification-service/Dockerfile @@ -1,53 +1,57 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS notificationServiceBuilder -WORKDIR /usr/local/notification-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./notification-service/package.json ./ -COPY ./notification-service/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./notification-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/notification-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=notificationServiceBuilder /usr/local/notification-service/yarn.lock ./ -COPY ./notification-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=notificationServiceBuilder /usr/local/notification-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link notification-service/package.json notification-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link notification-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ +RUN mkdir -p /usr/local/app/dist/migrations + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/notification-service/Gulpfile.js b/notification-service/Gulpfile.mjs similarity index 88% rename from notification-service/Gulpfile.js rename to notification-service/Gulpfile.mjs index b9b5728517..de6d265d30 100644 --- a/notification-service/Gulpfile.js +++ b/notification-service/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { console.log('configure demo'); diff --git a/notification-service/package.json b/notification-service/package.json index 4a1dadb124..5329eed869 100644 --- a/notification-service/package.json +++ b/notification-service/package.json @@ -2,14 +2,13 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -53,5 +52,6 @@ "start": "node dist/index.js", "watch": "nodemon src/index.ts" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/notification-service/src/api/notification.service.ts b/notification-service/src/api/notification.service.ts index 0620e962e0..2aa88be862 100644 --- a/notification-service/src/api/notification.service.ts +++ b/notification-service/src/api/notification.service.ts @@ -1,5 +1,5 @@ -import { Notification } from '@entity/notification.entity'; -import { Progress } from '@entity/progress.entity'; +import { Notification } from '../entity/notification.entity.js'; +import { Progress } from '../entity/progress.entity.js'; import { DataBaseHelper, MessageError, diff --git a/notification-service/src/app.module.ts b/notification-service/src/app.module.ts index 7470fa532e..29562e5cbf 100644 --- a/notification-service/src/app.module.ts +++ b/notification-service/src/app.module.ts @@ -1,5 +1,5 @@ import { Module } from '@nestjs/common'; -import { NotificationModule } from '@api/notification.service'; +import { NotificationModule } from './api/notification.service.js'; @Module({ imports: [NotificationModule], diff --git a/notification-service/src/app.ts b/notification-service/src/app.ts index 9174316422..db0876d493 100644 --- a/notification-service/src/app.ts +++ b/notification-service/src/app.ts @@ -5,7 +5,7 @@ import { MongoDriver } from '@mikro-orm/mongodb'; import { NestFactory } from '@nestjs/core'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; import process from 'process'; -import { AppModule } from './app.module'; +import { AppModule } from './app.module.js'; Promise.all([ Migration({ diff --git a/notification-service/src/config.ts b/notification-service/src/config.ts index 91e446a644..5738c47dd3 100644 --- a/notification-service/src/config.ts +++ b/notification-service/src/config.ts @@ -1,12 +1,6 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@entity': __dirname + '/entity', -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV diff --git a/notification-service/src/index.ts b/notification-service/src/index.ts index 3feaec3b2e..dae6021377 100644 --- a/notification-service/src/index.ts +++ b/notification-service/src/index.ts @@ -1,3 +1,2 @@ -import 'module-alias/register'; -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/notification-service/tsconfig.json b/notification-service/tsconfig.json index f656f84026..58f20eeba7 100644 --- a/notification-service/tsconfig.json +++ b/notification-service/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "experimentalDecorators": true, - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es6" ], @@ -11,6 +11,7 @@ "sourceMap": true, "outDir": "dist/", "esModuleInterop": true, + "resolveJsonModule": true, "skipLibCheck": true, "baseUrl": "./src", "paths": { diff --git a/notification-service/tsconfig.production.json b/notification-service/tsconfig.production.json index a056be45a3..ece216ef9c 100644 --- a/notification-service/tsconfig.production.json +++ b/notification-service/tsconfig.production.json @@ -1,8 +1,8 @@ { "compilerOptions": { "experimentalDecorators": true, - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es6" ], @@ -11,6 +11,7 @@ "sourceMap": false, "outDir": "dist/", "esModuleInterop": true, + "resolveJsonModule": true, "skipLibCheck": true, "baseUrl": "./src", "paths": { diff --git a/package.json b/package.json index 43d2d3c7ed..a1cabecceb 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,13 @@ "ai-service", "notification-service" ], - "version": "2.23.1", + "version": "2.24.0", "devDependencies": { "detect-secrets": "^1.0.6" }, "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "scripts": { "detect-secrets": "detect-secrets-launcher --word-list exclude-secrets.txt k8s-manifests/**/* */src/**.ts **/.env*", diff --git a/policy-service/.dockerignore b/policy-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/policy-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/policy-service/Dockerfile b/policy-service/Dockerfile index 7e67fc4cbd..508e30605c 100644 --- a/policy-service/Dockerfile +++ b/policy-service/Dockerfile @@ -1,53 +1,56 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS policyServiceBuilder -WORKDIR /usr/local/policy-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./policy-service/package.json ./ -COPY ./policy-service/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./policy-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/policy-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=policyServiceBuilder /usr/local/policy-service/yarn.lock ./ -COPY ./policy-service/package.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=policyServiceBuilder /usr/local/policy-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link policy-service/package.json policy-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link policy-service/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/policy-service/Gulpfile.js b/policy-service/Gulpfile.mjs similarity index 88% rename from policy-service/Gulpfile.js rename to policy-service/Gulpfile.mjs index 4be1d2ab2c..bc72367a0b 100644 --- a/policy-service/Gulpfile.js +++ b/policy-service/Gulpfile.mjs @@ -1,9 +1,9 @@ 'use strict' -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; gulp.task('configure:demo', () => { return gulp diff --git a/policy-service/package.json b/policy-service/package.json index 020e5506bc..16605758d4 100644 --- a/policy-service/package.json +++ b/policy-service/package.json @@ -12,17 +12,16 @@ "author": "Envision Blockchain Solutions ", "resolutions": { "@azure/core-rest-pipeline": "1.12.1", - "image-size": "1.0.2", - "@types/mime": "3.0.4" + "image-size": "1.0.2" }, "dependencies": { - "@guardian/common": "2.23.1", - "@guardian/interfaces": "2.23.1", + "@guardian/common": "2.24.0", + "@guardian/interfaces": "2.24.0", "@hashgraph/sdk": "2.34.1", "@mattrglobal/jsonld-signatures-bbs": "^1.1.2", "@meeco/cryppo": "2.0.2", - "@mikro-orm/core": "5.7.12", - "@mikro-orm/mongodb": "5.7.12", + "@mikro-orm/core": "^6.1.11", + "@mikro-orm/mongodb": "^6.1.11", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", "@nestjs/microservices": "^9.4.1", @@ -37,7 +36,7 @@ "ajv-formats": "^2.1.1", "axios": "^1.3.6", "bs58": "^4.0.1", - "bson": "^5.3.0", + "bson": "^6.5.0", "cors": "^2.8.5", "cron": "^2.0.0", "deep-equal": "^2.0.5", @@ -51,7 +50,7 @@ "mathjs": "^10.1.0", "module-alias": "^2.2.2", "moment": "^2.29.2", - "mongodb": "5.6.0", + "mongodb": "^6.5.0", "prom-client": "^14.1.1", "prometheus-api-metrics": "3.2.2", "reflect-metadata": "^0.1.13", @@ -93,9 +92,10 @@ "dev": "tsc -w", "lint": "tslint --config ../tslint.json --project .", "start": "node dist/index.js", - "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/policy-service.xml", - "test:local": "mocha tests/**/*.test.js", + "test": "mocha tests/**/*.test.mjs --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/policy-service.xml", + "test:local": "mocha tests/**/*.test.mjs", "test:stability": "mocha tests/stability.test.js" }, - "version": "2.23.1" + "type": "module", + "version": "2.24.0" } diff --git a/policy-service/src/api/policy-process-path.ts b/policy-service/src/api/policy-process-path.ts index 4addb3e538..50f3d145bd 100644 --- a/policy-service/src/api/policy-process-path.ts +++ b/policy-service/src/api/policy-process-path.ts @@ -1,6 +1,10 @@ +import { fileURLToPath } from 'url'; import path from 'path'; +const filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(filename); + /** * Policy module path */ -export const POLICY_PROCESS_PATH = path.join(__dirname, 'policy-process'); +export const POLICY_PROCESS_PATH = path.join(dirname, 'policy-process'); diff --git a/policy-service/src/api/policy-process.ts b/policy-service/src/api/policy-process.ts index 43ecc59b0c..b4783d151e 100644 --- a/policy-service/src/api/policy-process.ts +++ b/policy-service/src/api/policy-process.ts @@ -1,14 +1,14 @@ -import '../config' +import '../config.js' import { COMMON_CONNECTION_CONFIG, DataBaseHelper, DatabaseServer, entities, Environment, ExternalEventChannel, IPFS, LargePayloadContainer, Logger, MessageBrokerChannel, MessageServer, NotificationService, OldSecretManager, Users, Workers } from '@guardian/common'; import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; -import { BlockTreeGenerator } from '@policy-engine/block-tree-generator'; -import { PolicyValidator } from '@policy-engine/block-validators'; +import { BlockTreeGenerator } from '../policy-engine/block-tree-generator.js'; +import { PolicyValidator } from '../policy-engine/block-validators/index.js'; import process from 'process'; -import { CommonVariables } from '@helpers/common-variables'; +import { CommonVariables } from '../helpers/common-variables.js'; import { PolicyEvents } from '@guardian/interfaces'; import { GridFSBucket } from 'mongodb'; -import { SynchronizationService } from '@policy-engine/multi-policy-service'; +import { SynchronizationService } from '../policy-engine/multi-policy-service/index.js'; import { Module } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; diff --git a/policy-service/src/app.ts b/policy-service/src/app.ts index c3d261569c..75d9b5ede4 100644 --- a/policy-service/src/app.ts +++ b/policy-service/src/app.ts @@ -1,7 +1,7 @@ import { ApplicationState, LargePayloadContainer, Logger, MessageBrokerChannel } from '@guardian/common'; import { ApplicationStates } from '@guardian/interfaces'; -import { PolicyContainer } from '@helpers/policy-container'; -import { startMetricsServer } from './utils/metrics'; +import { PolicyContainer } from './helpers/policy-container.js'; +import { startMetricsServer } from './utils/metrics.js'; export const obj = {}; diff --git a/policy-service/src/config.ts b/policy-service/src/config.ts index 364e76c7f0..f56aaa7b28 100644 --- a/policy-service/src/config.ts +++ b/policy-service/src/config.ts @@ -1,19 +1,7 @@ -import moduleAlias from 'module-alias'; import dotenv from 'dotenv'; import 'reflect-metadata'; import fs from 'fs'; -moduleAlias.addAliases({ - '@api': __dirname + '/api', - '@entity': __dirname + '/entity', - '@helpers': __dirname + '/helpers', - '@policy-engine': __dirname + '/policy-engine', - '@hedera-modules': __dirname + '/hedera-modules/index', - '@database-modules': __dirname + '/database-modules/index', - '@document-loader': __dirname + '/document-loader', - '@analytics': __dirname + '/analytics/index' -}); - dotenv.config(); const envPath = process.env.GUARDIAN_ENV ? `./configs/.env.policy.${process.env.GUARDIAN_ENV}` : './configs/.env.policy'; diff --git a/policy-service/src/helpers/policy-container.ts b/policy-service/src/helpers/policy-container.ts index be7a8610bd..5bc56a9209 100644 --- a/policy-service/src/helpers/policy-container.ts +++ b/policy-service/src/helpers/policy-container.ts @@ -3,7 +3,7 @@ import { ChildProcess, execFile, fork } from 'node:child_process'; import process from 'process'; import { GenerateUUIDv4, PolicyEvents } from '@guardian/interfaces'; import { Subscription } from 'nats'; -import { POLICY_PROCESS_PATH } from '@api/policy-process-path'; +import { POLICY_PROCESS_PATH } from '../api/policy-process-path.js'; /** * Policy start options diff --git a/policy-service/src/index.ts b/policy-service/src/index.ts index 11b146661a..dae6021377 100644 --- a/policy-service/src/index.ts +++ b/policy-service/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/policy-service/src/policy-engine/block-tree-generator.ts b/policy-service/src/policy-engine/block-tree-generator.ts index 82472461b4..65a681513c 100644 --- a/policy-service/src/policy-engine/block-tree-generator.ts +++ b/policy-service/src/policy-engine/block-tree-generator.ts @@ -1,13 +1,13 @@ -import { IPolicyBlock, IPolicyInstance, IPolicyInterfaceBlock, IPolicyNavigationStep } from './policy-engine.interface'; -import { PolicyComponentsUtils } from './policy-components-utils'; +import { IPolicyBlock, IPolicyInstance, IPolicyInterfaceBlock, IPolicyNavigationStep } from './policy-engine.interface.js'; +import { PolicyComponentsUtils } from './policy-components-utils.js'; import { GenerateUUIDv4, IUser, PolicyEvents, UserRole } from '@guardian/interfaces'; import { DataBaseHelper, DatabaseServer, Logger, MessageError, MessageResponse, NatsService, Policy, Singleton, Users, } from '@guardian/common'; -import { IPolicyUser, PolicyUser } from './policy-user'; -import { PolicyValidator } from '@policy-engine/block-validators'; +import { IPolicyUser, PolicyUser } from './policy-user.js'; +import { PolicyValidator } from '../policy-engine/block-validators/index.js' import { headers } from 'nats'; -import { Inject } from '@helpers/decorators/inject'; -import { ComponentsService } from './helpers/components-service'; -import { RecordUtils } from './record-utils'; +import { ComponentsService } from './helpers/components-service.js'; +import { RecordUtils } from './record-utils.js'; +import { Inject } from '../helpers/decorators/inject.js' /** * Block tree generator @@ -19,7 +19,7 @@ export class BlockTreeGenerator extends NatsService { * @private */ @Inject() - private readonly users: Users; + declare private users: Users; /** * Message queue name @@ -222,6 +222,10 @@ export class BlockTreeGenerator extends NatsService { return new MessageResponse({ id: block.uuid }); }); + this.getPolicyMessages(PolicyEvents.GET_TAG_BLOCK_MAP, policyId, async () => { + return new MessageResponse(Object.fromEntries(PolicyComponentsUtils.GetTagBlockMap(policyId))); + }); + this.getPolicyMessages(PolicyEvents.GET_POLICY_NAVIGATION, policyId, async (msg: any) => { const { user } = msg; const userFull = await this.getUser(policyInstance, user); diff --git a/policy-service/src/policy-engine/block-validators/block-validator.ts b/policy-service/src/policy-engine/block-validators/block-validator.ts index 04f52efbad..3a1da93d36 100644 --- a/policy-service/src/policy-engine/block-validators/block-validator.ts +++ b/policy-service/src/policy-engine/block-validators/block-validator.ts @@ -1,56 +1,56 @@ import * as mathjs from 'mathjs'; -import { PolicyValidator } from './policy-validator'; -import { IBlockErrors } from './interfaces/block-errors.interface'; -import { IBlockProp } from './interfaces/block-prop.interface'; -import { InterfaceDocumentActionBlock } from './blocks/action-block'; -import { AggregateBlock } from './blocks/aggregate-block'; -import { ButtonBlock } from './blocks/button-block'; -import { CalculateContainerBlock } from './blocks/calculate-block'; -import { CalculateMathAddon } from './blocks/calculate-math-addon'; -import { CalculateMathVariables } from './blocks/calculate-math-variables'; -import { InterfaceContainerBlock } from './blocks/container-block'; -import { CreateTokenBlock } from './blocks/create-token-block'; -import { CustomLogicBlock } from './blocks/custom-logic-block'; -import { DocumentValidatorBlock } from './blocks/document-validator-block'; -import { InterfaceDocumentsSource } from './blocks/documents-source'; -import { DocumentsSourceAddon } from './blocks/documents-source-addon'; -import { ExternalDataBlock } from './blocks/external-data-block'; -import { FiltersAddonBlock } from './blocks/filters-addon-block'; -import { GroupManagerBlock } from './blocks/group-manager'; -import { HistoryAddon } from './blocks/history-addon'; -import { HttpRequestBlock } from './blocks/http-request-block'; -import { TokenOperationAddon } from './blocks/impact-addon'; -import { InformationBlock } from './blocks/information-block'; -import { MintBlock } from './blocks/mint-block'; -import { MultiSignBlock } from './blocks/multi-sign-block'; -import { PaginationAddon } from './blocks/pagination-addon'; -import { PolicyRolesBlock } from './blocks/policy-roles'; -import { ReassigningBlock } from './blocks/reassigning.block'; -import { ReportBlock } from './blocks/report-block'; -import { ReportItemBlock } from './blocks/report-item-block'; -import { RequestVcDocumentBlock } from './blocks/request-vc-document-block'; -import { RetirementBlock } from './blocks/retirement-block'; -import { RevokeBlock } from './blocks/revoke-block'; -import { RevocationBlock } from './blocks/revocation-block'; -import { SelectiveAttributes } from './blocks/selective-attributes-addon'; -import { SendToGuardianBlock } from './blocks/send-to-guardian-block'; -import { SetRelationshipsBlock } from './blocks/set-relationships-block'; -import { SplitBlock } from './blocks/split-block'; -import { InterfaceStepBlock } from './blocks/step-block'; -import { SwitchBlock } from './blocks/switch-block'; -import { TimerBlock } from './blocks/timer-block'; -import { TokenActionBlock } from './blocks/token-action-block'; -import { TokenConfirmationBlock } from './blocks/token-confirmation-block'; -import { ModuleValidator } from './module-validator'; -import { ModuleBlock } from './blocks/module'; -import { TagsManagerBlock } from './blocks/tag-manager'; -import { ExternalTopicBlock } from './blocks/external-topic-block'; -import { MessagesReportBlock } from './blocks/messages-report-block'; -import { NotificationBlock } from './blocks/notification.block'; +import { PolicyValidator } from './policy-validator.js'; +import { IBlockErrors } from './interfaces/block-errors.interface.js'; +import { IBlockProp } from './interfaces/block-prop.interface.js'; +import { InterfaceDocumentActionBlock } from './blocks/action-block.js'; +import { AggregateBlock } from './blocks/aggregate-block.js'; +import { ButtonBlock } from './blocks/button-block.js'; +import { CalculateContainerBlock } from './blocks/calculate-block.js'; +import { CalculateMathAddon } from './blocks/calculate-math-addon.js'; +import { CalculateMathVariables } from './blocks/calculate-math-variables.js'; +import { InterfaceContainerBlock } from './blocks/container-block.js'; +import { CreateTokenBlock } from './blocks/create-token-block.js'; +import { CustomLogicBlock } from './blocks/custom-logic-block.js'; +import { DocumentValidatorBlock } from './blocks/document-validator-block.js'; +import { InterfaceDocumentsSource } from './blocks/documents-source.js'; +import { DocumentsSourceAddon } from './blocks/documents-source-addon.js'; +import { ExternalDataBlock } from './blocks/external-data-block.js'; +import { FiltersAddonBlock } from './blocks/filters-addon-block.js'; +import { GroupManagerBlock } from './blocks/group-manager.js'; +import { HistoryAddon } from './blocks/history-addon.js'; +import { HttpRequestBlock } from './blocks/http-request-block.js'; +import { TokenOperationAddon } from './blocks/impact-addon.js'; +import { InformationBlock } from './blocks/information-block.js'; +import { MintBlock } from './blocks/mint-block.js'; +import { MultiSignBlock } from './blocks/multi-sign-block.js'; +import { PaginationAddon } from './blocks/pagination-addon.js'; +import { PolicyRolesBlock } from './blocks/policy-roles.js'; +import { ReassigningBlock } from './blocks/reassigning.block.js'; +import { ReportBlock } from './blocks/report-block.js'; +import { ReportItemBlock } from './blocks/report-item-block.js'; +import { RequestVcDocumentBlock } from './blocks/request-vc-document-block.js'; +import { RetirementBlock } from './blocks/retirement-block.js'; +import { RevokeBlock } from './blocks/revoke-block.js'; +import { RevocationBlock } from './blocks/revocation-block.js'; +import { SelectiveAttributes } from './blocks/selective-attributes-addon.js'; +import { SendToGuardianBlock } from './blocks/send-to-guardian-block.js'; +import { SetRelationshipsBlock } from './blocks/set-relationships-block.js'; +import { SplitBlock } from './blocks/split-block.js'; +import { InterfaceStepBlock } from './blocks/step-block.js'; +import { SwitchBlock } from './blocks/switch-block.js'; +import { TimerBlock } from './blocks/timer-block.js'; +import { TokenActionBlock } from './blocks/token-action-block.js'; +import { TokenConfirmationBlock } from './blocks/token-confirmation-block.js'; +import { ModuleValidator } from './module-validator.js'; +import { ModuleBlock } from './blocks/module.js'; +import { TagsManagerBlock } from './blocks/tag-manager.js'; +import { ExternalTopicBlock } from './blocks/external-topic-block.js'; +import { MessagesReportBlock } from './blocks/messages-report-block.js'; +import { NotificationBlock } from './blocks/notification.block.js'; import { ISchema, SchemaField, SchemaHelper } from '@guardian/interfaces'; -import { ToolValidator } from './tool-validator'; -import { ToolBlock } from './blocks/tool'; -import { ExtractDataBlock } from './blocks/extract-data'; +import { ToolValidator } from './tool-validator.js'; +import { ToolBlock } from './blocks/tool.js'; +import { ExtractDataBlock } from './blocks/extract-data.js'; export const validators = [ InterfaceDocumentActionBlock, diff --git a/policy-service/src/policy-engine/block-validators/blocks/action-block.ts b/policy-service/src/policy-engine/block-validators/blocks/action-block.ts index a2d5b529f9..49370be0ac 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/action-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/action-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/aggregate-block.ts b/policy-service/src/policy-engine/block-validators/blocks/aggregate-block.ts index 4ab699a84d..37586f5b11 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/aggregate-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/aggregate-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Aggregate block diff --git a/policy-service/src/policy-engine/block-validators/blocks/button-block.ts b/policy-service/src/policy-engine/block-validators/blocks/button-block.ts index 2cc1ae88bb..5582c4b0e1 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/button-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/button-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document Buttons with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/calculate-block.ts b/policy-service/src/policy-engine/block-validators/blocks/calculate-block.ts index c571ddfc12..78ff671625 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/calculate-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/calculate-block.ts @@ -1,8 +1,8 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CalculateMathAddon } from './calculate-math-addon'; -import { CalculateMathVariables } from './calculate-math-variables'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CalculateMathAddon } from './calculate-math-addon.js'; +import { CalculateMathVariables } from './calculate-math-variables.js'; import { Schema } from '@guardian/interfaces'; -import { CommonBlock } from './common'; +import { CommonBlock } from './common.js'; /** * Calculate block diff --git a/policy-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts index 4628021d5e..47b64d39f6 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/calculate-math-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts b/policy-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts index a09746b8e0..49bdd3e9fc 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/calculate-math-variables.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math Variables diff --git a/policy-service/src/policy-engine/block-validators/blocks/common.ts b/policy-service/src/policy-engine/block-validators/blocks/common.ts index d4435d8b1f..44b0e2f47d 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/common.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/common.ts @@ -1,4 +1,4 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; /** * Common block @@ -25,4 +25,4 @@ export class CommonBlock { } return true; } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/container-block.ts b/policy-service/src/policy-engine/block-validators/blocks/container-block.ts index 50e3b1bc14..b8ef7f8523 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/container-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/container-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Container block with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/create-token-block.ts b/policy-service/src/policy-engine/block-validators/blocks/create-token-block.ts index 174b339b70..b8aae2a36f 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/create-token-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/create-token-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Create Token block diff --git a/policy-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts b/policy-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts index 9984d8d259..c409df0595 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/custom-logic-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Custom logic block @@ -24,4 +24,4 @@ export class CustomLogicBlock { ); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/document-validator-block.ts b/policy-service/src/policy-engine/block-validators/blocks/document-validator-block.ts index 5939322b2b..bf419d3077 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/document-validator-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/document-validator-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document Validator diff --git a/policy-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts index 14412542e8..93925368bd 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/documents-source-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Documents source addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/documents-source.ts b/policy-service/src/policy-engine/block-validators/blocks/documents-source.ts index 9817b10ef5..cd6baa7157 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/documents-source.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/documents-source.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document source block with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/external-data-block.ts b/policy-service/src/policy-engine/block-validators/blocks/external-data-block.ts index e52075049f..f28f2ce178 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/external-data-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/external-data-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * External data block diff --git a/policy-service/src/policy-engine/block-validators/blocks/external-topic-block.ts b/policy-service/src/policy-engine/block-validators/blocks/external-topic-block.ts index f4c0466acc..4648cf8940 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/external-topic-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/external-topic-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * External topic block diff --git a/policy-service/src/policy-engine/block-validators/blocks/extract-data.ts b/policy-service/src/policy-engine/block-validators/blocks/extract-data.ts index 0cfcef2994..285ae4db9f 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/extract-data.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/extract-data.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts b/policy-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts index 6d94a66691..61168cd108 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/filters-addon-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Filters addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/group-manager.ts b/policy-service/src/policy-engine/block-validators/blocks/group-manager.ts index 3d3020d86d..c0a61eebee 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/group-manager.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/group-manager.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Document action clock with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/history-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/history-addon.ts index e3af9943c3..11fe649dd7 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/history-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/history-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * History Addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/http-request-block.ts b/policy-service/src/policy-engine/block-validators/blocks/http-request-block.ts index fe8881f6f4..6a76108c99 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/http-request-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/http-request-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Http request block diff --git a/policy-service/src/policy-engine/block-validators/blocks/impact-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/impact-addon.ts index 09e74a4049..4b670903be 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/impact-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/impact-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp, PropertyValidator } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp, PropertyValidator } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Calculate math addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/information-block.ts b/policy-service/src/policy-engine/block-validators/blocks/information-block.ts index 437e3b05ff..ebc0d6c2f3 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/information-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/information-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../..//block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/policy-service/src/policy-engine/block-validators/blocks/messages-report-block.ts b/policy-service/src/policy-engine/block-validators/blocks/messages-report-block.ts index 756a50e83b..f2e6216383 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/messages-report-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/messages-report-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Report block diff --git a/policy-service/src/policy-engine/block-validators/blocks/mint-block.ts b/policy-service/src/policy-engine/block-validators/blocks/mint-block.ts index a18476d696..293166e8af 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/mint-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/mint-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Mint block diff --git a/policy-service/src/policy-engine/block-validators/blocks/module.ts b/policy-service/src/policy-engine/block-validators/blocks/module.ts index 3ab497a290..92c1755b94 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/module.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/module.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/policy-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts b/policy-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts index 7970be474e..dbebc219bd 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/multi-sign-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Switch block diff --git a/policy-service/src/policy-engine/block-validators/blocks/notification.block.ts b/policy-service/src/policy-engine/block-validators/blocks/notification.block.ts index 390dabebeb..e941964384 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/notification.block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/notification.block.ts @@ -1,6 +1,6 @@ import { NotificationType, UserOption } from '@guardian/interfaces'; -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Notification Block diff --git a/policy-service/src/policy-engine/block-validators/blocks/pagination-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/pagination-addon.ts index cb3e698137..6cf632b414 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/pagination-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/pagination-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Pagination addon diff --git a/policy-service/src/policy-engine/block-validators/blocks/policy-roles.ts b/policy-service/src/policy-engine/block-validators/blocks/policy-roles.ts index c315cfd23d..6e520e68b0 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/policy-roles.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/policy-roles.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/policy-service/src/policy-engine/block-validators/blocks/reassigning.block.ts b/policy-service/src/policy-engine/block-validators/blocks/reassigning.block.ts index 5640f4e3ba..223c8ea2de 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/reassigning.block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/reassigning.block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Reassigning block @@ -24,4 +24,4 @@ export class ReassigningBlock { ); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/report-block.ts b/policy-service/src/policy-engine/block-validators/blocks/report-block.ts index 55f924a8d6..ce6eb7a99e 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/report-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/report-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Report block diff --git a/policy-service/src/policy-engine/block-validators/blocks/report-item-block.ts b/policy-service/src/policy-engine/block-validators/blocks/report-item-block.ts index 8f7c5e659f..91b175005d 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/report-item-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/report-item-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Report item block diff --git a/policy-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts b/policy-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts index 1c54909e50..4e00186ceb 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/request-vc-document-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Request VC document block @@ -28,4 +28,4 @@ export class RequestVcDocumentBlock { validator.addError(`Unhandled exception ${validator.getErrorMessage(error)}`); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/retirement-block.ts b/policy-service/src/policy-engine/block-validators/blocks/retirement-block.ts index 0726411209..98f5618145 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/retirement-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/retirement-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Retirement block diff --git a/policy-service/src/policy-engine/block-validators/blocks/revocation-block.ts b/policy-service/src/policy-engine/block-validators/blocks/revocation-block.ts index 527bb12f00..196e9d0140 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/revocation-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/revocation-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Revoke document action with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/revoke-block.ts b/policy-service/src/policy-engine/block-validators/blocks/revoke-block.ts index ae6af7788d..2bf0db5b43 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/revoke-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/revoke-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Revoke document action with UI diff --git a/policy-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts b/policy-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts index 81027a4cf5..fdb247f273 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/selective-attributes-addon.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Selective Attributes diff --git a/policy-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts b/policy-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts index d8490cdf8c..9efc2dc22b 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/send-to-guardian-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Send to guardian @@ -42,4 +42,4 @@ export class SendToGuardianBlock { validator.addError(`Unhandled exception ${validator.getErrorMessage(error)}`); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts b/policy-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts index 7bbefda878..342d6e51bd 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/set-relationships-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Set document relationships action diff --git a/policy-service/src/policy-engine/block-validators/blocks/split-block.ts b/policy-service/src/policy-engine/block-validators/blocks/split-block.ts index b6879f5919..ded9d007b9 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/split-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/split-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Split block diff --git a/policy-service/src/policy-engine/block-validators/blocks/step-block.ts b/policy-service/src/policy-engine/block-validators/blocks/step-block.ts index 6a755e464b..b6500807e9 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/step-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/step-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Step block diff --git a/policy-service/src/policy-engine/block-validators/blocks/switch-block.ts b/policy-service/src/policy-engine/block-validators/blocks/switch-block.ts index 18eb437c42..f60ac827ea 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/switch-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/switch-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Switch block diff --git a/policy-service/src/policy-engine/block-validators/blocks/tag-manager.ts b/policy-service/src/policy-engine/block-validators/blocks/tag-manager.ts index c43c0f8807..03598147fa 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/tag-manager.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/tag-manager.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Container block with UI @@ -24,4 +24,4 @@ export class TagsManagerBlock { ); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/blocks/timer-block.ts b/policy-service/src/policy-engine/block-validators/blocks/timer-block.ts index dee5d2e8a5..3045a39891 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/timer-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/timer-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Timer block diff --git a/policy-service/src/policy-engine/block-validators/blocks/token-action-block.ts b/policy-service/src/policy-engine/block-validators/blocks/token-action-block.ts index d58b27c1d7..a223b25ab4 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/token-action-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/token-action-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/policy-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts b/policy-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts index 524b650d78..23d478d082 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/token-confirmation-block.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Information block diff --git a/policy-service/src/policy-engine/block-validators/blocks/tool.ts b/policy-service/src/policy-engine/block-validators/blocks/tool.ts index 78d92f0f70..9d24734cf4 100644 --- a/policy-service/src/policy-engine/block-validators/blocks/tool.ts +++ b/policy-service/src/policy-engine/block-validators/blocks/tool.ts @@ -1,5 +1,5 @@ -import { BlockValidator, IBlockProp } from '@policy-engine/block-validators'; -import { CommonBlock } from './common'; +import { BlockValidator, IBlockProp } from '../../block-validators/index.js'; +import { CommonBlock } from './common.js'; /** * Policy roles block diff --git a/policy-service/src/policy-engine/block-validators/index.ts b/policy-service/src/policy-engine/block-validators/index.ts index d80c833861..32dd5a61a6 100644 --- a/policy-service/src/policy-engine/block-validators/index.ts +++ b/policy-service/src/policy-engine/block-validators/index.ts @@ -1,7 +1,7 @@ -export { PolicyValidator, } from './policy-validator'; -export { BlockValidator } from './block-validator'; -export { PropertyValidator } from './property-validator'; -export { ISerializedErrors } from './interfaces/serialized-errors.interface'; -export { IBlockErrors } from './interfaces/block-errors.interface'; -export { IBlockProp } from './interfaces/block-prop.interface'; -export { IModulesErrors } from './interfaces/modules-errors.interface'; +export { PolicyValidator, } from './policy-validator.js'; +export { BlockValidator } from './block-validator.js'; +export { PropertyValidator } from './property-validator.js'; +export { ISerializedErrors } from './interfaces/serialized-errors.interface.js'; +export { IBlockErrors } from './interfaces/block-errors.interface.js'; +export { IBlockProp } from './interfaces/block-prop.interface.js'; +export { IModulesErrors } from './interfaces/modules-errors.interface.js'; diff --git a/policy-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts b/policy-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts index 442d31409a..13e12f24af 100644 --- a/policy-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts +++ b/policy-service/src/policy-engine/block-validators/interfaces/modules-errors.interface.ts @@ -1,4 +1,4 @@ -import { IBlockErrors } from './block-errors.interface'; +import { IBlockErrors } from './block-errors.interface.js'; /** * Module errors diff --git a/policy-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts b/policy-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts index 7885f2b17b..b15e00ed7c 100644 --- a/policy-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts +++ b/policy-service/src/policy-engine/block-validators/interfaces/serialized-errors.interface.ts @@ -1,5 +1,5 @@ -import { IBlockErrors } from './block-errors.interface'; -import { IModulesErrors } from './modules-errors.interface'; +import { IBlockErrors } from './block-errors.interface.js'; +import { IModulesErrors } from './modules-errors.interface.js'; /** * Serialized errors @@ -29,4 +29,4 @@ export interface ISerializedErrors { * Is valid */ isValid: boolean; -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/module-validator.ts b/policy-service/src/policy-engine/block-validators/module-validator.ts index 66df4bfc68..fb15b544ca 100644 --- a/policy-service/src/policy-engine/block-validators/module-validator.ts +++ b/policy-service/src/policy-engine/block-validators/module-validator.ts @@ -1,12 +1,12 @@ /** * Module Validator */ -import { BlockValidator } from './block-validator'; -import { IModulesErrors } from './interfaces/modules-errors.interface'; +import { BlockValidator } from './block-validator.js'; +import { IModulesErrors } from './interfaces/modules-errors.interface.js'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; import { DatabaseServer } from '@guardian/common'; -import { ToolValidator } from './tool-validator'; -import { SchemaValidator } from './schema-validator'; +import { ToolValidator } from './tool-validator.js'; +import { SchemaValidator } from './schema-validator.js'; /** * Module Validator diff --git a/policy-service/src/policy-engine/block-validators/policy-validator.ts b/policy-service/src/policy-engine/block-validators/policy-validator.ts index b7eebb9418..0d1c5aaf0c 100644 --- a/policy-service/src/policy-engine/block-validators/policy-validator.ts +++ b/policy-service/src/policy-engine/block-validators/policy-validator.ts @@ -1,10 +1,10 @@ import { DatabaseServer, Policy } from '@guardian/common'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; -import { BlockValidator } from './block-validator'; -import { ModuleValidator } from './module-validator'; -import { ISerializedErrors } from './interfaces/serialized-errors.interface'; -import { ToolValidator } from './tool-validator'; -import { SchemaValidator } from './schema-validator'; +import { BlockValidator } from './block-validator.js'; +import { ModuleValidator } from './module-validator.js'; +import { ISerializedErrors } from './interfaces/serialized-errors.interface.js'; +import { ToolValidator } from './tool-validator.js'; +import { SchemaValidator } from './schema-validator.js'; /** * Policy Validator diff --git a/policy-service/src/policy-engine/block-validators/schema-validator.ts b/policy-service/src/policy-engine/block-validators/schema-validator.ts index 4840082bac..1a5d997ad3 100644 --- a/policy-service/src/policy-engine/block-validators/schema-validator.ts +++ b/policy-service/src/policy-engine/block-validators/schema-validator.ts @@ -3,7 +3,7 @@ */ import { ISchema, SchemaCategory } from '@guardian/interfaces'; import { DatabaseServer, Schema } from '@guardian/common'; -import { IBlockErrors } from './interfaces/block-errors.interface'; +import { IBlockErrors } from './interfaces/block-errors.interface.js'; /** * Schema Validator @@ -196,4 +196,4 @@ export class SchemaValidator { public static fromSystem(name: string): SchemaValidator { return new SchemaValidator(name, null, true); } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/block-validators/tool-validator.ts b/policy-service/src/policy-engine/block-validators/tool-validator.ts index c399203d6e..07d9393c81 100644 --- a/policy-service/src/policy-engine/block-validators/tool-validator.ts +++ b/policy-service/src/policy-engine/block-validators/tool-validator.ts @@ -1,8 +1,8 @@ import { DatabaseServer, PolicyTool } from '@guardian/common'; -import { BlockValidator } from './block-validator'; -import { IModulesErrors } from './interfaces/modules-errors.interface'; +import { BlockValidator } from './block-validator.js'; +import { IModulesErrors } from './interfaces/modules-errors.interface.js'; import { ISchema, ModuleStatus } from '@guardian/interfaces'; -import { SchemaValidator } from './schema-validator'; +import { SchemaValidator } from './schema-validator.js'; /** * Policy Validator diff --git a/policy-service/src/policy-engine/blocks/action-block.ts b/policy-service/src/policy-engine/blocks/action-block.ts index 86d77770ea..bf2973c904 100644 --- a/policy-service/src/policy-engine/blocks/action-block.ts +++ b/policy-service/src/policy-engine/blocks/action-block.ts @@ -1,13 +1,13 @@ -import { EventBlock } from '@policy-engine/helpers/decorators'; +import { EventBlock } from '../helpers/decorators/index.js'; import { UserType, Schema } from '@guardian/interfaces'; -import { findOptions } from '@policy-engine/helpers/find-options'; -import { IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyInterfaceBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { findOptions } from '../helpers/find-options.js'; +import { IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyInterfaceBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; import { KeyType } from '@guardian/common'; /** diff --git a/policy-service/src/policy-engine/blocks/aggregate-block.ts b/policy-service/src/policy-engine/blocks/aggregate-block.ts index 2d39c2f6b8..3009aaf793 100644 --- a/policy-service/src/policy-engine/blocks/aggregate-block.ts +++ b/policy-service/src/policy-engine/blocks/aggregate-block.ts @@ -1,13 +1,13 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; import { AggregateVC, VcDocumentDefinition as VcDocument } from '@guardian/common'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyEvent } from '@policy-engine/interfaces/policy-event'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces/policy-event-type'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent } from '../interfaces/policy-event.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/policy-event-type.js'; import ObjGet from 'lodash.get'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Aggregate block diff --git a/policy-service/src/policy-engine/blocks/button-block.ts b/policy-service/src/policy-engine/blocks/button-block.ts index 3294b9f343..26e48e8a1f 100644 --- a/policy-service/src/policy-engine/blocks/button-block.ts +++ b/policy-service/src/policy-engine/blocks/button-block.ts @@ -1,10 +1,10 @@ -import { EventBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyInterfaceBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { EventBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyInterfaceBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Document Buttons with UI diff --git a/policy-service/src/policy-engine/blocks/calculate-block.ts b/policy-service/src/policy-engine/blocks/calculate-block.ts index 2951514174..b10ac281fa 100644 --- a/policy-service/src/policy-engine/blocks/calculate-block.ts +++ b/policy-service/src/policy-engine/blocks/calculate-block.ts @@ -1,17 +1,17 @@ import { SchemaHelper } from '@guardian/interfaces'; -import { ActionCallback, CalculateBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { BlockActionError } from '@policy-engine/errors'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; +import { ActionCallback, CalculateBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { BlockActionError } from '../errors/index.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; import { VcDocumentDefinition, VcHelper } from '@guardian/common'; // tslint:disable-next-line:no-duplicate-imports import { VcDocument as VcDocumentCollection } from '@guardian/common'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; interface IMetadata { owner: IPolicyUser; diff --git a/policy-service/src/policy-engine/blocks/calculate-math-addon.ts b/policy-service/src/policy-engine/blocks/calculate-math-addon.ts index 75247266e3..79a11ad3f3 100644 --- a/policy-service/src/policy-engine/blocks/calculate-math-addon.ts +++ b/policy-service/src/policy-engine/blocks/calculate-math-addon.ts @@ -1,9 +1,9 @@ -import { CalculateAddon } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyCalculateAddon } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { CalculateAddon } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyCalculateAddon } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Calculate math addon diff --git a/policy-service/src/policy-engine/blocks/calculate-math-variables.ts b/policy-service/src/policy-engine/blocks/calculate-math-variables.ts index 66def1fc6c..ac9d966e3c 100644 --- a/policy-service/src/policy-engine/blocks/calculate-math-variables.ts +++ b/policy-service/src/policy-engine/blocks/calculate-math-variables.ts @@ -1,11 +1,11 @@ -import { CalculateAddon } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyCalculateAddon } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { CalculateAddon } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyCalculateAddon } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { BlockActionError } from '../errors/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Calculate math Variables diff --git a/policy-service/src/policy-engine/blocks/container-block.ts b/policy-service/src/policy-engine/blocks/container-block.ts index 6e3fe80567..1fd212ba62 100644 --- a/policy-service/src/policy-engine/blocks/container-block.ts +++ b/policy-service/src/policy-engine/blocks/container-block.ts @@ -1,8 +1,8 @@ -import { ContainerBlock } from '@policy-engine/helpers/decorators/container-block'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { ContainerBlock } from '../helpers/decorators/container-block.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; /** * Container block with UI diff --git a/policy-service/src/policy-engine/blocks/create-token-block.ts b/policy-service/src/policy-engine/blocks/create-token-block.ts index 263747c8c2..634567b995 100644 --- a/policy-service/src/policy-engine/blocks/create-token-block.ts +++ b/policy-service/src/policy-engine/blocks/create-token-block.ts @@ -1,27 +1,15 @@ -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { ActionCallback, StateField } from '@policy-engine/helpers/decorators'; -import { - IPolicyBlock, - IPolicyDocument, - IPolicyEventState, - IPolicyRequestBlock, -} from '@policy-engine/policy-engine.interface'; -import { - IPolicyEvent, - PolicyInputEventType, - PolicyOutputEventType, -} from '@policy-engine/interfaces'; -import { - ChildrenType, - ControlType, -} from '@policy-engine/interfaces/block-about'; -import { EventBlock } from '@policy-engine/helpers/decorators/event-block'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; +import { PolicyUtils } from '../helpers/utils.js'; +import { BlockActionError } from '../errors/index.js'; +import { ActionCallback, StateField } from '../helpers/decorators/index.js'; +import { IPolicyBlock, IPolicyDocument, IPolicyEventState, IPolicyRequestBlock, } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType, } from '../interfaces/index.js'; +import { ChildrenType, ControlType, } from '../interfaces/block-about.js'; +import { EventBlock } from '../helpers/decorators/event-block.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; import { MessageAction, MessageServer, TokenMessage } from '@guardian/common'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Create Token block @@ -203,10 +191,12 @@ export class CreateTokenBlock { // #region Send new token to hedera const hederaCred = await policyOwnerCred.loadHederaCredentials(ref); + const signOptions = await policyOwnerCred.loadSignOptions(ref); const rootTopic = await PolicyUtils.getInstancePolicyTopic(ref); const messageServer = new MessageServer( hederaCred.hederaAccountId, hederaCred.hederaAccountKey, + signOptions, ref.dryRun ).setTopicObject(rootTopic); const tokenMessage = new TokenMessage(MessageAction.CreateToken); diff --git a/policy-service/src/policy-engine/blocks/custom-logic-block.ts b/policy-service/src/policy-engine/blocks/custom-logic-block.ts index f6fa1ed4cc..a2466a4470 100644 --- a/policy-service/src/policy-engine/blocks/custom-logic-block.ts +++ b/policy-service/src/policy-engine/blocks/custom-logic-block.ts @@ -1,23 +1,20 @@ import { Worker } from 'node:worker_threads'; import path from 'path' -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { - VcHelper, - DIDMessage, - MessageAction, - MessageServer, - HederaDidDocument -} from '@guardian/common'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { DIDMessage, HederaDidDocument, MessageAction, MessageServer, VcHelper } from '@guardian/common'; import { ArtifactType, SchemaHelper } from '@guardian/interfaces'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { BlockActionError } from '../errors/index.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { fileURLToPath } from 'url'; + +const filename = fileURLToPath(import.meta.url); interface IMetadata { owner: IPolicyUser; @@ -160,7 +157,7 @@ export class CustomLogicBlock { const importCode = `const [done, user, documents, mathjs, artifacts, formulajs] = arguments;\r\n`; const expression = ref.options.expression || ''; - const worker = new Worker(path.join(path.dirname(__filename), '..', 'helpers', 'custom-logic-worker.js'), { + const worker = new Worker(path.join(path.dirname(filename), '..', 'helpers', 'custom-logic-worker.js'), { workerData: { execFunc: `${importCode}${execCode}${expression}`, user, @@ -364,9 +361,11 @@ export class CustomLogicBlock { message.setDocument(didObject); const hederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref); const client = new MessageServer( hederaCred.hederaAccountId, hederaCred.hederaAccountKey, + signOptions, ref.dryRun ); const messageResult = await client @@ -390,4 +389,4 @@ export class CustomLogicBlock { throw new BlockActionError(error, ref.blockType, ref.uuid); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/blocks/document-validator-block.ts b/policy-service/src/policy-engine/blocks/document-validator-block.ts index 915cf155b0..81c4c18ea9 100644 --- a/policy-service/src/policy-engine/blocks/document-validator-block.ts +++ b/policy-service/src/policy-engine/blocks/document-validator-block.ts @@ -1,12 +1,12 @@ -import { BlockActionError } from '@policy-engine/errors'; -import { ActionCallback, ValidatorBlock } from '@policy-engine/helpers/decorators'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '@policy-engine/policy-engine.interface'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { BlockActionError } from '../errors/index.js'; +import { ActionCallback, ValidatorBlock } from '../helpers/decorators/index.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '../policy-engine.interface.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Document Validator diff --git a/policy-service/src/policy-engine/blocks/documents-source-addon.ts b/policy-service/src/policy-engine/blocks/documents-source-addon.ts index 4fc0f67916..c9d1a897c0 100644 --- a/policy-service/src/policy-engine/blocks/documents-source-addon.ts +++ b/policy-service/src/policy-engine/blocks/documents-source-addon.ts @@ -1,10 +1,10 @@ -import { SourceAddon, StateField } from '@policy-engine/helpers/decorators'; -import { BlockActionError } from '@policy-engine/errors'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyAddonBlock, IPolicyDocument } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { SourceAddon, StateField } from '../helpers/decorators/index.js'; +import { BlockActionError } from '../errors/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyAddonBlock, IPolicyDocument } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; import ObjGet from 'lodash.get'; import ObjSet from 'lodash.set'; diff --git a/policy-service/src/policy-engine/blocks/documents-source.ts b/policy-service/src/policy-engine/blocks/documents-source.ts index 47c3451669..6a3e0b32a2 100644 --- a/policy-service/src/policy-engine/blocks/documents-source.ts +++ b/policy-service/src/policy-engine/blocks/documents-source.ts @@ -1,11 +1,11 @@ -import { DataSourceBlock } from '@policy-engine/helpers/decorators/data-source-block'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyAddonBlock, IPolicySourceBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { StateField } from '@policy-engine/helpers/decorators'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { DataSourceBlock } from '../helpers/decorators/data-source-block.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyAddonBlock, IPolicySourceBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { StateField } from '../helpers/decorators/index.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; import ObjGet from 'lodash.get'; /** diff --git a/policy-service/src/policy-engine/blocks/external-data-block.ts b/policy-service/src/policy-engine/blocks/external-data-block.ts index 209d1cbc1a..a88a797e32 100644 --- a/policy-service/src/policy-engine/blocks/external-data-block.ts +++ b/policy-service/src/policy-engine/blocks/external-data-block.ts @@ -1,19 +1,19 @@ -import { ActionCallback, ExternalData } from '@policy-engine/helpers/decorators'; +import { ActionCallback, ExternalData } from '../helpers/decorators/index.js'; import { DocumentSignature, Schema } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '@policy-engine/policy-engine.interface'; -import { BlockActionError } from '@policy-engine/errors'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '../policy-engine.interface.js'; +import { BlockActionError } from '../errors/index.js'; +import { IPolicyUser, PolicyUser } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { VcDocument as VcDocumentCollection, VcDocumentDefinition as VcDocument, VcHelper, } from '@guardian/common'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * External data block diff --git a/policy-service/src/policy-engine/blocks/external-topic-block.ts b/policy-service/src/policy-engine/blocks/external-topic-block.ts index 8b2951614f..563231b7de 100644 --- a/policy-service/src/policy-engine/blocks/external-topic-block.ts +++ b/policy-service/src/policy-engine/blocks/external-topic-block.ts @@ -1,13 +1,13 @@ import { CronJob } from 'cron'; -import { ActionCallback, EventBlock } from '@policy-engine/helpers/decorators'; +import { ActionCallback, EventBlock } from '../helpers/decorators/index.js'; import { IVC, Schema, SchemaField, SchemaHelper, TopicType } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { AnyBlockType, IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '@policy-engine/policy-engine.interface'; -import { BlockActionError } from '@policy-engine/errors'; -import { IHederaCredentials, IPolicyUser } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { AnyBlockType, IPolicyAddonBlock, IPolicyDocument, IPolicyEventState, IPolicyValidatorBlock } from '../policy-engine.interface.js'; +import { BlockActionError } from '../errors/index.js'; +import { IHederaCredentials, IPolicyUser } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { VcDocument as VcDocumentCollection, MessageServer, @@ -26,7 +26,7 @@ import { ExternalDocuments, ExternalEvent, ExternalEventType -} from '@policy-engine/interfaces/external-event'; +} from '../interfaces/external-event.js'; import { TopicId } from '@hashgraph/sdk'; /** @@ -915,4 +915,4 @@ export class ExternalTopicBlock { return {}; } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/blocks/extract-data-block.ts b/policy-service/src/policy-engine/blocks/extract-data-block.ts index d5548fa3ce..18eeb95513 100644 --- a/policy-service/src/policy-engine/blocks/extract-data-block.ts +++ b/policy-service/src/policy-engine/blocks/extract-data-block.ts @@ -1,13 +1,13 @@ -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '../policy-components-utils'; -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { Schema } from '@guardian/interfaces'; -import { BlockActionError } from '@policy-engine/errors'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { BlockActionError } from '../errors/index.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Extract block diff --git a/policy-service/src/policy-engine/blocks/filters-addon-block.ts b/policy-service/src/policy-engine/blocks/filters-addon-block.ts index 0c1d60f01a..c89786ab9e 100644 --- a/policy-service/src/policy-engine/blocks/filters-addon-block.ts +++ b/policy-service/src/policy-engine/blocks/filters-addon-block.ts @@ -1,11 +1,11 @@ -import { DataSourceAddon } from '@policy-engine/helpers/decorators/data-source-addon'; -import { BlockActionError } from '@policy-engine/errors'; -import { findOptions } from '@policy-engine/helpers/find-options'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyAddonBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { DataSourceAddon } from '../helpers/decorators/data-source-addon.js'; +import { BlockActionError } from '../errors/index.js'; +import { findOptions } from '../helpers/find-options.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyAddonBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Filters addon diff --git a/policy-service/src/policy-engine/blocks/get-block-about.ts b/policy-service/src/policy-engine/blocks/get-block-about.ts index 4bb1136e84..4c7e835462 100644 --- a/policy-service/src/policy-engine/blocks/get-block-about.ts +++ b/policy-service/src/policy-engine/blocks/get-block-about.ts @@ -1,5 +1,5 @@ -import * as blocks from './'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; +import * as blocks from './index.js'; +import { IPolicyBlock } from '../policy-engine.interface.js'; /** * Get block about information diff --git a/policy-service/src/policy-engine/blocks/get-block-by-type.ts b/policy-service/src/policy-engine/blocks/get-block-by-type.ts index b96bf27846..421963227c 100644 --- a/policy-service/src/policy-engine/blocks/get-block-by-type.ts +++ b/policy-service/src/policy-engine/blocks/get-block-by-type.ts @@ -1,5 +1,5 @@ -import * as blocks from './'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; +import * as blocks from './index.js'; +import { IPolicyBlock } from '../policy-engine.interface.js'; /** * Return block constructor by block type diff --git a/policy-service/src/policy-engine/blocks/group-manager.ts b/policy-service/src/policy-engine/blocks/group-manager.ts index b00e045a95..59bfc00c76 100644 --- a/policy-service/src/policy-engine/blocks/group-manager.ts +++ b/policy-service/src/policy-engine/blocks/group-manager.ts @@ -1,13 +1,13 @@ -import { EventBlock } from '@policy-engine/helpers/decorators'; -import { GroupRelationshipType, GroupAccessType } from '@guardian/interfaces'; -import { IPolicyInterfaceBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { PolicyRoles, MessageServer, MessageStatus } from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { EventBlock } from '../helpers/decorators/index.js'; +import { GroupAccessType, GroupRelationshipType } from '@guardian/interfaces'; +import { IPolicyInterfaceBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser, PolicyUser } from '../policy-user.js'; +import { MessageServer, MessageStatus, PolicyRoles } from '@guardian/common'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Document action clock with UI @@ -113,8 +113,9 @@ export class GroupManagerBlock { if (member.messageId) { const userCred = await PolicyUtils.getUserCredentials(ref, user.did); const userHederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref); const messageServer = new MessageServer( - userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, ref.dryRun + userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, signOptions, ref.dryRun ); const message = await messageServer.getMessage(member.messageId); const topic = await PolicyUtils.getPolicyTopic(ref, message.topicId); diff --git a/policy-service/src/policy-engine/blocks/history-addon.ts b/policy-service/src/policy-engine/blocks/history-addon.ts index 73437d805e..a7d296af38 100644 --- a/policy-service/src/policy-engine/blocks/history-addon.ts +++ b/policy-service/src/policy-engine/blocks/history-addon.ts @@ -1,5 +1,5 @@ -import { SourceAddon } from '@policy-engine/helpers/decorators'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; +import { SourceAddon } from '../helpers/decorators/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; /** * History Addon diff --git a/policy-service/src/policy-engine/blocks/http-request-block.ts b/policy-service/src/policy-engine/blocks/http-request-block.ts index c79f5a7ccd..5612d5f726 100644 --- a/policy-service/src/policy-engine/blocks/http-request-block.ts +++ b/policy-service/src/policy-engine/blocks/http-request-block.ts @@ -1,12 +1,12 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ActionCallback } from '@policy-engine/helpers/decorators'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { BasicBlock } from '../helpers/decorators/basic-block.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ActionCallback } from '../helpers/decorators/index.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { IPolicyCalculateBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { VcDocumentDefinition as VcDocument, VcHelper, Workers } from '@guardian/common'; import { WorkerTaskType } from '@guardian/interfaces'; diff --git a/policy-service/src/policy-engine/blocks/impact-addon.ts b/policy-service/src/policy-engine/blocks/impact-addon.ts index 1b26a8849b..56377c8c72 100644 --- a/policy-service/src/policy-engine/blocks/impact-addon.ts +++ b/policy-service/src/policy-engine/blocks/impact-addon.ts @@ -1,12 +1,12 @@ -import { TokenAddon } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; +import { TokenAddon } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; import { Schema, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; import { VcDocumentDefinition as VcDocument, VcHelper } from '@guardian/common'; -import { BlockActionError } from '@policy-engine/errors'; +import { BlockActionError } from '../errors/index.js'; /** * Calculate math addon diff --git a/policy-service/src/policy-engine/blocks/index.ts b/policy-service/src/policy-engine/blocks/index.ts index e238e01a9f..bd5e67589f 100644 --- a/policy-service/src/policy-engine/blocks/index.ts +++ b/policy-service/src/policy-engine/blocks/index.ts @@ -1,49 +1,49 @@ -export { GetBlockAbout } from './get-block-about'; -export { GetBlockByType } from './get-block-by-type'; -export { AggregateBlock } from './aggregate-block'; -export { CalculateContainerBlock } from './calculate-block'; -export { CalculateMathAddon } from './calculate-math-addon'; -export { CustomLogicBlock } from '@policy-engine/blocks/custom-logic-block'; -export { DocumentsSourceAddon } from './documents-source-addon'; -export { ExternalDataBlock } from './external-data-block'; -export { FiltersAddonBlock } from './filters-addon-block'; -export { InformationBlock } from './information-block'; -export { InterfaceContainerBlock } from './container-block'; -export { InterfaceDocumentActionBlock } from './action-block'; -export { InterfaceDocumentsSource } from './documents-source'; -export { InterfaceStepBlock } from './step-block'; -export { MintBlock } from './mint-block'; -export { PaginationAddon } from '@policy-engine/blocks/pagination-addon'; -export { PolicyRolesBlock } from './policy-roles'; -export { ReassigningBlock } from './reassigning.block'; -export { ReportBlock } from './report-block'; -export { ReportItemBlock } from './report-item-block'; -export { RetirementBlock } from './retirement-block'; -export { RequestVcDocumentBlock } from './request-vc-document-block'; -export { SendToGuardianBlock } from './send-to-guardian-block'; -export { SwitchBlock } from './switch-block'; -export { TimerBlock } from './timer-block'; -export { RevokeBlock } from './revoke-block'; -export { RevocationBlock } from './revocation-block'; -export { SetRelationshipsBlock } from './set-relationships-block'; -export { ButtonBlock } from './button-block'; -export { TokenActionBlock } from './token-action-block'; -export { DocumentValidatorBlock } from './document-validator-block'; -export { TokenConfirmationBlock } from './token-confirmation-block'; -export { GroupManagerBlock } from './group-manager'; -export { MultiSignBlock } from './multi-sign-block'; -export { CalculateMathVariables } from './calculate-math-variables'; -export { CreateTokenBlock } from './create-token-block'; -export { SplitBlock } from './split-block'; -export { TokenOperationAddon } from './impact-addon'; -export { HttpRequestBlock } from './http-request-block'; -export { HistoryAddon } from './history-addon'; -export { SelectiveAttributes } from './selective-attributes-addon'; -export { ModuleBlock } from './module'; -export { TagsManagerBlock } from './tag-manager'; -export { ExternalTopicBlock } from './external-topic-block'; -export { UploadVcDocumentBlock } from './upload-vc-document-block'; -export { MessagesReportBlock } from './messages-report-block'; -export { NotificationBlock } from './notification.block'; -export { ToolBlock } from './tool'; -export { ExtractDataBlock } from './extract-data-block'; \ No newline at end of file +export { GetBlockAbout } from './get-block-about.js'; +export { GetBlockByType } from './get-block-by-type.js'; +export { AggregateBlock } from './aggregate-block.js'; +export { CalculateContainerBlock } from './calculate-block.js'; +export { CalculateMathAddon } from './calculate-math-addon.js'; +export { CustomLogicBlock } from '../blocks/custom-logic-block.js'; +export { DocumentsSourceAddon } from './documents-source-addon.js'; +export { ExternalDataBlock } from './external-data-block.js'; +export { FiltersAddonBlock } from './filters-addon-block.js'; +export { InformationBlock } from './information-block.js'; +export { InterfaceContainerBlock } from './container-block.js'; +export { InterfaceDocumentActionBlock } from './action-block.js'; +export { InterfaceDocumentsSource } from './documents-source.js'; +export { InterfaceStepBlock } from './step-block.js'; +export { MintBlock } from './mint-block.js'; +export { PaginationAddon } from '../blocks/pagination-addon.js'; +export { PolicyRolesBlock } from './policy-roles.js'; +export { ReassigningBlock } from './reassigning.block.js'; +export { ReportBlock } from './report-block.js'; +export { ReportItemBlock } from './report-item-block.js'; +export { RetirementBlock } from './retirement-block.js'; +export { RequestVcDocumentBlock } from './request-vc-document-block.js'; +export { SendToGuardianBlock } from './send-to-guardian-block.js'; +export { SwitchBlock } from './switch-block.js'; +export { TimerBlock } from './timer-block.js'; +export { RevokeBlock } from './revoke-block.js'; +export { RevocationBlock } from './revocation-block.js'; +export { SetRelationshipsBlock } from './set-relationships-block.js'; +export { ButtonBlock } from './button-block.js'; +export { TokenActionBlock } from './token-action-block.js'; +export { DocumentValidatorBlock } from './document-validator-block.js'; +export { TokenConfirmationBlock } from './token-confirmation-block.js'; +export { GroupManagerBlock } from './group-manager.js'; +export { MultiSignBlock } from './multi-sign-block.js'; +export { CalculateMathVariables } from './calculate-math-variables.js'; +export { CreateTokenBlock } from './create-token-block.js'; +export { SplitBlock } from './split-block.js'; +export { TokenOperationAddon } from './impact-addon.js'; +export { HttpRequestBlock } from './http-request-block.js'; +export { HistoryAddon } from './history-addon.js'; +export { SelectiveAttributes } from './selective-attributes-addon.js'; +export { ModuleBlock } from './module.js'; +export { TagsManagerBlock } from './tag-manager.js'; +export { ExternalTopicBlock } from './external-topic-block.js'; +export { UploadVcDocumentBlock } from './upload-vc-document-block.js'; +export { MessagesReportBlock } from './messages-report-block.js'; +export { NotificationBlock } from './notification.block.js'; +export { ToolBlock } from './tool.js'; +export { ExtractDataBlock } from './extract-data-block.js'; diff --git a/policy-service/src/policy-engine/blocks/information-block.ts b/policy-service/src/policy-engine/blocks/information-block.ts index d2060fc779..f94dc8c901 100644 --- a/policy-service/src/policy-engine/blocks/information-block.ts +++ b/policy-service/src/policy-engine/blocks/information-block.ts @@ -1,8 +1,8 @@ -import { DataSourceBlock } from '@policy-engine/helpers/decorators/data-source-block'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { DataSourceBlock } from '../helpers/decorators/data-source-block.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; /** * Information block diff --git a/policy-service/src/policy-engine/blocks/messages-report-block.ts b/policy-service/src/policy-engine/blocks/messages-report-block.ts index 7fb25c85f5..7f4363377c 100644 --- a/policy-service/src/policy-engine/blocks/messages-report-block.ts +++ b/policy-service/src/policy-engine/blocks/messages-report-block.ts @@ -1,13 +1,13 @@ -import { Report } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyReportBlock } from '@policy-engine/policy-engine.interface'; -import { BlockActionError } from '@policy-engine/errors'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { IReport, MessagesReport } from '../helpers/messages-report'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { Report } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyReportBlock } from '../policy-engine.interface.js'; +import { BlockActionError } from '../errors/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { IReport, MessagesReport } from '../helpers/messages-report.js'; +import { PolicyUtils } from '../helpers/utils.js'; /** * Report block diff --git a/policy-service/src/policy-engine/blocks/mint-block.ts b/policy-service/src/policy-engine/blocks/mint-block.ts index 6230b70396..da15097c66 100644 --- a/policy-service/src/policy-engine/blocks/mint-block.ts +++ b/policy-service/src/policy-engine/blocks/mint-block.ts @@ -1,26 +1,17 @@ -import { ActionCallback, TokenBlock } from '@policy-engine/helpers/decorators'; -import { BlockActionError } from '@policy-engine/errors'; -import { DocumentSignature, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { - Token as TokenCollection, - VcDocumentDefinition as VcDocument, - VCMessage, - MessageAction, - MessageServer, - VPMessage, - MessageMemo, - VcHelper, - HederaDidDocument, -} from '@guardian/common'; -import { DataTypes, PolicyUtils } from '@policy-engine/helpers/utils'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyTokenBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { MintService } from '@policy-engine/mint/mint-service'; +import { ActionCallback, TokenBlock } from '../helpers/decorators/index.js'; +import { BlockActionError } from '../errors/index.js'; +import { DocumentSignature, SchemaEntity, SchemaHelper, DocumentCategoryType } from '@guardian/interfaces'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { HederaDidDocument, MessageAction, MessageMemo, MessageServer, Token as TokenCollection, VcDocumentDefinition as VcDocument, VcHelper, VCMessage, VPMessage, } from '@guardian/common'; + +import { PolicyUtils } from '../helpers/utils.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyTokenBlock } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { MintService } from '../mint/mint-service.js'; /** * Mint block @@ -305,9 +296,11 @@ export class MintBlock { ref.log(`Topic Id: ${topicId}`); const policyOwnerHederaCred = await policyOwnerCred.loadHederaCredentials(ref); + const signOptions = await policyOwnerCred.loadSignOptions(ref); const messageServer = new MessageServer( policyOwnerHederaCred.hederaAccountId, policyOwnerHederaCred.hederaAccountKey, + signOptions, ref.dryRun ); @@ -321,7 +314,7 @@ export class MintBlock { .setTopicObject(topic) .sendMessage(vcMessage); const mintVcDocument = PolicyUtils.createVC(ref, user, mintVC); - mintVcDocument.type = DataTypes.MINT; + mintVcDocument.type = DocumentCategoryType.MINT; mintVcDocument.schema = `#${mintVC.getSubjectType()}`; mintVcDocument.messageId = vcMessageResult.getId(); mintVcDocument.topicId = vcMessageResult.getTopicId(); @@ -344,7 +337,7 @@ export class MintBlock { .sendMessage(vpMessage); const vpMessageId = vpMessageResult.getId(); const vpDocument = PolicyUtils.createVP(ref, user, vp); - vpDocument.type = DataTypes.MINT; + vpDocument.type = DocumentCategoryType.MINT; vpDocument.messageId = vpMessageId; vpDocument.topicId = vpMessageResult.getTopicId(); vpDocument.documentFields = Array.from( @@ -364,7 +357,8 @@ export class MintBlock { accountId, vpMessageId, transactionMemo, - documents + documents, + signOptions ); return [savedVp, tokenValue]; } diff --git a/policy-service/src/policy-engine/blocks/module.ts b/policy-service/src/policy-engine/blocks/module.ts index a6b47ef433..5ef06d8bf5 100644 --- a/policy-service/src/policy-engine/blocks/module.ts +++ b/policy-service/src/policy-engine/blocks/module.ts @@ -1,11 +1,11 @@ -import { ContainerBlock } from '@policy-engine/helpers/decorators/container-block'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ActionCallback } from '@policy-engine/helpers/decorators'; -import { IPolicyEvent } from '@policy-engine/interfaces'; -import { PolicyInputEventType } from '@policy-engine/interfaces/policy-event-type'; -import { IPolicyEventState } from '@policy-engine/policy-engine.interface'; +import { ContainerBlock } from '../helpers/decorators/container-block.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ActionCallback } from '../helpers/decorators/index.js'; +import { IPolicyEvent } from '../interfaces/index.js'; +import { PolicyInputEventType } from '../interfaces/policy-event-type.js'; +import { IPolicyEventState } from '../policy-engine.interface.js'; /** * Container block with UI diff --git a/policy-service/src/policy-engine/blocks/multi-sign-block.ts b/policy-service/src/policy-engine/blocks/multi-sign-block.ts index bc9f4b0ac4..33664948c5 100644 --- a/policy-service/src/policy-engine/blocks/multi-sign-block.ts +++ b/policy-service/src/policy-engine/blocks/multi-sign-block.ts @@ -1,22 +1,15 @@ -import { ActionCallback, EventBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { DataTypes, PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { BlockActionError } from '@policy-engine/errors'; -import { - PolicyRoles, - VcDocument as VcDocumentCollection, - MessageAction, - MessageServer, - VcHelper, - VcDocumentDefinition as VcDocument, - VPMessage, -} from '@guardian/common'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { Inject } from '@helpers/decorators/inject'; +import { ActionCallback, EventBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { IPolicyUser } from '../policy-user.js'; +import { BlockActionError } from '../errors/index.js'; +import { MessageAction, MessageServer, PolicyRoles, VcDocument as VcDocumentCollection, VcDocumentDefinition as VcDocument, VcHelper, VPMessage, } from '@guardian/common'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { Inject } from '../../helpers/decorators/inject.js'; +import { DocumentCategoryType } from '@guardian/interfaces'; /** * Sign Status @@ -65,7 +58,7 @@ export class MultiSignBlock { * @private */ @Inject() - private readonly vcHelper: VcHelper; + declare private vcHelper: VcHelper; /** * Before init callback @@ -229,6 +222,7 @@ export class MultiSignBlock { ); const documentOwnerHederaCred = await documentOwnerCred.loadHederaCredentials(ref); + const signOptions = await documentOwnerCred.loadSignOptions(ref); const vpMessage = new VPMessage(MessageAction.CreateVP); vpMessage.setDocument(vp); vpMessage.setRelationships(sourceDoc.messageId ? [sourceDoc.messageId] : []); @@ -237,6 +231,7 @@ export class MultiSignBlock { const messageServer = new MessageServer( documentOwnerHederaCred.hederaAccountId, documentOwnerHederaCred.hederaAccountKey, + signOptions, ref.dryRun ); @@ -245,7 +240,7 @@ export class MultiSignBlock { .sendMessage(vpMessage); const vpMessageId = vpMessageResult.getId(); const vpDocument = PolicyUtils.createVP(ref, docOwner, vp); - vpDocument.type = DataTypes.MULTI_SIGN; + vpDocument.type = DocumentCategoryType.MULTI_SIGN; vpDocument.messageId = vpMessageId; vpDocument.topicId = vpMessageResult.getTopicId(); vpDocument.relationships = sourceDoc.messageId ? [sourceDoc.messageId] : null; diff --git a/policy-service/src/policy-engine/blocks/notification.block.ts b/policy-service/src/policy-engine/blocks/notification.block.ts index 22b289d27d..2888dce649 100644 --- a/policy-service/src/policy-engine/blocks/notification.block.ts +++ b/policy-service/src/policy-engine/blocks/notification.block.ts @@ -1,26 +1,26 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; import { IPolicyEventState, IPolicyRequestBlock, -} from '@policy-engine/policy-engine.interface'; +} from '../policy-engine.interface.js'; import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType, -} from '@policy-engine/interfaces'; +} from '../interfaces/index.js'; import { ChildrenType, ControlType, PropertyType, SelectItemType, -} from '@policy-engine/interfaces/block-about'; +} from '../interfaces/block-about.js'; import { ExternalDocuments, ExternalEvent, ExternalEventType, -} from '@policy-engine/interfaces/external-event'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +} from '../interfaces/external-event.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { NotificationHelper, Users } from '@guardian/common'; import { NotificationAction, @@ -201,19 +201,25 @@ export class NotificationBlock { switch (ref.options.user) { case UserOption.ALL: { - const policyUsers = await ref.databaseServer.getAllPolicyUsers( - ref.policyId - ); - for (const user of policyUsers) { - await notify( - ref.options.title, - ref.options.message, - user.userId + if (!ref.dryRun) { + const policyUsers = + await ref.databaseServer.getAllPolicyUsers( + ref.policyId + ); + const users = await new Users().getUsersByIds( + policyUsers.map((pu) => pu.did) ); + for (const user of users) { + await notify( + ref.options.title, + ref.options.message, + user.id + ); + } } } case UserOption.CURRENT: { - if (event.user.did !== ref.policyOwner) { + if (event.user.did !== ref.policyOwner && !ref.dryRun) { const user = await PolicyUtils.getUser(ref, event.user.did); await notify( ref.options.title, @@ -239,7 +245,13 @@ export class NotificationBlock { ? event.data.data[0].owner : event.data.data.owner ); - await notify(ref.options.title, ref.options.message, user.id); + if (user.did === ref.policyOwner || !ref.dryRun) { + await notify( + ref.options.title, + ref.options.message, + user.id + ); + } break; } case UserOption.DOCUMENT_ISSUER: { @@ -249,7 +261,13 @@ export class NotificationBlock { ? event.data.data[0].document?.issuer : event.data.data.document?.issuer ); - await notify(ref.options.title, ref.options.message, user.id); + if (user.did === ref.policyOwner || !ref.dryRun) { + await notify( + ref.options.title, + ref.options.message, + user.id + ); + } break; } case UserOption.GROUP_OWNER: { @@ -259,30 +277,38 @@ export class NotificationBlock { ); for (const role of roles) { const owner = await PolicyUtils.getUser(ref, role.owner); - await notify( - ref.options.title, - ref.options.message, - owner.id - ); + if (owner.did === ref.policyOwner || !ref.dryRun) { + await notify( + ref.options.title, + ref.options.message, + owner.id + ); + } } break; } case UserOption.ROLE: { - const users = ref.options.grouped + let policyUsers = ref.options.grouped ? await ref.databaseServer.getAllUsersByRole( - ref.policyId, - event.user.group, - ref.options.role - ) + ref.policyId, + event.user.group, + ref.options.role + ) : await ref.databaseServer.getUsersByRole( - ref.policyId, - ref.options.role - ); + ref.policyId, + ref.options.role + ); + policyUsers = ref.dryRun + ? policyUsers.filter((pu) => pu.did === ref.policyOwner) + : policyUsers; + const users = await new Users().getUsersByIds( + policyUsers.map((pu) => pu.did) + ); for (const user of users) { await notify( ref.options.title, ref.options.message, - user.userId + user.id ); } break; diff --git a/policy-service/src/policy-engine/blocks/pagination-addon.ts b/policy-service/src/policy-engine/blocks/pagination-addon.ts index d64464124a..b2d7cc2048 100644 --- a/policy-service/src/policy-engine/blocks/pagination-addon.ts +++ b/policy-service/src/policy-engine/blocks/pagination-addon.ts @@ -1,9 +1,9 @@ -import { SourceAddon, StateField } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicySourceBlock } from '@policy-engine/policy-engine.interface'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { SourceAddon, StateField } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicySourceBlock } from '../policy-engine.interface.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Pagination addon diff --git a/policy-service/src/policy-engine/blocks/policy-roles.ts b/policy-service/src/policy-engine/blocks/policy-roles.ts index fb9a8b656b..75b0c27522 100644 --- a/policy-service/src/policy-engine/blocks/policy-roles.ts +++ b/policy-service/src/policy-engine/blocks/policy-roles.ts @@ -1,14 +1,14 @@ -import { ActionCallback, EventBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { GroupAccessType, GroupRelationshipType, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; -import { BlockActionError } from '@policy-engine/errors'; -import { AnyBlockType } from '@policy-engine/policy-engine.interface'; -import { DataTypes, PolicyUtils } from '@policy-engine/helpers/utils'; +import { ActionCallback, EventBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { IPolicyUser, PolicyUser } from '../policy-user.js'; +import { DocumentCategoryType, GroupAccessType, GroupRelationshipType, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; +import { BlockActionError } from '../errors/index.js'; +import { AnyBlockType } from '../policy-engine.interface.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { VcHelper, MessageAction, MessageServer, RoleMessage, IAuthUser } from '@guardian/common'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * User Group @@ -318,6 +318,7 @@ export class PolicyRolesBlock { const userCred = await PolicyUtils.getUserCredentials(ref, group.owner); const hederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref) const didDocument = await userCred.loadDidDocument(ref); const uuid: string = await ref.components.generateUUID(); @@ -350,7 +351,7 @@ export class PolicyRolesBlock { ); const rootTopic = await PolicyUtils.getInstancePolicyTopic(ref); - const messageServer = new MessageServer(hederaCred.hederaAccountId, hederaCred.hederaAccountKey, ref.dryRun); + const messageServer = new MessageServer(hederaCred.hederaAccountId, hederaCred.hederaAccountKey, signOptions, ref.dryRun); const vcMessage = new RoleMessage(MessageAction.CreateVC); vcMessage.setDocument(userVC); vcMessage.setRole(group); @@ -359,7 +360,7 @@ export class PolicyRolesBlock { .sendMessage(vcMessage); const vcDocument = PolicyUtils.createVC(ref, user, userVC); - vcDocument.type = DataTypes.USER_ROLE; + vcDocument.type = DocumentCategoryType.USER_ROLE; vcDocument.schema = `#${userVC.getSubjectType()}`; vcDocument.messageId = vcMessageResult.getId(); vcDocument.topicId = vcMessageResult.getTopicId(); diff --git a/policy-service/src/policy-engine/blocks/reassigning.block.ts b/policy-service/src/policy-engine/blocks/reassigning.block.ts index fb7d535c13..5916e95d0f 100644 --- a/policy-service/src/policy-engine/blocks/reassigning.block.ts +++ b/policy-service/src/policy-engine/blocks/reassigning.block.ts @@ -1,14 +1,14 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; import { VcHelper } from '@guardian/common'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { Inject } from '@helpers/decorators/inject'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { Inject } from '../../helpers/decorators/inject.js'; /** * Reassigning block @@ -41,7 +41,7 @@ export class ReassigningBlock { * @private */ @Inject() - private readonly vcHelper: VcHelper; + declare private vcHelper: VcHelper; /** * Document reassigning @@ -64,6 +64,7 @@ export class ReassigningBlock { let root: UserCredentials; let groupContext: any; + if (ref.options.issuer === 'owner') { root = await PolicyUtils.getUserCredentials(ref, document.owner); groupContext = await PolicyUtils.getGroupContext(ref, owner); @@ -148,4 +149,4 @@ export class ReassigningBlock { documents: ExternalDocuments(result) })); } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/blocks/report-block.ts b/policy-service/src/policy-engine/blocks/report-block.ts index db68aa104a..a0c0c4b26f 100644 --- a/policy-service/src/policy-engine/blocks/report-block.ts +++ b/policy-service/src/policy-engine/blocks/report-block.ts @@ -1,13 +1,13 @@ -import { Report } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyReportBlock } from '@policy-engine/policy-engine.interface'; +import { Report } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyReportBlock } from '../policy-engine.interface.js'; import { IImpactReport, IPolicyReport, IReport, IReportItem, IVCReport, SchemaEntity, } from '@guardian/interfaces'; -import { BlockActionError } from '@policy-engine/errors'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyInputEventType } from '@policy-engine/interfaces'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { BlockActionError } from '../errors/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyInputEventType } from '../interfaces/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; import { getVCField, VcDocument, VpDocument } from '@guardian/common'; /** diff --git a/policy-service/src/policy-engine/blocks/report-item-block.ts b/policy-service/src/policy-engine/blocks/report-item-block.ts index e6eba0077c..b69d40dd3b 100644 --- a/policy-service/src/policy-engine/blocks/report-item-block.ts +++ b/policy-service/src/policy-engine/blocks/report-item-block.ts @@ -1,11 +1,11 @@ import { findOptions, getVCIssuer } from '@guardian/common'; -import { ReportItem } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyReportItemBlock } from '@policy-engine/policy-engine.interface'; +import { ReportItem } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyReportItemBlock } from '../policy-engine.interface.js'; import { IReportItem } from '@guardian/interfaces'; -import { BlockActionError } from '@policy-engine/errors'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { BlockActionError } from '../errors/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Report item block diff --git a/policy-service/src/policy-engine/blocks/request-vc-document-block.ts b/policy-service/src/policy-engine/blocks/request-vc-document-block.ts index 5d8ec5f4a6..24fd28e28c 100644 --- a/policy-service/src/policy-engine/blocks/request-vc-document-block.ts +++ b/policy-service/src/policy-engine/blocks/request-vc-document-block.ts @@ -1,15 +1,15 @@ import { CheckResult, removeObjectProperties, Schema, SchemaHelper } from '@guardian/interfaces'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { ActionCallback, StateField } from '@policy-engine/helpers/decorators'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyRequestBlock, IPolicyValidatorBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { EventBlock } from '@policy-engine/helpers/decorators/event-block'; +import { PolicyUtils } from '../helpers/utils.js'; +import { BlockActionError } from '../errors/index.js'; +import { ActionCallback, StateField } from '../helpers/decorators/index.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState, IPolicyRequestBlock, IPolicyValidatorBlock } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { EventBlock } from '../helpers/decorators/event-block.js'; import { DIDMessage, MessageAction, MessageServer, VcDocument as VcDocumentCollection, VcHelper, } from '@guardian/common'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; import deepEqual from 'deep-equal'; /** @@ -307,9 +307,11 @@ export class RequestVcDocumentBlock { message.setDocument(didObject); const userHederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref); const client = new MessageServer( userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, + signOptions, ref.dryRun ); const messageResult = await client diff --git a/policy-service/src/policy-engine/blocks/retirement-block.ts b/policy-service/src/policy-engine/blocks/retirement-block.ts index e96e6df332..f47be24c2b 100644 --- a/policy-service/src/policy-engine/blocks/retirement-block.ts +++ b/policy-service/src/policy-engine/blocks/retirement-block.ts @@ -1,16 +1,16 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { BlockActionError } from '@policy-engine/errors'; -import { DocumentSignature, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { BlockActionError } from '../errors/index.js'; +import { DocumentCategoryType, DocumentSignature, SchemaEntity, SchemaHelper } from '@guardian/interfaces'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; import { Token as TokenCollection, VcHelper, VcDocumentDefinition as VcDocument, MessageServer, VCMessage, MessageAction, VPMessage, HederaDidDocument } from '@guardian/common'; -import { DataTypes, PolicyUtils } from '@policy-engine/helpers/utils'; -import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { MintService } from '@policy-engine/mint/mint-service'; +import { PolicyUtils } from '../helpers/utils.js'; +import { AnyBlockType, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { MintService } from '../mint/mint-service.js'; /** * Retirement block @@ -113,6 +113,7 @@ export class RetirementBlock { const didDocument = await root.loadDidDocument(ref); const hederaCred = await root.loadHederaCredentials(ref); + const signOptions = await root.loadSignOptions(ref); const uuid: string = await ref.components.generateUUID(); const amount = PolicyUtils.aggregate(ref.options.rule, documents); @@ -121,7 +122,7 @@ export class RetirementBlock { const vcs = [].concat(documents, wipeVC); const vp = await this.createVP(didDocument, uuid, vcs); - const messageServer = new MessageServer(hederaCred.hederaAccountId, hederaCred.hederaAccountKey, ref.dryRun); + const messageServer = new MessageServer(hederaCred.hederaAccountId, hederaCred.hederaAccountKey, signOptions, ref.dryRun); ref.log(`Topic Id: ${topicId}`); const topic = await PolicyUtils.getPolicyTopic(ref, topicId); const vcMessage = new VCMessage(MessageAction.CreateVC); @@ -133,7 +134,7 @@ export class RetirementBlock { .sendMessage(vcMessage); const vcDocument = PolicyUtils.createVC(ref, user, wipeVC); - vcDocument.type = DataTypes.RETIREMENT; + vcDocument.type = DocumentCategoryType.RETIREMENT; vcDocument.schema = `#${wipeVC.getSubjectType()}`; vcDocument.messageId = vcMessageResult.getId(); vcDocument.topicId = vcMessageResult.getTopicId(); @@ -152,7 +153,7 @@ export class RetirementBlock { .sendMessage(vpMessage); const vpDocument = PolicyUtils.createVP(ref, user, vp); - vpDocument.type = DataTypes.RETIREMENT; + vpDocument.type = DocumentCategoryType.RETIREMENT; vpDocument.messageId = vpMessageResult.getId(); vpDocument.topicId = vpMessageResult.getTopicId(); vpDocument.relationships = relationships; diff --git a/policy-service/src/policy-engine/blocks/revocation-block.ts b/policy-service/src/policy-engine/blocks/revocation-block.ts index 15f3326581..2ff9742369 100644 --- a/policy-service/src/policy-engine/blocks/revocation-block.ts +++ b/policy-service/src/policy-engine/blocks/revocation-block.ts @@ -1,28 +1,12 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { - AnyBlockType, - IPolicyEventState, - IPolicyInterfaceBlock, -} from '@policy-engine/policy-engine.interface'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyEventState, IPolicyInterfaceBlock, } from '../policy-engine.interface.js'; import { Message, MessageServer } from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { - IPolicyEvent, - PolicyInputEventType, - PolicyOutputEventType, -} from '@policy-engine/interfaces'; -import { - ChildrenType, - ControlType, - PropertyType, -} from '@policy-engine/interfaces/block-about'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { - ExternalDocuments, - ExternalEvent, - ExternalEventType, -} from '@policy-engine/interfaces/external-event'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType, } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType, } from '../interfaces/block-about.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType, } from '../interfaces/external-event.js'; export const RevokedStatus = 'Revoked'; @@ -178,9 +162,11 @@ export class RevocationBlock { const userCred = await PolicyUtils.getUserCredentials(ref, event.user.did); const userHederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref); const messageServer = new MessageServer( userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, + signOptions, ref.dryRun ); const policyTopics = await ref.databaseServer.getTopics({ diff --git a/policy-service/src/policy-engine/blocks/revoke-block.ts b/policy-service/src/policy-engine/blocks/revoke-block.ts index 8a687d5536..af91f62cb1 100644 --- a/policy-service/src/policy-engine/blocks/revoke-block.ts +++ b/policy-service/src/policy-engine/blocks/revoke-block.ts @@ -1,12 +1,12 @@ -import { ActionCallback, EventBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyEventState, IPolicyInterfaceBlock } from '@policy-engine/policy-engine.interface'; +import { ActionCallback, EventBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyEventState, IPolicyInterfaceBlock } from '../policy-engine.interface.js'; import { Message, MessageServer } from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; export const RevokedStatus = 'Revoked'; @@ -133,8 +133,9 @@ export class RevokeBlock { const userCred = await PolicyUtils.getUserCredentials(ref, event.user.did); const userHederaCred = await userCred.loadHederaCredentials(ref); + const signOptions = await userCred.loadSignOptions(ref); const messageServer = new MessageServer( - userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, ref.dryRun + userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, signOptions, ref.dryRun ); const policyTopics = await ref.databaseServer.getTopics({ policyId: ref.policyId }); diff --git a/policy-service/src/policy-engine/blocks/selective-attributes-addon.ts b/policy-service/src/policy-engine/blocks/selective-attributes-addon.ts index 4b4c7f04b8..05976d3f79 100644 --- a/policy-service/src/policy-engine/blocks/selective-attributes-addon.ts +++ b/policy-service/src/policy-engine/blocks/selective-attributes-addon.ts @@ -1,5 +1,5 @@ -import { SourceAddon } from '@policy-engine/helpers/decorators'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; +import { SourceAddon } from '../helpers/decorators/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; /** * Selective Attributes diff --git a/policy-service/src/policy-engine/blocks/send-to-guardian-block.ts b/policy-service/src/policy-engine/blocks/send-to-guardian-block.ts index e866f16d8e..c40e05c99d 100644 --- a/policy-service/src/policy-engine/blocks/send-to-guardian-block.ts +++ b/policy-service/src/policy-engine/blocks/send-to-guardian-block.ts @@ -1,27 +1,16 @@ -import { BlockActionError } from '@policy-engine/errors'; -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; +import { BlockActionError } from '../errors/index.js'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; import { DocumentStatus } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { - MessageAction, - MessageServer, - VcDocumentDefinition as VcDocument, - VpDocumentDefinition as VpDocument, - VCMessage, - MessageMemo, - VPMessage, - DIDMessage, - Message, - HederaDidDocument -} from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { DocumentType } from '@policy-engine/interfaces/document.type'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { DIDMessage, HederaDidDocument, Message, MessageAction, MessageMemo, MessageServer, VcDocumentDefinition as VcDocument, VCMessage, VpDocumentDefinition as VpDocument, VPMessage } from '@guardian/common'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { DocumentType } from '../interfaces/document.type.js'; /** * Document Operations @@ -434,8 +423,9 @@ export class SendToGuardianBlock { const topic = await PolicyUtils.getOrCreateTopic(ref, ref.options.topic, root, topicOwner, document); const userHederaCred = await user.loadHederaCredentials(ref); + const signOptions = await user.loadSignOptions(ref); const messageServer = new MessageServer( - userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, ref.dryRun + userHederaCred.hederaAccountId, userHederaCred.hederaAccountKey, signOptions, ref.dryRun ); const memo = MessageMemo.parseMemo(true, ref.options.memo, document); const vcMessageResult = await messageServer @@ -581,4 +571,4 @@ export class SendToGuardianBlock { documents: ExternalDocuments(event.data?.data), })); } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/blocks/set-relationships-block.ts b/policy-service/src/policy-engine/blocks/set-relationships-block.ts index dd3bc69494..df626824cd 100644 --- a/policy-service/src/policy-engine/blocks/set-relationships-block.ts +++ b/policy-service/src/policy-engine/blocks/set-relationships-block.ts @@ -1,9 +1,9 @@ -import { ActionCallback, SetRelationshipsBlock as SetRelationships } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyDocument, IPolicyEventState, IPolicyRequestBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ActionCallback, SetRelationshipsBlock as SetRelationships } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyDocument, IPolicyEventState, IPolicyRequestBlock } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Set document relationships action diff --git a/policy-service/src/policy-engine/blocks/split-block.ts b/policy-service/src/policy-engine/blocks/split-block.ts index 62dc82a329..0b56ad6547 100644 --- a/policy-service/src/policy-engine/blocks/split-block.ts +++ b/policy-service/src/policy-engine/blocks/split-block.ts @@ -1,11 +1,11 @@ -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '../policy-components-utils'; -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { IPolicyBlock, IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { IPolicyBlock, IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyUser, UserCredentials } from '../policy-user.js'; import { SplitDocuments, Schema as SchemaCollection, @@ -13,9 +13,9 @@ import { VcDocumentDefinition as VcDocument, } from '@guardian/common'; import { SchemaEntity } from '@guardian/interfaces'; -import { BlockActionError } from '@policy-engine/errors'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; -import { Inject } from '@helpers/decorators/inject'; +import { BlockActionError } from '../errors/index.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; +import { Inject } from '../../helpers/decorators/inject.js'; /** * Split block @@ -59,7 +59,7 @@ export class SplitBlock { * @private */ @Inject() - private readonly vcHelper: VcHelper; + declare private vcHelper: VcHelper; /** * Schema diff --git a/policy-service/src/policy-engine/blocks/step-block.ts b/policy-service/src/policy-engine/blocks/step-block.ts index 953392d650..4b9a4a008a 100644 --- a/policy-service/src/policy-engine/blocks/step-block.ts +++ b/policy-service/src/policy-engine/blocks/step-block.ts @@ -1,11 +1,11 @@ -import { ActionCallback, ContainerBlock, StateField } from '@policy-engine/helpers/decorators'; -import { BlockActionError } from '@policy-engine/errors'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyBlock, IPolicyContainerBlock, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType, SelectItemType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ActionCallback, ContainerBlock, StateField } from '../helpers/decorators/index.js'; +import { BlockActionError } from '../errors/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyBlock, IPolicyContainerBlock, IPolicyEventState } from '../policy-engine.interface.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType, SelectItemType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Step block @@ -59,7 +59,7 @@ export class InterfaceStepBlock { * Block state */ @StateField() - state: { [key: string]: any } = { index: 0 }; + declare state: { [key: string]: any }; /** * Final steps */ @@ -69,6 +69,8 @@ export class InterfaceStepBlock { * Before init callback */ public async beforeInit(): Promise { + this.state = {} + const ref = PolicyComponentsUtils.GetBlockRef(this); this.endIndexes[ref.children.length - 1] = true; if (ref.options?.finalBlocks && Array.isArray(ref.options.finalBlocks)) { diff --git a/policy-service/src/policy-engine/blocks/switch-block.ts b/policy-service/src/policy-engine/blocks/switch-block.ts index 342a6ad09a..8647efe5ce 100644 --- a/policy-service/src/policy-engine/blocks/switch-block.ts +++ b/policy-service/src/policy-engine/blocks/switch-block.ts @@ -1,12 +1,12 @@ -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; import { VcDocumentDefinition as VcDocument } from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { IPolicyDocument, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { IPolicyUser } from '../policy-user.js'; +import { IPolicyDocument, IPolicyEventState } from '../policy-engine.interface.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Switch block diff --git a/policy-service/src/policy-engine/blocks/tag-manager.ts b/policy-service/src/policy-engine/blocks/tag-manager.ts index a1d1be4efc..89bbd8beb7 100644 --- a/policy-service/src/policy-engine/blocks/tag-manager.ts +++ b/policy-service/src/policy-engine/blocks/tag-manager.ts @@ -1,21 +1,12 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { AnyBlockType, IPolicyDocument } from '@policy-engine/policy-engine.interface'; -import { IHederaCredentials, IPolicyUser } from '@policy-engine/policy-user'; -import { BlockActionError } from '@policy-engine/errors'; -import { SchemaCategory, SchemaHelper, SchemaStatus, TagType } from '@guardian/interfaces'; -import { - Tag, - MessageAction, - MessageServer, - MessageType, - TagMessage, - TopicConfig, - VcHelper, - DatabaseServer, -} from '@guardian/common'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { BasicBlock } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { AnyBlockType, IPolicyDocument } from '../policy-engine.interface.js'; +import { IHederaCredentials, IPolicyUser } from '../policy-user.js'; +import { BlockActionError } from '../errors/index.js'; +import { ISignOptions, SchemaCategory, SchemaHelper, SchemaStatus, TagType } from '@guardian/interfaces'; +import { DatabaseServer, MessageAction, MessageServer, MessageType, Tag, TagMessage, TopicConfig, VcHelper, } from '@guardian/common'; +import { PolicyUtils } from '../helpers/utils.js'; /** * Tag Manager @@ -192,7 +183,8 @@ export class TagsManagerBlock { tag.target = target.target; tag.status = 'Published'; const hederaCred = await userCred.loadHederaCredentials(ref); - await this.publishTag(tag, target.topicId, hederaCred); + const signOptions = await userCred.loadSignOptions(ref); + await this.publishTag(tag, target.topicId, hederaCred, signOptions); } else { tag.target = null; tag.localTarget = target.id; @@ -293,11 +285,14 @@ export class TagsManagerBlock { /** * Publish tag - * @param tag + * @param item + * @param topicId + * @param owner + * @param signOptions */ - private async publishTag(item: Tag, topicId: string, owner: IHederaCredentials): Promise { + private async publishTag(item: Tag, topicId: string, owner: IHederaCredentials, signOptions: ISignOptions): Promise { const ref = PolicyComponentsUtils.GetBlockRef(this); - const messageServer = new MessageServer(owner.hederaAccountId, owner.hederaAccountKey, ref.dryRun); + const messageServer = new MessageServer(owner.hederaAccountId, owner.hederaAccountKey, signOptions, ref.dryRun); const topic = await ref.databaseServer.getTopicById(topicId); const topicConfig = await TopicConfig.fromObject(topic, !ref.dryRun); @@ -323,7 +318,8 @@ export class TagsManagerBlock { const ref = PolicyComponentsUtils.GetBlockRef(this); const user = await PolicyUtils.getUserCredentials(ref, owner); const userCred = await user.loadHederaCredentials(ref); - const messageServer = new MessageServer(userCred.hederaAccountId, userCred.hederaAccountKey, ref.dryRun); + const signOptions = await user.loadSignOptions(ref); + const messageServer = new MessageServer(userCred.hederaAccountId, userCred.hederaAccountKey, signOptions, ref.dryRun); const topic = await ref.databaseServer.getTopicById(topicId); const topicConfig = await TopicConfig.fromObject(topic, !ref.dryRun); @@ -352,7 +348,7 @@ export class TagsManagerBlock { ): Promise { const ref = PolicyComponentsUtils.GetBlockRef(this); - const messageServer = new MessageServer(null, null, ref.dryRun); + const messageServer = new MessageServer(null, null, null, ref.dryRun); const messages = await messageServer.getMessages(topicId, MessageType.Tag); const map = new Map(); for (const message of messages) { diff --git a/policy-service/src/policy-engine/blocks/timer-block.ts b/policy-service/src/policy-engine/blocks/timer-block.ts index bbc907f242..ea1f91c4e1 100644 --- a/policy-service/src/policy-engine/blocks/timer-block.ts +++ b/policy-service/src/policy-engine/blocks/timer-block.ts @@ -1,13 +1,13 @@ import moment from 'moment'; import { CronJob } from 'cron'; -import { ActionCallback, BasicBlock, StateField } from '@policy-engine/helpers/decorators'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { AnyBlockType, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces/policy-event-type'; -import { IPolicyEvent } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { ActionCallback, BasicBlock, StateField } from '../helpers/decorators/index.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { AnyBlockType, IPolicyEventState } from '../policy-engine.interface.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/policy-event-type.js'; +import { IPolicyEvent } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; import { PolicyType } from '@guardian/interfaces'; /** diff --git a/policy-service/src/policy-engine/blocks/token-action-block.ts b/policy-service/src/policy-engine/blocks/token-action-block.ts index 5855bbf0d0..fa72b7d3dd 100644 --- a/policy-service/src/policy-engine/blocks/token-action-block.ts +++ b/policy-service/src/policy-engine/blocks/token-action-block.ts @@ -1,13 +1,13 @@ -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '../policy-components-utils'; -import { ActionCallback, BasicBlock } from '@policy-engine/helpers/decorators'; -import { IPolicyBlock, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IHederaCredentials, IPolicyUser } from '@policy-engine/policy-user'; -import { BlockActionError } from '@policy-engine/errors'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ActionCallback, BasicBlock } from '../helpers/decorators/index.js'; +import { IPolicyBlock, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IHederaCredentials, IPolicyUser } from '../policy-user.js'; +import { BlockActionError } from '../errors/index.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Information block diff --git a/policy-service/src/policy-engine/blocks/token-confirmation-block.ts b/policy-service/src/policy-engine/blocks/token-confirmation-block.ts index bad55aa760..53da190595 100644 --- a/policy-service/src/policy-engine/blocks/token-confirmation-block.ts +++ b/policy-service/src/policy-engine/blocks/token-confirmation-block.ts @@ -1,14 +1,14 @@ -import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '../policy-components-utils'; -import { ActionCallback, EventBlock, StateField } from '@policy-engine/helpers/decorators'; -import { IPolicyBlock, IPolicyEventState } from '@policy-engine/policy-engine.interface'; -import { CatchErrors } from '@policy-engine/helpers/decorators/catch-errors'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { IPolicyEvent, PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { ActionCallback, EventBlock, StateField } from '../helpers/decorators/index.js'; +import { IPolicyBlock, IPolicyEventState } from '../policy-engine.interface.js'; +import { CatchErrors } from '../helpers/decorators/catch-errors.js'; +import { PolicyUtils } from '../helpers/utils.js'; import { Token as TokenCollection } from '@guardian/common'; -import { BlockActionError } from '@policy-engine/errors'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { BlockActionError } from '../errors/index.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Information block diff --git a/policy-service/src/policy-engine/blocks/tool.ts b/policy-service/src/policy-engine/blocks/tool.ts index 49e2c4fd49..f5b0874494 100644 --- a/policy-service/src/policy-engine/blocks/tool.ts +++ b/policy-service/src/policy-engine/blocks/tool.ts @@ -1,11 +1,11 @@ -import { ContainerBlock } from '@policy-engine/helpers/decorators/container-block'; -import { ChildrenType, ControlType } from '@policy-engine/interfaces/block-about'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ActionCallback } from '@policy-engine/helpers/decorators'; -import { IPolicyEvent } from '@policy-engine/interfaces'; -import { PolicyInputEventType } from '@policy-engine/interfaces/policy-event-type'; -import { IPolicyEventState } from '@policy-engine/policy-engine.interface'; +import { ContainerBlock } from '../helpers/decorators/container-block.js'; +import { ChildrenType, ControlType } from '../interfaces/block-about.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ActionCallback } from '../helpers/decorators/index.js'; +import { IPolicyEvent } from '../interfaces/index.js'; +import { PolicyInputEventType } from '../interfaces/policy-event-type.js'; +import { IPolicyEventState } from '../policy-engine.interface.js'; /** * Container block with UI diff --git a/policy-service/src/policy-engine/blocks/upload-vc-document-block.ts b/policy-service/src/policy-engine/blocks/upload-vc-document-block.ts index 9ab52151b0..c6ce21cce5 100644 --- a/policy-service/src/policy-engine/blocks/upload-vc-document-block.ts +++ b/policy-service/src/policy-engine/blocks/upload-vc-document-block.ts @@ -1,15 +1,15 @@ import { DocumentSignature, Schema } from '@guardian/interfaces'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { ActionCallback } from '@policy-engine/helpers/decorators'; -import { IPolicyEventState, IPolicyRequestBlock } from '@policy-engine/policy-engine.interface'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { ChildrenType, ControlType, PropertyType } from '@policy-engine/interfaces/block-about'; -import { EventBlock } from '@policy-engine/helpers/decorators/event-block'; +import { PolicyUtils } from '../helpers/utils.js'; +import { BlockActionError } from '../errors/index.js'; +import { ActionCallback } from '../helpers/decorators/index.js'; +import { IPolicyEventState, IPolicyRequestBlock } from '../policy-engine.interface.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../interfaces/index.js'; +import { ChildrenType, ControlType, PropertyType } from '../interfaces/block-about.js'; +import { EventBlock } from '../helpers/decorators/event-block.js'; import { VcHelper, VcDocumentDefinition as VcDocument } from '@guardian/common'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { ExternalDocuments, ExternalEvent, ExternalEventType } from '@policy-engine/interfaces/external-event'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; +import { IPolicyUser } from '../policy-user.js'; +import { ExternalDocuments, ExternalEvent, ExternalEventType } from '../interfaces/external-event.js'; /** * Request VC document block diff --git a/policy-service/src/policy-engine/errors/block-init-error.ts b/policy-service/src/policy-engine/errors/block-init-error.ts index 66ef8a9250..0807f5048a 100644 --- a/policy-service/src/policy-engine/errors/block-init-error.ts +++ b/policy-service/src/policy-engine/errors/block-init-error.ts @@ -1,4 +1,4 @@ -import { BlockError } from '@policy-engine/interfaces'; +import { BlockError } from '../interfaces/index.js'; /** * Error fires when block init diff --git a/policy-service/src/policy-engine/errors/index.ts b/policy-service/src/policy-engine/errors/index.ts index a9801adb6b..f24de2bd18 100644 --- a/policy-service/src/policy-engine/errors/index.ts +++ b/policy-service/src/policy-engine/errors/index.ts @@ -1,3 +1,3 @@ -export { PolicyOtherError } from '@policy-engine/errors/policy-other-error'; -export { BlockInitError } from '@policy-engine/errors/block-init-error'; -export { BlockActionError } from '@policy-engine/errors/block-action-error'; +export { PolicyOtherError } from '../errors/policy-other-error.js'; +export { BlockInitError } from '../errors/block-init-error.js'; +export { BlockActionError } from '../errors/block-action-error.js'; diff --git a/policy-service/src/policy-engine/helpers/components-service.ts b/policy-service/src/policy-engine/helpers/components-service.ts index b670796c23..87fe2ac058 100644 --- a/policy-service/src/policy-engine/helpers/components-service.ts +++ b/policy-service/src/policy-engine/helpers/components-service.ts @@ -8,9 +8,9 @@ import { } from '@guardian/common'; import { GenerateUUIDv4, PolicyType, SchemaEntity } from '@guardian/interfaces'; import { PrivateKey } from '@hashgraph/sdk'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { Recording, Running } from '@policy-engine/record'; +import { IPolicyBlock } from '../policy-engine.interface.js'; +import { IPolicyUser } from '../policy-user.js'; +import { Recording, Running } from '../record/index.js'; export class ComponentsService { /** @@ -362,4 +362,4 @@ export class ComponentsService { } return null; } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/helpers/data-transform-engine/index.ts b/policy-service/src/policy-engine/helpers/data-transform-engine/index.ts index d5fa46a082..1c574c9836 100644 --- a/policy-service/src/policy-engine/helpers/data-transform-engine/index.ts +++ b/policy-service/src/policy-engine/helpers/data-transform-engine/index.ts @@ -1 +1 @@ -export { TransformState } from '@policy-engine/helpers/data-transform-engine/transform-state'; +export { TransformState } from '../../helpers/data-transform-engine/transform-state.js'; diff --git a/policy-service/src/policy-engine/helpers/data-transform-engine/transform-state.ts b/policy-service/src/policy-engine/helpers/data-transform-engine/transform-state.ts index 83af5d52b2..b21998a181 100644 --- a/policy-service/src/policy-engine/helpers/data-transform-engine/transform-state.ts +++ b/policy-service/src/policy-engine/helpers/data-transform-engine/transform-state.ts @@ -1,5 +1,5 @@ -import { BlockActionError } from '@policy-engine/errors'; -import { PolicyComponentsUtils } from '../../policy-components-utils'; +import { BlockActionError } from '../../errors/index.js'; +import { PolicyComponentsUtils } from '../../policy-components-utils.js'; /** * Transform block state diff --git a/policy-service/src/policy-engine/helpers/decorators/basic-block.ts b/policy-service/src/policy-engine/helpers/decorators/basic-block.ts index 8d85f7cc1b..b56abe4ac6 100644 --- a/policy-service/src/policy-engine/helpers/decorators/basic-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/basic-block.ts @@ -1,15 +1,15 @@ -import { PolicyBlockDefaultOptions } from '@policy-engine/helpers/policy-block-default-options'; -import { BlockCacheType, EventConfig } from '@policy-engine/interfaces'; -import { PolicyBlockDecoratorOptions, PolicyBlockFullArgumentList } from '@policy-engine/interfaces/block-options'; +import { PolicyBlockDefaultOptions } from '../../helpers/policy-block-default-options.js'; +import { BlockCacheType, EventConfig } from '../../interfaces/index.js'; +import { PolicyBlockDecoratorOptions, PolicyBlockFullArgumentList } from '../../interfaces/block-options.js'; import { PolicyRole, PolicyType } from '@guardian/interfaces'; -import { AnyBlockType, IPolicyBlock, IPolicyDocument, ISerializedBlock, } from '../../policy-engine.interface'; -import { PolicyComponentsUtils } from '../../policy-components-utils'; -import { IPolicyEvent, PolicyLink } from '@policy-engine/interfaces/policy-event'; -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces/policy-event-type'; +import { AnyBlockType, IPolicyBlock, IPolicyDocument, ISerializedBlock, } from '../../policy-engine.interface.js'; +import { PolicyComponentsUtils } from '../../policy-components-utils.js'; +import { IPolicyEvent, PolicyLink } from '../../interfaces/policy-event.js'; +import { PolicyInputEventType, PolicyOutputEventType } from '../../interfaces/policy-event-type.js'; import { Logger, DatabaseServer, Policy } from '@guardian/common'; import deepEqual from 'deep-equal'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { ComponentsService } from '../components-service'; +import { IPolicyUser, PolicyUser } from '../../policy-user.js'; +import { ComponentsService } from '../components-service.js'; /** * Basic block decorator @@ -186,9 +186,12 @@ export function BasicBlock(options: Partial) { this.sourceLinks = []; this.targetLinks = []; - if (!Array.isArray(this.actions)) { - this.actions = []; + if(Array.isArray(super.actions)) { + this.actions = [...super.actions] + } else { + this.actions = []; } + this.actions.push([PolicyInputEventType.RunEvent, this.runAction]); this.actions.push([PolicyInputEventType.RefreshEvent, this.refreshAction]); diff --git a/policy-service/src/policy-engine/helpers/decorators/calculate-addon.ts b/policy-service/src/policy-engine/helpers/decorators/calculate-addon.ts index e666a1dfa3..28a4c68d8b 100644 --- a/policy-service/src/policy-engine/helpers/decorators/calculate-addon.ts +++ b/policy-service/src/policy-engine/helpers/decorators/calculate-addon.ts @@ -1,7 +1,7 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; import * as mathjs from 'mathjs'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { IPolicyUser } from '../../policy-user.js'; /** * Calculate addon diff --git a/policy-service/src/policy-engine/helpers/decorators/calculate-block.ts b/policy-service/src/policy-engine/helpers/decorators/calculate-block.ts index 45576278c3..940463c61c 100644 --- a/policy-service/src/policy-engine/helpers/decorators/calculate-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/calculate-block.ts @@ -1,6 +1,6 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { IPolicyCalculateAddon } from '@policy-engine/policy-engine.interface'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { IPolicyCalculateAddon } from '../../policy-engine.interface.js'; /** * Calculate block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/catch-errors.ts b/policy-service/src/policy-engine/helpers/decorators/catch-errors.ts index 7cd0c4a89a..68af97dc72 100644 --- a/policy-service/src/policy-engine/helpers/decorators/catch-errors.ts +++ b/policy-service/src/policy-engine/helpers/decorators/catch-errors.ts @@ -1,7 +1,7 @@ import { BlockErrorActions } from '@guardian/interfaces'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; +import { PolicyComponentsUtils } from '../../policy-components-utils.js'; import { Logger } from '@guardian/common'; -import { PolicyOutputEventType } from '@policy-engine/interfaces'; +import { PolicyOutputEventType } from '../../interfaces/index.js'; /** * Catch errors decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/container-block.ts b/policy-service/src/policy-engine/helpers/decorators/container-block.ts index aebb3bdfc3..eaaa12b11f 100644 --- a/policy-service/src/policy-engine/helpers/decorators/container-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/container-block.ts @@ -1,8 +1,8 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { PolicyComponentsUtils } from '../../policy-components-utils'; -import { IPolicyBlock, IPolicyContainerBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { PolicyComponentsUtils } from '../../policy-components-utils.js'; +import { IPolicyBlock, IPolicyContainerBlock } from '../../policy-engine.interface.js'; +import { IPolicyUser } from '../../policy-user.js'; /** * Container block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/data-source-addon.ts b/policy-service/src/policy-engine/helpers/decorators/data-source-addon.ts index d7addd1ee2..9d2ae140c3 100644 --- a/policy-service/src/policy-engine/helpers/decorators/data-source-addon.ts +++ b/policy-service/src/policy-engine/helpers/decorators/data-source-addon.ts @@ -1,8 +1,8 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { PolicyComponentsUtils } from '../../policy-components-utils'; -import { BlockActionError } from '@policy-engine/errors'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { PolicyComponentsUtils } from '../../policy-components-utils.js'; +import { BlockActionError } from '../../errors/index.js'; +import { IPolicyUser } from '../../policy-user.js'; /** * Data source addon decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/data-source-block.ts b/policy-service/src/policy-engine/helpers/decorators/data-source-block.ts index 1402187644..c2ad43e552 100644 --- a/policy-service/src/policy-engine/helpers/decorators/data-source-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/data-source-block.ts @@ -1,7 +1,7 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { IPolicyBlock } from '../../policy-engine.interface.js'; +import { IPolicyUser } from '../../policy-user.js'; /** * Datasource block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/event-block.ts b/policy-service/src/policy-engine/helpers/decorators/event-block.ts index 146daa6b16..7b55ea0e11 100644 --- a/policy-service/src/policy-engine/helpers/decorators/event-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/event-block.ts @@ -1,7 +1,7 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { BasicBlock } from './basic-block'; -import { BlockActionError } from '@policy-engine/errors'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { BasicBlock } from './basic-block.js'; +import { BlockActionError } from '../../errors/index.js'; +import { IPolicyUser } from '../../policy-user.js'; import { PolicyType } from '@guardian/interfaces'; /** diff --git a/policy-service/src/policy-engine/helpers/decorators/event-callback.ts b/policy-service/src/policy-engine/helpers/decorators/event-callback.ts index 8d7bf9ff6c..9fbf6bfb46 100644 --- a/policy-service/src/policy-engine/helpers/decorators/event-callback.ts +++ b/policy-service/src/policy-engine/helpers/decorators/event-callback.ts @@ -1,4 +1,4 @@ -import { PolicyInputEventType, PolicyOutputEventType } from '@policy-engine/interfaces/policy-event-type'; +import { PolicyInputEventType, PolicyOutputEventType } from '../../interfaces/policy-event-type.js'; /** * Action callback decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/external-data.ts b/policy-service/src/policy-engine/helpers/decorators/external-data.ts index db161071d6..8a784aca14 100644 --- a/policy-service/src/policy-engine/helpers/decorators/external-data.ts +++ b/policy-service/src/policy-engine/helpers/decorators/external-data.ts @@ -1,5 +1,5 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; /** * External data block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/index.ts b/policy-service/src/policy-engine/helpers/decorators/index.ts index c42fa9bc4f..9eb189d918 100644 --- a/policy-service/src/policy-engine/helpers/decorators/index.ts +++ b/policy-service/src/policy-engine/helpers/decorators/index.ts @@ -1,18 +1,18 @@ -export * from './basic-block'; -export * from './calculate-addon'; -export * from './calculate-block'; -export * from './catch-errors'; -export * from './container-block'; -export * from './data-source-addon'; -export * from './data-source-block'; -export * from './event-block'; -export * from './event-callback'; -export * from './external-data'; -export * from './report-block'; -export * from './report-item-block'; -export * from './set-relationships-block'; -export * from './source-addon'; -export * from './state-field'; -export * from './token-addon'; -export * from './token-block'; -export * from './validator-block'; \ No newline at end of file +export * from './basic-block.js'; +export * from './calculate-addon.js'; +export * from './calculate-block.js'; +export * from './catch-errors.js'; +export * from './container-block.js'; +export * from './data-source-addon.js'; +export * from './data-source-block.js'; +export * from './event-block.js'; +export * from './event-callback.js'; +export * from './external-data.js'; +export * from './report-block.js'; +export * from './report-item-block.js'; +export * from './set-relationships-block.js'; +export * from './source-addon.js'; +export * from './state-field.js'; +export * from './token-addon.js'; +export * from './token-block.js'; +export * from './validator-block.js'; diff --git a/policy-service/src/policy-engine/helpers/decorators/report-block.ts b/policy-service/src/policy-engine/helpers/decorators/report-block.ts index 3e59bca60d..2fb70ce9a4 100644 --- a/policy-service/src/policy-engine/helpers/decorators/report-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/report-block.ts @@ -1,6 +1,6 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { IPolicyReportItemBlock } from '@policy-engine/policy-engine.interface'; -import { DataSourceBlock } from '.'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { IPolicyReportItemBlock } from '../../policy-engine.interface.js'; +import { DataSourceBlock } from './index.js'; /** * Report block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/report-item-block.ts b/policy-service/src/policy-engine/helpers/decorators/report-item-block.ts index d3299bc70b..2972f71cf1 100644 --- a/policy-service/src/policy-engine/helpers/decorators/report-item-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/report-item-block.ts @@ -1,6 +1,6 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { IPolicyReportItemBlock } from '@policy-engine/policy-engine.interface'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { IPolicyReportItemBlock } from '../../policy-engine.interface.js'; /** * Report Irem decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/set-relationships-block.ts b/policy-service/src/policy-engine/helpers/decorators/set-relationships-block.ts index f39ad7ec78..c7fe8b5d90 100644 --- a/policy-service/src/policy-engine/helpers/decorators/set-relationships-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/set-relationships-block.ts @@ -1,6 +1,6 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { BasicBlock } from './basic-block'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { BasicBlock } from './basic-block.js'; +import { IPolicyUser } from '../../policy-user.js'; /** * Set relationships block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/source-addon.ts b/policy-service/src/policy-engine/helpers/decorators/source-addon.ts index bd4b552a71..2ddf6ac1a0 100644 --- a/policy-service/src/policy-engine/helpers/decorators/source-addon.ts +++ b/policy-service/src/policy-engine/helpers/decorators/source-addon.ts @@ -1,7 +1,7 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { IPolicyBlock } from '../../policy-engine.interface.js'; +import { IPolicyUser } from '../../policy-user.js'; /** * Source addon diff --git a/policy-service/src/policy-engine/helpers/decorators/state-field.ts b/policy-service/src/policy-engine/helpers/decorators/state-field.ts index fb544c16e4..ae029802e9 100644 --- a/policy-service/src/policy-engine/helpers/decorators/state-field.ts +++ b/policy-service/src/policy-engine/helpers/decorators/state-field.ts @@ -1,4 +1,4 @@ -import { STATE_KEY } from '@policy-engine/helpers/constants'; +import { STATE_KEY } from '../../helpers/constants.js'; /** * State field decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/token-addon.ts b/policy-service/src/policy-engine/helpers/decorators/token-addon.ts index af15b6390a..44a6b38503 100644 --- a/policy-service/src/policy-engine/helpers/decorators/token-addon.ts +++ b/policy-service/src/policy-engine/helpers/decorators/token-addon.ts @@ -1,6 +1,6 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces'; -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { IPolicyUser, UserCredentials } from '@policy-engine/policy-user'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/index.js'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { IPolicyUser, UserCredentials } from '../../policy-user.js'; /** * Token addon diff --git a/policy-service/src/policy-engine/helpers/decorators/token-block.ts b/policy-service/src/policy-engine/helpers/decorators/token-block.ts index a226d21997..9c8e076a9f 100644 --- a/policy-service/src/policy-engine/helpers/decorators/token-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/token-block.ts @@ -1,6 +1,6 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; -import { IPolicyTokenAddon } from '@policy-engine/policy-engine.interface'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; +import { IPolicyTokenAddon } from '../../policy-engine.interface.js'; /** * Token block decorator diff --git a/policy-service/src/policy-engine/helpers/decorators/validator-block.ts b/policy-service/src/policy-engine/helpers/decorators/validator-block.ts index c7335eb682..f8506c8fbe 100644 --- a/policy-service/src/policy-engine/helpers/decorators/validator-block.ts +++ b/policy-service/src/policy-engine/helpers/decorators/validator-block.ts @@ -1,6 +1,6 @@ -import { BasicBlock } from '@policy-engine/helpers/decorators/basic-block'; -import { IPolicyEvent } from '@policy-engine/interfaces'; -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; +import { BasicBlock } from '../../helpers/decorators/basic-block.js'; +import { IPolicyEvent } from '../../interfaces/index.js'; +import { PolicyBlockDecoratorOptions } from '../../interfaces/block-options.js'; /** * Validator block decorator diff --git a/policy-service/src/policy-engine/helpers/get-other-options.ts b/policy-service/src/policy-engine/helpers/get-other-options.ts index bf67065639..ca2fa375fe 100644 --- a/policy-service/src/policy-engine/helpers/get-other-options.ts +++ b/policy-service/src/policy-engine/helpers/get-other-options.ts @@ -1,4 +1,4 @@ -import { PolicyBlockDecoratorOptions } from '@policy-engine/interfaces/block-options'; +import { PolicyBlockDecoratorOptions } from '../interfaces/block-options.js'; /** * Return custom options object for block instance diff --git a/policy-service/src/policy-engine/helpers/policy-block-default-options.ts b/policy-service/src/policy-engine/helpers/policy-block-default-options.ts index 477dacb6fb..c73f56f72a 100644 --- a/policy-service/src/policy-engine/helpers/policy-block-default-options.ts +++ b/policy-service/src/policy-engine/helpers/policy-block-default-options.ts @@ -1,4 +1,4 @@ -import { PolicyBlockOptionsPartial } from '@policy-engine/interfaces/block-options'; +import { PolicyBlockOptionsPartial } from '../interfaces/block-options.js'; /** * Default options for block instance diff --git a/policy-service/src/policy-engine/helpers/utils.ts b/policy-service/src/policy-engine/helpers/utils.ts index f5d4fa4d4d..728b733a7b 100644 --- a/policy-service/src/policy-engine/helpers/utils.ts +++ b/policy-service/src/policy-engine/helpers/utils.ts @@ -1,47 +1,10 @@ import * as mathjs from 'mathjs'; -import { AnyBlockType, IPolicyDocument } from '@policy-engine/policy-engine.interface'; -import { - DidDocumentStatus, - DocumentSignature, - DocumentStatus, - Schema, - SchemaEntity, - TopicType, - WorkerTaskType -} from '@guardian/interfaces'; -import { - IAuthUser, - Token, - Topic, - Schema as SchemaCollection, - VcDocument as VcDocumentCollection, - VcDocumentDefinition as VcDocument, - VcDocumentDefinition as HVcDocument, - TopicHelper, - VpDocumentDefinition as VpDocument, - TopicConfig, - KeyType, Wallet, - Users, - Workers, - NotificationHelper, - VcSubject, - HederaDidDocument -} from '@guardian/common'; +import { AnyBlockType, IPolicyDocument } from '../policy-engine.interface.js'; +import { DidDocumentStatus, DocumentSignature, DocumentStatus, Schema, SchemaEntity, TopicType, WorkerTaskType } from '@guardian/interfaces'; +import { HederaDidDocument, IAuthUser, KeyType, NotificationHelper, Schema as SchemaCollection, Token, Topic, TopicConfig, TopicHelper, Users, VcDocument as VcDocumentCollection, VcDocumentDefinition as VcDocument, VcDocumentDefinition as HVcDocument, VcSubject, VpDocumentDefinition as VpDocument, Wallet, Workers } from '@guardian/common'; import { TokenId, TopicId } from '@hashgraph/sdk'; -import { IPolicyUser, UserCredentials, PolicyUser, IHederaCredentials } from '@policy-engine/policy-user'; -import { DocumentType } from '@policy-engine/interfaces/document.type'; - -/** - * Data types - */ -export enum DataTypes { - MRV = 'mrv', - REPORT = 'report', - MINT = 'mint', - RETIREMENT = 'retirement', - USER_ROLE = 'user-role', - MULTI_SIGN = 'MULTI_SIGN' -} +import { IHederaCredentials, IPolicyUser, PolicyUser, UserCredentials } from '../policy-user.js'; +import { DocumentType } from '../interfaces/document.type.js'; /** * Policy engine utils @@ -829,8 +792,11 @@ export class PolicyUtils { ? (await root.loadHederaCredentials(ref)) : (await user.loadHederaCredentials(ref)); + const signOptions = config.static + ? (await root.loadSignOptions(ref)) + : (await user.loadSignOptions(ref)); const topicHelper = new TopicHelper( - hederaCred.hederaAccountId, hederaCred.hederaAccountKey, ref.dryRun + hederaCred.hederaAccountId, hederaCred.hederaAccountKey, signOptions, ref.dryRun, ); topic = await topicHelper.create({ type: TopicType.DynamicTopic, diff --git a/policy-service/src/policy-engine/interfaces/block-about.ts b/policy-service/src/policy-engine/interfaces/block-about.ts index d8eb9249ff..486aa83816 100644 --- a/policy-service/src/policy-engine/interfaces/block-about.ts +++ b/policy-service/src/policy-engine/interfaces/block-about.ts @@ -1,4 +1,4 @@ -import { PolicyInputEventType, PolicyOutputEventType } from './policy-event-type'; +import { PolicyInputEventType, PolicyOutputEventType } from './policy-event-type.js'; /** * Children type diff --git a/policy-service/src/policy-engine/interfaces/block-options.ts b/policy-service/src/policy-engine/interfaces/block-options.ts index 49994e2356..8081658987 100644 --- a/policy-service/src/policy-engine/interfaces/block-options.ts +++ b/policy-service/src/policy-engine/interfaces/block-options.ts @@ -1,8 +1,8 @@ -import { PolicyBlockMap, PolicyTagMap } from './'; -import { IPolicyBlock, } from '@policy-engine/policy-engine.interface'; +import { PolicyBlockMap, PolicyTagMap } from './index.js'; +import { IPolicyBlock, } from '../policy-engine.interface.js'; import { UserRole } from '@guardian/interfaces'; -import { BlockAbout } from './block-about'; +import { BlockAbout } from './block-about.js'; /** * Policy block decorator options diff --git a/policy-service/src/policy-engine/interfaces/block-state.ts b/policy-service/src/policy-engine/interfaces/block-state.ts index 36b34f608e..e25695d101 100644 --- a/policy-service/src/policy-engine/interfaces/block-state.ts +++ b/policy-service/src/policy-engine/interfaces/block-state.ts @@ -1,4 +1,4 @@ -import { IPolicyBlock, IPolicyInterfaceBlock, IPolicyNavigationStep } from '@policy-engine/policy-engine.interface'; +import { IPolicyBlock, IPolicyInterfaceBlock, IPolicyNavigationStep } from '../policy-engine.interface.js'; /** * Block state data diff --git a/policy-service/src/policy-engine/interfaces/event-config.ts b/policy-service/src/policy-engine/interfaces/event-config.ts index d1c0d7c2bd..779c020982 100644 --- a/policy-service/src/policy-engine/interfaces/event-config.ts +++ b/policy-service/src/policy-engine/interfaces/event-config.ts @@ -1,4 +1,4 @@ -import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type'; +import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type.js'; /** * Event config diff --git a/policy-service/src/policy-engine/interfaces/external-event.ts b/policy-service/src/policy-engine/interfaces/external-event.ts index 8d2521b7f4..7a884b38c4 100644 --- a/policy-service/src/policy-engine/interfaces/external-event.ts +++ b/policy-service/src/policy-engine/interfaces/external-event.ts @@ -1,5 +1,5 @@ -import { AnyBlockType, IPolicyDocument } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; +import { AnyBlockType, IPolicyDocument } from '../policy-engine.interface.js'; +import { IPolicyUser } from '../policy-user.js'; /** * External Event Type @@ -96,4 +96,4 @@ export const ExternalDocuments = (document: IPolicyDocument | IPolicyDocument[]) } catch (error) { return null; } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/interfaces/index.ts b/policy-service/src/policy-engine/interfaces/index.ts index fe20c7d416..a0c499859c 100644 --- a/policy-service/src/policy-engine/interfaces/index.ts +++ b/policy-service/src/policy-engine/interfaces/index.ts @@ -3,7 +3,7 @@ export { PolicyBlockState, PolicyBlockStateCommon, PolicyBlockStateData, PolicyTagMap -} from './block-state'; +} from './block-state.js'; export { PolicyBlockAdditionalFields, @@ -11,28 +11,28 @@ export { PolicyBlockDecoratorOptions, PolicyBlockFullArgumentList, PolicyBlockOptionsPartial -} from './block-options'; +} from './block-options.js'; export { BlockError, BlockErrorDTO -} from './block-error'; +} from './block-error.js'; export { PolicyInputEventType, PolicyOutputEventType -} from './policy-event-type'; +} from './policy-event-type.js'; export { IPolicyEvent, PolicyLink, EventCallback -} from './policy-event'; +} from './policy-event.js'; export { EventConfig -} from './event-config'; +} from './event-config.js'; -export { EventActor } from './policy-event-type'; +export { EventActor } from './policy-event-type.js'; -export { BlockCacheType } from './block-cache.type'; \ No newline at end of file +export { BlockCacheType } from './block-cache.type.js'; diff --git a/policy-service/src/policy-engine/interfaces/policy-event.ts b/policy-service/src/policy-engine/interfaces/policy-event.ts index fcb1fe7833..8b2891dd69 100644 --- a/policy-service/src/policy-engine/interfaces/policy-event.ts +++ b/policy-service/src/policy-engine/interfaces/policy-event.ts @@ -1,7 +1,7 @@ -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { AnyBlockType } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type'; +import { PolicyUtils } from '../helpers/utils.js'; +import { AnyBlockType } from '../policy-engine.interface.js'; +import { IPolicyUser, PolicyUser } from '../policy-user.js'; +import { EventActor, PolicyInputEventType, PolicyOutputEventType } from './policy-event-type.js'; /** * Event callback type diff --git a/policy-service/src/policy-engine/mint/mint-service.ts b/policy-service/src/policy-engine/mint/mint-service.ts index f9fc61478f..c3aac9c2fd 100644 --- a/policy-service/src/policy-engine/mint/mint-service.ts +++ b/policy-service/src/policy-engine/mint/mint-service.ts @@ -1,37 +1,12 @@ -import { AnyBlockType } from '@policy-engine/policy-engine.interface'; -import { - ContractParamType, - ExternalMessageEvents, - GenerateUUIDv4, - IRootConfig, - NotificationAction, - TokenType, - WorkerTaskType, -} from '@guardian/interfaces'; -import { - DatabaseServer, - ExternalEventChannel, - KeyType, - Logger, - MessageAction, - MessageServer, - MintRequest, - MultiPolicy, - NotificationHelper, - SynchronizationMessage, - Token, - TopicConfig, - Users, - VcDocumentDefinition as VcDocument, - Wallet, - Workers, -} from '@guardian/common'; +import { AnyBlockType } from '../policy-engine.interface.js'; +import { ContractParamType, ExternalMessageEvents, GenerateUUIDv4, IRootConfig, ISignOptions, NotificationAction, TokenType, WorkerTaskType, } from '@guardian/interfaces'; +import { DatabaseServer, ExternalEventChannel, KeyType, Logger, MessageAction, MessageServer, MintRequest, MultiPolicy, NotificationHelper, SynchronizationMessage, Token, TopicConfig, Users, VcDocumentDefinition as VcDocument, Wallet, Workers, } from '@guardian/common'; import { AccountId, PrivateKey, TokenId } from '@hashgraph/sdk'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IHederaCredentials, IPolicyUser } from '@policy-engine/policy-user'; -import { TokenConfig } from './configs/token-config'; -import { MintNFT } from './types/mint-nft'; -import { MintFT } from './types/mint-ft'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IHederaCredentials, IPolicyUser } from '../policy-user.js'; +import { TokenConfig } from './configs/token-config.js'; +import { MintNFT } from './types/mint-nft.js'; +import { MintFT } from './types/mint-ft.js'; /** * Mint Service @@ -98,31 +73,153 @@ export class MintService { } /** - * Send Synchronization Message + * Mint * @param ref - * @param multipleConfig + * @param token + * @param tokenValue + * @param documentOwner * @param root - * @param data + * @param targetAccount + * @param vpMessageId + * @param transactionMemo + * @param documents + * @param signOptions */ - private static async sendMessage( + public static async mint( ref: AnyBlockType, - multipleConfig: MultiPolicy, + token: Token, + tokenValue: number, + documentOwner: IPolicyUser, root: IHederaCredentials, - data: any - ) { - const message = new SynchronizationMessage(MessageAction.Mint); - message.setDocument(multipleConfig, data); - const messageServer = new MessageServer( - root.hederaAccountId, - root.hederaAccountKey, - ref.dryRun + targetAccount: string, + vpMessageId: string, + transactionMemo: string, + documents: VcDocument[], + signOptions: ISignOptions + ): Promise { + const multipleConfig = await MintService.getMultipleConfig( + ref, + documentOwner ); - const topic = new TopicConfig( - { topicId: multipleConfig.synchronizationTopicId }, - null, - null + const users = new Users(); + const documentOwnerUser = await users.getUserById(documentOwner.did); + const policyOwner = await users.getUserById(ref.policyOwner); + const notifier = NotificationHelper.init([ + documentOwnerUser?.id, + policyOwner?.id, + ]); + if (multipleConfig) { + const hash = VcDocument.toCredentialHash( + documents, + (value: any) => { + delete value.id; + delete value.policyId; + delete value.ref; + return value; + } + ); + await MintService.sendMessage(ref, multipleConfig, root, { + hash, + messageId: vpMessageId, + tokenId: token.tokenId, + amount: tokenValue, + memo: transactionMemo, + target: targetAccount, + }, signOptions); + if (multipleConfig.type === 'Main') { + const user = await PolicyUtils.getUserCredentials( + ref, + documentOwner.did + ); + await DatabaseServer.createMultiPolicyTransaction({ + uuid: GenerateUUIDv4(), + policyId: ref.policyId, + owner: documentOwner.did, + user: user.hederaAccountId, + hash, + vpMessageId, + tokenId: token.tokenId, + amount: tokenValue, + target: targetAccount, + status: 'Waiting', + }); + } + notifier.success( + `Multi mint`, + multipleConfig.type === 'Main' + ? 'Mint transaction created' + : `Request to mint is submitted`, + NotificationAction.POLICY_VIEW, + ref.policyId + ); + } else { + const tokenConfig = await MintService.getTokenConfig(ref, token); + if (token.tokenType === 'non-fungible') { + const mintNFT = await MintNFT.create( + { + target: targetAccount, + amount: tokenValue, + vpMessageId, + tokenId: token.tokenId, + metadata: vpMessageId, + tokenType: token.tokenType, + decimals: token.decimals, + memo: transactionMemo, + }, + root, + tokenConfig, + ref, + notifier + ); + MintService.activeMintProcesses.add(mintNFT.mintRequestId); + mintNFT + .mint() + .catch((error) => + MintService.error(PolicyUtils.getErrorMessage(error)) + ) + .finally(() => { + MintService.activeMintProcesses.delete( + mintNFT.mintRequestId + ); + }); + } else { + const mintFT = await MintFT.create( + { + target: targetAccount, + amount: tokenValue, + vpMessageId, + tokenId: token.tokenId, + tokenType: token.tokenType, + decimals: token.decimals, + memo: transactionMemo, + }, + root, + tokenConfig, + ref, + notifier + ); + MintService.activeMintProcesses.add(mintFT.mintRequestId); + mintFT + .mint() + .catch((error) => + MintService.error(PolicyUtils.getErrorMessage(error)) + ) + .finally(() => { + MintService.activeMintProcesses.delete( + mintFT.mintRequestId + ); + }); + } + } + + new ExternalEventChannel().publishMessage( + ExternalMessageEvents.TOKEN_MINTED, + { + tokenId: token.tokenId, + tokenValue, + memo: transactionMemo, + } ); - await messageServer.setTopicObject(topic).sendMessage(message); } /** @@ -277,145 +374,34 @@ export class MintService { } /** - * Mint + * Send Synchronization Message * @param ref - * @param token - * @param tokenValue - * @param documentOwner + * @param multipleConfig * @param root - * @param targetAccount - * @param uuid + * @param data + * @param signOptions */ - public static async mint( + private static async sendMessage( ref: AnyBlockType, - token: Token, - tokenValue: number, - documentOwner: IPolicyUser, + multipleConfig: MultiPolicy, root: IHederaCredentials, - targetAccount: string, - vpMessageId: string, - transactionMemo: string, - documents: VcDocument[] - ): Promise { - const multipleConfig = await MintService.getMultipleConfig( - ref, - documentOwner + data: any, + signOptions: ISignOptions + ) { + const message = new SynchronizationMessage(MessageAction.Mint); + message.setDocument(multipleConfig, data); + const messageServer = new MessageServer( + root.hederaAccountId, + root.hederaAccountKey, + signOptions, + ref.dryRun ); - const users = new Users(); - const documentOwnerUser = await users.getUserById(documentOwner.did); - const policyOwner = await users.getUserById(ref.policyOwner); - const notifier = NotificationHelper.init([ - documentOwnerUser?.id, - policyOwner?.id, - ]); - if (multipleConfig) { - const hash = VcDocument.toCredentialHash( - documents, - (value: any) => { - delete value.id; - delete value.policyId; - delete value.ref; - return value; - } - ); - await MintService.sendMessage(ref, multipleConfig, root, { - hash, - messageId: vpMessageId, - tokenId: token.tokenId, - amount: tokenValue, - memo: transactionMemo, - target: targetAccount, - }); - if (multipleConfig.type === 'Main') { - const user = await PolicyUtils.getUserCredentials( - ref, - documentOwner.did - ); - await DatabaseServer.createMultiPolicyTransaction({ - uuid: GenerateUUIDv4(), - policyId: ref.policyId, - owner: documentOwner.did, - user: user.hederaAccountId, - hash, - vpMessageId, - tokenId: token.tokenId, - amount: tokenValue, - target: targetAccount, - status: 'Waiting', - }); - } - notifier.success( - `Multi mint`, - multipleConfig.type === 'Main' - ? 'Mint transaction created' - : `Request to mint is submitted`, - NotificationAction.POLICY_VIEW, - ref.policyId - ); - } else { - const tokenConfig = await MintService.getTokenConfig(ref, token); - if (token.tokenType === 'non-fungible') { - const mintNFT = await MintNFT.create( - { - target: targetAccount, - amount: tokenValue, - vpMessageId, - tokenId: token.tokenId, - metadata: vpMessageId, - memo: transactionMemo, - }, - root, - tokenConfig, - ref, - notifier - ); - MintService.activeMintProcesses.add(mintNFT.mintRequestId); - mintNFT - .mint() - .catch((error) => - MintService.error(PolicyUtils.getErrorMessage(error)) - ) - .finally(() => { - MintService.activeMintProcesses.delete( - mintNFT.mintRequestId - ); - }); - } else { - const mintFT = await MintFT.create( - { - target: targetAccount, - amount: tokenValue, - vpMessageId, - tokenId: token.tokenId, - memo: transactionMemo, - }, - root, - tokenConfig, - ref, - notifier - ); - MintService.activeMintProcesses.add(mintFT.mintRequestId); - mintFT - .mint() - .catch((error) => - MintService.error(PolicyUtils.getErrorMessage(error)) - ) - .finally(() => { - MintService.activeMintProcesses.delete( - mintFT.mintRequestId - ); - }); - } - } - - new ExternalEventChannel().publishMessage( - ExternalMessageEvents.TOKEN_MINTED, - { - tokenId: token.tokenId, - tokenValue, - memo: transactionMemo, - } + const topic = new TopicConfig( + { topicId: multipleConfig.synchronizationTopicId }, + null, + null ); + await messageServer.setTopicObject(topic).sendMessage(message); } /** @@ -471,6 +457,8 @@ export class MintService { secondaryVpIds: ids, memo, tokenId: token.tokenId, + tokenType: token.tokenType, + decimals: token.decimals, }, root, tokenConfig, @@ -497,6 +485,8 @@ export class MintService { secondaryVpIds: ids, memo, tokenId: token.tokenId, + tokenType: token.tokenType, + decimals: token.decimals, }, root, tokenConfig, diff --git a/policy-service/src/policy-engine/mint/types/mint-ft.ts b/policy-service/src/policy-engine/mint/types/mint-ft.ts index 746d9cc4f4..ef9c4f0088 100644 --- a/policy-service/src/policy-engine/mint/types/mint-ft.ts +++ b/policy-service/src/policy-engine/mint/types/mint-ft.ts @@ -2,11 +2,12 @@ import { MintRequest, NotificationHelper, Workers } from '@guardian/common'; import { WorkerTaskType, MintTransactionStatus, + TokenType, } from '@guardian/interfaces'; -import { TypedMint } from './typed-mint'; -import { IHederaCredentials } from '@policy-engine/policy-user'; -import { TokenConfig } from '../configs/token-config'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { TypedMint } from './typed-mint.js'; +import { IHederaCredentials } from '../../policy-user.js'; +import { TokenConfig } from '../configs/token-config.js'; +import { PolicyUtils } from '../../helpers/utils.js'; /** * Mint FT @@ -55,6 +56,8 @@ export class MintFT extends TypedMint { vpMessageId: string; memo: string; tokenId: string; + tokenType: TokenType; + decimals: number; secondaryVpIds?: string[]; }, root: IHederaCredentials, diff --git a/policy-service/src/policy-engine/mint/types/mint-nft.ts b/policy-service/src/policy-engine/mint/types/mint-nft.ts index a1ae2b2eb0..9472122404 100644 --- a/policy-service/src/policy-engine/mint/types/mint-nft.ts +++ b/policy-service/src/policy-engine/mint/types/mint-nft.ts @@ -4,11 +4,11 @@ import { MintTransaction, MintRequest, } from '@guardian/common'; -import { MintTransactionStatus, WorkerTaskType } from '@guardian/interfaces'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; -import { IHederaCredentials } from '@policy-engine/policy-user'; -import { TypedMint } from './typed-mint'; -import { TokenConfig } from '../configs/token-config'; +import { MintTransactionStatus, TokenType, WorkerTaskType } from '@guardian/interfaces'; +import { PolicyUtils } from '../../helpers/utils.js'; +import { IHederaCredentials } from '../../policy-user.js'; +import { TypedMint } from './typed-mint.js'; +import { TokenConfig } from '../configs/token-config.js'; /** * Mint NFT @@ -63,6 +63,8 @@ export class MintNFT extends TypedMint { vpMessageId: string; memo: string; tokenId: string; + tokenType: TokenType; + decimals: number; metadata?: string; secondaryVpIds?: string[]; }, diff --git a/policy-service/src/policy-engine/mint/types/typed-mint.ts b/policy-service/src/policy-engine/mint/types/typed-mint.ts index a6b469f715..4660d0e502 100644 --- a/policy-service/src/policy-engine/mint/types/typed-mint.ts +++ b/policy-service/src/policy-engine/mint/types/typed-mint.ts @@ -3,13 +3,14 @@ import { MintRequest, NotificationHelper, } from '@guardian/common'; -import { IHederaCredentials } from '@policy-engine/policy-user'; -import { TokenConfig } from '../configs/token-config'; -import { MintService } from '../mint-service'; -import { PolicyUtils } from '@policy-engine/helpers/utils'; +import { IHederaCredentials } from '../../policy-user.js'; +import { TokenConfig } from '../configs/token-config.js'; +import { MintService } from '../mint-service.js'; +import { PolicyUtils } from '../../helpers/utils.js'; import { MintTransactionStatus, NotificationAction, + TokenType } from '@guardian/interfaces'; /** @@ -86,6 +87,8 @@ export abstract class TypedMint { vpMessageId: string; memo: string; tokenId: string; + tokenType: TokenType; + decimals: number; metadata?: string; }, root: IHederaCredentials, diff --git a/policy-service/src/policy-engine/multi-policy-service/index.ts b/policy-service/src/policy-engine/multi-policy-service/index.ts index be2d2a6b6c..b993ea4771 100644 --- a/policy-service/src/policy-engine/multi-policy-service/index.ts +++ b/policy-service/src/policy-engine/multi-policy-service/index.ts @@ -1,2 +1,2 @@ -export { SynchronizationService } from './synchronization-service'; -export { MintService } from '../mint/mint-service'; +export { SynchronizationService } from './synchronization-service.js'; +export { MintService } from '../mint/mint-service.js'; diff --git a/policy-service/src/policy-engine/multi-policy-service/mint-service.ts b/policy-service/src/policy-engine/multi-policy-service/mint-service.ts new file mode 100644 index 0000000000..f06dd450bd --- /dev/null +++ b/policy-service/src/policy-engine/multi-policy-service/mint-service.ts @@ -0,0 +1,625 @@ +import { AnyBlockType } from '../policy-engine.interface.js'; +import { ContractParamType, ExternalMessageEvents, GenerateUUIDv4, ISignOptions, NotificationAction, WorkerTaskType } from '@guardian/interfaces'; +import { DatabaseServer, ExternalEventChannel, KeyType, Logger, MessageAction, MessageServer, MultiPolicy, NotificationHelper, SynchronizationMessage, Token, TopicConfig, Users, VcDocumentDefinition as VcDocument, Wallet, Workers, } from '@guardian/common'; +import { AccountId, PrivateKey, TokenId } from '@hashgraph/sdk'; +import { PolicyUtils } from '../helpers/utils.js'; +import { IHederaCredentials, IPolicyUser } from '../policy-user.js'; + +/** + * Token Config + */ +interface TokenConfig { + /** + * Token name + */ + tokenName: string + /** + * Treasury Account Id + */ + treasuryId: any; + /** + * Token ID + */ + tokenId: any; + /** + * Supply Key + */ + supplyKey: string; + /** + * Treasury Account Key + */ + treasuryKey: string; +} + +/** + * Mint Service + */ +export class MintService { + /** + * Size of mint NFT batch + */ + public static readonly BATCH_NFT_MINT_SIZE = + Math.floor(Math.abs(+process.env.BATCH_NFT_MINT_SIZE)) || 10; + + /** + * Wallet service + */ + private static readonly wallet = new Wallet(); + /** + * Logger service + */ + private static readonly logger = new Logger(); + + /** + * Mint Non Fungible Tokens + * @param token + * @param tokenValue + * @param root + * @param targetAccount + * @param uuid + * @param transactionMemo + * @param ref + */ + private static async mintNonFungibleTokens( + token: TokenConfig, + tokenValue: number, + root: IHederaCredentials, + targetAccount: string, + uuid: string, + transactionMemo: string, + ref?: AnyBlockType, + notifier?: NotificationHelper, + ): Promise { + const mintNFT = (metaData: string[]): Promise => + workers.addRetryableTask( + { + type: WorkerTaskType.MINT_NFT, + data: { + hederaAccountId: root.hederaAccountId, + hederaAccountKey: root.hederaAccountKey, + dryRun: ref && ref.dryRun, + tokenId: token.tokenId, + supplyKey: token.supplyKey, + metaData, + transactionMemo, + }, + }, + 1, 10 + ); + const transferNFT = (serials: number[]): Promise => { + MintService.logger.debug( + `Transfer ${token?.tokenId} serials: ${JSON.stringify(serials)}`, + ['POLICY_SERVICE', mintId.toString()] + ); + return workers.addRetryableTask( + { + type: WorkerTaskType.TRANSFER_NFT, + data: { + hederaAccountId: + root.hederaAccountId, + hederaAccountKey: + root.hederaAccountKey, + dryRun: ref && ref.dryRun, + tokenId: token.tokenId, + targetAccount, + treasuryId: token.treasuryId, + treasuryKey: token.treasuryKey, + element: serials, + transactionMemo, + }, + }, + 1, 10 + ); + }; + const mintAndTransferNFT = async (metaData: string[]) => { + try { + return await transferNFT(await mintNFT(metaData)); + } catch (e) { + return null; + } + } + const mintId = Date.now(); + MintService.log(`Mint(${mintId}): Start (Count: ${tokenValue})`, ref); + + const result: number[] = []; + const workers = new Workers(); + const data = new Array(Math.floor(tokenValue)); + data.fill(uuid); + const dataChunks = PolicyUtils.splitChunk(data, 10); + const tasks = PolicyUtils.splitChunk( + dataChunks, + MintService.BATCH_NFT_MINT_SIZE + ); + for (let i = 0; i < tasks.length; i++) { + const dataChunk = tasks[i]; + MintService.log( + `Mint(${mintId}): Minting and transferring (Chunk: ${i * MintService.BATCH_NFT_MINT_SIZE + 1 + }/${tasks.length * MintService.BATCH_NFT_MINT_SIZE})`, + ref + ); + notifier?.step( + `Mint(${token.tokenName}): Minting and transferring (Chunk: ${i * MintService.BATCH_NFT_MINT_SIZE + 1 + }/${tasks.length * MintService.BATCH_NFT_MINT_SIZE})`, + (i * MintService.BATCH_NFT_MINT_SIZE + + 1) / (tasks.length * MintService.BATCH_NFT_MINT_SIZE) * + 100 + ); + try { + const results = await Promise.all(dataChunk.map(mintAndTransferNFT)); + for (const serials of results) { + if (Array.isArray(serials)) { + for (const n of serials) { + result.push(n); + } + } + } + } catch (error) { + notifier?.stop({ + title: 'Minting tokens', + message: `Mint(${token.tokenName + }): Error (${PolicyUtils.getErrorMessage(error)})`, + }); + MintService.error( + `Mint(${mintId}): Error (${PolicyUtils.getErrorMessage( + error + )})`, + ref + ); + throw error; + } + } + + notifier?.finish(); + + MintService.log( + `Mint(${mintId}): Minted (Count: ${Math.floor(tokenValue)})`, + ref + ); + MintService.log( + `Mint(${mintId}): Transferred ${token.treasuryId} -> ${targetAccount} `, + ref + ); + MintService.log(`Mint(${mintId}): End`, ref); + + return result; + } + + /** + * Mint Fungible Tokens + * @param token + * @param tokenValue + * @param root + * @param targetAccount + * @param uuid + * @param transactionMemo + * @param ref + */ + private static async mintFungibleTokens( + token: TokenConfig, + tokenValue: number, + root: IHederaCredentials, + targetAccount: string, + uuid: string, + transactionMemo: string, + ref?: AnyBlockType, + ): Promise { + const mintId = Date.now(); + MintService.log(`Mint(${mintId}): Start (Count: ${tokenValue})`, ref); + + let result: number | null = null; + try { + const workers = new Workers(); + await workers.addRetryableTask({ + type: WorkerTaskType.MINT_FT, + data: { + hederaAccountId: root.hederaAccountId, + hederaAccountKey: root.hederaAccountKey, + dryRun: ref && ref.dryRun, + tokenId: token.tokenId, + supplyKey: token.supplyKey, + tokenValue, + transactionMemo + } + }, 10); + await workers.addRetryableTask({ + type: WorkerTaskType.TRANSFER_FT, + data: { + hederaAccountId: root.hederaAccountId, + hederaAccountKey: root.hederaAccountKey, + dryRun: ref && ref.dryRun, + tokenId: token.tokenId, + targetAccount, + treasuryId: token.treasuryId, + treasuryKey: token.treasuryKey, + tokenValue, + transactionMemo + } + }, 10); + result = tokenValue; + } catch (error) { + result = null; + MintService.error(`Mint FT(${mintId}): Mint/Transfer Error (${PolicyUtils.getErrorMessage(error)})`, ref); + } + + MintService.log(`Mint(${mintId}): End`, ref); + + return result; + } + + /** + * Get token keys + * @param ref + * @param token + */ + private static async getTokenConfig(ref: AnyBlockType, token: Token): Promise { + const tokenConfig: TokenConfig = { + treasuryId: token.draftToken ? '0.0.0' : token.adminId, + tokenId: token.draftToken ? '0.0.0' : token.tokenId, + supplyKey: null, + treasuryKey: null, + tokenName: token.tokenName, + } + if (ref.dryRun) { + const tokenPK = PrivateKey.generate().toString(); + tokenConfig.supplyKey = tokenPK; + tokenConfig.treasuryKey = tokenPK; + } else { + const [treasuryKey, supplyKey] = await Promise.all([ + MintService.wallet.getUserKey( + token.owner, + KeyType.TOKEN_TREASURY_KEY, + token.tokenId + ), + MintService.wallet.getUserKey( + token.owner, + KeyType.TOKEN_SUPPLY_KEY, + token.tokenId + ), + ]); + tokenConfig.supplyKey = supplyKey; + tokenConfig.treasuryKey = treasuryKey; + } + return tokenConfig; + } + + /** + * Mint + * @param ref + * @param token + * @param tokenValue + * @param documentOwner + * @param root + * @param targetAccount + * @param uuid + */ + public static async mint( + ref: AnyBlockType, + token: Token, + tokenValue: number, + documentOwner: IPolicyUser, + root: IHederaCredentials, + targetAccount: string, + messageId: string, + transactionMemo: string, + documents: VcDocument[], + ): Promise { + const multipleConfig = await MintService.getMultipleConfig(ref, documentOwner); + const users = new Users(); + const documentOwnerUser = await users.getUserById(documentOwner.did); + const wallet = new Wallet(); + const signOptions = await wallet.getUserSignOptions(documentOwnerUser); + const policyOwner = await users.getUserById(ref.policyOwner); + const notifier = NotificationHelper.init( + [documentOwnerUser?.id, policyOwner?.id], + ); + if (multipleConfig) { + const hash = VcDocument.toCredentialHash(documents, (value: any) => { + delete value.id; + delete value.policyId; + delete value.ref; + return value; + }); + await MintService.sendMessage(ref, multipleConfig, root, { + hash, + messageId, + tokenId: token.tokenId, + amount: tokenValue, + memo: transactionMemo, + target: targetAccount, + }, signOptions); + if (multipleConfig.type === 'Main') { + const user = await PolicyUtils.getUserCredentials(ref, documentOwner.did); + await DatabaseServer.createMultiPolicyTransaction({ + uuid: GenerateUUIDv4(), + policyId: ref.policyId, + owner: documentOwner.did, + user: user.hederaAccountId, + hash, + tokenId: token.tokenId, + amount: tokenValue, + target: targetAccount, + status: 'Waiting' + }); + } + } else { + const tokenConfig = await MintService.getTokenConfig(ref, token); + if (token.tokenType === 'non-fungible') { + const serials = await MintService.mintNonFungibleTokens( + tokenConfig, + tokenValue, + root, + targetAccount, + messageId, + transactionMemo, + ref, + await notifier.progress( + 'Minting tokens', + `Start minting ${token.tokenName}` + ) + ); + await MintService.updateDocuments(messageId, { tokenId: token.tokenId, serials }, ref); + } else { + const amount = await MintService.mintFungibleTokens( + tokenConfig, tokenValue, root, targetAccount, messageId, transactionMemo, ref + ); + await MintService.updateDocuments(messageId, { tokenId: token.tokenId, amount }, ref); + } + } + + notifier.success( + multipleConfig ? `Multi mint` : `Mint completed`, + multipleConfig + ? `Request to mint is submitted` + : `All ${token.tokenName} tokens have been minted and transferred`, + NotificationAction.POLICY_VIEW, + ref.policyId + ); + + new ExternalEventChannel().publishMessage( + ExternalMessageEvents.TOKEN_MINTED, + { + tokenId: token.tokenId, + tokenValue, + memo: transactionMemo + } + ); + } + + /** + * Send Synchronization Message + * @param ref + * @param multipleConfig + * @param root + * @param data + * @param signOptions + */ + private static async sendMessage( + ref: AnyBlockType, + multipleConfig: MultiPolicy, + root: IHederaCredentials, + data: any, + signOptions: ISignOptions + ) { + const message = new SynchronizationMessage(MessageAction.Mint); + message.setDocument(multipleConfig, data); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, signOptions, ref.dryRun); + const topic = new TopicConfig({ topicId: multipleConfig.synchronizationTopicId }, null, null); + await messageServer + .setTopicObject(topic) + .sendMessage(message); + } + + /** + * Mint + * @param ref + * @param token + * @param tokenValue + * @param documentOwner + * @param root + * @param targetAccount + * @param uuid + */ + public static async multiMint( + root: IHederaCredentials, + token: Token, + tokenValue: number, + targetAccount: string, + ids: string[], + notifier?: NotificationHelper, + ): Promise { + const messageIds = ids.join(','); + const memo = messageIds; + const tokenConfig: TokenConfig = { + treasuryId: token.adminId, + tokenId: token.tokenId, + supplyKey: null, + treasuryKey: null, + tokenName: token.tokenName, + } + const [treasuryKey, supplyKey] = await Promise.all([ + MintService.wallet.getUserKey( + token.owner, + KeyType.TOKEN_TREASURY_KEY, + token.tokenId + ), + MintService.wallet.getUserKey( + token.owner, + KeyType.TOKEN_SUPPLY_KEY, + token.tokenId + ), + ]); + tokenConfig.supplyKey = supplyKey; + tokenConfig.treasuryKey = treasuryKey; + + if (token.tokenType === 'non-fungible') { + const serials = await MintService.mintNonFungibleTokens( + tokenConfig, + tokenValue, + root, + targetAccount, + messageIds, + memo, + null, + await notifier?.progress( + 'Minting tokens', + `Start minting ${token.tokenName}` + ) + ); + await MintService.updateDocuments(ids, { tokenId: token.tokenId, serials }, null); + } else { + const amount = await MintService.mintFungibleTokens( + tokenConfig, tokenValue, root, targetAccount, messageIds, memo, null + ); + await MintService.updateDocuments(ids, { tokenId: token.tokenId, amount }, null); + } + + notifier?.success( + `Mint completed`, + `All ${token.tokenName} tokens have been minted and transferred` + ); + + new ExternalEventChannel().publishMessage( + ExternalMessageEvents.TOKEN_MINTED, + { + tokenId: token.tokenId, + tokenValue, + memo + } + ); + } + + /** + * Wipe + * @param token + * @param tokenValue + * @param root + * @param targetAccount + * @param uuid + */ + public static async wipe( + ref: AnyBlockType, + token: Token, + tokenValue: number, + root: IHederaCredentials, + targetAccount: string, + uuid: string + ): Promise { + const workers = new Workers(); + if (token.wipeContractId) { + await workers.addNonRetryableTask( + { + type: WorkerTaskType.CONTRACT_CALL, + data: { + contractId: token.wipeContractId, + hederaAccountId: root.hederaAccountId, + hederaAccountKey: root.hederaAccountKey, + functionName: 'wipe', + gas: 1000000, + parameters: [ + { + type: ContractParamType.ADDRESS, + value: TokenId.fromString( + token.tokenId + ).toSolidityAddress(), + }, + { + type: ContractParamType.ADDRESS, + value: AccountId.fromString( + targetAccount + ).toSolidityAddress(), + }, + { + type: ContractParamType.INT64, + value: tokenValue + } + ], + }, + }, + 20 + ); + } else { + const wipeKey = await MintService.wallet.getUserKey( + token.owner, + KeyType.TOKEN_WIPE_KEY, + token.tokenId + ); + await workers.addRetryableTask({ + type: WorkerTaskType.WIPE_TOKEN, + data: { + hederaAccountId: root.hederaAccountId, + hederaAccountKey: root.hederaAccountKey, + dryRun: ref.dryRun, + token, + wipeKey, + targetAccount, + tokenValue, + uuid + } + }, 10); + } + } + + /** + * Update VP Documents + * @param ids + * @param value + * @param ref + */ + private static async updateDocuments(ids: string | string[], value: any, ref: AnyBlockType) { + const dryRunId = ref ? ref.dryRun : null; + const filter = Array.isArray(ids) ? { + where: { messageId: { $in: ids } } + } : { + where: { messageId: { $eq: ids } } + } + await DatabaseServer.updateVpDocuments(value, filter, dryRunId); + } + + /** + * Get Multiple Link + * @param ref + * @param documentOwner + */ + private static async getMultipleConfig(ref: AnyBlockType, documentOwner: IPolicyUser) { + return await DatabaseServer.getMultiPolicy(ref.policyInstance.instanceTopicId, documentOwner.did); + } + + /** + * Write log message + * @param message + */ + public static log(message: string, ref?: AnyBlockType,) { + if (ref) { + MintService.logger.info(message, ['GUARDIAN_SERVICE', ref.uuid, ref.blockType, ref.tag, ref.policyId]); + } else { + MintService.logger.info(message, ['GUARDIAN_SERVICE']); + } + + } + + /** + * Write error message + * @param message + */ + public static error(message: string, ref?: AnyBlockType,) { + if (ref) { + MintService.logger.error(message, ['GUARDIAN_SERVICE', ref.uuid, ref.blockType, ref.tag, ref.policyId]); + } else { + MintService.logger.error(message, ['GUARDIAN_SERVICE']); + } + + } + + /** + * Write warn message + * @param message + */ + public static warn(message: string, ref?: AnyBlockType,) { + if (ref) { + MintService.logger.warn(message, ['GUARDIAN_SERVICE', ref.uuid, ref.blockType, ref.tag, ref.policyId]); + } else { + MintService.logger.warn(message, ['GUARDIAN_SERVICE']); + } + + } +} diff --git a/policy-service/src/policy-engine/multi-policy-service/synchronization-service.ts b/policy-service/src/policy-engine/multi-policy-service/synchronization-service.ts index b1b56fbc17..7c8273743e 100644 --- a/policy-service/src/policy-engine/multi-policy-service/synchronization-service.ts +++ b/policy-service/src/policy-engine/multi-policy-service/synchronization-service.ts @@ -1,24 +1,7 @@ -import { - IRootConfig, - PolicyType, - WorkerTaskType -} from '@guardian/interfaces'; +import { IRootConfig, PolicyType, WorkerTaskType } from '@guardian/interfaces'; import { CronJob } from 'cron'; -import { MintService } from '../mint/mint-service'; -import { - Logger, - Token, - DatabaseServer, - MultiPolicyTransaction, - Policy, - Users, - MessageAction, - MessageServer, - SynchronizationMessage, - TopicConfig, - Workers, - NotificationHelper, -} from '@guardian/common'; +import { MintService } from '../mint/mint-service.js'; +import { DatabaseServer, Logger, MessageAction, MessageServer, MultiPolicyTransaction, NotificationHelper, Policy, SynchronizationMessage, Token, TopicConfig, Users, Workers, } from '@guardian/common'; /** * Synchronization Service @@ -126,7 +109,7 @@ export class SynchronizationService { } const topic = new TopicConfig({ topicId: policy.synchronizationTopicId }, null, null); - const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey).setTopicObject(topic); + const messageServer = new MessageServer(root.hederaAccountId, root.hederaAccountKey, root.signOptions).setTopicObject(topic); const workers = new Workers(); const messages = await workers.addRetryableTask({ diff --git a/policy-service/src/policy-engine/policy-components-utils.ts b/policy-service/src/policy-engine/policy-components-utils.ts index c590642524..a43a9bc03a 100644 --- a/policy-service/src/policy-engine/policy-components-utils.ts +++ b/policy-service/src/policy-engine/policy-components-utils.ts @@ -7,7 +7,7 @@ import { PolicyLink, PolicyOutputEventType, PolicyTagMap -} from '@policy-engine/interfaces'; +} from './interfaces/index.js'; import { BlockType, GenerateUUIDv4, ModuleStatus, PolicyEvents, PolicyType } from '@guardian/interfaces'; import { AnyBlockType, @@ -19,17 +19,17 @@ import { IPolicyNavigationStep, ISerializedBlock, ISerializedBlockExtend -} from './policy-engine.interface'; +} from './policy-engine.interface.js'; import { DatabaseServer, Policy, PolicyTool } from '@guardian/common'; -import { STATE_KEY } from '@policy-engine/helpers/constants'; -import { GetBlockByType } from '@policy-engine/blocks/get-block-by-type'; -import { GetOtherOptions } from '@policy-engine/helpers/get-other-options'; -import { GetBlockAbout } from '@policy-engine/blocks'; -import { IPolicyUser } from './policy-user'; -import { ExternalEvent } from './interfaces/external-event'; -import { BlockTreeGenerator } from '@policy-engine/block-tree-generator'; -import { PolicyNavigationMap } from './interfaces/block-state'; -import { ComponentsService } from './helpers/components-service'; +import { STATE_KEY } from './helpers/constants.js'; +import { GetBlockByType } from './blocks/get-block-by-type.js'; +import { GetOtherOptions } from './helpers/get-other-options.js'; +import { GetBlockAbout } from './blocks/index.js'; +import { IPolicyUser } from './policy-user.js'; +import { ExternalEvent } from './interfaces/external-event.js'; +import { BlockTreeGenerator } from './block-tree-generator.js'; +import { PolicyNavigationMap } from './interfaces/block-state.js'; +import { ComponentsService } from './helpers/components-service.js'; /** * Policy tag helper @@ -978,6 +978,15 @@ export class PolicyComponentsUtils { return PolicyComponentsUtils.BlockByBlockId.get(uuid) as T; } + /** + * Get tag block map + * @param policyId Policy identifier + * @returns Tag block map + */ + public static GetTagBlockMap(policyId: string) { + return PolicyComponentsUtils.TagMapByPolicyId.get(policyId); + } + /** * Get navigation * @param policyId diff --git a/policy-service/src/policy-engine/policy-engine.interface.ts b/policy-service/src/policy-engine/policy-engine.interface.ts index 78283b9923..b37e8fb59c 100644 --- a/policy-service/src/policy-engine/policy-engine.interface.ts +++ b/policy-service/src/policy-engine/policy-engine.interface.ts @@ -1,9 +1,8 @@ import { PolicyRole } from '@guardian/interfaces'; -import { BlockCacheType, PolicyOutputEventType } from '@policy-engine/interfaces'; -import { EventConfig, IPolicyEvent } from './interfaces'; +import { BlockCacheType, PolicyOutputEventType, EventConfig, IPolicyEvent } from './interfaces/index.js'; import { DatabaseServer, Policy } from '@guardian/common'; -import { IPolicyUser, UserCredentials } from './policy-user'; -import { ComponentsService } from './helpers/components-service'; +import { IPolicyUser, UserCredentials } from './policy-user.js'; +import { ComponentsService } from './helpers/components-service.js'; /** * Policy roles interface diff --git a/policy-service/src/policy-engine/policy-user.ts b/policy-service/src/policy-engine/policy-user.ts index ea5c816e8b..b5830bd4ee 100644 --- a/policy-service/src/policy-engine/policy-user.ts +++ b/policy-service/src/policy-engine/policy-user.ts @@ -1,6 +1,6 @@ import { DatabaseServer, DidDocument, HederaBBSMethod, HederaDidDocument, HederaEd25519Method, IAuthUser, KeyType, PolicyRoles, Users, Wallet } from '@guardian/common'; -import { PolicyRole } from '@guardian/interfaces'; -import { AnyBlockType, IPolicyDocument } from './policy-engine.interface'; +import { ISignOptions, PolicyRole, SignType } from '@guardian/interfaces'; +import { AnyBlockType, IPolicyDocument } from './policy-engine.interface.js'; /** * Hedera Account interface @@ -220,6 +220,19 @@ export class UserCredentials { } } + public async loadSignOptions(ref: AnyBlockType): Promise { + if (this._dryRun) { + return { + signType: SignType.INTERNAL + } + } else { + const users = new Users() + const userFull = await users.getUserById(this._did); + const wallet = new Wallet(); + return await wallet.getUserSignOptions(userFull) + } + } + public async loadHederaCredentials(ref: AnyBlockType): Promise { const hederaKey = await this.loadHederaKey(ref); return { @@ -327,4 +340,4 @@ export class UserCredentials { public static async create(ref: AnyBlockType, userDid: string): Promise { return await (new UserCredentials(ref, userDid)).load(ref); } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/record-utils.ts b/policy-service/src/policy-engine/record-utils.ts index 5e4d530df5..7053f6d6ea 100644 --- a/policy-service/src/policy-engine/record-utils.ts +++ b/policy-service/src/policy-engine/record-utils.ts @@ -1,8 +1,8 @@ -import { Recording } from './record/recording'; -import { Running } from './record'; -import { PolicyComponentsUtils } from './policy-components-utils'; -import { IPolicyUser } from './policy-user'; -import { AnyBlockType } from './policy-engine.interface'; +import { Recording } from './record/recording.js'; +import { Running } from './record/index.js'; +import { PolicyComponentsUtils } from './policy-components-utils.js'; +import { IPolicyUser } from './policy-user.js'; +import { AnyBlockType } from './policy-engine.interface.js'; /** * Record utils @@ -283,4 +283,4 @@ export class RecordUtils { await record.setUser(did); } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/record/index.ts b/policy-service/src/policy-engine/record/index.ts index 3b9adc1835..f30b0d5033 100644 --- a/policy-service/src/policy-engine/record/index.ts +++ b/policy-service/src/policy-engine/record/index.ts @@ -1,6 +1,6 @@ -export * from './recording'; -export * from './running'; -export * from './status.type'; -export * from './action.type'; -export * from './method.type'; -export * from './record-item'; \ No newline at end of file +export * from './recording.js'; +export * from './running.js'; +export * from './status.type.js'; +export * from './action.type.js'; +export * from './method.type.js'; +export * from './record-item.js'; diff --git a/policy-service/src/policy-engine/record/record-item.ts b/policy-service/src/policy-engine/record/record-item.ts index 2c3dbfefe8..777b0a0dce 100644 --- a/policy-service/src/policy-engine/record/record-item.ts +++ b/policy-service/src/policy-engine/record/record-item.ts @@ -1,5 +1,5 @@ -import { RecordAction } from './action.type'; -import { RecordMethod } from './method.type'; +import { RecordAction } from './action.type.js'; +import { RecordMethod } from './method.type.js'; /** * Record item @@ -37,4 +37,4 @@ export interface RecordItem { * Document */ document?: any, -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/record/recording.ts b/policy-service/src/policy-engine/record/recording.ts index a2256e334e..23535a0451 100644 --- a/policy-service/src/policy-engine/record/recording.ts +++ b/policy-service/src/policy-engine/record/recording.ts @@ -1,12 +1,12 @@ import { DatabaseServer, HederaDidDocument } from '@guardian/common'; import { GenerateUUIDv4, PolicyEvents } from '@guardian/interfaces'; -import { BlockTreeGenerator } from '@policy-engine/block-tree-generator'; -import { AnyBlockType } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser } from '@policy-engine/policy-user'; -import { RecordingStatus } from './status.type'; -import { RecordAction } from './action.type'; -import { RecordMethod } from './method.type'; -import { RecordItem } from './record-item'; +import { BlockTreeGenerator } from '../block-tree-generator.js'; +import { AnyBlockType } from '../policy-engine.interface.js'; +import { IPolicyUser } from '../policy-user.js'; +import { RecordingStatus } from './status.type.js'; +import { RecordAction } from './action.type.js'; +import { RecordMethod } from './method.type.js'; +import { RecordItem } from './record-item.js'; /** * Recording controller @@ -257,4 +257,4 @@ export class Recording { public async getResults(): Promise { return null; } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/record/running.ts b/policy-service/src/policy-engine/record/running.ts index 2000c6089c..480bc18fe2 100644 --- a/policy-service/src/policy-engine/record/running.ts +++ b/policy-service/src/policy-engine/record/running.ts @@ -1,14 +1,14 @@ import { GenerateUUIDv4, PolicyEvents, TopicType } from '@guardian/interfaces'; -import { RunningStatus } from './status.type'; -import { BlockTreeGenerator } from '@policy-engine/block-tree-generator'; -import { RecordAction } from './action.type'; -import { RecordMethod } from './method.type'; -import { IPolicyBlock } from '@policy-engine/policy-engine.interface'; -import { IPolicyUser, PolicyUser } from '@policy-engine/policy-user'; -import { PolicyComponentsUtils } from '@policy-engine/policy-components-utils'; +import { RunningStatus } from './status.type.js'; +import { BlockTreeGenerator } from '../block-tree-generator.js'; +import { RecordAction } from './action.type.js'; +import { RecordMethod } from './method.type.js'; +import { IPolicyBlock } from '../policy-engine.interface.js'; +import { IPolicyUser, PolicyUser } from '../policy-user.js'; +import { PolicyComponentsUtils } from '../policy-components-utils.js'; import { DatabaseServer, HederaDidDocument, IRecordResult, RecordImportExport, VcHelper } from '@guardian/common'; -import { RecordItem } from './record-item'; -import { GenerateDID, GenerateUUID, IGenerateValue, RecordItemStack, Utils } from './utils'; +import { RecordItem } from './record-item.js'; +import { GenerateDID, GenerateUUID, IGenerateValue, RecordItemStack, Utils } from './utils.js'; import { AccountId, PrivateKey } from '@hashgraph/sdk'; /** @@ -690,4 +690,4 @@ export class Running { return null; } } -} \ No newline at end of file +} diff --git a/policy-service/src/policy-engine/record/utils.ts b/policy-service/src/policy-engine/record/utils.ts index 50ae364da2..773c3eac6f 100644 --- a/policy-service/src/policy-engine/record/utils.ts +++ b/policy-service/src/policy-engine/record/utils.ts @@ -1,4 +1,4 @@ -import { RecordItem } from './record-item'; +import { RecordItem } from './record-item.js'; /** * Generate item diff --git a/policy-service/src/utils/metrics.ts b/policy-service/src/utils/metrics.ts index 354b40c93f..5a9a1ae883 100644 --- a/policy-service/src/utils/metrics.ts +++ b/policy-service/src/utils/metrics.ts @@ -1,13 +1,14 @@ import express from 'express'; import client from 'prom-client'; -import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; +// import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; const app = express(); const PORT = process.env.METRICS_PORT || 5006; export const startMetricsServer = () => { - app.use(guardianServicePrometheusMetrics()); + //TODO: fix crush app read from undefined + // app.use(guardianServicePrometheusMetrics()); app.get('/metrics', async (req, res) => { res.set('Content-Type', client.register.contentType); diff --git a/policy-service/tests/unit-tests/blocks/block-tree-generator.test.js b/policy-service/tests/unit-tests/blocks/block-tree-generator.test.mjs similarity index 82% rename from policy-service/tests/unit-tests/blocks/block-tree-generator.test.js rename to policy-service/tests/unit-tests/blocks/block-tree-generator.test.mjs index 8db5146341..4e5a1e6677 100644 --- a/policy-service/tests/unit-tests/blocks/block-tree-generator.test.js +++ b/policy-service/tests/unit-tests/blocks/block-tree-generator.test.mjs @@ -1,8 +1,8 @@ -const dotenv = require('dotenv'); -dotenv.config(); +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; +import dotenv from 'dotenv'; -const moduleAlias = require('module-alias'); -const rewire = require("rewire"); +dotenv.config(); moduleAlias.addAliases({ "@api": process.cwd() + '/dist' + "/api", @@ -16,7 +16,7 @@ moduleAlias.addAliases({ "@database-modules": process.cwd() + '/dist' + "/database-modules" }); -const {Inject} = rewire('../../../dist/helpers/decorators/inject'); +// const { Inject } = rewire(process.cwd() + '/dist' + '/helpers/decorators/inject.js'); //const { BlockTreeGenerator } = require("../../../dist/policy-engine/block-tree-generator"); diff --git a/policy-service/tests/unit-tests/blocks/information-block.test.js b/policy-service/tests/unit-tests/blocks/information-block.test.js deleted file mode 100644 index b9fe04c60b..0000000000 --- a/policy-service/tests/unit-tests/blocks/information-block.test.js +++ /dev/null @@ -1,25 +0,0 @@ - - -const moduleAlias = require('module-alias'); - -moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@database-modules": process.cwd() + '/dist' + "/database-modules" -}); - -const {assert} = require('chai'); - -describe('Information block', function() { - it('init', async function () { - }) - - it('getData', async function() { - }) -}) diff --git a/policy-service/tests/unit-tests/blocks/information-block.test.mjs b/policy-service/tests/unit-tests/blocks/information-block.test.mjs new file mode 100644 index 0000000000..5d07101c93 --- /dev/null +++ b/policy-service/tests/unit-tests/blocks/information-block.test.mjs @@ -0,0 +1,25 @@ +import { assert } from 'chai'; +import moduleAlias from 'module-alias'; +import dotenv from 'dotenv'; + +dotenv.config(); + +moduleAlias.addAliases({ + '@api': `${process.cwd()}/dist/api`, + '@entity': `${process.cwd()}/dist/entity`, + '@subscribers': `${process.cwd()}/dist/subscribers`, + '@helpers': `${process.cwd()}/dist/helpers`, + '@auth': `${process.cwd()}/dist/auth`, + '@policy-engine': `${process.cwd()}/dist/policy-engine`, + '@hedera-modules': `${process.cwd()}/dist/hedera-modules/index`, + '@document-loader': `${process.cwd()}/dist/document-loader`, + '@database-modules': `${process.cwd()}/dist/database-modules`, +}); + +describe('Information block', function() { + it('init', async function () { + }) + + it('getData', async function() { + }) +}) diff --git a/policy-service/tests/unit-tests/blocks/policy-components-utils.test.js b/policy-service/tests/unit-tests/blocks/policy-components-utils.test.js deleted file mode 100644 index b857109350..0000000000 --- a/policy-service/tests/unit-tests/blocks/policy-components-utils.test.js +++ /dev/null @@ -1,35 +0,0 @@ -const moduleAlias = require('module-alias'); - -moduleAlias.addAliases({ - "@api": process.cwd() + '/dist' + "/api", - "@entity": process.cwd() + '/dist' + "/entity", - "@subscribers": process.cwd() + '/dist' + "dist/subscribers", - "@helpers": process.cwd() + '/dist' + "/helpers", - "@auth": process.cwd() + '/dist' + "/auth", - "@policy-engine": process.cwd() + '/dist' + "/policy-engine", - "@hedera-modules": process.cwd() + '/dist' + "/hedera-modules/index", - "@document-loader": process.cwd() + '/dist' + "/document-loader", - "@database-modules": process.cwd() + '/dist' + "/database-modules" -}); - -const rewire = require("rewire"); - -const {Inject} = rewire('../../../dist/helpers/decorators/inject'); -const {PolicyComponentsUtils} = require("../../../dist/policy-engine/policy-components-utils"); -const {GenerateNewUUID} = require('@guardian/common'); -const {assert} = require('chai'); -const { GenerateUUIDv4 } = require("@guardian/interfaces"); - -describe('State Container', function () { - it('GenerateNewUUID', async function () { - assert.equal(GenerateUUIDv4().length, 36) - }); - - // it('IfUUIDRegistered', async function () { - // assert.equal(PolicyComponentsUtils.IfUUIDRegistered(new Array(36).fill('0').join('')), false); - // const uuid = GenerateUUIDv4(); - // PolicyComponentsUtils.PolicyBlockMapObject.set(uuid, {}); - // assert.equal(PolicyComponentsUtils.IfUUIDRegistered(uuid), true); - // - // }); -}) diff --git a/policy-service/tests/unit-tests/blocks/policy-components-utils.test.mjs b/policy-service/tests/unit-tests/blocks/policy-components-utils.test.mjs new file mode 100644 index 0000000000..5479b01fc5 --- /dev/null +++ b/policy-service/tests/unit-tests/blocks/policy-components-utils.test.mjs @@ -0,0 +1,37 @@ +import { assert } from 'chai'; +import moduleAlias from 'module-alias'; +import rewire from 'rewire'; + +import { GenerateUUIDv4 } from '@guardian/interfaces'; +import * as common from '@guardian/common'; + +import { Inject } from '../../../dist/helpers/decorators/inject.js'; +import { PolicyComponentsUtils } from '../../../dist/policy-engine/policy-components-utils.js'; + +const { GenerateNewUUID } = common; + +moduleAlias.addAliases({ + '@api': `${process.cwd()}/dist/api`, + '@entity': `${process.cwd()}/dist/entity`, + '@subscribers': `${process.cwd()}/dist/subscribers`, + '@helpers': `${process.cwd()}/dist/helpers`, + '@auth': `${process.cwd()}/dist/auth`, + '@policy-engine': `${process.cwd()}/dist/policy-engine`, + '@hedera-modules': `${process.cwd()}/dist/hedera-modules/index`, + '@document-loader': `${process.cwd()}/dist/document-loader`, + '@database-modules': `${process.cwd()}/dist/database-modules`, +}); + +describe('State Container', function () { + it('GenerateNewUUID', async function () { + assert.equal(GenerateUUIDv4().length, 36) + }); + + // it('IfUUIDRegistered', async function () { + // assert.equal(PolicyComponentsUtils.IfUUIDRegistered(new Array(36).fill('0').join('')), false); + // const uuid = GenerateUUIDv4(); + // PolicyComponentsUtils.PolicyBlockMapObject.set(uuid, {}); + // assert.equal(PolicyComponentsUtils.IfUUIDRegistered(uuid), true); + // + // }); +}) diff --git a/policy-service/tests/unit-tests/helpers/decorators/basic-block.test.js b/policy-service/tests/unit-tests/helpers/decorators/basic-block.test.mjs similarity index 72% rename from policy-service/tests/unit-tests/helpers/decorators/basic-block.test.js rename to policy-service/tests/unit-tests/helpers/decorators/basic-block.test.mjs index c3c180e0a6..e61484e6c8 100644 --- a/policy-service/tests/unit-tests/helpers/decorators/basic-block.test.js +++ b/policy-service/tests/unit-tests/helpers/decorators/basic-block.test.mjs @@ -1,6 +1,8 @@ -require('module-alias/register'); -const {assert} = require('chai') -const {BasicBlock} = require("../../../../dist/policy-engine/helpers/decorators"); +import 'module-alias/register.js'; + +import { assert } from 'chai'; + +import { BasicBlock } from '../../../../dist/policy-engine/helpers/decorators/basic-block.js'; describe('Basic Block', function() { it('Create', async function() { diff --git a/policy-service/tests/unit-tests/helpers/decorators/container-block.test.js b/policy-service/tests/unit-tests/helpers/decorators/container-block.test.mjs similarity index 71% rename from policy-service/tests/unit-tests/helpers/decorators/container-block.test.js rename to policy-service/tests/unit-tests/helpers/decorators/container-block.test.mjs index 464524d449..501e4eef5b 100644 --- a/policy-service/tests/unit-tests/helpers/decorators/container-block.test.js +++ b/policy-service/tests/unit-tests/helpers/decorators/container-block.test.mjs @@ -1,6 +1,8 @@ -require('module-alias/register'); -const {assert} = require('chai') -const {ContainerBlock} = require("../../../../dist/policy-engine/helpers/decorators"); +import 'module-alias/register.js'; + +import { assert } from 'chai'; + +import { ContainerBlock} from '../../../../dist/policy-engine/helpers/decorators/container-block.js'; describe('Container Block', function() { it('Create', async function() { diff --git a/policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.js b/policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.mjs similarity index 71% rename from policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.js rename to policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.mjs index 1900ddbec6..f35f7087f5 100644 --- a/policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.js +++ b/policy-service/tests/unit-tests/helpers/decorators/data-source-block.test.mjs @@ -1,6 +1,8 @@ -require('module-alias/register'); -const {assert} = require('chai') -const {DataSourceBlock} = require("../../../../dist/policy-engine/helpers/decorators"); +import 'module-alias/register.js'; + +import { assert } from 'chai'; + +import { DataSourceBlock} from '../../../../dist/policy-engine/helpers/decorators/data-source-block.js'; describe('DataSource Block', function() { it('Create', async function() { diff --git a/policy-service/tests/unit-tests/helpers/decorators/event-block.test.js b/policy-service/tests/unit-tests/helpers/decorators/event-block.test.mjs similarity index 72% rename from policy-service/tests/unit-tests/helpers/decorators/event-block.test.js rename to policy-service/tests/unit-tests/helpers/decorators/event-block.test.mjs index c4aa55d3c1..0001f6d859 100644 --- a/policy-service/tests/unit-tests/helpers/decorators/event-block.test.js +++ b/policy-service/tests/unit-tests/helpers/decorators/event-block.test.mjs @@ -1,6 +1,8 @@ -require('module-alias/register'); -const {assert} = require('chai') -const {EventBlock} = require("../../../../dist/policy-engine/helpers/decorators"); +import 'module-alias/register.js'; + +import { assert } from 'chai'; + +import { EventBlock } from '../../../../dist/policy-engine/helpers/decorators/event-block.js'; describe('Event Block', function() { it('Create', async function() { diff --git a/policy-service/tests/unit-tests/helpers/decorators/external-data.test.js b/policy-service/tests/unit-tests/helpers/decorators/external-data.test.mjs similarity index 72% rename from policy-service/tests/unit-tests/helpers/decorators/external-data.test.js rename to policy-service/tests/unit-tests/helpers/decorators/external-data.test.mjs index 89b815d818..66dbf32417 100644 --- a/policy-service/tests/unit-tests/helpers/decorators/external-data.test.js +++ b/policy-service/tests/unit-tests/helpers/decorators/external-data.test.mjs @@ -1,6 +1,8 @@ -require('module-alias/register'); -const {assert} = require('chai') -const {ExternalData} = require("../../../../dist/policy-engine/helpers/decorators"); +import 'module-alias/register.js'; + +import { assert } from 'chai'; + +import { ExternalData } from '../../../../dist/policy-engine/helpers/decorators/external-data.js'; describe('ExternalData Block', function() { it('Create', async function() { diff --git a/policy-service/tests/unit-tests/mockup/trust-chain.service.js b/policy-service/tests/unit-tests/mockup/trust-chain.service.mjs similarity index 99% rename from policy-service/tests/unit-tests/mockup/trust-chain.service.js rename to policy-service/tests/unit-tests/mockup/trust-chain.service.mjs index 567e8cf680..cdd4156d47 100644 --- a/policy-service/tests/unit-tests/mockup/trust-chain.service.js +++ b/policy-service/tests/unit-tests/mockup/trust-chain.service.mjs @@ -1,6 +1,6 @@ 'use strict'; -module.exports.testObject1 = [ +export const testObject1 = [ { 'type': 'VP', 'id': '5d46d1fd-75ad-4073-ade7-322d6f31374c', @@ -1131,4 +1131,4 @@ module.exports.testObject3 = [ 'label': 'HASH', 'tag': 'Account Creation' } -] \ No newline at end of file +] diff --git a/policy-service/tsconfig.json b/policy-service/tsconfig.json index 64f035fcdd..dcec1e8e3b 100644 --- a/policy-service/tsconfig.json +++ b/policy-service/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" diff --git a/policy-service/tsconfig.production.json b/policy-service/tsconfig.production.json index c3d47204b7..475f693803 100644 --- a/policy-service/tsconfig.production.json +++ b/policy-service/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" diff --git a/swagger-analytics.yaml b/swagger-analytics.yaml index b554cfe6e1..a36430e459 100644 --- a/swagger-analytics.yaml +++ b/swagger-analytics.yaml @@ -208,7 +208,7 @@ info: the heart of the Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a requirements-based tokenization implementation. - version: 2.23.1 + version: 2.24.0 contact: name: API developer url: https://envisionblockchain.com diff --git a/swagger.yaml b/swagger.yaml index 01e6c97ed1..af5863bb2e 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -797,6 +797,19 @@ paths: description: Parent ID schema: type: string + requestBody: + required: true + description: Form data with artifacts. + content: + multipart/form-data: + schema: + type: array + items: + type: object + properties: + artifacts: + type: string + format: binary responses: '200': description: Successful operation. @@ -3327,6 +3340,49 @@ paths: tags: *ref_5 security: - bearerAuth: [] + /tools/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadata + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] /tools/push/import/file: post: operationId: ToolsApi_toolImportFileAsync @@ -3356,6 +3412,49 @@ paths: tags: *ref_5 security: - bearerAuth: [] + /tools/push/import/file-metadata: + post: + operationId: ToolsApi_toolImportFileWithMetadataAsync + summary: Imports new tool from a zip file. + description: >- + Imports new tool and all associated artifacts, such as schemas and VCs, + from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: [] + requestBody: + required: true + description: Form data with tool file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskDTO' + '401': + description: Unauthorized. + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_5 + security: + - bearerAuth: [] /tools/push/import/message: post: operationId: ToolsApi_toolImportMessageAsync @@ -4429,6 +4528,164 @@ paths: security: - bearerAuth: [] - bearerAuth: [] + /policies/{policyId}/data: + get: + operationId: PolicyApi_downloadPolicyData + summary: Get policy data. + description: >- + Get policy data. Only users with the Standard Registry role are allowed + to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy data. + content: + application/json: + schema: + type: string + format: binary + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/data: + post: + operationId: PolicyApi_uploadPolicyData + summary: Upload policy data. + description: >- + Upload policy data. Only users with the Standard Registry role are + allowed to make the request. + parameters: [] + requestBody: + required: true + description: Policy data file + content: + application/json: + schema: + type: string + format: binary + responses: + '200': + description: Uploaded policy. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/tag-block-map: + get: + operationId: PolicyApi_getTagBlockMap + summary: Get policy tag block map. + description: >- + Get policy tag block map. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy tag block map. + content: + application/json: + schema: + type: object + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + /policies/{policyId}/virtual-keys: + get: + operationId: PolicyApi_downloadVirtualKeys + summary: Get policy virtual keys. + description: >- + Get policy virtual keys. Only users with the Standard Registry role are + allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + responses: + '200': + description: Policy virtual keys. + content: + application/json: + schema: + type: string + format: binary + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] + post: + operationId: PolicyApi_uploadVirtualKeys + summary: Upload policy virtual keys. + description: >- + Upload policy virtual keys. Only users with the Standard Registry role + are allowed to make the request. + parameters: + - name: policyId + required: true + in: path + description: Policy identifier. + schema: {} + requestBody: + required: true + description: Virtual keys file + content: + application/json: + schema: + type: string + format: binary + responses: + '200': + description: Operation completed. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearerAuth: [] /policies/{policyId}/blocks: get: tags: @@ -4956,6 +5213,56 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /policies/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadata + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: false + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearer: [] /policies/push/import/file: post: tags: @@ -4996,6 +5303,56 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /policies/push/import/file-metadata: + post: + operationId: PolicyApi_importPolicyFromFileWithMetadataAsync + summary: Imports new policy from a zip file with metadata. + description: >- + Imports new policy and all associated artifacts, such as schemas and + VCs, from the provided zip file into the local DB. Only users with the + Standard Registry role are allowed to make the request. + parameters: + - name: versionOfTopicId + required: false + in: query + description: Topic Id + schema: + type: string + requestBody: + required: true + description: Form data with policy file and metadata. + content: + multipart/form-data: + schema: + type: object + properties: + policyFile: + type: string + format: binary + metadata: + type: string + format: binary + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '401': + description: Unauthorized + '403': + description: Forbidden. + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorDTO' + tags: *ref_7 + security: + - bearerAuth: [] + - bearer: [] /policies/import/file/preview: post: tags: @@ -9962,7 +10319,7 @@ info: the heart of the Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a requirements-based tokenization implementation. - version: 2.23.1 + version: 2.24.0 contact: name: API developer url: https://envisionblockchain.com @@ -10863,6 +11220,18 @@ components: type: object roles: type: object + blocks: + type: object + tokens: + type: object + migrateState: + type: boolean + migrateRetirePools: + type: boolean + editedVCs: + type: object + retireContractId: + type: string required: - policies - vcs @@ -10870,6 +11239,12 @@ components: - schemas - groups - roles + - blocks + - tokens + - migrateState + - migrateRetirePools + - editedVCs + - retireContractId PolicyCategoryDTO: type: object properties: @@ -11229,6 +11604,27 @@ components: - right - total - documents + RegisteredUsersDTO: + type: object + properties: + username: + type: string + did: + type: string + parent: + type: string + role: + type: string + policyRoles: + type: array + items: + type: string + required: + - username + - did + - parent + - role + - policyRoles ToolDTO: type: object properties: @@ -11269,27 +11665,6 @@ components: - messageId - codeVersion - createDate - RegisteredUsersDTO: - type: object - properties: - username: - type: string - did: - type: string - parent: - type: string - role: - type: string - policyRoles: - type: array - items: - type: string - required: - - username - - did - - parent - - role - - policyRoles Credentials: type: object required: diff --git a/topic-viewer/.dockerignore b/topic-viewer/.dockerignore index a33ce683c4..995dcad415 100644 --- a/topic-viewer/.dockerignore +++ b/topic-viewer/.dockerignore @@ -1,3 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc dist +Dockerfile node_modules npm-debug.log \ No newline at end of file diff --git a/topic-viewer/Dockerfile b/topic-viewer/Dockerfile index 6ca252d9ea..19b30ed1d4 100644 --- a/topic-viewer/Dockerfile +++ b/topic-viewer/Dockerfile @@ -1,23 +1,37 @@ -FROM node:20 as topicViewerbuilder -WORKDIR /usr/local/topic-viewer -COPY ./topic-viewer/package.json ./ -COPY ./topic-viewer/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN yarn install -ADD ./topic-viewer/src ./src -RUN yarn run build:prod +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/topic-viewer -COPY ./topic-viewer/package.json ./ -COPY --from=topicViewerbuilder /usr/local/topic-viewer/yarn.lock ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN yarn install -COPY ./topic-viewer/public ./public -COPY --from=topicViewerbuilder /usr/local/topic-viewer/dist ./dist +# Stage 1: Installing production dependecies +FROM base as deps +COPY --link topic-viewer/package.json topic-viewer/tsconfig*.json yarn.lock ./ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod -CMD yarn start +# Stage 2: Build service +FROM base as build +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link topic-viewer/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 3: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link topic-viewer/public public/ + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node + +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/topic-viewer/package.json b/topic-viewer/package.json index 7abfb97999..4a1258f99a 100644 --- a/topic-viewer/package.json +++ b/topic-viewer/package.json @@ -29,8 +29,6 @@ "dev": "tsc -w", "start": "node dist/index.js" }, - "version": "2.23.1", - "resolutions": { - "@types/mime": "3.0.4" - } + "type": "module", + "version": "2.24.0" } diff --git a/topic-viewer/src/index.ts b/topic-viewer/src/index.ts index a1201d1451..04a03ad945 100644 --- a/topic-viewer/src/index.ts +++ b/topic-viewer/src/index.ts @@ -1,5 +1,5 @@ import express from 'express'; -import { startMetricsServer } from './utils/metrics'; +import { startMetricsServer } from './utils/metrics.js'; const PORT = process.env.PORT || 3006; (async () => { diff --git a/topic-viewer/src/utils/metrics.ts b/topic-viewer/src/utils/metrics.ts index 4e4706d029..2ded056483 100644 --- a/topic-viewer/src/utils/metrics.ts +++ b/topic-viewer/src/utils/metrics.ts @@ -1,13 +1,14 @@ import express from 'express'; import client from 'prom-client'; -import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; +// import guardianServicePrometheusMetrics from 'prometheus-api-metrics'; const app = express(); const PORT = process.env.METRICS_PORT || 5009; export const startMetricsServer = () => { - app.use(guardianServicePrometheusMetrics()); + //TODO: fix crush app read from undefined + // app.use(guardianServicePrometheusMetrics()); app.get('/metrics', async (req, res) => { res.set('Content-Type', client.register.contentType); diff --git a/topic-viewer/tsconfig.json b/topic-viewer/tsconfig.json index 3db81a7fc7..77ddd9e95f 100644 --- a/topic-viewer/tsconfig.json +++ b/topic-viewer/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" @@ -11,7 +11,7 @@ "outDir": "dist/", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "esModuleInterop": true + "esModuleInterop": true, }, "include": [ "src/**/*" diff --git a/topic-viewer/tsconfig.production.json b/topic-viewer/tsconfig.production.json index 0fc5db8b08..d2c4f42eb8 100644 --- a/topic-viewer/tsconfig.production.json +++ b/topic-viewer/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" @@ -11,7 +11,7 @@ "outDir": "dist/", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "esModuleInterop": true + "esModuleInterop": true, }, "include": [ "src/**/*" diff --git a/tree-viewer/.dockerignore b/tree-viewer/.dockerignore index a33ce683c4..995dcad415 100644 --- a/tree-viewer/.dockerignore +++ b/tree-viewer/.dockerignore @@ -1,3 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc dist +Dockerfile node_modules npm-debug.log \ No newline at end of file diff --git a/tree-viewer/Dockerfile b/tree-viewer/Dockerfile index 7a4806817d..e57e3776c0 100644 --- a/tree-viewer/Dockerfile +++ b/tree-viewer/Dockerfile @@ -1,23 +1,37 @@ -FROM node:20 as treeViewerbuilder -WORKDIR /usr/local/tree-viewer -COPY ./tree-viewer/package.json ./ -COPY ./tree-viewer/tsconfig*.json ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN yarn install -ADD ./tree-viewer/src ./src -RUN yarn run build:prod +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/tree-viewer -COPY ./topic-viewer/package.json ./ -COPY --from=treeViewerbuilder /usr/local/tree-viewer/yarn.lock ./ -COPY ./yarn.lock ./ -COPY ./package-lock.json ./ -RUN yarn install -COPY ./tree-viewer/public ./public -COPY --from=treeViewerbuilder /usr/local/tree-viewer/dist ./dist +# Stage 1: Installing production dependecies +FROM base as deps +COPY --link tree-viewer/package.json tree-viewer/tsconfig*.json yarn.lock ./ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod -CMD yarn start +# Stage 2: Build service +FROM base as build +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link tree-viewer/src src/ +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 3: Create the final image +FROM base as image +ENV NODE_ENV production + +COPY --link tree-viewer/public public/ + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node + +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/tree-viewer/package.json b/tree-viewer/package.json index 55da885924..e5e0042460 100644 --- a/tree-viewer/package.json +++ b/tree-viewer/package.json @@ -27,8 +27,6 @@ "dev": "tsc -w", "start": "node dist/index.js" }, - "version": "2.23.1", - "resolutions": { - "@types/mime": "3.0.4" - } + "type": "module", + "version": "2.24.0" } diff --git a/tree-viewer/tsconfig.json b/tree-viewer/tsconfig.json index 3db81a7fc7..77ddd9e95f 100644 --- a/tree-viewer/tsconfig.json +++ b/tree-viewer/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" @@ -11,7 +11,7 @@ "outDir": "dist/", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "esModuleInterop": true + "esModuleInterop": true, }, "include": [ "src/**/*" diff --git a/tree-viewer/tsconfig.production.json b/tree-viewer/tsconfig.production.json index 0fc5db8b08..d2c4f42eb8 100644 --- a/tree-viewer/tsconfig.production.json +++ b/tree-viewer/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", + "module": "ESNext", + "target": "es2022", "lib": [ "es5", "es6" @@ -11,7 +11,7 @@ "outDir": "dist/", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "esModuleInterop": true + "esModuleInterop": true, }, "include": [ "src/**/*" diff --git a/web-proxy/.dockerignore b/web-proxy/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/web-proxy/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/web-proxy/Dockerfile b/web-proxy/Dockerfile index 3094f3b08f..14208d1e99 100644 --- a/web-proxy/Dockerfile +++ b/web-proxy/Dockerfile @@ -1,22 +1,34 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package*.json ./ -COPY ./interfaces/tsconfig*.json ./ -ADD ./interfaces/src ./src/. -RUN npm install -RUN npm pack +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn -FROM node:20 as frontendBuilder +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build frontend +FROM base as build ENV NODE_OPTIONS="--openssl-legacy-provider" -WORKDIR /usr/local/frontend -COPY ./frontend/. /usr/local/frontend -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz ./ -RUN npm install guardian-interfaces-*.tgz -RUN npm run build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz ./interfaces.tgz +COPY --link ./frontend/. ./ +RUN npm install interfaces.tgz && npm run build + +# Stage 3: Create the final image +FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image + +# Copy config and built application from the build stage into the image +COPY --link ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf +COPY --link --from=build /usr/local/app/dist/guardian /usr/share/nginx/html -FROM nginx:1.25.3 -ENV PLATFORM="docker" -COPY ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf -COPY --from=frontendBuilder /usr/local/frontend/dist/guardian /usr/share/nginx/html +# Change the user to nginx +USER nginx -EXPOSE 80 +EXPOSE 80 \ No newline at end of file diff --git a/web-proxy/Dockerfile.ci b/web-proxy/Dockerfile.ci index 673cf0f0e2..a5a7b3c666 100644 --- a/web-proxy/Dockerfile.ci +++ b/web-proxy/Dockerfile.ci @@ -1,22 +1,34 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package*.json ./ -COPY ./interfaces/tsconfig*.json ./ -ADD ./interfaces/src ./src/. -RUN npm install -RUN npm pack +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn -FROM node:20 as frontendBuilder +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build frontend +FROM base as build ENV NODE_OPTIONS="--openssl-legacy-provider" -WORKDIR /usr/local/frontend -COPY ./frontend/. /usr/local/frontend -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz ./ -RUN npm install guardian-interfaces-*.tgz -RUN npm run build:prod +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz ./interfaces.tgz +COPY --link ./frontend/. ./ +RUN npm install interfaces.tgz && npm run build:prod + +# Stage 3: Create the final image +FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image + +# Copy config and built application from the build stage into the image +COPY --link ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf +COPY --link --from=build /usr/local/app/dist/guardian /usr/share/nginx/html -FROM nginx:1.25.3 -ENV PLATFORM="docker" -COPY ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf -COPY --from=frontendBuilder /usr/local/frontend/dist/guardian /usr/share/nginx/html +# Change the user to nginx +USER nginx -EXPOSE 80 +EXPOSE 80 \ No newline at end of file diff --git a/web-proxy/Dockerfile.demo b/web-proxy/Dockerfile.demo index b974abff78..c729eec869 100644 --- a/web-proxy/Dockerfile.demo +++ b/web-proxy/Dockerfile.demo @@ -1,22 +1,34 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package*.json ./ -COPY ./interfaces/tsconfig*.json ./ -ADD ./interfaces/src ./src/. -RUN npm install -RUN npm pack +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn -FROM node:20 as frontendBuilder +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build frontend +FROM base as build ENV NODE_OPTIONS="--openssl-legacy-provider" -WORKDIR /usr/local/frontend -COPY ./frontend/. /usr/local/frontend -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz ./ -RUN npm install guardian-interfaces-*.tgz -RUN npm run build:demo +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz ./interfaces.tgz +COPY --link ./frontend/. ./ +RUN npm install interfaces.tgz && npm run build:demo + +# Stage 3: Create the final image +FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image + +# Copy config and built application from the build stage into the image +COPY --link ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf +COPY --link --from=build /usr/local/app/dist/guardian /usr/share/nginx/html -FROM nginx:1.25.3 -ENV PLATFORM="docker" -COPY ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf -COPY --from=frontendBuilder /usr/local/frontend/dist/guardian /usr/share/nginx/html +# Change the user to nginx +USER nginx -EXPOSE 80 +EXPOSE 80 \ No newline at end of file diff --git a/worker-service/.dockerignore b/worker-service/.dockerignore new file mode 100644 index 0000000000..995dcad415 --- /dev/null +++ b/worker-service/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.npmrc +dist +Dockerfile +node_modules +npm-debug.log \ No newline at end of file diff --git a/worker-service/Dockerfile b/worker-service/Dockerfile index 45d130bf0b..f8550205bf 100644 --- a/worker-service/Dockerfile +++ b/worker-service/Dockerfile @@ -1,45 +1,58 @@ -FROM node:20 AS interfacesModuleBuilder -WORKDIR /usr/local/interfaces -COPY ./interfaces/package.json ./ -COPY ./interfaces/tsconfig*.json ./ -ADD ./interfaces/src ./src/. -RUN yarn install -RUN yarn pack - -FROM node:20 AS commonModuleBuilder -WORKDIR /usr/local/common -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY ./common/package.json ./ -COPY ./common/tsconfig*.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./common/src ./src/. -RUN yarn pack - -FROM node:20 AS workerServiceBuilder -WORKDIR /usr/local/worker-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY ./worker-service/package.json ./ -COPY ./worker-service/tsconfig*.json ./ -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -ADD ./worker-service/src ./src/. -RUN yarn run build:prod - -FROM node:20 -ENV PLATFORM="docker" -ENV NODE_ENV="production" -WORKDIR /usr/local/worker-service -COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz -COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz -COPY --from=workerServiceBuilder /usr/local/worker-service/yarn.lock ./ -COPY ./worker-service/package.json ./ +# syntax=docker/dockerfile:1 +# Stage 0: Use node image for base image for all stages +ARG NODE_VERSION=20.11.1-alpine +FROM node:${NODE_VERSION} as base +WORKDIR /usr/local/app +# Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory +ARG YARN_CACHE_FOLDER=/root/.yarn + +# Stage 1: Build interfaces module +FROM base as interfaces +COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ +COPY --link interfaces/src src/ +# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn pack + +# Stage 2: Build common module +FROM base as common +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link common/package.json common/tsconfig*.json yarn.lock ./ +COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN yarn install -COPY --from=workerServiceBuilder /usr/local/worker-service/dist ./dist -RUN rm /tmp/interfaces.tgz /tmp/common.tgz +RUN --mount=type=cache,target=/root/.yarn \ + yarn install && yarn pack + +# Stage 3: Installing production dependecies +FROM base as deps +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link worker-service/package.json worker-service/tsconfig*.json yarn.lock ./ +RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" +RUN apk add --no-cache git +RUN --mount=type=cache,target=/root/.yarn,sharing=private \ + yarn install --prod + +# Stage 4: Build service +FROM base as build +COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz +COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz +COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ +COPY --link worker-service/src src/ +RUN apk add --no-cache git +RUN --mount=type=cache,target=/root/.yarn \ + yarn install --frozen-lockfile && yarn run build:prod + +# Stage 5: Create the final image +FROM base as image +ENV NODE_ENV production + +# Copy the production dependencies from the deps stage and the built application from the build stage into the image +COPY --link --from=deps /usr/local/app/node_modules node_modules/ +COPY --link --from=deps /usr/local/app/package.json ./ +COPY --link --from=build /usr/local/app/dist dist/ + +# Change the user to node +USER node -CMD yarn start +CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/worker-service/Gulpfile.js b/worker-service/Gulpfile.js deleted file mode 100644 index 4be1d2ab2c..0000000000 --- a/worker-service/Gulpfile.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict' - -const gulp = require('gulp'); -const ts = require('gulp-typescript'); -const rename = require('gulp-rename'); -const sourcemaps = require('gulp-sourcemaps'); - -gulp.task('configure:demo', () => { - return gulp - .src('environments/environment.demo.ts') - .pipe(rename('environment.ts')) - .pipe(gulp.dest('src')); -}) - -gulp.task('configure:production', () => { - return gulp - .src('environments/environment.prod.ts') - .pipe(rename('environment.ts')) - .pipe(gulp.dest('src')); -}) - -gulp.task('compile:dev', () => { - const tsProject = ts.createProject('tsconfig.json'); - - return tsProject - .src() - .pipe(sourcemaps.init()) - .pipe(tsProject()).js - .pipe(sourcemaps.write({ sourceRoot: '/dist' })) - .pipe(gulp.dest('dist')); -}) - -gulp.task('compile:production', () => { - const tsProject = ts.createProject('tsconfig.production.json'); - - return tsProject - .src() - .pipe(tsProject()).js - .pipe(gulp.dest('dist')); -}) - -gulp.task('build:demo', gulp.series(['configure:demo', 'compile:dev'])); -gulp.task('build:prod', gulp.series(['configure:production', 'compile:production'])); -gulp.task('watch:only', () => { - gulp.watch('src/**/*.ts', gulp.series(['compile:dev'])); -}) -gulp.task('watch', gulp.series(['build:demo', 'watch:only'])) diff --git a/worker-service/Gulpfile.mjs b/worker-service/Gulpfile.mjs new file mode 100644 index 0000000000..bc72367a0b --- /dev/null +++ b/worker-service/Gulpfile.mjs @@ -0,0 +1,47 @@ +'use strict' + +import gulp from 'gulp'; +import ts from 'gulp-typescript'; +import rename from 'gulp-rename'; +import sourcemaps from 'gulp-sourcemaps'; + +gulp.task('configure:demo', () => { + return gulp + .src('environments/environment.demo.ts') + .pipe(rename('environment.ts')) + .pipe(gulp.dest('src')); +}) + +gulp.task('configure:production', () => { + return gulp + .src('environments/environment.prod.ts') + .pipe(rename('environment.ts')) + .pipe(gulp.dest('src')); +}) + +gulp.task('compile:dev', () => { + const tsProject = ts.createProject('tsconfig.json'); + + return tsProject + .src() + .pipe(sourcemaps.init()) + .pipe(tsProject()).js + .pipe(sourcemaps.write({ sourceRoot: '/dist' })) + .pipe(gulp.dest('dist')); +}) + +gulp.task('compile:production', () => { + const tsProject = ts.createProject('tsconfig.production.json'); + + return tsProject + .src() + .pipe(tsProject()).js + .pipe(gulp.dest('dist')); +}) + +gulp.task('build:demo', gulp.series(['configure:demo', 'compile:dev'])); +gulp.task('build:prod', gulp.series(['configure:production', 'compile:production'])); +gulp.task('watch:only', () => { + gulp.watch('src/**/*.ts', gulp.series(['compile:dev'])); +}) +gulp.task('watch', gulp.series(['build:demo', 'watch:only'])) diff --git a/worker-service/package.json b/worker-service/package.json index bc96524920..1d057349bf 100644 --- a/worker-service/package.json +++ b/worker-service/package.json @@ -2,8 +2,8 @@ "author": "Envision Blockchain Solutions ", "dependencies": { "@filebase/client": "^0.0.5", - "@guardian/common": "^2.23.1", - "@guardian/interfaces": "^2.23.1", + "@guardian/common": "^2.24.0", + "@guardian/interfaces": "^2.24.0", "@hashgraph/sdk": "2.34.1", "@nestjs/common": "^9.4.1", "@nestjs/core": "^9.4.1", @@ -25,7 +25,8 @@ "jsonwebtoken": "^8.5.1", "module-alias": "^2.2.2", "reflect-metadata": "^0.1.13", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "fireblocks-sdk": "^5.20.0" }, "description": "", "devDependencies": { @@ -61,12 +62,9 @@ "dev:docker": "nodemon .", "lint": "tslint --config ../tslint.json --project .", "start": "node dist/index.js", - "test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/worker-service.xml --exit" + "test": "mocha tests/**/*.test.mjs --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/worker-service.xml --exit" }, "type": "module", "types": "dist/index.d.ts", - "version": "2.23.1", - "resolutions": { - "@types/mime": "3.0.4" - } + "version": "2.24.0" } diff --git a/worker-service/src/api/helpers/fireblocks-helper.ts b/worker-service/src/api/helpers/fireblocks-helper.ts new file mode 100644 index 0000000000..15b3a3aaa5 --- /dev/null +++ b/worker-service/src/api/helpers/fireblocks-helper.ts @@ -0,0 +1,53 @@ +import { FireblocksSDK, PeerType, TransactionOperation, TransactionResponse, TransactionStatus } from 'fireblocks-sdk' + +export class FireblocksHelper{ + + private readonly client: FireblocksSDK; + + constructor( + private readonly apiKey: string, + private readonly privateKey: string, + private readonly vaultId: string, + private readonly assetId: string, + ) { + const baseUrl = process.env.FIREBLOCKS_BASEURL || 'https://api.fireblocks.io'; + this.client = new FireblocksSDK(this.privateKey, this.apiKey, baseUrl) + } + + async createTransaction(message: Uint8Array) { + try { + const transaction = await this.client.createTransaction({ + operation: TransactionOperation.RAW, + source: {type: PeerType.VAULT_ACCOUNT, id: this.vaultId}, + assetId: this.assetId, + extraParameters: {rawMessageData: {messages: [{content: Buffer.from(message).toString('hex')}]}} + }); + return await this.getTransactionResult(transaction.id); + } catch (e) { + console.log(e); + } + } + + private async delay(time: number): Promise { + return new Promise((resolve: any) => setTimeout(resolve, time)); + } + + private async getTransactionResult(transactionId: string): Promise { + const txInfo = await this.client.getTransactionById(transactionId); + if ([ + TransactionStatus.CANCELLED, + TransactionStatus.FAILED, + TransactionStatus.BLOCKED, + TransactionStatus.REJECTED, + ].includes(txInfo.status)) { + throw new Error(`Fireblocks transaction "${transactionId}" failed with status ${txInfo.status}`); + } + if (txInfo.status === TransactionStatus.COMPLETED) { + return txInfo; + } else { + await this.delay(3000); + return this.getTransactionResult(transactionId); + } + + } +} diff --git a/worker-service/src/api/helpers/hedera-sdk-helper.ts b/worker-service/src/api/helpers/hedera-sdk-helper.ts index 1178edc577..a8f0b357e6 100644 --- a/worker-service/src/api/helpers/hedera-sdk-helper.ts +++ b/worker-service/src/api/helpers/hedera-sdk-helper.ts @@ -17,6 +17,7 @@ import { Hbar, HbarUnit, PrivateKey, + PublicKey, Status, Timestamp, TokenAssociateTransaction, @@ -43,13 +44,14 @@ import { TransactionRecordQuery, TransferTransaction } from '@hashgraph/sdk'; -import { HederaUtils, timeout } from './utils'; +import { HederaUtils, timeout } from './utils.js'; import axios, { AxiosResponse } from 'axios'; -import { Environment } from './environment'; -import { ContractParamType, GenerateUUIDv4, HederaResponseCode } from '@guardian/interfaces'; +import { Environment } from './environment.js'; +import { ContractParamType, FireblocksCreds, GenerateUUIDv4, HederaResponseCode, ISignOptions, SignType } from '@guardian/interfaces'; import Long from 'long'; -import { TransactionLogger } from './transaction-logger'; +import { TransactionLogger } from './transaction-logger.js'; import process from 'process'; +import { FireblocksHelper } from './fireblocks-helper'; export const MAX_FEE = Math.abs(+process.env.MAX_TRANSACTION_FEE) || 30; export const INITIAL_BALANCE = 30; @@ -891,6 +893,7 @@ export class HederaSDKHelper { * * @param privateKey * @param transactionMemo + * @param signOptions * @returns Message timestamp */ @timeout(HederaSDKHelper.MAX_TIMEOUT, 'Topic message submit transaction timeout exceeded') @@ -898,7 +901,8 @@ export class HederaSDKHelper { topicId: string | TopicId, message: string, privateKey?: string | PrivateKey, - transactionMemo?: string + transactionMemo?: string, + signOptions?: ISignOptions ): Promise { const client = this.client; @@ -913,10 +917,57 @@ export class HederaSDKHelper { messageTransaction = messageTransaction.setTransactionMemo(transactionMemo.substring(0, 100)); } + let signType = SignType.INTERNAL; + if (signOptions?.signType) { + signType = signOptions.signType; + } + if (privateKey) { - messageTransaction = messageTransaction.freezeWith(client); - messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey)); + switch (signType) { + case SignType.FIREBLOCKS: { + const signData = (signOptions as any).data as FireblocksCreds; + + const fireblocksClient = new FireblocksHelper( + signData.apiKey, + signData.privateKey, + signData.vaultId, + signData.assetId, + ); + const accountIds = Object.values(this.client.network) as AccountId[]; + messageTransaction.setNodeAccountIds([accountIds[0]]); + messageTransaction = messageTransaction.freezeWith(client); + messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey)); + const tx = await fireblocksClient.createTransaction(messageTransaction.toBytes()); + + if (!tx || !Array.isArray(tx.signedMessages)) { + throw new Error(`Fireblocks signing failed`); + } + + const signedMessage = tx.signedMessages[0]; + if (signedMessage) { + const pubKey = PublicKey.fromStringED25519(signedMessage.publicKey); + const signature = Buffer.from(signedMessage.signature.fullSig, 'hex'); + try { + messageTransaction.addSignature(pubKey, signature); + } catch (error) { + throw new Error(error); + } + } + break; + } + + case SignType.INTERNAL: { + messageTransaction = messageTransaction.freezeWith(client); + messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey)); + break; + } + + default: + messageTransaction = messageTransaction.freezeWith(client); + messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey)); + } } + const rec = await this.executeAndRecord(client, messageTransaction, 'TopicMessageSubmitTransaction'); const seconds = rec.consensusTimestamp.seconds.toString(); const nanos = rec.consensusTimestamp.nanos.toString(); diff --git a/worker-service/src/api/worker.ts b/worker-service/src/api/worker.ts index 97959024f4..9b1e70353d 100644 --- a/worker-service/src/api/worker.ts +++ b/worker-service/src/api/worker.ts @@ -1,9 +1,9 @@ import { Logger, MessageBrokerChannel, MessageResponse, NatsService, NotificationHelper, SecretManager, Users, } from '@guardian/common'; -import { ExternalMessageEvents, GenerateUUIDv4, ITask, ITaskResult, WorkerEvents, WorkerTaskType } from '@guardian/interfaces'; -import { HederaSDKHelper, NetworkOptions } from './helpers/hedera-sdk-helper'; -import { IpfsClientClass } from './ipfs-client-class'; +import { ExternalMessageEvents, GenerateUUIDv4, ISignOptions, ITask, ITaskResult, WorkerEvents, WorkerTaskType } from '@guardian/interfaces'; +import { HederaSDKHelper, NetworkOptions } from './helpers/hedera-sdk-helper.js'; +import { IpfsClientClass } from './ipfs-client-class.js'; import { AccountId, ContractFunctionParameters, ContractId, PrivateKey, TokenId } from '@hashgraph/sdk'; -import { HederaUtils } from './helpers/utils'; +import { HederaUtils } from './helpers/utils.js'; import axios from 'axios'; import process from 'process'; @@ -333,9 +333,10 @@ export class Worker extends NatsService { case WorkerTaskType.SEND_HEDERA: { const { operatorId, operatorKey, dryRun } = task.data.clientOptions; + const signOptions: ISignOptions = task.data.signOptions; client = new HederaSDKHelper(operatorId, operatorKey, dryRun, networkOptions); const { topicId, buffer, submitKey, memo } = task.data; - result.data = await client.submitMessage(topicId, buffer, submitKey, memo); + result.data = await client.submitMessage(topicId, buffer, submitKey, memo, signOptions); break; } diff --git a/worker-service/src/app.ts b/worker-service/src/app.ts index aeae346166..d61e16c090 100644 --- a/worker-service/src/app.ts +++ b/worker-service/src/app.ts @@ -1,6 +1,6 @@ import { ApplicationState, LargePayloadContainer, Logger, MessageBrokerChannel, NotificationService, OldSecretManager, SecretManager, Users, ValidateConfiguration } from '@guardian/common'; -import { Worker } from './api/worker'; -import { HederaSDKHelper } from './api/helpers/hedera-sdk-helper'; +import { Worker } from './api/worker.js'; +import { HederaSDKHelper } from './api/helpers/hedera-sdk-helper.js'; import { ApplicationStates, GenerateUUIDv4 } from '@guardian/interfaces'; import * as process from 'process'; import { Module } from '@nestjs/common'; diff --git a/worker-service/src/index.ts b/worker-service/src/index.ts index 11b146661a..dae6021377 100644 --- a/worker-service/src/index.ts +++ b/worker-service/src/index.ts @@ -1,2 +1,2 @@ -import './config'; -import './app'; +import './config.js'; +import './app.js'; diff --git a/worker-service/tests/ipfs-client.test.js b/worker-service/tests/ipfs-client.test.mjs similarity index 87% rename from worker-service/tests/ipfs-client.test.js rename to worker-service/tests/ipfs-client.test.mjs index 87b7fbf274..2d8a0dc459 100644 --- a/worker-service/tests/ipfs-client.test.js +++ b/worker-service/tests/ipfs-client.test.mjs @@ -1,12 +1,13 @@ -const dotenv = require('dotenv'); -const path = require('path'); +import { Blob } from 'node:buffer'; +import { describe, before, it } from 'node:test'; -dotenv.config({ path: path.resolve(__dirname, `../../configs/.env.${process.env.TEST_ENV}.guardian.system`) }); +import { assert } from 'chai'; +import dotenv from 'dotenv'; +import path from 'path'; + +import { IpfsClient } from '../dist/api/ipfs-client.js'; -const { IpfsClient } = require('../dist/api/ipfs-client'); -const { assert } = require('chai'); -const { Blob } = require("node:buffer"); -const { describe, before, it} = require("node:test"); +dotenv.config({ path: path.resolve(__dirname, `../../configs/.env.${process.env.TEST_ENV}.guardian.system`) }); /** * This test suite enables the testing and implementation of new IPFS clients. diff --git a/worker-service/tests/network-tests/hedera-sdk-helper.test.js b/worker-service/tests/network-tests/hedera-sdk-helper.test.mjs similarity index 98% rename from worker-service/tests/network-tests/hedera-sdk-helper.test.js rename to worker-service/tests/network-tests/hedera-sdk-helper.test.mjs index 2359693002..53b954c7d5 100644 --- a/worker-service/tests/network-tests/hedera-sdk-helper.test.js +++ b/worker-service/tests/network-tests/hedera-sdk-helper.test.mjs @@ -1,10 +1,10 @@ +import { assert } from 'chai'; import dotenv from 'dotenv'; -import {HederaSDKHelper} from '../../dist/api/helpers/hedera-sdk-helper.js' -import {HederaUtils} from '../../dist/api/helpers/utils.js'; -import {assert} from 'chai'; -dotenv.config(); +import { HederaSDKHelper } from '../../dist/api/helpers/hedera-sdk-helper.js'; +import { HederaUtils } from '../../dist/api/helpers/utils.js'; +dotenv.config(); async function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); diff --git a/worker-service/tsconfig.json b/worker-service/tsconfig.json index 6e0ea92f21..a4f3088515 100644 --- a/worker-service/tsconfig.json +++ b/worker-service/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "esnext", - "target": "esnext", + "module": "ESNext", + "target": "es2022", "lib": [ "esnext" ], @@ -27,4 +27,4 @@ "resolveFullPaths": true, "verbose": false } -} \ No newline at end of file +} diff --git a/worker-service/tsconfig.production.json b/worker-service/tsconfig.production.json index 2283edd4d5..bc28eaee1a 100644 --- a/worker-service/tsconfig.production.json +++ b/worker-service/tsconfig.production.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "esnext", - "target": "esnext", + "module": "ESNext", + "target": "es2022", "lib": [ "esnext" ], diff --git a/yarn.lock b/yarn.lock index 8dac5d91d7..37232f1d23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1033,7 +1033,7 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== @@ -1329,6 +1329,11 @@ dependencies: browser-headers "^0.4.1" +"@ioredis/commands@^1.1.1": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" + integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg== + "@ipld/car@^3.0.1", "@ipld/car@^3.2.3": version "3.2.4" resolved "https://registry.yarnpkg.com/@ipld/car/-/car-3.2.4.tgz#115951ba2255ec51d865773a074e422c169fb01c" @@ -1574,44 +1579,48 @@ node-forge "0.10.0" yaml "^1.6.0" -"@mikro-orm/core@5.7.12": - version "5.7.12" - resolved "https://registry.yarnpkg.com/@mikro-orm/core/-/core-5.7.12.tgz#245a307faa781c38ea0b0d3f0e28c453c3d7bbaa" - integrity sha512-bd9M4zCzdUGjM2uDGVZmo2ENqa/slzSxOk4knS/LUeAVGgLizidRIT9A41lObILCT1giaVV70n1PhxNSrHe8sA== +"@mikro-orm/core@^6.1.11": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@mikro-orm/core/-/core-6.2.1.tgz#5ad75bb9ec7a955355396cbb44633d93aa092a93" + integrity sha512-qx7Tqm95Mmni/9Rfe7rNttHPkTLPltDQzAFGsd6V3R1HVlnwDsBKkNT0mChZ6nSgJvtwDLH0C0YUttn+IRrhPA== dependencies: - acorn-loose "8.3.0" - acorn-walk "8.2.0" - dotenv "16.1.4" - fs-extra "11.1.1" + dataloader "2.2.2" + dotenv "16.4.5" + esprima "4.0.1" + fs-extra "11.2.0" globby "11.1.0" - mikro-orm "~5.7.12" - reflect-metadata "0.1.13" + mikro-orm "6.2.1" + reflect-metadata "0.2.2" -"@mikro-orm/migrations-mongodb@5.7.12": - version "5.7.12" - resolved "https://registry.yarnpkg.com/@mikro-orm/migrations-mongodb/-/migrations-mongodb-5.7.12.tgz#0801117b1e27e825710f9ffe2284c09c49bbe7c3" - integrity sha512-9ORpa/W0vdP2jPGh4J3xlSIRBYV+pzkEb9rj7NK+DfM5BaOvcWfBY7oZE/ShvZvCuwH7AWt7al0aJH+OqKWBYw== +"@mikro-orm/migrations-mongodb@^6.1.11": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@mikro-orm/migrations-mongodb/-/migrations-mongodb-6.2.1.tgz#2c331382397e17e1601309dfc14482f93478052e" + integrity sha512-zqeYo7p/nbLd0QJ1edxK3cEb1hbZciUlOZ3owHybiFVYD96CsfXgzjYLc1C1npbe1uYfFB9iOOQ/7yEiHuwchg== dependencies: - "@mikro-orm/mongodb" "~5.7.12" - fs-extra "11.1.1" - mongodb "5.6.0" - umzug "3.2.1" + "@mikro-orm/mongodb" "6.2.1" + fs-extra "11.2.0" + mongodb "6.5.0" + umzug "3.8.0" -"@mikro-orm/mongodb@5.7.12": - version "5.7.12" - resolved "https://registry.yarnpkg.com/@mikro-orm/mongodb/-/mongodb-5.7.12.tgz#a633ca576c4fe2ecfbf1274dd472f8113e1dce53" - integrity sha512-Xm2xYQaA5bkx0WJFO7OEc9VTC7Wjkq5Jqbfzi3AFlehL+ZTG3M1qgAPp9RVj3Z/UtLY0201ZHopGgui+aRQwSA== +"@mikro-orm/mongodb@6.2.1", "@mikro-orm/mongodb@^6.1.11": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@mikro-orm/mongodb/-/mongodb-6.2.1.tgz#62354bc5ba757341325e0be2ed942139e9017799" + integrity sha512-9rVDPmUh2jNlZKs2Pp7V+YOA4FISioEi+EvWFYVExbVuMWO67+iO/E6iWZZtWL/dkR4kwTKrfSOI6eckZmN6xw== dependencies: - bson "^5.3.0" - mongodb "5.6.0" + bson "^6.4.0" + mongodb "6.5.0" -"@mikro-orm/mongodb@~5.7.12": - version "5.7.14" - resolved "https://registry.yarnpkg.com/@mikro-orm/mongodb/-/mongodb-5.7.14.tgz#de8ede9819325b8eac81c645cd6008bad21e6902" - integrity sha512-5G4rI7kgZ8pcsGkt9t3s1Ecf36gTG4J/wH2jCZmHtOnAJngVe+6CSSqLUwo4kOmxTtQwTREoK7hjir098FO+Cw== +"@mongodb-js/saslprep@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz#0c48a96c8d799e81fae311b7251aa5c1dc7c6e95" + integrity sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA== dependencies: - bson "^5.4.0" - mongodb "5.7.0" + sparse-bitfield "^3.0.3" + +"@multiformats/base-x@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" + integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== "@multiformats/multiaddr-to-uri@^9.0.1": version "9.0.8" @@ -1732,6 +1741,13 @@ dependencies: "@noble/hashes" "1.3.2" +"@noble/curves@^1.1.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/curves@^1.2.0", "@noble/curves@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" @@ -1754,6 +1770,11 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== +"@noble/hashes@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1775,6 +1796,29 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@notabene/pii-sdk@^1.17.0": + version "1.17.0" + resolved "https://registry.yarnpkg.com/@notabene/pii-sdk/-/pii-sdk-1.17.0.tgz#e319fafd7df4148470a9f8920232c5e5f9185bab" + integrity sha512-3fccyWmODK+TK9XS6S7Nitq7tvvJc8ALdzraypkZXly88nWAQkVDkxxQL9a9LScIxLnMSVIQrjw2n52UopmfKQ== + dependencies: + "@ethersproject/bytes" "5.7.0" + "@noble/curves" "^1.1.0" + "@stablelib/ed25519" "1.0.3" + axios "^1.6.0" + axios-oauth-client "^1.5.0" + axios-token-interceptor "^0.2.0" + base64url "3.0.1" + bs58 "5.0.0" + debug "^4.3.4" + did-jwt "6.11.6" + dotenv "^16.0.3" + lodash "^4.17.21" + multibase "4.0.6" + multicodec "3.2.1" + node-fetch "^3.3.1" + tslib "^2.5.0" + uuid "^9.0.0" + "@npmcli/fs@^2.1.0": version "2.1.2" resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-2.1.2.tgz#a9e2541a4a2fec2e69c29b35e6060973da79b865" @@ -2530,7 +2574,7 @@ resolved "https://registry.yarnpkg.com/@stablelib/constant-time/-/constant-time-1.0.1.tgz#bde361465e1cf7b9753061b77e376b0ca4c77e35" integrity sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg== -"@stablelib/ed25519@^1.0.1": +"@stablelib/ed25519@1.0.3", "@stablelib/ed25519@^1.0.1", "@stablelib/ed25519@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/ed25519/-/ed25519-1.0.3.tgz#f8fdeb6f77114897c887bb6a3138d659d3f35996" integrity sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg== @@ -2572,7 +2616,7 @@ "@stablelib/binary" "^1.0.0" "@stablelib/wipe" "^1.0.0" -"@stablelib/random@^1.0.2": +"@stablelib/random@^1.0.1", "@stablelib/random@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@stablelib/random/-/random-1.0.2.tgz#2dece393636489bf7e19c51229dd7900eddf742c" integrity sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w== @@ -2580,6 +2624,15 @@ "@stablelib/binary" "^1.0.1" "@stablelib/wipe" "^1.0.1" +"@stablelib/sha256@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@stablelib/sha256/-/sha256-1.0.1.tgz#77b6675b67f9b0ea081d2e31bda4866297a3ae4f" + integrity sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ== + dependencies: + "@stablelib/binary" "^1.0.1" + "@stablelib/hash" "^1.0.1" + "@stablelib/wipe" "^1.0.1" + "@stablelib/sha512@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/sha512/-/sha512-1.0.1.tgz#6da700c901c2c0ceacbd3ae122a38ac57c72145f" @@ -2594,7 +2647,7 @@ resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== -"@stablelib/x25519@^1.0.0": +"@stablelib/x25519@^1.0.0", "@stablelib/x25519@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/x25519/-/x25519-1.0.3.tgz#13c8174f774ea9f3e5e42213cbf9fc68a3c7b7fd" integrity sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw== @@ -2612,7 +2665,7 @@ "@stablelib/chacha" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/xchacha20poly1305@^1.0.0": +"@stablelib/xchacha20poly1305@^1.0.0", "@stablelib/xchacha20poly1305@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/xchacha20poly1305/-/xchacha20poly1305-1.0.1.tgz#addcaf30b92dd956f76b3357888e2f91b92e7a61" integrity sha512-B1Abj0sMJ8h3HNmGnJ7vHBrAvxuNka6cJJoZ1ILN7iuacXp7sUYcgOVEOTLWj+rtQMpspY9tXSCRLPmN1mQNWg== @@ -3060,11 +3113,16 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.5.tgz#3e0d2db570e9fb6ccb2dc8fde0be1d79ac810d39" integrity sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA== -"@types/mime@*", "@types/mime@3.0.4", "@types/mime@^1": +"@types/mime@*": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.4.tgz#2198ac274de6017b44d941e00261d5bc6a0e0a45" integrity sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw== +"@types/mime@^1": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" + integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== + "@types/minimatch@^3.0.4": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" @@ -3232,12 +3290,11 @@ resolved "https://registry.yarnpkg.com/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz#1306dbfa53768bcbcfc95a1c8cde367975581859" integrity sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA== -"@types/whatwg-url@^8.2.1": - version "8.2.2" - resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-8.2.2.tgz#749d5b3873e845897ada99be4448041d4cc39e63" - integrity sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA== +"@types/whatwg-url@^11.0.2": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-11.0.4.tgz#ffed0dc8d89d91f62e3f368fcbda222a487c4f63" + integrity sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw== dependencies: - "@types/node" "*" "@types/webidl-conversions" "*" "@types/winston@^2.4.4": @@ -3513,18 +3570,6 @@ acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-loose@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/acorn-loose/-/acorn-loose-8.3.0.tgz#0cd62461d21dce4f069785f8d3de136d5525029a" - integrity sha512-75lAs9H19ldmW+fAbyqHdjgdCrz0pWGXKmnqFoh8PyVd1L2RIb4RzYrSjmopeqv3E1G3/Pimu6GgLlrGbrkF7w== - dependencies: - acorn "^8.5.0" - -acorn-walk@8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -3535,7 +3580,7 @@ acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.5.0, acorn@^8.9.0: +acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -4086,6 +4131,13 @@ aws4@^1.12.0, aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== +axios-oauth-client@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/axios-oauth-client/-/axios-oauth-client-1.5.0.tgz#8e5b8aa0c6dd21e9767a96a358ce11c77fe008a3" + integrity sha512-CFuTfK9KdRnDDR6LQlUJ0GNKUZ3tHRSFdKPM9WqeCtUdcuKDgWt9aDFH7Xl87VpUcfNt5qRVl4iHdayqtXVv7g== + dependencies: + qs "^6.10.1" + axios-retry@^3.2.4: version "3.9.1" resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.9.1.tgz#c8924a8781c8e0a2c5244abf773deb7566b3830d" @@ -4094,6 +4146,13 @@ axios-retry@^3.2.4: "@babel/runtime" "^7.15.4" is-retry-allowed "^2.2.0" +axios-token-interceptor@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/axios-token-interceptor/-/axios-token-interceptor-0.2.0.tgz#07e79f01f414c196bc84b07556cc84e02ed676bd" + integrity sha512-la74OEsXBH1IS9yI6p2oTIynPtBzs0PVUSOwOBgFg2kBwTeDqQ+YJ6jaOWxsTYyqJO510OzHTfnzAn3GFuf9xA== + dependencies: + lock "^1.1.0" + axios@^0.26.0: version "0.26.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" @@ -4110,6 +4169,15 @@ axios@^1.3.1, axios@^1.3.6, axios@^1.4.0, axios@^1.6.5: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.6.0: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + b4a@^1.6.4: version "1.6.6" resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.6.tgz#a4cc349a3851987c3c4ac2d7785c18744f6da9ba" @@ -4176,7 +4244,7 @@ base64url-universal@^2.0.0: dependencies: base64url "^3.0.1" -base64url@^3.0.0, base64url@^3.0.1: +base64url@3.0.1, base64url@^3.0.0, base64url@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== @@ -4201,6 +4269,11 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +bech32@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" + integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== + bessel@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/bessel/-/bessel-1.0.2.tgz#828812291e0b62e94959cdea43fac186e8a7202d" @@ -4464,6 +4537,13 @@ bs58@4.0.1, bs58@^4.0.1: dependencies: base-x "^3.0.2" +bs58@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279" + integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== + dependencies: + base-x "^4.0.0" + bson@^4.0.4: version "4.7.2" resolved "https://registry.yarnpkg.com/bson/-/bson-4.7.2.tgz#320f4ad0eaf5312dd9b45dc369cc48945e2a5f2e" @@ -4471,10 +4551,10 @@ bson@^4.0.4: dependencies: buffer "^5.6.0" -bson@^5.3.0, bson@^5.4.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/bson/-/bson-5.5.1.tgz#f5849d405711a7f23acdda9a442375df858e6833" - integrity sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g== +bson@^6.4.0, bson@^6.5.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/bson/-/bson-6.6.0.tgz#f225137eb49fe19bee4d87949a0515c05176e2ad" + integrity sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA== buffer-crc32@^0.2.1, buffer-crc32@^0.2.13: version "0.2.13" @@ -4649,6 +4729,11 @@ canonicalize@^1.0.1: resolved "https://registry.yarnpkg.com/canonicalize/-/canonicalize-1.0.8.tgz#24d1f1a00ed202faafd9bf8e63352cd4450c6df1" integrity sha512-0CNTVCLZggSh7bc5VkX5WWPWO+cyZbNd07IHIsSXLia/eAq+r836hgk+8BKoEh7949Mda87VUOitx5OddVj64A== +canonicalize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/canonicalize/-/canonicalize-2.0.0.tgz#32be2cef4446d67fd5348027a384cae28f17226a" + integrity sha512-ulDEYPv7asdKvqahuAY35c1selLdzDwHqugK92hfkzvlDCwXRRelDkR+Er33md/PtnpqHemgkuDPanZ4fiYZ8w== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -4947,6 +5032,11 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" +cluster-key-slot@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz#88ddaa46906e303b5de30d3153b7d9fe0a0c19ac" + integrity sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA== + cmake-js@^7.2.1: version "7.3.0" resolved "https://registry.yarnpkg.com/cmake-js/-/cmake-js-7.3.0.tgz#6fd6234b7aeec4545c1c806f9e3f7ffacd9798b2" @@ -5345,6 +5435,16 @@ data-uri-to-buffer@^3.0.1: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + +dataloader@2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.2.2.tgz#216dc509b5abe39d43a9b9d97e6e5e473dfbe3e0" + integrity sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g== + date-fns@^2.30.0: version "2.30.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" @@ -5436,7 +5536,7 @@ decimal.js@^10.3.1: resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== -decode-uri-component@^0.2.0: +decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== @@ -5568,6 +5668,11 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== +denque@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" + integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw== + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -5601,6 +5706,29 @@ detect-secrets@^1.0.6: debug "^4.1.0" which "^1.3.1" +did-jwt@6.11.6: + version "6.11.6" + resolved "https://registry.yarnpkg.com/did-jwt/-/did-jwt-6.11.6.tgz#3eeb30d6bd01f33bfa17089574915845802a7d44" + integrity sha512-OfbWknRxJuUqH6Lk0x+H1FsuelGugLbBDEwsoJnicFOntIG/A4y19fn0a8RLxaQbWQ5gXg0yDq5E2huSBiiXzw== + dependencies: + "@stablelib/ed25519" "^1.0.2" + "@stablelib/random" "^1.0.1" + "@stablelib/sha256" "^1.0.1" + "@stablelib/x25519" "^1.0.2" + "@stablelib/xchacha20poly1305" "^1.0.1" + bech32 "^2.0.0" + canonicalize "^2.0.0" + did-resolver "^4.0.0" + elliptic "^6.5.4" + js-sha3 "^0.8.0" + multiformats "^9.6.5" + uint8arrays "^3.0.0" + +did-resolver@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/did-resolver/-/did-resolver-4.1.0.tgz#740852083c4fd5bf9729d528eca5d105aff45eb6" + integrity sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA== + diff@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" @@ -5680,12 +5808,7 @@ dot-prop@^7.2.0: dependencies: type-fest "^2.11.2" -dotenv@16.1.4: - version "16.1.4" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.1.4.tgz#67ac1a10cd9c25f5ba604e4e08bc77c0ebe0ca8c" - integrity sha512-m55RtE8AsPeJBpOIFKihEmqUcoVncQIwo7x9U8ZwLEZw9ZpXboz2c+rvog+jUaJvVrZ5kBOeYQBX5+8Aa/OZQw== - -dotenv@^16.0.0, dotenv@^16.0.1, dotenv@^16.3.1: +dotenv@16.4.5, dotenv@^16.0.0, dotenv@^16.0.1, dotenv@^16.0.3, dotenv@^16.3.1: version "16.4.5" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== @@ -5777,10 +5900,10 @@ elliptic@6.5.4, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emittery@^0.12.1: - version "0.12.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.12.1.tgz#cb9a4a18745816f7a1fa03a8953e7eaededb45f2" - integrity sha512-pYyW59MIZo0HxPFf+Vb3+gacUu0gxVS3TZwB2ClwkEZywgF9f9OJDoVmNLojTn0vKX3tO9LC+pdQEcLP4Oz/bQ== +emittery@^0.13.0: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" @@ -6120,7 +6243,7 @@ espree@^9.0.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" -esprima@^4.0.0, esprima@^4.0.1: +esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -6430,7 +6553,7 @@ fast-fifo@^1.0.0, fast-fifo@^1.1.0, fast-fifo@^1.2.0: resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.2.9: +fast-glob@^3.2.9, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -6502,6 +6625,14 @@ fetch-blob@^2.1.1, fetch-blob@^2.1.2: resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-2.1.2.tgz#a7805db1361bd44c1ef62bb57fb5fe8ea173ef3c" integrity sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow== +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -6538,6 +6669,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== + finalhandler@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -6613,6 +6749,19 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" +fireblocks-sdk@^5.20.0: + version "5.25.1" + resolved "https://registry.yarnpkg.com/fireblocks-sdk/-/fireblocks-sdk-5.25.1.tgz#fd54283581ab477f7259838c1d9952efd43f234c" + integrity sha512-bPs8LZ7bQD9XeLpmsofgxNllWnJbjxTzq2VX2+G4JkZRhPGR9s1WeqDvDIkw9BkZnsveeOkHRp4pg7SyMSs54A== + dependencies: + "@notabene/pii-sdk" "^1.17.0" + axios "^1.6.0" + jsonwebtoken "9.0.0" + platform "^1.3.6" + qs "^6.11.0" + query-string "^7.1.3" + uuid "^8.3.2" + flagged-respawn@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" @@ -6655,6 +6804,11 @@ follow-redirects@^1.14.8, follow-redirects@^1.15.4: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -6715,6 +6869,13 @@ formdata-node@^4.3.2: node-domexception "1.0.0" web-streams-polyfill "4.0.0-beta.3" +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -6747,10 +6908,10 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" - integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== +fs-extra@11.2.0, fs-extra@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -6765,15 +6926,6 @@ fs-extra@^10.0.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" - integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@~7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -6783,14 +6935,6 @@ fs-extra@~7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-jetpack@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/fs-jetpack/-/fs-jetpack-4.3.1.tgz#cdfd4b64e6bfdec7c7dc55c76b39efaa7853bb20" - integrity sha512-dbeOK84F6BiQzk2yqqCVwCPWTxAvVGJ3fMQc6E2wuEohS28mR6yHngbrKuVCK1KHRx/ccByDylqu4H5PCP2urQ== - dependencies: - minimatch "^3.0.2" - rimraf "^2.6.3" - fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -7109,7 +7253,7 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.0.0, glob@^8.0.1, glob@^8.0.3: +glob@^8.0.0, glob@^8.0.1: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -7764,6 +7908,21 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ== +ioredis@^5.3.2: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.4.1.tgz#1c56b70b759f01465913887375ed809134296f40" + integrity sha512-2YZsvl7jopIa1gaePkeMtd9rAcSjOOjPtpcLlOeusyO+XH2SK5ZcT+UCrElPP+WVIInh2TzeI4XW9ENaSLVVHA== + dependencies: + "@ioredis/commands" "^1.1.1" + cluster-key-slot "^1.1.0" + debug "^4.3.4" + denque "^2.1.0" + lodash.defaults "^4.2.0" + lodash.isarguments "^3.1.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" + standard-as-callback "^2.1.0" + ip-address@^9.0.5: version "9.0.5" resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" @@ -8601,7 +8760,7 @@ js-base64@^3.6.1, js-base64@^3.7.4: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== -js-sha3@0.8.0: +js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== @@ -8798,6 +8957,16 @@ jsonpointer@^5.0.1: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== +jsonwebtoken@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" + integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== + dependencies: + jws "^3.2.2" + lodash "^4.17.21" + ms "^2.1.1" + semver "^7.3.8" + jsonwebtoken@9.0.2, jsonwebtoken@^9.0.0: version "9.0.2" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" @@ -9121,6 +9290,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lock@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/lock/-/lock-1.1.0.tgz#53157499d1653b136ca66451071fca615703fa55" + integrity sha512-NZQIJJL5Rb9lMJ0Yl1JoVr9GSdo4HTPsUEWsSFzB8dE8DSoiLCVavWZPi7Rnlv/o73u6I24S/XYc/NmG4l8EKA== + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -9161,6 +9335,11 @@ lodash.includes@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== +lodash.isarguments@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg== + lodash.isboolean@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" @@ -9562,10 +9741,10 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -mikro-orm@~5.7.12: - version "5.7.14" - resolved "https://registry.yarnpkg.com/mikro-orm/-/mikro-orm-5.7.14.tgz#040f40b4e0c28966469d5ad42d93fdbd91ffc04c" - integrity sha512-izfG8Cz5aYGYhxaNNv1Ozc1LAC/ifIsniwDrTWbxHVJkMlWLKAM8FzJhoZpXZzBissZqeRN9tPdzvBCxwV4G0w== +mikro-orm@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/mikro-orm/-/mikro-orm-6.2.1.tgz#14088a75edaed1dd11042ed5cca9505ddb8aa27e" + integrity sha512-px/9uOzKoRmxDO150WOFndV1m6chjRc1UahM8Zhq8f/DnJ80qbVIhH9BKICu04A9l96SxVIL7AG94plFr8ZByg== mime-db@1.52.0: version "1.52.0" @@ -9830,35 +10009,22 @@ moment@^2.29.1, moment@^2.29.2: resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== -mongodb-connection-string-url@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz#57901bf352372abdde812c81be47b75c6b2ec5cf" - integrity sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ== - dependencies: - "@types/whatwg-url" "^8.2.1" - whatwg-url "^11.0.0" - -mongodb@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.6.0.tgz#caff5278341bfc0f1ef6f394bb403d207de03d1e" - integrity sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ== +mongodb-connection-string-url@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz#b4f87f92fd8593f3b9365f592515a06d304a1e9c" + integrity sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ== dependencies: - bson "^5.3.0" - mongodb-connection-string-url "^2.6.0" - socks "^2.7.1" - optionalDependencies: - saslprep "^1.0.3" + "@types/whatwg-url" "^11.0.2" + whatwg-url "^13.0.0" -mongodb@5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.7.0.tgz#e16d2fcdfd9f8503ec2d88288392dc3235bb3ecc" - integrity sha512-zm82Bq33QbqtxDf58fLWBwTjARK3NSvKYjyz997KSy6hpat0prjeX/kxjbPVyZY60XYPDNETaHkHJI2UCzSLuw== +mongodb@6.5.0, mongodb@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.5.0.tgz#3735b4fba085b26ca06f7744e9639bc538e93d87" + integrity sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA== dependencies: - bson "^5.4.0" - mongodb-connection-string-url "^2.6.0" - socks "^2.7.1" - optionalDependencies: - saslprep "^1.0.3" + "@mongodb-js/saslprep" "^1.1.5" + bson "^6.4.0" + mongodb-connection-string-url "^3.0.0" move-file@^2.1.0: version "2.1.0" @@ -9914,6 +10080,21 @@ multiaddr@^10.0.0: uint8arrays "^3.0.0" varint "^6.0.0" +multibase@4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-4.0.6.tgz#6e624341483d6123ca1ede956208cb821b440559" + integrity sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ== + dependencies: + "@multiformats/base-x" "^4.0.1" + +multicodec@3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-3.2.1.tgz#82de3254a0fb163a107c1aab324f2a91ef51efb2" + integrity sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw== + dependencies: + uint8arrays "^3.0.0" + varint "^6.0.0" + multiformats@^11.0.0, multiformats@^11.0.1, multiformats@^11.0.2: version "11.0.2" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-11.0.2.tgz#b14735efc42cd8581e73895e66bebb9752151b60" @@ -9929,7 +10110,7 @@ multiformats@^13.0.0, multiformats@^13.0.1, multiformats@^13.1.0: resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.1.0.tgz#5aa9d2175108a448fc3bdb54ba8a3d0b6cab3ac3" integrity sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ== -multiformats@^9.0.4, multiformats@^9.4.13, multiformats@^9.4.2, multiformats@^9.4.5, multiformats@^9.4.7, multiformats@^9.5.4, multiformats@^9.6.3, multiformats@^9.6.4: +multiformats@^9.0.4, multiformats@^9.4.13, multiformats@^9.4.2, multiformats@^9.4.5, multiformats@^9.4.7, multiformats@^9.5.4, multiformats@^9.6.3, multiformats@^9.6.4, multiformats@^9.6.5: version "9.9.0" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== @@ -10121,7 +10302,7 @@ node-api-headers@^1.1.0: resolved "https://registry.yarnpkg.com/node-api-headers/-/node-api-headers-1.1.0.tgz#3f9dd7bb10b29e1c3e3db675979605a308b2373c" integrity sha512-ucQW+SbYCUPfprvmzBsnjT034IGRB2XK8rRc78BgjNKhTdFKgAwAmgW704bKIBmcYW48it0Gkjpkd39Azrwquw== -node-domexception@1.0.0: +node-domexception@1.0.0, node-domexception@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== @@ -10141,6 +10322,15 @@ node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.8, node-fetch@^2.6.9: dependencies: whatwg-url "^5.0.0" +node-fetch@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + node-forge@0.10.0, node-forge@^0.10.0, node-forge@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" @@ -10991,6 +11181,11 @@ pkginfo@^0.4.1: resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" integrity sha512-8xCNE/aT/EXKenuMDZ+xTVwkT8gsoHN2z/Q29l80u0ppGEXVvsKRzNMbtKhg8LS8k1tJLAHHylf6p4VFmP6XUQ== +platform@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" + integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== + plimit-lit@^1.2.6: version "1.6.1" resolved "https://registry.yarnpkg.com/plimit-lit/-/plimit-lit-1.6.1.tgz#a34594671b31ee8e93c72d505dfb6852eb72374a" @@ -11019,10 +11214,10 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" -pony-cause@^2.1.2: - version "2.1.10" - resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.10.tgz#828457ad6f13be401a075dbf14107a9057945174" - integrity sha512-3IKLNXclQgkU++2fSi93sQ6BznFuxSLB11HdvZQ6JW/spahf/P1pAHBQEahr20rs0htZW0UDkM1HmA+nZkXKsw== +pony-cause@^2.1.4: + version "2.1.11" + resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" + integrity sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg== posix-character-classes@^0.1.0: version "0.1.1" @@ -11321,7 +11516,7 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== @@ -11345,11 +11540,28 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" +qs@^6.10.1, qs@^6.11.0: + version "6.12.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a" + integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ== + dependencies: + side-channel "^1.0.6" + qs@~6.5.2, qs@~6.5.3: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== +query-string@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" + integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg== + dependencies: + decode-uri-component "^0.2.2" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + querystring@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" @@ -11612,15 +11824,27 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w== + +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A== + dependencies: + redis-errors "^1.0.0" + reduce-flatten@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== -reflect-metadata@0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" - integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +reflect-metadata@0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.2.2.tgz#400c845b6cba87a21f2c65c4aeb158f4fa4d9c5b" + integrity sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q== reflect-metadata@^0.1.13: version "0.1.14" @@ -11888,7 +12112,7 @@ rfc4648@1.5.2: resolved "https://registry.yarnpkg.com/rfc4648/-/rfc4648-1.5.2.tgz#cf5dac417dd83e7f4debf52e3797a723c1373383" integrity sha512-tLOizhR6YGovrEBLatX1sdcuhoSCXddw3mqNVAcKxGJ+J0hFeJ+SjeWCv5UPA/WU3YzWPPuCVYgXBKZUPGpKtg== -rimraf@2, rimraf@^2.6.3: +rimraf@2: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -11979,13 +12203,6 @@ safe-stable-stringify@^2.3.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -saslprep@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" - integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== - dependencies: - sparse-bitfield "^3.0.3" - saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" @@ -12198,6 +12415,16 @@ side-channel@^1.0.4: get-intrinsic "^1.2.4" object-inspect "^1.13.1" +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -12326,7 +12553,7 @@ socks-proxy-agent@^7.0.0: debug "^4.3.3" socks "^2.6.2" -socks@^2.6.2, socks@^2.7.1: +socks@^2.6.2: version "2.7.3" resolved "https://registry.yarnpkg.com/socks/-/socks-2.7.3.tgz#7d8a75d7ce845c0a96f710917174dba0d543a785" integrity sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw== @@ -12448,6 +12675,11 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz#887da8aa73218e51a1d917502d79863161a93f9c" integrity sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg== +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -12497,6 +12729,11 @@ stack-trace@0.0.10, stack-trace@0.0.x: resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg== +standard-as-callback@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" + integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -12579,6 +12816,11 @@ streamx@^2.15.0: optionalDependencies: bare-events "^2.2.0" +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== + string-argv@~0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" @@ -13022,12 +13264,12 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" -tr46@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" - integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== +tr46@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" + integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== dependencies: - punycode "^2.1.1" + punycode "^2.3.0" tr46@~0.0.3: version "0.0.3" @@ -13188,11 +13430,16 @@ type-fest@^0.8.0, type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^2.11.2, type-fest@^2.18.0, type-fest@^2.19.0: +type-fest@^2.11.2, type-fest@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== +type-fest@^4.0.0: + version "4.15.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.15.0.tgz#21da206b89c15774cc718c4f2d693e13a1a14a43" + integrity sha512-tB9lu0pQpX5KJq54g+oHOLumOx+pMep4RaM6liXh2PKmVRFF+/vAtUP0ZaJ0kOySfVNjF6doBWPHhBhISKdlIA== + type-fest@^4.9.0: version "4.10.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.10.3.tgz#ff01cb0a1209f59583d61e1312de9715e7ea4874" @@ -13343,17 +13590,16 @@ uint8arrays@^5.0.0, uint8arrays@^5.0.1, uint8arrays@^5.0.2: dependencies: multiformats "^13.0.0" -umzug@3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/umzug/-/umzug-3.2.1.tgz#01c3a109efb037a10a317d4191be22810c37b195" - integrity sha512-XyWQowvP9CKZycKc/Zg9SYWrAWX/gJCE799AUTFqk8yC3tp44K1xWr3LoFF0MNEjClKOo1suCr5ASnoy+KltdA== +umzug@3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/umzug/-/umzug-3.8.0.tgz#dfe2d753141f155f30106b2b893e355fed0c645f" + integrity sha512-FRBvdZxllW3eUzsqG3CIfgOVChUONrKNZozNOJfvmcfBn5pMKcJjICuMMEsDLHYa/aqd7a2NtXfYEG86XHe1lQ== dependencies: "@rushstack/ts-command-line" "^4.12.2" - emittery "^0.12.1" - fs-jetpack "^4.3.1" - glob "^8.0.3" - pony-cause "^2.1.2" - type-fest "^2.18.0" + emittery "^0.13.0" + fast-glob "^3.3.2" + pony-cause "^2.1.4" + type-fest "^4.0.0" unbox-primitive@^1.0.2: version "1.0.2" @@ -13733,12 +13979,12 @@ webidl-conversions@^7.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -whatwg-url@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" - integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== +whatwg-url@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-13.0.0.tgz#b7b536aca48306394a34e44bda8e99f332410f8f" + integrity sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig== dependencies: - tr46 "^3.0.0" + tr46 "^4.1.1" webidl-conversions "^7.0.0" whatwg-url@^5.0.0: