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

@textile/users

Package Overview
Dependencies
Maintainers
5
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@textile/users - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

44

dist/api/index.js

@@ -17,4 +17,4 @@ "use strict";

const loglevel_1 = __importDefault(require("loglevel"));
const users_pb_1 = require("@textile/users-grpc/users_pb");
const users_pb_service_1 = require("@textile/users-grpc/users_pb_service");
const usersd_pb_1 = require("@textile/users-grpc/api/usersd/pb/usersd_pb");
const usersd_pb_service_1 = require("@textile/users-grpc/api/usersd/pb/usersd_pb_service");
const hub_threads_client_1 = require("@textile/hub-threads-client");

@@ -66,4 +66,4 @@ const threads_id_1 = require("@textile/threads-id");

logger.debug('list threads request');
const req = new users_pb_1.ListThreadsRequest();
const res = yield api.unary(users_pb_service_1.APIService.ListThreads, req, ctx);
const req = new usersd_pb_1.ListThreadsRequest();
const res = yield api.unary(usersd_pb_service_1.APIService.ListThreads, req, ctx);
return res.getListList().map((value) => {

@@ -87,5 +87,5 @@ const thread = value.toObject();

logger.debug('get thread request');
const req = new users_pb_1.GetThreadRequest();
const req = new usersd_pb_1.GetThreadRequest();
req.setName(name);
const res = yield api.unary(users_pb_service_1.APIService.GetThread, req, ctx);
const res = yield api.unary(usersd_pb_service_1.APIService.GetThread, req, ctx);
const thread = res.toObject();

@@ -106,4 +106,4 @@ return {

logger.debug('setup mailbox request');
const req = new users_pb_1.SetupMailboxRequest();
const res = yield api.unary(users_pb_service_1.APIService.SetupMailbox, req, ctx);
const req = new usersd_pb_1.SetupMailboxRequest();
const res = yield api.unary(usersd_pb_service_1.APIService.SetupMailbox, req, ctx);
const mailboxID = threads_id_1.ThreadID.fromBytes(Buffer.from(res.getMailboxId_asB64(), 'base64'));

@@ -131,3 +131,3 @@ return mailboxID.toString();

logger.debug('send message request');
const req = new users_pb_1.SendMessageRequest();
const req = new usersd_pb_1.SendMessageRequest();
req.setTo(to);

@@ -138,3 +138,3 @@ req.setToBody(toBody);

req.setFromSignature(fromSignature);
const res = yield api.unary(users_pb_service_1.APIService.SendMessage, req, ctx);
const res = yield api.unary(usersd_pb_service_1.APIService.SendMessage, req, ctx);
return {

@@ -157,3 +157,3 @@ id: res.getId(),

logger.debug('list inbox message request');
const req = new users_pb_1.ListInboxMessagesRequest();
const req = new usersd_pb_1.ListInboxMessagesRequest();
if (opts && opts.seek)

@@ -168,8 +168,8 @@ req.setSeek(opts.seek);

case Status.READ:
req.setStatus(users_pb_1.ListInboxMessagesRequest.Status.STATUS_READ);
req.setStatus(usersd_pb_1.ListInboxMessagesRequest.Status.STATUS_READ);
case Status.UNREAD:
req.setStatus(users_pb_1.ListInboxMessagesRequest.Status.STATUS_UNREAD);
req.setStatus(usersd_pb_1.ListInboxMessagesRequest.Status.STATUS_UNREAD);
}
}
const res = yield api.unary(users_pb_service_1.APIService.ListInboxMessages, req, ctx);
const res = yield api.unary(usersd_pb_service_1.APIService.ListInboxMessages, req, ctx);
return res.getMessagesList().map(convertMessageObj);

@@ -185,3 +185,3 @@ });

logger.debug('list sentbox message request');
const req = new users_pb_1.ListSentboxMessagesRequest();
const req = new usersd_pb_1.ListSentboxMessagesRequest();
if (opts && opts.seek)

@@ -193,3 +193,3 @@ req.setSeek(opts.seek);

req.setAscending(opts.ascending);
const res = yield api.unary(users_pb_service_1.APIService.ListSentboxMessages, req, ctx);
const res = yield api.unary(usersd_pb_service_1.APIService.ListSentboxMessages, req, ctx);
return res.getMessagesList().map(convertMessageObj);

@@ -205,5 +205,5 @@ });

logger.debug('read inbox message request');
const req = new users_pb_1.ReadInboxMessageRequest();
const req = new usersd_pb_1.ReadInboxMessageRequest();
req.setId(id);
const res = yield api.unary(users_pb_service_1.APIService.ReadInboxMessage, req, ctx);
const res = yield api.unary(usersd_pb_service_1.APIService.ReadInboxMessage, req, ctx);
return { readAt: res.toObject().readAt };

@@ -219,5 +219,5 @@ });

logger.debug('delete inbox message request');
const req = new users_pb_1.DeleteInboxMessageRequest();
const req = new usersd_pb_1.DeleteInboxMessageRequest();
req.setId(id);
yield api.unary(users_pb_service_1.APIService.DeleteInboxMessage, req, ctx);
yield api.unary(usersd_pb_service_1.APIService.DeleteInboxMessage, req, ctx);
return;

@@ -233,5 +233,5 @@ });

logger.debug('delete sentbox message request');
const req = new users_pb_1.DeleteSentboxMessageRequest();
const req = new usersd_pb_1.DeleteSentboxMessageRequest();
req.setId(id);
yield api.unary(users_pb_service_1.APIService.DeleteSentboxMessage, req, ctx);
yield api.unary(usersd_pb_service_1.APIService.DeleteSentboxMessage, req, ctx);
return;

@@ -238,0 +238,0 @@ });

export * from './api';
export * from './users';
export { SetupMailboxRequest, SetupMailboxResponse, ListThreadsRequest, ListThreadsResponse, GetThreadResponse, GetThreadRequest, SendMessageRequest, SendMessageResponse, ListInboxMessagesRequest, ListInboxMessagesResponse, ListSentboxMessagesRequest, ListSentboxMessagesResponse, ReadInboxMessageRequest, ReadInboxMessageResponse, DeleteInboxMessageRequest, DeleteInboxMessageResponse, DeleteSentboxMessageRequest, DeleteSentboxMessageResponse, } from '@textile/users-grpc/users_pb';
export { SetupMailboxRequest, SetupMailboxResponse, ListThreadsRequest, ListThreadsResponse, GetThreadResponse, GetThreadRequest, SendMessageRequest, SendMessageResponse, ListInboxMessagesRequest, ListInboxMessagesResponse, ListSentboxMessagesRequest, ListSentboxMessagesResponse, ReadInboxMessageRequest, ReadInboxMessageResponse, DeleteInboxMessageRequest, DeleteInboxMessageResponse, DeleteSentboxMessageRequest, DeleteSentboxMessageResponse, } from '@textile/users-grpc/api/usersd/pb/usersd_pb';

@@ -16,21 +16,21 @@ "use strict";

