Comparing version 1.3.3 to 1.4.0
@@ -1,1 +0,1 @@ | ||
export declare const baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n rowId: String!\n type: String!\n id: String\n data: String\n }\n \n"; | ||
export declare const baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n type: String!\n id: String\n data: String\n }\n \n"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n rowId: String!\n type: String!\n id: String\n data: String\n }\n \n"; | ||
exports.baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n type: String!\n id: String\n data: String\n }\n \n"; | ||
//# sourceMappingURL=graphql-base-type-defs.js.map |
import { Core } from '../core'; | ||
import { LastMessageTimestampForInstance } from '../service/service-manager'; | ||
import { Message } from '../message/message'; | ||
@@ -7,2 +8,17 @@ interface Context { | ||
export declare const resolvers: { | ||
Query: { | ||
serviceMessagesSince: (_: any, args: { | ||
ts: LastMessageTimestampForInstance[]; | ||
}, ctx: Context) => Promise<{ | ||
data: string; | ||
raw: string; | ||
metaData: import("../message/message").MetaData[]; | ||
type: string | null; | ||
threadId: string | null; | ||
sender: string | null; | ||
receiver: string | null; | ||
timestamp: number | null; | ||
vc?: any; | ||
}[]>; | ||
}; | ||
Mutation: { | ||
@@ -16,3 +32,3 @@ newMessage: (_: any, args: { | ||
}; | ||
export declare const typeDefs = "\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n"; | ||
export declare const typeDefs = "\n input LastMessageTimestampForInstance {\n timestamp: Int!\n did: String!\n type: String!\n id: String!\n }\n\n type ServiceMessage {\n id: String!\n threadId: String,\n timestamp: Int,\n sender: String,\n receiver: String,\n type: String,\n raw: String,\n data: String,\n metaData: [MessageMetaData]\n }\n\n extend type Query {\n serviceMessagesSince(ts: [LastMessageTimestampForInstance]!): [ServiceMessage]\n }\n\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n"; | ||
export {}; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -54,3 +65,17 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}); }; | ||
var serviceMessagesSince = function (_, args, ctx) { return __awaiter(void 0, void 0, void 0, function () { | ||
var res; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, ctx.core.getMessagesSince(args.ts)]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.map(function (msg) { return (__assign(__assign({}, msg), { data: JSON.stringify(msg.data), raw: msg.raw, metaData: msg.allMeta })); })]; | ||
} | ||
}); | ||
}); }; | ||
exports.resolvers = { | ||
Query: { | ||
serviceMessagesSince: serviceMessagesSince, | ||
}, | ||
Mutation: { | ||
@@ -60,3 +85,3 @@ newMessage: newMessage, | ||
}; | ||
exports.typeDefs = "\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n"; | ||
exports.typeDefs = "\n input LastMessageTimestampForInstance {\n timestamp: Int!\n did: String!\n type: String!\n id: String!\n }\n\n type ServiceMessage {\n id: String!\n threadId: String,\n timestamp: Int,\n sender: String,\n receiver: String,\n type: String,\n raw: String,\n data: String,\n metaData: [MessageMetaData]\n }\n\n extend type Query {\n serviceMessagesSince(ts: [LastMessageTimestampForInstance]!): [ServiceMessage]\n }\n\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n"; | ||
//# sourceMappingURL=graphql-core.js.map |
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.4.0](https://github.com/uport-project/daf/compare/v1.3.7...v1.4.0) (2020-01-14) | ||
### Features | ||
* GQL query to get latest service messages ([8061fbe](https://github.com/uport-project/daf/commit/8061fbed8fc3626b165b8c03dee79901682f60a2)) | ||
## [1.3.3](https://github.com/uport-project/daf/compare/v1.3.2...v1.3.3) (2019-12-20) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "daf-core", | ||
"description": "DID Agent Framework Core", | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"main": "build/index.js", | ||
@@ -30,3 +30,3 @@ "types": "build/index.d.ts", | ||
"keywords": [], | ||
"gitHead": "3109c4aa4763f6322a6db150e5c1c71ffb27bd42" | ||
"gitHead": "202b139fb6d940593f3094a825c3754bdc2159c6" | ||
} |
@@ -25,3 +25,2 @@ export const baseTypeDefs = ` | ||
type MessageMetaData { | ||
rowId: String! | ||
type: String! | ||
@@ -28,0 +27,0 @@ id: String |
import { Core } from '../core' | ||
import { LastMessageTimestampForInstance } from '../service/service-manager' | ||
import { Message } from '../message/message' | ||
@@ -24,3 +26,20 @@ | ||
const serviceMessagesSince = async ( | ||
_: any, | ||
args: { ts: LastMessageTimestampForInstance[] }, | ||
ctx: Context, | ||
) => { | ||
const res = await ctx.core.getMessagesSince(args.ts) | ||
return res.map(msg => ({ | ||
...msg, | ||
data: JSON.stringify(msg.data), | ||
raw: msg.raw, | ||
metaData: msg.allMeta, | ||
})) | ||
} | ||
export const resolvers = { | ||
Query: { | ||
serviceMessagesSince, | ||
}, | ||
Mutation: { | ||
@@ -32,2 +51,25 @@ newMessage, | ||
export const typeDefs = ` | ||
input LastMessageTimestampForInstance { | ||
timestamp: Int! | ||
did: String! | ||
type: String! | ||
id: String! | ||
} | ||
type ServiceMessage { | ||
id: String! | ||
threadId: String, | ||
timestamp: Int, | ||
sender: String, | ||
receiver: String, | ||
type: String, | ||
raw: String, | ||
data: String, | ||
metaData: [MessageMetaData] | ||
} | ||
extend type Query { | ||
serviceMessagesSince(ts: [LastMessageTimestampForInstance]!): [ServiceMessage] | ||
} | ||
extend type Mutation { | ||
@@ -34,0 +76,0 @@ newMessage(raw: String!, sourceType: String!, sourceId: String): Message |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126228
2250