From cf9970e1948e335b9aa9869325f73aea8e20ea69 Mon Sep 17 00:00:00 2001 From: Charlie Laabs Date: Mon, 18 Jul 2022 23:03:33 -0500 Subject: [PATCH] Fix bundled types and main entrypoint --- Readme.md | 10 ++++++++++ package-lock.json | 2 +- package.json | 5 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 7a7dc42..54a7278 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,12 @@ # ubisoft-demux-node +[![npm](https://img.shields.io/npm/v/ubisoft-demux)](https://www.npmjs.com/package/ubisoft-demux) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/claabs/ubisoft-demux-node/Unit%20test%20and%20build) [![Coverage Status](https://coveralls.io/repos/github/claabs/ubisoft-demux-node/badge.svg?branch=master)](https://coveralls.io/github/claabs/ubisoft-demux-node?branch=master) +The Ubisoft Connect game launcher uses a bespoke socket-level protocol sending protocol buffer encoded messages to perform the majority of its core functionality. +This package implements the Demux protocol and assists with communicating directly with the Demux API. + ## Usage The package is well documented with JSDoc and TypeScript. Hovering and IntelliSense should give you plenty of information on each function. The types for the protobuf data are undocumented as of now due to being internal Ubisoft knowledge. @@ -16,6 +20,7 @@ You should be using this package guided by knowledge gained from reverse enginee Basic requests contain a `requestId` that must increment with each request. This method keeps track of all requests and manages the `requestId` for you. ```ts +import { UbisoftDemux } from 'ubisoft-demux'; const ubiDemux = new UbisoftDemux(); const resp = await ubiDemux.basicRequest({ getPatchInfoReq: { @@ -31,6 +36,7 @@ const resp = await ubiDemux.basicRequest({ A service is a set of requests restricted to a certain domain's data model. This package will keep track of a request's service type and decode it appropriately. ```ts +import { UbisoftDemux } from 'ubisoft-demux'; const ubiDemux = new UbisoftDemux(); const resp = await ubiDemux.serviceRequest('utility_service', { request: { @@ -44,6 +50,7 @@ const resp = await ubiDemux.serviceRequest('utility_service', { Most service interactions occur through an open "connection". This package will open a connection and manage incrementing its connection `requestId`. ```ts +import { UbisoftDemux } from 'ubisoft-demux'; const ubiDemux = new UbisoftDemux(); const connection = await ubiDemux.openConnection('ownership_service'); const resp = await connection.request({ @@ -63,6 +70,7 @@ const resp = await connection.request({ You can authenticate with the Demux API using a login ticket obtained from the UbiServices HTTP API. See below for more on it. ```ts +import { UbisoftDemux } from 'ubisoft-demux'; const ubiDemux = new UbisoftDemux(); await ubiDemux.basicRequest({ authenticateReq: { @@ -88,6 +96,7 @@ Ubisoft's HTTP REST API is out of the scope of this package, but it contains som Currently only supports fresh login without 2FA. ```ts +import { UbiServicesApi } from 'ubisoft-demux'; const ubiServices = new UbiServicesApi(); const { ticket } = await ubiServices.login(email, password); ``` @@ -97,6 +106,7 @@ const { ticket } = await ubiServices.login(email, password); Since many of Ubisoft Connect's local files are also protobuf format, this package can also decode many of them. ```ts +import { UbisoftFileParser } from 'ubisoft-demux'; const data = readFileSync(`%LOCALAPPDATA%/Ubisoft Game Launcher/user.dat`); const fileParser = new UbisoftFileParser(); const result = fileParser.parseUserDat(data); diff --git a/package-lock.json b/package-lock.json index 1c7fd03..84c4db5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ubisoft-demux", - "version": "1.10690.0", + "version": "1.10690.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6864346..ce987ab 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "ubisoft-demux", - "version": "1.10690.0", + "version": "1.10690.1", "description": "A Node.js client to interact with Ubisoft Connect's protobuf demux API", - "main": "dist/index.js", + "main": "dist/src/index.js", "scripts": { "test": "DEBUG=ubisoft-demux* jest", "test:ci": "jest --coverage", @@ -10,6 +10,7 @@ "lint": "tsc --noEmit && eslint .", "gen-proto": "protoc proto/*/*.proto --proto_path=proto --plugin=node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=src/generated/. --ts_proto_opt=onlyTypes=true --ts_proto_opt=outputEncodeMethods=false --ts_proto_opt=outputJsonMethods=false --ts_proto_opt=esModuleInterop=true --ts_proto_opt=env=node --ts_proto_opt=useOptionals=messages" }, + "types": "dist/src/index.d.ts", "author": { "name": "Charlie Laabs", "url": "https://github.com/claabs"