// Exports all API response types for typescript users
var users_pb_1 = require("@textile/users-grpc/users_pb");
Object.defineProperty(exports, "SetupMailboxRequest", { enumerable: true, get: function () { return users_pb_1.SetupMailboxRequest; } });
Object.defineProperty(exports, "SetupMailboxResponse", { enumerable: true, get: function () { return users_pb_1.SetupMailboxResponse; } });
Object.defineProperty(exports, "ListThreadsRequest", { enumerable: true, get: function () { return users_pb_1.ListThreadsRequest; } });
Object.defineProperty(exports, "ListThreadsResponse", { enumerable: true, get: function () { return users_pb_1.ListThreadsResponse; } });
Object.defineProperty(exports, "GetThreadResponse", { enumerable: true, get: function () { return users_pb_1.GetThreadResponse; } });
Object.defineProperty(exports, "GetThreadRequest", { enumerable: true, get: function () { return users_pb_1.GetThreadRequest; } });
Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return users_pb_1.SendMessageRequest; } });
Object.defineProperty(exports, "SendMessageResponse", { enumerable: true, get: function () { return users_pb_1.SendMessageResponse; } });
Object.defineProperty(exports, "ListInboxMessagesRequest", { enumerable: true, get: function () { return users_pb_1.ListInboxMessagesRequest; } });
Object.defineProperty(exports, "ListInboxMessagesResponse", { enumerable: true, get: function () { return users_pb_1.ListInboxMessagesResponse; } });
Object.defineProperty(exports, "ListSentboxMessagesRequest", { enumerable: true, get: function () { return users_pb_1.ListSentboxMessagesRequest; } });
Object.defineProperty(exports, "ListSentboxMessagesResponse", { enumerable: true, get: function () { return users_pb_1.ListSentboxMessagesResponse; } });
Object.defineProperty(exports, "ReadInboxMessageRequest", { enumerable: true, get: function () { return users_pb_1.ReadInboxMessageRequest; } });
Object.defineProperty(exports, "ReadInboxMessageResponse", { enumerable: true, get: function () { return users_pb_1.ReadInboxMessageResponse; } });
Object.defineProperty(exports, "DeleteInboxMessageRequest", { enumerable: true, get: function () { return users_pb_1.DeleteInboxMessageRequest; } });
Object.defineProperty(exports, "DeleteInboxMessageResponse", { enumerable: true, get: function () { return users_pb_1.DeleteInboxMessageResponse; } });
Object.defineProperty(exports, "DeleteSentboxMessageRequest", { enumerable: true, get: function () { return users_pb_1.DeleteSentboxMessageRequest; } });
Object.defineProperty(exports, "DeleteSentboxMessageResponse", { enumerable: true, get: function () { return users_pb_1.DeleteSentboxMessageResponse; } });
var usersd_pb_1 = require("@textile/users-grpc/api/usersd/pb/usersd_pb");
Object.defineProperty(exports, "SetupMailboxRequest", { enumerable: true, get: function () { return usersd_pb_1.SetupMailboxRequest; } });
Object.defineProperty(exports, "SetupMailboxResponse", { enumerable: true, get: function () { return usersd_pb_1.SetupMailboxResponse; } });
Object.defineProperty(exports, "ListThreadsRequest", { enumerable: true, get: function () { return usersd_pb_1.ListThreadsRequest; } });
Object.defineProperty(exports, "ListThreadsResponse", { enumerable: true, get: function () { return usersd_pb_1.ListThreadsResponse; } });
Object.defineProperty(exports, "GetThreadResponse", { enumerable: true, get: function () { return usersd_pb_1.GetThreadResponse; } });
Object.defineProperty(exports, "GetThreadRequest", { enumerable: true, get: function () { return usersd_pb_1.GetThreadRequest; } });
Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return usersd_pb_1.SendMessageRequest; } });
Object.defineProperty(exports, "SendMessageResponse", { enumerable: true, get: function () { return usersd_pb_1.SendMessageResponse; } });
Object.defineProperty(exports, "ListInboxMessagesRequest", { enumerable: true, get: function () { return usersd_pb_1.ListInboxMessagesRequest; } });
Object.defineProperty(exports, "ListInboxMessagesResponse", { enumerable: true, get: function () { return usersd_pb_1.ListInboxMessagesResponse; } });
Object.defineProperty(exports, "ListSentboxMessagesRequest", { enumerable: true, get: function () { return usersd_pb_1.ListSentboxMessagesRequest; } });
Object.defineProperty(exports, "ListSentboxMessagesResponse", { enumerable: true, get: function () { return usersd_pb_1.ListSentboxMessagesResponse; } });
Object.defineProperty(exports, "ReadInboxMessageRequest", { enumerable: true, get: function () { return usersd_pb_1.ReadInboxMessageRequest; } });
Object.defineProperty(exports, "ReadInboxMessageResponse", { enumerable: true, get: function () { return usersd_pb_1.ReadInboxMessageResponse; } });
Object.defineProperty(exports, "DeleteInboxMessageRequest", { enumerable: true, get: function () { return usersd_pb_1.DeleteInboxMessageRequest; } });
Object.defineProperty(exports, "DeleteInboxMessageResponse", { enumerable: true, get: function () { return usersd_pb_1.DeleteInboxMessageResponse; } });
Object.defineProperty(exports, "DeleteSentboxMessageRequest", { enumerable: true, get: function () { return usersd_pb_1.DeleteSentboxMessageRequest; } });
Object.defineProperty(exports, "DeleteSentboxMessageResponse", { enumerable: true, get: function () { return usersd_pb_1.DeleteSentboxMessageResponse; } });
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import * as pb from '@textile/hub-grpc/hub_pb';
import * as pb from '@textile/hub-grpc/api/hubd/pb/hubd_pb';
import { ContextInterface } from '@textile/context';

