Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@perspect3vism/ad4m

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@perspect3vism/ad4m - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

lib/DID.d.ts

8

lib/Ad4mClient.test.js

@@ -124,2 +124,10 @@ "use strict";

});
it('getMany() smoke test', async () => {
const getMany = await ad4mClient.expression.getMany(["hash1", "hash2"]);
console.warn("got result", getMany);
expect(getMany.length).toBe(2);
expect(getMany[0].author).toBe('did:ad4m:test');
expect(getMany[0].data).toBe("{\"type\":\"test expression\",\"content\":\"test\"}");
expect(getMany[1]).toBeNull();
});
it('getRaw() smoke test', async () => {

@@ -126,0 +134,0 @@ const nonExisting = await ad4mClient.expression.getRaw("wrong address");

1

lib/expression/ExpressionClient.d.ts

@@ -7,4 +7,5 @@ import { ApolloClient } from "@apollo/client";

get(url: string): Promise<ExpressionRendered>;
getMany(urls: string[]): Promise<ExpressionRendered[]>;
getRaw(url: string): Promise<string>;
create(content: any, languageAddress: string): Promise<string>;
}

@@ -45,2 +45,22 @@ "use strict";

}
async getMany(urls) {
const { expressionMany } = (0, unwrapApolloResult_1.default)(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
query: (0, client_1.gql) `query expressionMany($urls: [String!]!) {
expressionMany(urls: $urls) {
author
timestamp
data
language {
address
}
proof {
valid
invalid
}
}
}`,
variables: { urls }
}));
return expressionMany;
}
async getRaw(url) {

@@ -47,0 +67,0 @@ const { expressionRaw } = (0, unwrapApolloResult_1.default)(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({

import { ExpressionRendered } from "./Expression";
export default class ExpressionResolver {
expression(url: string): ExpressionRendered;
expressionMany(urls: string[]): (ExpressionRendered | null)[];
expressionRaw(url: string): string;
expressionCreate(content: string, languageAddress: string): string;
}

@@ -34,2 +34,5 @@ "use strict";

}
expressionMany(urls) {
return [testExpression, null];
}
expressionRaw(url) {

@@ -55,2 +58,9 @@ if (url === 'neighbourhood://Qm123') {

__decorate([
(0, type_graphql_1.Query)(returns => [Expression_1.ExpressionRendered], { nullable: "items" }),
__param(0, (0, type_graphql_1.Arg)('urls', type => [String])),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Array]),
__metadata("design:returntype", Array)
], ExpressionResolver.prototype, "expressionMany", null);
__decorate([
(0, type_graphql_1.Query)(returns => String, { nullable: true }),

@@ -57,0 +67,0 @@ __param(0, (0, type_graphql_1.Arg)('url')),

@@ -7,4 +7,5 @@ import { ApolloClient } from "@apollo/client";

get(url: string): Promise<ExpressionRendered>;
getMany(urls: string[]): Promise<ExpressionRendered[]>;
getRaw(url: string): Promise<string>;
create(content: any, languageAddress: string): Promise<string>;
}

@@ -45,2 +45,22 @@ "use strict";

}
async getMany(urls) {
const { expressionMany } = (0, unwrapApolloResult_1.default)(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
query: (0, client_1.gql) `query expressionMany($urls: [String!]!) {
expressionMany(urls: $urls) {
author
timestamp
data
language {
address
}
proof {
valid
invalid
}
}
}`,
variables: { urls }
}));
return expressionMany;
}
async getRaw(url) {

@@ -47,0 +67,0 @@ const { expressionRaw } = (0, unwrapApolloResult_1.default)(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({

import { ExpressionRendered } from "./Expression";
export default class ExpressionResolver {
expression(url: string): ExpressionRendered;
expressionMany(urls: string[]): (ExpressionRendered | null)[];
expressionRaw(url: string): string;
expressionCreate(content: string, languageAddress: string): string;
}

@@ -34,2 +34,5 @@ "use strict";

}
expressionMany(urls) {
return [testExpression, null];
}
expressionRaw(url) {

@@ -55,2 +58,9 @@ if (url === 'neighbourhood://Qm123') {

__decorate([
(0, type_graphql_1.Query)(returns => [Expression_1.ExpressionRendered], { nullable: "items" }),
__param(0, (0, type_graphql_1.Arg)('urls', type => [String])),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Array]),
__metadata("design:returntype", Array)
], ExpressionResolver.prototype, "expressionMany", null);
__decorate([
(0, type_graphql_1.Query)(returns => String, { nullable: true }),

@@ -57,0 +67,0 @@ __param(0, (0, type_graphql_1.Arg)('url')),

@@ -141,2 +141,3 @@

expression(url: String!): ExpressionRendered
expressionMany(urls: [String!]!): [ExpressionRendered]!
expressionRaw(url: String!): String

@@ -143,0 +144,0 @@ language(address: String!): LanguageHandle

2

package.json
{
"name": "@perspect3vism/ad4m",
"version": "0.1.10",
"version": "0.1.11",
"description": "*The Agent-Centric Distributed Application Meta-ontology* or just: *Agent-Centric DApp Meta-ontology* * A new meta-ontology for interoperable, decentralized application design * A spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends * The basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -142,2 +142,11 @@ import { buildSchema } from "type-graphql"

it('getMany() smoke test', async () => {
const getMany = await ad4mClient.expression.getMany(["hash1", "hash2"]);
console.warn("got result", getMany);
expect(getMany.length).toBe(2);
expect(getMany[0].author).toBe('did:ad4m:test');
expect(getMany[0].data).toBe("{\"type\":\"test expression\",\"content\":\"test\"}");
expect(getMany[1]).toBeNull();
})
it('getRaw() smoke test', async () => {

@@ -144,0 +153,0 @@ const nonExisting = await ad4mClient.expression.getRaw("wrong address")

@@ -33,2 +33,23 @@ import { ApolloClient, gql } from "@apollo/client";

async getMany(urls: string[]): Promise<ExpressionRendered[]> {
const { expressionMany } = unwrapApolloResult(await this.#apolloClient.query({
query: gql`query expressionMany($urls: [String!]!) {
expressionMany(urls: $urls) {
author
timestamp
data
language {
address
}
proof {
valid
invalid
}
}
}`,
variables: { urls }
}))
return expressionMany
}
async getRaw(url: string): Promise<string> {

@@ -35,0 +56,0 @@ const { expressionRaw } = unwrapApolloResult(await this.#apolloClient.query({

@@ -24,2 +24,7 @@ import { Arg, Mutation, Query, Resolver } from "type-graphql";

@Query(returns => [ExpressionRendered], {nullable: "items"})
expressionMany(@Arg('urls', type => [String]) urls: string[]): (ExpressionRendered | null)[] {
return [testExpression, null]
}
@Query(returns => String, {nullable: true})

@@ -26,0 +31,0 @@ expressionRaw(@Arg('url') url: string): string {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc