From a67b55cd7263499f62404fa088f4f759e7c0441d Mon Sep 17 00:00:00 2001 From: Venryx Date: Fri, 10 May 2024 18:13:16 -0700 Subject: [PATCH] * MS claim-gen subtree-importer supports new "counter_claim" field in the claim object/structure. --- .../client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts | 3 +++ .../Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts index e205ea994..1db3c6fcd 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts @@ -115,6 +115,9 @@ export class CG_Claim extends CG_Node { // v3 (tool extending claim-gen) arguments?: (string | CG_Argument)[]; + + // v4 + counter_claim?: string; } export class CG_Argument extends CG_Node { argument: string; diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts index 8d87f4a7e..24e42a3e6 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts @@ -56,6 +56,7 @@ export const GetResourcesInClaim_CG = CreateAccessor((context: ImportContext, cl const args = [] as CG_Argument[]; if (claim.argument) args.push({argument: claim.argument} as CG_Argument); if (claim.arguments) args.push(...claim.arguments.map(a=>(IsString(a) ? {argument: a} : a)) as CG_Argument[]); + if (claim.counter_claim) args.push({argument: claim.counter_claim} as CG_Argument); for (const [i, argument] of args.entries()) { result.push(NewNodeResource(context, argument, NodeType.claim, path_indexes.concat(i), path_titles.concat(argument.argument), claimResource, ChildGroup.freeform)); }