diff --git a/cli/commands/publish/upload.manifest.ts b/cli/commands/publish/upload.manifest.ts index 1ec071c..2fa9733 100644 --- a/cli/commands/publish/upload.manifest.ts +++ b/cli/commands/publish/upload.manifest.ts @@ -16,7 +16,9 @@ export type ChainSettings = { [id: string]: ChainSetting } type Manifest = { from: string, name: string, + displayName?: string, description: string, + longDescription?: string, agentId: string, agentIdHash: string, version: string, @@ -24,23 +26,29 @@ type Manifest = { imageReference: string, documentation: string, repository?: string, + licenseUrl?: string, + promoUrl?: string, chainIds: number[], publishedFrom: string, chainSettings?: ChainSettings } export default function provideUploadManifest( - filesystem: typeof fs, - addToIpfs: AddToIpfs, - agentName: string, - description: string, - agentId: string, - version: string, - documentation: string, - repository: string, - cliVersion: string, - chainIds: number[], - chainSettings?: ChainSettings + filesystem: typeof fs, + addToIpfs: AddToIpfs, + agentName: string, + agentDisplayName: string, + description: string, + longDescription: string, + agentId: string, + version: string, + documentation: string, + repository: string, + licenseUrl: string, + promoUrl: string, + cliVersion: string, + chainIds: number[], + chainSettings?: ChainSettings ): UploadManifest { assertExists(filesystem, 'filesystem') assertExists(addToIpfs, 'addToIpfs') @@ -69,6 +77,8 @@ export default function provideUploadManifest( const manifest: Manifest = { from: new Wallet(privateKey).address, name: agentName, + displayName: agentDisplayName, + longDescription: longDescription, description, agentId: agentName, agentIdHash: agentId, @@ -77,6 +87,8 @@ export default function provideUploadManifest( imageReference, documentation: documentationReference, repository, + licenseUrl: licenseUrl, + promoUrl: promoUrl, chainIds, publishedFrom: `Forta CLI ${cliVersion}`, chainSettings: formatChainSettings(chainSettings), diff --git a/cli/di.container.ts b/cli/di.container.ts index 63e3f8e..82e4333 100644 --- a/cli/di.container.ts +++ b/cli/di.container.ts @@ -138,7 +138,9 @@ export default function configureContainer(args: any = {}) { } }).singleton(), agentName: asFunction((packageJson: any) => packageJson.name).singleton(), + agentDisplayName: asFunction((packageJson: any) => packageJson.displayName).singleton(), description: asFunction((packageJson: any) => packageJson.description).singleton(), + longDescription: asFunction((packageJson: any) => packageJson.longDescription).singleton(), agentId: asFunction((args: any, fortaConfig: FortaConfig, agentName: string) => { return args.agentId || fortaConfig.agentId || keccak256(agentName) }).singleton(), @@ -167,6 +169,8 @@ export default function configureContainer(args: any = {}) { } return undefined }).singleton(), + licenseUrl: asFunction((packageJson: any) => packageJson.licenseUrl).singleton(), + promoUrl: asFunction((packageJson: any) => packageJson.promoUrl).singleton(), keyfileName: asFunction((fortaConfig: FortaConfig) => { return fortaConfig.keyfile }), diff --git a/cli/utils/ipfs/get.from.ipfs.spec.ts b/cli/utils/ipfs/get.from.ipfs.spec.ts index 50a7fc2..74df5c4 100644 --- a/cli/utils/ipfs/get.from.ipfs.spec.ts +++ b/cli/utils/ipfs/get.from.ipfs.spec.ts @@ -3,24 +3,29 @@ import { formatDate, formatIpfsData } from "../../commands/info"; import provideGetFromIpfs, { GetFromIpfs, IpfsData, IpfsManifestData } from "./get.from.ipfs"; const mockIpfsData = { - "manifest":{ - "from":"0x123456", - "name":"Compound Liquidatable Positions Monitor", - "agentId":"Compound Liquidatable Positions Monitor", - "agentIdHash":"0x3c61101f1d349661298a58ba59a58fbce5a3626c5c7af10b091796969e0d6c59", - "version":"0.0.1", - "timestamp":"Fri, 20 May 2022 15:54:56 GMT", - "imageReference":"bafybeib5kmox5r2wpre3tgkfgfr76tm4qascagmqvod2wcojxrqmgyxfp4@sha256:2fcfede6f821f4f14e745598fd71b2201471517acd345f7b8f0cd424d35b441a", - "documentation":"QmQXZvBdZ4eMtCefNXYMRwQ7UJbgW74EqrMv9wS9hoSXV7", - "repository":"https://github.com/arbitraryexecution/compound-monitoring/tree/main/liquidation-monitor", - "projects":[ - "compound_v2" - ], - "chainIds":[ - 1 - ], - "publishedFrom":"Forta Explorer 0.0.2" - } as IpfsManifestData + "manifest": { + "from": "0x123456", + "name": "Compound Liquidatable Positions Monitor", + "displayName": "Compound Liquidatable Positions Monitor", + "agentId": "Compound Liquidatable Positions Monitor", + "description": "Test description", + "longDescription": "Test long description", + "agentIdHash": "0x3c61101f1d349661298a58ba59a58fbce5a3626c5c7af10b091796969e0d6c59", + "version": "0.0.1", + "timestamp": "Fri, 20 May 2022 15:54:56 GMT", + "imageReference": "bafybeib5kmox5r2wpre3tgkfgfr76tm4qascagmqvod2wcojxrqmgyxfp4@sha256:2fcfede6f821f4f14e745598fd71b2201471517acd345f7b8f0cd424d35b441a", + "documentation": "QmQXZvBdZ4eMtCefNXYMRwQ7UJbgW74EqrMv9wS9hoSXV7", + "repository": "https://github.com/arbitraryexecution/compound-monitoring/tree/main/liquidation-monitor", + "licenseUrl": "https://github.com/arbitraryexecution/compound-monitoring/tree/main/liquidation-monitor", + "promoUrl": "https://github.com/arbitraryexecution/compound-monitoring/tree/main/liquidation-monitor", + "projects": [ + "compound_v2" + ], + "chainIds": [ + 1 + ], + "publishedFrom": "Forta Explorer 0.0.2" + } as IpfsManifestData } diff --git a/cli/utils/ipfs/get.from.ipfs.ts b/cli/utils/ipfs/get.from.ipfs.ts index db27625..9c7760a 100644 --- a/cli/utils/ipfs/get.from.ipfs.ts +++ b/cli/utils/ipfs/get.from.ipfs.ts @@ -9,13 +9,18 @@ export interface IpfsData { export interface IpfsManifestData { name: string, + displayName: string, from: string, + description: string, + longDescription: string agentId: string, version: string, imageReference: string, agentIdHash: string, timestamp: string, repository: string, + licenseUrl: string, + promoUrl: string, chainIds: number[], publishedFrom: string, documentation: string