From 2d2061f552f9821467c2fd391978c77d7931c587 Mon Sep 17 00:00:00 2001 From: simvalery Date: Wed, 7 Aug 2024 14:59:45 +0400 Subject: [PATCH 01/12] add sort Signed-off-by: simvalery Signed-off-by: simvalery --- .../policy-engine/blocks/documents-source.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/policy-service/src/policy-engine/blocks/documents-source.ts b/policy-service/src/policy-engine/blocks/documents-source.ts index 8afba08128..e4d947c165 100644 --- a/policy-service/src/policy-engine/blocks/documents-source.ts +++ b/policy-service/src/policy-engine/blocks/documents-source.ts @@ -87,7 +87,7 @@ export class InterfaceDocumentsSource { queryParams = {}; } - const {itemsPerPage, page, size, filterByUUID, ...filterIds} = queryParams; + const {itemsPerPage, page, size, filterByUUID, sortDirection, sortField, ...filterIds} = queryParams; const filterAddons = ref.getFiltersAddons(); const filters = filterAddons.map(addon => { @@ -136,8 +136,15 @@ export class InterfaceDocumentsSource { return addon.blockType === 'historyAddon'; }) as IPolicyAddonBlock; - const enableCommonSorting = ref.options.uiMetaData.enableSorting; - const sortState = this.state[user.id] || {}; + const enableCommonSorting = ref.options.uiMetaData.enableSorting || (sortDirection && sortField); + let sortState = this.state[user.id] || {}; + if (sortDirection && sortField) { + sortState = { + orderDirection: sortDirection, + orderField: sortField + }; + this.state[user.id] = sortState; + } let data: any = enableCommonSorting ? await this.getDataByAggregationFilters(ref, user, sortState, paginationData, history) : await ref.getGlobalSources(user, paginationData); @@ -158,14 +165,14 @@ export class InterfaceDocumentsSource { state.document, history ? history.options.timelineLabelPath || - 'option.status' + 'option.status' : 'option.status' ), comment: ObjGet( state.document, history ? history.options.timelineDescriptionPath || - 'option.comment' + 'option.comment' : 'option.comment' ), created: state.createDate, From 991b729f09e95c2f7fdae9852bf83cf58c023964 Mon Sep 17 00:00:00 2001 From: "prernaa.agarwal" Date: Thu, 8 Aug 2024 01:45:24 +0000 Subject: [PATCH 02/12] GITBOOK-217: Updated roadmap 1 --- docs/guardian/readme/roadmap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guardian/readme/roadmap.md b/docs/guardian/readme/roadmap.md index e0163901ca..4e5afa5272 100644 --- a/docs/guardian/readme/roadmap.md +++ b/docs/guardian/readme/roadmap.md @@ -1,6 +1,6 @@ # 🛣️ Roadmap -
FeatureRelease monthReleased?Release Version
Development of AMS-I.C.: Thermal Energy Production with or Without ElectricityJuly 2024No
Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the WebinarJuly 2024No
Indexer APIJuly 2024No
Filtering data for blocks is stateful API, introduce stateless data filters for API usage.July 2024No
Auto-testing community submitted policiesJuly 2024No
GHG Scorecards ResearchJuly 2024No
Code audit: support and resolution of issuesJuly 2024No
Token action block to work with token templatesAugust 2024No
Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB AtlasAugust 2024No
Default values for schema-defined fieldsAugust 2024No
API versioning and support/deprecation scheduleAugust 2024No
Leverage the pre-built images as the default way to start Guardian locallyAugust 2024No
GS Methodology for Emission Reductions from Safe Drinking Water Supply v.1.0August 2024No
Guardian analytics: insights and top-down data way pointsSeptember 2024No
Rationalize API and UI return error codesSeptember 2024No
On-demand state proof generation for critical Guardian operationsSeptember 2024No
Simplify default SR schema to take out optional propertiesSeptember 2024No
Verra SDVM001 SD Vista Methodology for Time Savings from Improved CookstovesSeptember 2024No
Scope 3/PCF Referencing Demo (Methodology Breakdown)September 2024No
Block configuration (mini-) wizardsOctober 2024No
API facilities to retrieve unique references (IDs) of results for API-triggered operationsOctober 2024No
ACR Methodology for Quantifying, Monitoring, Reporting, and Verifying Greenhouse Gas Emissions Reductions and Removals from Landfill Gas Destruction and Beneficial Use ProjectsOctober 2024No
Guardian analytics: bottom-up data traceabilityNovember 2024No
CDM AMS-III.BM Methodology for Lightweight Two and Three Wheeled Personal TransportationNovember 2024No
Trustchain support for contract-based issuance and retirement implementationDecember 2024No
GS Methodology for Collection of Sargassum and Other Macroalgae to Avoid Emissions from Decomposition and to Use for Beneficial ProductsDecember 2024No
Reviewing and Verifying Atma policyDecember 2024No
Emissions Reduction/Removals (ERRs) Calculation Pre-Calculator in GuardianJanuary 2025No
Formula Driven Definitions & Schema Tree EnhancementJanuary 2025No
Dry-run policy execution 'savepoints' - restart policy dry-run from the list of 'saved' placesJanuary 2025No
Standardize UI on Angular Material, remove/replace PrimeNGJanuary 2025No
Verra Methodology for Enhanced Fleet Vehicle and Combustion Engine Efficiency (Under Final Review)January 2025No
Enhancing Research on Indexer and Analytics Use CasesJanuary 2025No
+
FeatureRelease monthReleased?Release Version
Development of AMS-I.C.: Thermal Energy Production with or Without ElectricityAugust 2024No
Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the WebinarJuly 2024Yes2.27
Indexer APIJuly 2024Yes2.27
Development of VMR0006 : Energy Efficiency and Fuel Switch Measures in Thermal Applications, v1.2vJuly 2024Yes2.27
Filtering data for blocks is stateful API, introduce stateless data filters for API usage.July 2024Yes2.27
Auto-testing community submitted policiesJuly 2024Yes2.27
GHG Scorecards ResearchAugust 2024No
Code audit: support and resolution of issuesAugust 2024No
Token action block to work with token templatesAugust 2024No
Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB AtlasAugust 2024No
Default values for schema-defined fields September 2024No
API versioning and support/deprecation scheduleAugust 2024No
Leverage the pre-built images as the default way to start Guardian locallyAugust 2024No
GS Methodology for Emission Reductions from Safe Drinking Water Supply v.1.0August 2024No
Guardian analytics: insights and top-down data way pointsSeptember 2024No
Rationalize API and UI return error codesSeptember 2024No
On-demand state proof generation for critical Guardian operationsSeptember 2024No
Simplify default SR schema to take out optional propertiesSeptember 2024No
Verra SDVM001 SD Vista Methodology for Time Savings from Improved CookstovesSeptember 2024No
Scope 3/PCF Referencing Demo (Methodology Breakdown)September 2024No
Block configuration (mini-) wizardsOctober 2024No
API facilities to retrieve unique references (IDs) of results for API-triggered operationsOctober 2024No
ACR Methodology for Quantifying, Monitoring, Reporting, and Verifying Greenhouse Gas Emissions Reductions and Removals from Landfill Gas Destruction and Beneficial Use ProjectsOctober 2024No
Guardian analytics: bottom-up data traceabilityNovember 2024No
CDM AMS-III.BM Methodology for Lightweight Two and Three Wheeled Personal TransportationNovember 2024No
Trustchain support for contract-based issuance and retirement implementationDecember 2024No
GS Methodology for Collection of Sargassum and Other Macroalgae to Avoid Emissions from Decomposition and to Use for Beneficial ProductsDecember 2024No
Reviewing and Verifying Atma policyDecember 2024No
Emissions Reduction/Removals (ERRs) Calculation Pre-Calculator in GuardianJanuary 2025No
Formula Driven Definitions & Schema Tree EnhancementJanuary 2025No
Dry-run policy execution 'savepoints' - restart policy dry-run from the list of 'saved' placesJanuary 2025No
Standardize UI on Angular Material, remove/replace PrimeNGJanuary 2025No
Verra Methodology for Enhanced Fleet Vehicle and Combustion Engine Efficiency (Under Final Review)January 2025No
Enhancing Research on Indexer and Analytics Use CasesJanuary 2025No
{% tabs %} {% tab title="Upcoming Releases" %} From 3dbe661100530ffb84e2339dc06e8d091ced510c Mon Sep 17 00:00:00 2001 From: "prernaa.agarwal" Date: Thu, 8 Aug 2024 03:00:04 +0000 Subject: [PATCH 03/12] GITBOOK-218: Updated roadmap 2 --- docs/guardian/readme/roadmap.md | 190 +++++++++++++++++--------------- 1 file changed, 104 insertions(+), 86 deletions(-) diff --git a/docs/guardian/readme/roadmap.md b/docs/guardian/readme/roadmap.md index 4e5afa5272..7a5b5b86ff 100644 --- a/docs/guardian/readme/roadmap.md +++ b/docs/guardian/readme/roadmap.md @@ -1,10 +1,10 @@ # 🛣️ Roadmap -
FeatureRelease monthReleased?Release Version
Development of AMS-I.C.: Thermal Energy Production with or Without ElectricityAugust 2024No
Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the WebinarJuly 2024Yes2.27
Indexer APIJuly 2024Yes2.27
Development of VMR0006 : Energy Efficiency and Fuel Switch Measures in Thermal Applications, v1.2vJuly 2024Yes2.27
Filtering data for blocks is stateful API, introduce stateless data filters for API usage.July 2024Yes2.27
Auto-testing community submitted policiesJuly 2024Yes2.27
GHG Scorecards ResearchAugust 2024No
Code audit: support and resolution of issuesAugust 2024No
Token action block to work with token templatesAugust 2024No
Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB AtlasAugust 2024No
Default values for schema-defined fields September 2024No
API versioning and support/deprecation scheduleAugust 2024No
Leverage the pre-built images as the default way to start Guardian locallyAugust 2024No
GS Methodology for Emission Reductions from Safe Drinking Water Supply v.1.0August 2024No
Guardian analytics: insights and top-down data way pointsSeptember 2024No
Rationalize API and UI return error codesSeptember 2024No
On-demand state proof generation for critical Guardian operationsSeptember 2024No
Simplify default SR schema to take out optional propertiesSeptember 2024No
Verra SDVM001 SD Vista Methodology for Time Savings from Improved CookstovesSeptember 2024No
Scope 3/PCF Referencing Demo (Methodology Breakdown)September 2024No
Block configuration (mini-) wizardsOctober 2024No
API facilities to retrieve unique references (IDs) of results for API-triggered operationsOctober 2024No
ACR Methodology for Quantifying, Monitoring, Reporting, and Verifying Greenhouse Gas Emissions Reductions and Removals from Landfill Gas Destruction and Beneficial Use ProjectsOctober 2024No
Guardian analytics: bottom-up data traceabilityNovember 2024No
CDM AMS-III.BM Methodology for Lightweight Two and Three Wheeled Personal TransportationNovember 2024No
Trustchain support for contract-based issuance and retirement implementationDecember 2024No
GS Methodology for Collection of Sargassum and Other Macroalgae to Avoid Emissions from Decomposition and to Use for Beneficial ProductsDecember 2024No
Reviewing and Verifying Atma policyDecember 2024No
Emissions Reduction/Removals (ERRs) Calculation Pre-Calculator in GuardianJanuary 2025No
Formula Driven Definitions & Schema Tree EnhancementJanuary 2025No
Dry-run policy execution 'savepoints' - restart policy dry-run from the list of 'saved' placesJanuary 2025No
Standardize UI on Angular Material, remove/replace PrimeNGJanuary 2025No
Verra Methodology for Enhanced Fleet Vehicle and Combustion Engine Efficiency (Under Final Review)January 2025No
Enhancing Research on Indexer and Analytics Use CasesJanuary 2025No
+
FeatureRelease monthReleased?Release Version
Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the WebinarJuly 2024Yes2.27
Indexer APIJuly 2024Yes2.27
Development of VMR0006 : Energy Efficiency and Fuel Switch Measures in Thermal Applications, v1.2vJuly 2024Yes2.27
Filtering data for blocks is stateful API, introduce stateless data filters for API usage.July 2024Yes2.27
Auto-testing community submitted policiesJuly 2024Yes2.27
GHG Scorecards ResearchAugust 2024No
Development of AMS-I.C.: Thermal Energy Production with or Without ElectricityAugust 2024No
Code audit: support and resolution of issuesAugust 2024No
Token action block to work with token templatesAugust 2024No
Different token IDs for different projects by the same policyAugust 2024No
Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB AtlasAugust 2024No
Global Carbon Council (GCC) GCCM001: Methodology for Renewable Energy Generation Projects Supplying Electricity to Grid or Captive Consumers – Version 4.0September 2024No
API versioning and support/deprecation scheduleAugust 2024No
Leverage the pre-built images as the default way to start Guardian locallyAugust 2024No
Default values for schema-defined fields September 2024No
Guardian analytics: insights and top-down data way pointsSeptember 2024No
Rationalize API and UI return error codesSeptember 2024No
On-demand state proof generation for critical Guardian operationsSeptember 2024No
Simplify default SR schema to take out optional propertiesSeptember 2024No
Verra SDVM001 SD Vista Methodology for Time Savings from Improved CookstovesSeptember 2024No
Scope 3/PCF Referencing Demo (Methodology Breakdown)September 2024No
Block configuration (mini-) wizardsOctober 2024No
API facilities to retrieve unique references (IDs) of results for API-triggered operationsOctober 2024No
ACR Methodology for Quantifying, Monitoring, Reporting, and Verifying Greenhouse Gas Emissions Reductions and Removals from Landfill Gas Destruction and Beneficial Use ProjectsOctober 2024No
Guardian analytics: bottom-up data traceabilityNovember 2024No
CDM AMS-III.BM Methodology for Lightweight Two and Three Wheeled Personal TransportationNovember 2024No
Trustchain support for contract-based issuance and retirement implementationDecember 2024No
GS Methodology for Collection of Sargassum and Other Macroalgae to Avoid Emissions from Decomposition and to Use for Beneficial ProductsDecember 2024No
Reviewing and Verifying Atma policyDecember 2024No
Emissions Reduction/Removals (ERRs) Calculation Pre-Calculator in GuardianJanuary 2025No
Formula Driven Definitions & Schema Tree EnhancementJanuary 2025No
Dry-run policy execution 'savepoints' - restart policy dry-run from the list of 'saved' placesJanuary 2025No
Standardize UI on Angular Material, remove/replace PrimeNGJanuary 2025No
Verra Methodology for Enhanced Fleet Vehicle and Combustion Engine Efficiency (Under Final Review)January 2025No
Enhancing Research on Indexer and Analytics Use CasesJanuary 2025No
{% tabs %} {% tab title="Upcoming Releases" %} -## ---- July 2024---- +## ---- August 2024---- ### Development of AMS-I.C.: Thermal Energy Production with or Without Electricity @@ -26,75 +26,6 @@ Referral Link : [https://github.com/hashgraph/guardian/issues/2873](https://gith Documentation Link : [https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity](https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/cdm-ams-i.c.-thermal-energy-production-with-or-without-electricity) -### Development of VMR0006: Energy Efficiency and Fuel Switch Measures in Thermal Applications, v1.2v - -Designing of the Schema and getting it approved. - -Development of the policy using Schema - -Development of all the tool involved in the policy - -Referral Link : [https://github.com/hashgraph/guardian/issues/2922](https://github.com/hashgraph/guardian/issues/2922) - -### Indexer API - -Add suitable API facilities which would allow programmatic access to the indexed data and analytics, which include policy structure data (such as formulas used in the various elements - e.g. Tools) as well as project data. - -Referral Link: [https://github.com/hashgraph/guardian/issues/3637](https://github.com/hashgraph/guardian/issues/3637) - -### Filtering data for blocks is stateful API, introduce stateless data filters for API usage - -I don't necessarily think there is a hard requirement to remove the stateful nature of guardian filtering, as we cannot predict, what are the downstream API consumers are using this functionality or affects, they will be without some kind of deprecation notice. - -So, the recommendation would be: - -* Add ability to filter using a GET request for a filter, so data can be fetched and filtered in one action -* (As an alternative - preferred) It would be preferable to enable filtering at the block level when retrieving data so a API consumer does not need to add explicit filter blocks in block can use the Guardian API to be more RESTful by default. -* Post a six month deprecation notice for stateful usage of the filter (revert if hard requirement for others) - -An example, code enhancement could be implemented like this (tags are easier to reason about): - -From old version: - -``` - public function filterByTag(string $policyId, string $tag, string $uuid): object - { - return (object) $this->httpClient->post("policies/{$policyId}/tag/{$tag}/blocks", [ - 'filterValue' => $uuid - ], true); - } -``` - -to: - -``` -public function filterByTag(string $policyId, string $tag, string $uuid): object -{ - return (object) $this->httpClient->get("policies/{$policyId}/tag/{$tag}/blocks?filterValue={$uuid}"); -} -``` - -Or provide/document clearly a mechanism to filter on an [interface document block](https://docs.hedera.com/guardian/guardian/standard-registry/policies/policy-creation/introduction/interfacedocumentssourceblock) itself, which would be **preferred**. - -Referral Link: [https://github.com/hashgraph/guardian/issues/3610](https://github.com/hashgraph/guardian/issues/3610) - -### Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the Webinar - -Designing of the Schema and getting it approved. - -Development of the policy using Schema - -Development of all the tool involved in the policy - -Referral Link : [https://github.com/hashgraph/guardian/issues/2923](https://github.com/hashgraph/guardian/issues/2923) - -### Auto-testing community submitted policies - -* Relying on the [Policy equivalence assessment based on their execution results for the same data #1886](https://github.com/hashgraph/guardian/issues/1886) and [Full project data comparison as produced/captured by policies #2704](https://github.com/hashgraph/guardian/issues/2704) introduce capability to automatically and repeatably test policies -* Introduce a hook into the new policy merge and release build events which triggers execution of the community policies regression test cycle - -Referral Link : [https://github.com/hashgraph/guardian/issues/2847](https://github.com/hashgraph/guardian/issues/2847) - ### Code audit: support and resolution of issues * Define scope and organise code audit and application penetration testing by a reputable 3rd party security firm. @@ -110,7 +41,13 @@ Referral Link: [https://github.com/hashgraph/guardian/issues/2989](https://githu Referral Link : [https://github.com/hashgraph/guardian/issues/1017](https://github.com/hashgraph/guardian/issues/1017) -## ---- August 2024---- +### Global Carbon Council (GCC) GCCM001: Methodology for Renewable Energy Generation Projects Supplying Electricity to Grid or Captive Consumers – Version 4.0 + +1. Creating Schema design for this methodology. +2. Development of the schema and policy. +3. Testing the policy development through Guardian UI and configurator. + +Referral Link: [https://github.com/hashgraph/guardian/issues/3705](https://github.com/hashgraph/guardian/issues/3705) ### Token action block to work with token templates @@ -118,19 +55,19 @@ Enhance token action block to work with token templates in the same way as it wo Referral Link: [https://github.com/hashgraph/guardian/issues/2839 ](https://github.com/hashgraph/guardian/issues/2839) -### Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB Atlas. +### Different token IDs for different projects by the same policy -The task at hand involves modifying the codebase to seamlessly integrate the new MongoDB Atlas connection string without the redundant mongodb:// prefix. The correct format for the DB\_HOST environment variable should be mongodb+srv://:@staging.wj9lvfj.mongodb.net/?retryWrites=true\&w=majority. This adjustment will ensure a successful and accurate connection to our MongoDB Atlas instance. +* Introduce the facility to dynamically create new TokenIDs and 'assign' them to (newly registered) specific projects such that all data associated with these specific projects would be linked to the corresponding TokenIDs upon minting instances of the token. +* Ensure clear association with **the same methodology** for all TokenIDs and their respective trustchains. I.e. it should be clear that 'these tokens' have been issued by the same Policy, but for different projects. +* Extend trust chain to show multiple tokens and multiple projects 'managed' by the same policy -Referral Link: [https://github.com/hashgraph/guardian/issues/2940](https://github.com/hashgraph/guardian/issues/2940) +Referral Link : [https://github.com/hashgraph/guardian/issues/3267](https://github.com/hashgraph/guardian/issues/3267) -### Default values for schema-defined fields +### Enhance MongoDB Integration by incorporating seamless support for popular third-party services, such as MongoDB Atlas. -* Introduce facilities into the Guardian schema language which would allow Guardian policy engine (and humans when they read these schemas in json) to recognize what values should be considered default for the documents based on these schemas. -* Make Guardian policy engine UI to put in the default values into the fields of forms based on such schemas. The fact that these are default values automatically inserted into the field should be clearly identifiable, i.e. they need to look different from the values users explicitly put into the (other) fields. -* All standard tools/libraries (e.g. for verification) should work with such schemas out of the box +The task at hand involves modifying the codebase to seamlessly integrate the new MongoDB Atlas connection string without the redundant mongodb:// prefix. The correct format for the DB\_HOST environment variable should be mongodb+srv://:@staging.wj9lvfj.mongodb.net/?retryWrites=true\&w=majority. This adjustment will ensure a successful and accurate connection to our MongoDB Atlas instance. -Referral Link: [https://github.com/hashgraph/guardian/issues/2942](https://github.com/hashgraph/guardian/issues/2942) +Referral Link: [https://github.com/hashgraph/guardian/issues/2940](https://github.com/hashgraph/guardian/issues/2940) ### API versioning and support/deprecation schedule @@ -154,15 +91,15 @@ Referral Link: [https://github.com/hashgraph/guardian/issues/3236](https://githu Referral Link: [https://github.com/hashgraph/guardian/issues/3551](https://github.com/hashgraph/guardian/issues/3551) -### GS Methodology for Emission Reductions from Safe Drinking Water Supply v.1.0 +## ---- September 2024---- -1. Creating Schema design for this methodology. -2. Development of the schema and policy. -3. Testing the policy development through Guardian UI and configurator. +### Default values for schema-defined fields -Referral Link: [https://github.com/hashgraph/guardian/issues/3705](https://github.com/hashgraph/guardian/issues/3705) +* Introduce facilities into the Guardian schema language which would allow Guardian policy engine (and humans when they read these schemas in json) to recognize what values should be considered default for the documents based on these schemas. +* Make Guardian policy engine UI to put in the default values into the fields of forms based on such schemas. The fact that these are default values automatically inserted into the field should be clearly identifiable, i.e. they need to look different from the values users explicitly put into the (other) fields. +* All standard tools/libraries (e.g. for verification) should work with such schemas out of the box -## ---- September 2024---- +Referral Link: [https://github.com/hashgraph/guardian/issues/2942](https://github.com/hashgraph/guardian/issues/2942) ### Guardian analytics: insights and top-down data way points @@ -723,5 +660,86 @@ Documentation Link : [https://docs.hedera.com/guardian/guardian/demo-guide/carb Referral Link: [https://github.com/hashgraph/guardian/issues/2884](https://github.com/hashgraph/guardian/issues/2884) Documentation Link : [https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user](https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/cdm-ams-i.a.-electricity-generation-by-the-user) + +## ---- July 2024---- + +### Development of VMR0006: Energy Efficiency and Fuel Switch Measures in Thermal Applications, v1.2v + +Designing of the Schema and getting it approved. + +Development of the policy using Schema + +Development of all the tool involved in the policy + +Referral Link : [https://github.com/hashgraph/guardian/issues/2922](https://github.com/hashgraph/guardian/issues/2922) + +Documentation Link : [https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/verra-vmr0006-energy-efficiency-and-fuel-switch-measures-in-thermal-applications](https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/verra-vmr0006-energy-efficiency-and-fuel-switch-measures-in-thermal-applications) + +### Indexer API + +Add suitable API facilities which would allow programmatic access to the indexed data and analytics, which include policy structure data (such as formulas used in the various elements - e.g. Tools) as well as project data. + +Referral Link: [https://github.com/hashgraph/guardian/issues/3637](https://github.com/hashgraph/guardian/issues/3637) + +Documentation Link : [https://docs.hedera.com/guardian/guardian/global-indexer/indexer-apis](https://docs.hedera.com/guardian/guardian/global-indexer/indexer-apis) + +### Filtering data for blocks is stateful API, introduce stateless data filters for API usage + +I don't necessarily think there is a hard requirement to remove the stateful nature of guardian filtering, as we cannot predict, what are the downstream API consumers are using this functionality or affects, they will be without some kind of deprecation notice. + +So, the recommendation would be: + +* Add ability to filter using a GET request for a filter, so data can be fetched and filtered in one action +* (As an alternative - preferred) It would be preferable to enable filtering at the block level when retrieving data so a API consumer does not need to add explicit filter blocks in block can use the Guardian API to be more RESTful by default. +* Post a six month deprecation notice for stateful usage of the filter (revert if hard requirement for others) + +An example, code enhancement could be implemented like this (tags are easier to reason about): + +From old version: + +``` + public function filterByTag(string $policyId, string $tag, string $uuid): object + { + return (object) $this->httpClient->post("policies/{$policyId}/tag/{$tag}/blocks", [ + 'filterValue' => $uuid + ], true); + } +``` + +to: + +``` +public function filterByTag(string $policyId, string $tag, string $uuid): object +{ + return (object) $this->httpClient->get("policies/{$policyId}/tag/{$tag}/blocks?filterValue={$uuid}"); +} +``` + +Or provide/document clearly a mechanism to filter on an [interface document block](https://docs.hedera.com/guardian/guardian/standard-registry/policies/policy-creation/introduction/interfacedocumentssourceblock) itself, which would be **preferred**. + +Referral Link: [https://github.com/hashgraph/guardian/issues/3610](https://github.com/hashgraph/guardian/issues/3610) + +Documentation Link : [https://docs.hedera.com/guardian/guardian/standard-registry/policies/policy-creation/introduction/interfacedocumentssourceblock](https://docs.hedera.com/guardian/guardian/standard-registry/policies/policy-creation/introduction/interfacedocumentssourceblock) + +### Development of AMS-I.E and Mass Comparison on Cookstove methodologies for the Webinar + +Designing of the Schema and getting it approved. + +Development of the policy using Schema + +Development of all the tool involved in the policy + +Referral Link : [https://github.com/hashgraph/guardian/issues/2923](https://github.com/hashgraph/guardian/issues/2923) + +Documentation Link : [https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/ams-i.e-switch-from-non-renewable-biomass-for-thermal-applications-by-the-user](https://docs.hedera.com/guardian/guardian/demo-guide/carbon-offsets/ams-i.e-switch-from-non-renewable-biomass-for-thermal-applications-by-the-user) + +### Auto-testing community submitted policies + +* Relying on the [Policy equivalence assessment based on their execution results for the same data #1886](https://github.com/hashgraph/guardian/issues/1886) and [Full project data comparison as produced/captured by policies #2704](https://github.com/hashgraph/guardian/issues/2704) introduce capability to automatically and repeatably test policies +* Introduce a hook into the new policy merge and release build events which triggers execution of the community policies regression test cycle + +Referral Link : [https://github.com/hashgraph/guardian/issues/2847](https://github.com/hashgraph/guardian/issues/2847) + +Documentation Link : [https://docs.hedera.com/guardian/guardian/standard-registry/policies/auto-testing-of-the-policies/auto-testing-using-ui](https://docs.hedera.com/guardian/guardian/standard-registry/policies/auto-testing-of-the-policies/auto-testing-using-ui) {% endtab %} {% endtabs %} From cf69ee7f8d78d02024c230d23e6ae2b8b9a23397 Mon Sep 17 00:00:00 2001 From: simvalery Date: Thu, 8 Aug 2024 20:10:39 +0400 Subject: [PATCH 04/12] fix filter data types Signed-off-by: simvalery Signed-off-by: simvalery --- policy-service/src/policy-engine/blocks/documents-source.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/policy-service/src/policy-engine/blocks/documents-source.ts b/policy-service/src/policy-engine/blocks/documents-source.ts index e4d947c165..3bc35eeda7 100644 --- a/policy-service/src/policy-engine/blocks/documents-source.ts +++ b/policy-service/src/policy-engine/blocks/documents-source.ts @@ -100,11 +100,13 @@ export class InterfaceDocumentsSource { if (filterIds) { for (const filterId of Object.keys(filterIds)) { + const filterValue = isNaN(filterIds[filterId]) ? filterIds[filterId] : Number(filterIds[filterId]); + const filter = filterAddons.find((_filter) => { return (_filter.uuid === filterId) || (_filter.tag === filterId); }); if (filter) { - await (filter as IPolicyAddonBlock).setFilterState(user, {filterValue: filterIds[filterId]}); + await (filter as IPolicyAddonBlock).setFilterState(user, {filterValue}); } } } From 9ef13d9b5d604ca019a6db8e1990f63b5a7b90f8 Mon Sep 17 00:00:00 2001 From: simvalery Date: Thu, 8 Aug 2024 20:27:09 +0400 Subject: [PATCH 05/12] fix pagination Signed-off-by: simvalery Signed-off-by: simvalery --- .../src/policy-engine/blocks/documents-source.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/policy-service/src/policy-engine/blocks/documents-source.ts b/policy-service/src/policy-engine/blocks/documents-source.ts index 3bc35eeda7..3da19f41b8 100644 --- a/policy-service/src/policy-engine/blocks/documents-source.ts +++ b/policy-service/src/policy-engine/blocks/documents-source.ts @@ -127,8 +127,11 @@ export class InterfaceDocumentsSource { let paginationData = null; if (pagination) { - if (itemsPerPage && page) { - await pagination.setState(user, {itemsPerPage, page, size}); + if ((!isNaN(page)) && (!isNaN(itemsPerPage))) { + await pagination.setState(user, { + itemsPerPage: parseInt(itemsPerPage, 10), + page: parseInt(page, 10), + }); } paginationData = await pagination.getState(user); From 7c3716da21ec50f02f7e90efff59050a6cf642ab Mon Sep 17 00:00:00 2001 From: simvalery Date: Fri, 9 Aug 2024 08:37:46 +0400 Subject: [PATCH 06/12] fix query filters for vp Signed-off-by: simvalery Signed-off-by: simvalery --- .../helpers/decorators/data-source-block.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 333e194499..3ff34fea65 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 @@ -140,11 +140,28 @@ export function DataSourceBlock(options: Partial) { let totalCount = 0; let currentPosition = 0; + const _globalFilters = {} as any; + for (const key in globalFilters) { + if (!isNaN(globalFilters[key].$eq)) { + if (!_globalFilters.$or) { + _globalFilters.$or = []; + } + const filter1 = {} as any; + filter1[key] = {eq: String(globalFilters[key].$eq)}; + _globalFilters.$or.push(filter1); + const filter2 = {} as any; + filter2[key] = {eq: Number(globalFilters[key].$eq)}; + _globalFilters.$or.push(filter2); + } else { + _globalFilters[key] = globalFilters[key]; + } + } + const resultsCountArray = []; const sourceAddons = this.children.filter(c => c.blockClassName === 'SourceAddon'); for (const addon of sourceAddons) { - const resultCount = await addon.getFromSource(user, globalFilters, true); + const resultCount = await addon.getFromSource(user, _globalFilters, true); totalCount += resultCount; resultsCountArray.push(resultCount); } From 1eaa1760c85905c1c2a26ad0b0d16c378f73daa6 Mon Sep 17 00:00:00 2001 From: Artem Buslaev Date: Fri, 9 Aug 2024 14:53:03 +0400 Subject: [PATCH 07/12] allow full mongo connection string (#3999) Signed-off-by: Artem Buslaev --- common/src/helpers/db-helper.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/helpers/db-helper.ts b/common/src/helpers/db-helper.ts index 3ad04a790f..eb7e061067 100644 --- a/common/src/helpers/db-helper.ts +++ b/common/src/helpers/db-helper.ts @@ -4,6 +4,10 @@ import { BaseEntity } from '../models/index.js'; import { DataBaseNamingStrategy } from './db-naming-strategy.js'; import { GridFSBucket } from 'mongodb'; +function fixConnectionString(cs: string) { + return /.+\:\/\/.+/.test(cs) ? cs : `mongodb://${cs}`; +} + /** * Common connection config */ @@ -13,7 +17,7 @@ export const COMMON_CONNECTION_CONFIG: any = { 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}` : process.env.DB_DATABASE, - clientUrl: `mongodb://${process.env.DB_HOST}`, + clientUrl: fixConnectionString(process.env.DB_HOST), entities: [ 'dist/entity/*.js' ] From b136bfd755bca422e5f3abfb5e05cf8e7c1c2e74 Mon Sep 17 00:00:00 2001 From: prernaadev01 Date: Fri, 9 Aug 2024 12:14:20 -0400 Subject: [PATCH 08/12] Create wip of cdm Signed-off-by: prernaadev01 --- Methodology Library/CDM/Work In Progress/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Methodology Library/CDM/Work In Progress/readme.md diff --git a/Methodology Library/CDM/Work In Progress/readme.md b/Methodology Library/CDM/Work In Progress/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Methodology Library/CDM/Work In Progress/readme.md @@ -0,0 +1 @@ + From 6beba78b87ade314b0441574eccba294d7dce6da Mon Sep 17 00:00:00 2001 From: prernaadev01 Date: Fri, 9 Aug 2024 12:15:20 -0400 Subject: [PATCH 09/12] Create WIP of GHG Signed-off-by: prernaadev01 --- Methodology Library/GHG Methodology/Work In Progress/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Methodology Library/GHG Methodology/Work In Progress/readme.md diff --git a/Methodology Library/GHG Methodology/Work In Progress/readme.md b/Methodology Library/GHG Methodology/Work In Progress/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Methodology Library/GHG Methodology/Work In Progress/readme.md @@ -0,0 +1 @@ + From 32bd8702f4642b34f608947ee05cd40960408b2b Mon Sep 17 00:00:00 2001 From: prernaadev01 Date: Fri, 9 Aug 2024 12:16:16 -0400 Subject: [PATCH 10/12] Create WIP of Gold Standard Signed-off-by: prernaadev01 --- Methodology Library/Gold Standard/Work In Progress/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Methodology Library/Gold Standard/Work In Progress/readme.md diff --git a/Methodology Library/Gold Standard/Work In Progress/readme.md b/Methodology Library/Gold Standard/Work In Progress/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Methodology Library/Gold Standard/Work In Progress/readme.md @@ -0,0 +1 @@ + From 85711d144a627bda5a37262b0dbe10e32806f643 Mon Sep 17 00:00:00 2001 From: prernaadev01 Date: Fri, 9 Aug 2024 12:18:42 -0400 Subject: [PATCH 11/12] Create WIP of Verra Signed-off-by: prernaadev01 --- Methodology Library/Verra/Work In Progress/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Methodology Library/Verra/Work In Progress/readme.md diff --git a/Methodology Library/Verra/Work In Progress/readme.md b/Methodology Library/Verra/Work In Progress/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Methodology Library/Verra/Work In Progress/readme.md @@ -0,0 +1 @@ + From b9076c2b4ff8cd446b8a87a4d50caf95c6f4fd33 Mon Sep 17 00:00:00 2001 From: "prernaa.agarwal" Date: Fri, 9 Aug 2024 19:34:53 +0000 Subject: [PATCH 12/12] GITBOOK-219: Adding note for indexer data load --- docs/guardian/global-indexer/indexer-user-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/guardian/global-indexer/indexer-user-guide.md b/docs/guardian/global-indexer/indexer-user-guide.md index 90a32e5a38..efd6c90af2 100644 --- a/docs/guardian/global-indexer/indexer-user-guide.md +++ b/docs/guardian/global-indexer/indexer-user-guide.md @@ -21,6 +21,10 @@ docker compose -f "docker-compose-indexer.yml" up -d --build Once the above command is successfully executed and all the docker containers are running, Indexer can be launched at [http://localhost:3005](http://localhost:3005) +{% hint style="info" %} +Please note that it would take minimum 6 hours to load complete Indexer data. +{% endhint %} + ### Landing page includes following information: * _Registries_, _Methodologies_, _Total Documents_, _Total Issuance_. All cards are clickable. Also there is an ability to check charts with count and date.