Skip to content

Commit

Permalink
Merging Develop into Main for the 2.24.0 release (#3600)
Browse files Browse the repository at this point in the history
* remove console log

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added displaying transfer token

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix error handling in mint block

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix notification reciever

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix notifications clicking

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added retry interval

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* change name for env variable

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix timeout error

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix resolving nft mint transactions

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix multi policy mint

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* change notification order

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added check for amount

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* update setting env variables

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix transactions serials amount

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix mint errors

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix typo [skip ci]

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix transfer amount

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added irec 4 retry mint policy [skip ci]

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix Nobinding schema error
disable creation of schema without policy binded

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* enable creation of schema without policy binded

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* disable policy dropdown for editing schemas

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix image upload bug

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix image upload bug

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* load images into database in dryRun mode

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* remove console.log

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* GITBOOK-134: Added PWRM0002 Demo guide

* GITBOOK-135: 3311 ticket changes updated

* Create Readme.md of PWRM0002

* Update timestamps of Tool 13, 14 16

* Create readme.md of Hackathon

* Add files via upload

* fix file upload issue
fix clear dry run files

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* apply only image upload

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* feat: contarization redis cache service

* fix draft schemas in wisard

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix amount

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* use global common and interfaces modules

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* Add files via upload

* bump version

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* increase timeout for import tool

* feat: add esm for api-tests

* feat: move to esm common service

* feat: move to esm worker-service

* feat: move to esm policy and guardian services

* feat: move dev.js to esm

* feat: move to esm modules in gulp files api auth worker guardian policy logger notification

* feat: esm in ecosystem config

* refactor code

* feat: add js extention for imports in ai analytics services

* feat: add extention in application events service

* feat: add extentions for auth service

* feat: add extention guardian

* fix: ai auth analytics application events services

* feat: add extentions for api gateway service

* fix: api-gateway

* :wqfeat: add extention in common service

* fix: common service

* feat: esm for logger service

* fix: configs for target es2022

* feat: esm to policy service

* feat: esm to notification service

* feat: esm for interfaces

* feat: esm for tree viever mrv sender topic viever

* refactor code

* fix: error with id by create update base entityes

* feat: increase vertions of mongodb and microorm for esm

* fix: policy and guardian services on dry run

* fix: lint error unused import in guardian service

* fix: unit tests pre build

* fix: bson vertion for current mongo

* fix: get user undefined for get blocks and post groups

* fix: dirname in mrv sender

* fix: remove inject decorator in all places

* feat: increase bson guardian and policy

* fix: imports inside services

* fix: merge conflicts

* Revert "fix: merge conflicts"

This reverts commit afc2f2f.

* fix: merge conflicts

* fix: extentions and ts config for microservises

* Update README.md

* fix: pass context across super and declare prop

* fix: revert inject decorators across declare

* [skip ci] Add swagger.yaml

* fix: merge develop ai service

* added change tools while importing policy

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added token update endpoint

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* update publishing policies script [skip ci]

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix auth for update token api

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* refactoring

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* update cdm policies [skip ci]

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* added some tests for contracts and flow for irec4

* update status code for tests

* fix bottom margin for tools changing [skip ci]

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* Dockerfiles revised

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* node image replaced with the slim version

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* node version moved to arg

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Dockerfiles has been revamped to reduce the size of the final images

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Added/Modified .dockerignore files

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Optimize caching with "COPY --link"

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Run applications as a non-root user and use init:true for containers

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Yarn cache directory defined as an argument

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Yarn cache fix

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Permissions changes

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* Base node image is changed to alpine

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* GITBOOK-136: Added Filebase docs

* added bad_request const for status code

* added publishing contract file script

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>

* fix: migrate to redict cache store

* Revert "Merge branch 'develop' into feat/move-to-es-modules-develop"

This reverts commit 6da2788, reversing
changes made to 0c8b832.

* Revert "fix: merge with develop"

This reverts commit 0c8b832, reversing
changes made to 0fec16a.

* Revert "Revert "fix: merge with develop""

This reverts commit 5610fa5.

* Revert "Revert "Merge branch 'develop' into feat/move-to-es-modules-develop""

This reverts commit c48aa0f.

* added nfts limit in contracts

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* upd contracts [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* fix script [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* GITBOOK-137: Updated Changing Tools in UI section

* Update readme.md of ML readme

* remove output [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* GITBOOK-139: Added section on how to deploy contracts using your own account

* Update readme.md

* GITBOOK-140: Added Atma Scope 3 policy demo

* GITBOOK-142: Added Dovu MMCM

* update iii.f [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* feat: performance interceptor

* cache-endpoints
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* update policies [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* fix: extentions gulp files in description dockerfiles

* update policies [skip ci]

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* feat: wrap endpoinds in cache

* GITBOOK-143: added ExternalDataBlock details

* feat: use cache with apply decorators

* fix: file name import

* fix: get user only if auth token exist

* feat: add perf hooks in performance interceptor

* fix: add express flag for projects/properties route

* setup user profile
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* sign with fireblocks
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* user fireblocks config
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix serials column

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* remove res where it possible and add res.locals.data

* GITBOOK-144: Added Changing of Tools during Policy import APIs added

* fix fireblocks sign bug
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* add ui validators, add exception
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* temp fix validators
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* GITBOOK-145: Added youtube demo video for PWRM0002

* GITBOOK-146: Updated Guardian Introduction

* fix: remove cache from policies/:policyId/groups

* fix
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* Policy Preview/Import performance optimisations

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* fixed fields parsing for compare

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* parseConditions function improvements

Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>

* fix generate xlsx

Signed-off-by: Stepan Kiryakov <stepan.kiryakov@envisionblockchain.com>

* GITBOOK-147: Made some minor corrections

* test
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* added policy data migration

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* fix

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* fix

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* fix lint

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* remove types/mime resolution
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* Add files via upload

* fix signing
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix linting
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix autocomplete
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* remove singleton from fireblocks-helper.ts
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* fix
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* docs: add instruction for launch cache container in readme file

* bump version
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* GITBOOK-148: Added Live Project Data Migration UI

* GITBOOK-149: Fireblocks Docs added

* added migrating retire pools and dynamic tokens

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* [skip ci] Add swagger.yaml

* fix

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* GITBOOK-150: ACM0001 guide added

* fix lint

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* Update readme.md of ACM0001

* fix

Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>

* GITBOOK-151: Added migration policy data APIs

* hotfix: remove cache for contract routes

* GITBOOK-152: Added redict in Prerequisites

* GITBOOK-153: Added Prerequisites

* GITBOOK-154: Added Token template to migration

---------

Signed-off-by: artembuslaev <artem.buslaev@envisionblockchain.com>
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>
Signed-off-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>
Signed-off-by: Artem Buslaev <artem.buslaev@envisionblockchain.com>
Signed-off-by: Stepan Kiryakov <stepan.kiryakov@envisionblockchain.com>
Co-authored-by: artembuslaev <artem.buslaev@envisionblockchain.com>
Co-authored-by: envision-ci-agent <envision-ci-agent@users.noreply.github.com>
Co-authored-by: prernaa.agarwal <prernaa.agarwal@envisionblockchain.com>
Co-authored-by: Celiant <nikita.nikishin@envisionblockchain.com>
Co-authored-by: Ihar <igor.tsykala@envisionblockchain.com>
Co-authored-by: Andrey (Envision Blockchain) <32775532+anvabr@users.noreply.github.com>
Co-authored-by: Alexander Pyatakov <alex.pyatakov@envisionblockchain.com>
Co-authored-by: Stepan Kiryakov <stepan.kiryakov@envisionblockchain.com>
  • Loading branch information
9 people committed Apr 30, 2024
1 parent 864733c commit f450893
Show file tree
Hide file tree
Showing 1,442 changed files with 65,789 additions and 32,920 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Binary file not shown.
116 changes: 111 additions & 5 deletions Methodology Library/CDM/CDM ACM0001/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- Key Documents & Schemas
- Token (Carbon Emisison Reduction)
- Workflow
- IPFS Timestamp
- Step-by-Step

<!-- /TOC -->
Expand Down Expand Up @@ -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

Binary file not shown.
Binary file not shown.
Binary file modified Methodology Library/CDM/CDM ACM0007/ACM0007.policy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
72 changes: 51 additions & 21 deletions Methodology Library/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions ai-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.dockerignore
.env
.git
.gitignore
.npmrc
dist
Dockerfile
node_modules
npm-debug.log
99 changes: 52 additions & 47 deletions ai-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
14 changes: 6 additions & 8 deletions ai-service/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -32,7 +32,5 @@
"devDependencies": {
"nodemon": "^3.0.1"
},
"resolutions": {
"@types/mime": "3.0.4"
}
"type": "module"
}
11 changes: 5 additions & 6 deletions ai-service/src/ai-manager.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 2 additions & 2 deletions ai-service/src/api/service/ai-suggestions-service.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down

0 comments on commit f450893

Please sign in to comment.