@@ -3,0 +3,0 @@ export declare const createUsername: (size?: number) => string;

@@ -39,4 +39,4 @@ "use strict";

const multibase_1 = __importDefault(require("multibase"));
const pb = __importStar(require("@textile/hub-grpc/hub_pb"));
const hub_pb_service_1 = require("@textile/hub-grpc/hub_pb_service");
const pb = __importStar(require("@textile/hub-grpc/api/hubd/pb/hubd_pb"));
const hubd_pb_service_1 = require("@textile/hub-grpc/api/hubd/pb/hubd_pb_service");
const grpc_transport_1 = require("@textile/grpc-transport");

@@ -64,3 +64,3 @@ exports.createUsername = (size = 12) => {

req.setType(pb.KeyType[kind]);
const client = new hub_pb_service_1.APIServiceClient(ctx.host, { transport: grpc_transport_1.WebsocketTransport() });
const client = new hubd_pb_service_1.APIServiceClient(ctx.host, { transport: grpc_transport_1.WebsocketTransport() });
ctx.toMetadata().then((meta) => {

@@ -82,3 +82,3 @@ return client.createKey(req, meta, (err, message) => {

req.setUsername(username);
const client = new hub_pb_service_1.APIServiceClient(ctx.host, { transport: grpc_transport_1.WebsocketTransport() });
const client = new hubd_pb_service_1.APIServiceClient(ctx.host, { transport: grpc_transport_1.WebsocketTransport() });
ctx.toMetadata().then((meta) => {

@@ -85,0 +85,0 @@ client.signup(req, meta, (err, message) => {

@@ -121,3 +121,4 @@ import { grpc } from '@improbable-eng/grpc-web';

* async function example (threadID: ThreadID) {
* const users = await Users.withThread(threadID)
* const id = threadID.toString()
* const users = await Users.withThread(id)
* }

@@ -124,0 +125,0 @@ * ```

@@ -149,3 +149,4 @@ "use strict";

* async function example (threadID: ThreadID) {
* const users = await Users.withThread(threadID)
* const id = threadID.toString()
* const users = await Users.withThread(id)
* }

@@ -152,0 +153,0 @@ * ```

{
"name": "@textile/users",
"version": "1.0.1",
"version": "1.1.0",
"description": "web-gRPC wrapper client for managing Textile Users.",

@@ -33,13 +33,13 @@ "main": "dist/index",

"@improbable-eng/grpc-web": "^0.13.0",
"@textile/buckets-grpc": "2.0.1",
"@textile/context": "^0.7.0",
"@textile/buckets-grpc": "2.1.6",
"@textile/context": "^0.8.0",
"@textile/crypto": "^0.1.2",
"@textile/grpc-authentication": "^0.2.3",
"@textile/grpc-connection": "^0.1.5",
"@textile/grpc-transport": "^0.0.5",
"@textile/hub-grpc": "2.0.1",
"@textile/hub-threads-client": "^1.0.1",
"@textile/security": "^0.3.0",
"@textile/threads-id": "^0.1.15",
"@textile/users-grpc": "2.1.0",
"@textile/grpc-authentication": "^0.3.0",
"@textile/grpc-connection": "^0.2.0",
"@textile/grpc-transport": "^0.0.6",
"@textile/hub-grpc": "2.1.6",
"@textile/hub-threads-client": "^1.1.0",
"@textile/security": "^0.4.0",
"@textile/threads-id": "^0.1.16",
"@textile/users-grpc": "2.1.6",
"@types/next-tick": "^1.0.0",

@@ -73,3 +73,3 @@ "cids": "^0.8.0",

],
"gitHead": "41f1e44d027a68b7d67fc32f731268d8fc14d5d5"
"gitHead": "2167d5998b49d9b727c507fb1944668774a3e9a8"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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