@trinsic/trinsic
Advanced tools
Comparing version 1.7.1-rc1 to 1.7.1-rc2
@@ -9,3 +9,3 @@ "use strict"; | ||
const proto_1 = require("./proto"); | ||
const base64url_1 = __importDefault(require("base64url")); | ||
const js_base64_1 = require("js-base64"); | ||
class AccountService extends ServiceBase_1.default { | ||
@@ -31,3 +31,3 @@ constructor(options) { | ||
}); | ||
return (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(cloned).finish())); | ||
return js_base64_1.Base64.fromUint8Array(proto_1.AccountProfile.encode(cloned).finish(), true); | ||
} | ||
@@ -49,7 +49,7 @@ /** | ||
}); | ||
return (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(cloned).finish())); | ||
return js_base64_1.Base64.fromUint8Array(proto_1.AccountProfile.encode(cloned).finish(), true); | ||
} | ||
static convertToProfile(profile) { | ||
if (typeof profile == "string") { | ||
return proto_1.AccountProfile.decode(base64url_1.default.toBuffer(profile)); | ||
return proto_1.AccountProfile.decode(js_base64_1.Base64.toUint8Array(profile)); | ||
} | ||
@@ -69,3 +69,3 @@ return profile; | ||
let response = await this.client.signIn(request); | ||
const authToken = (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(response.profile).finish())); | ||
const authToken = js_base64_1.Base64.fromUint8Array(proto_1.AccountProfile.encode(response.profile).finish(), true); | ||
// set the auth token as active for the current service instance | ||
@@ -93,3 +93,3 @@ await this.tokenProvider.saveDefault(authToken); | ||
} | ||
let authToken = (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(response.profile).finish())); | ||
let authToken = js_base64_1.Base64.fromUint8Array(proto_1.AccountProfile.encode(response.profile).finish(), true); | ||
if ((_b = (_a = response.profile.protection) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : false) { | ||
@@ -116,3 +116,3 @@ authToken = await AccountService.unprotect(authToken, authCode); | ||
} | ||
const authToken = (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(response.profile).finish())); | ||
const authToken = js_base64_1.Base64.fromUint8Array(proto_1.AccountProfile.encode(response.profile).finish(), true); | ||
await this.tokenProvider.saveDefault(authToken); | ||
@@ -128,3 +128,3 @@ return authToken; | ||
return this.client.info(request, { | ||
metadata: await this.buildMetadata(proto_1.AccountInfoRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.AccountInfoRequest.encode(request).finish()), | ||
}); | ||
@@ -134,3 +134,3 @@ } | ||
return this.client.listDevices(request, { | ||
metadata: await this.buildMetadata(proto_1.ListDevicesRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.ListDevicesRequest.encode(request).finish()), | ||
}); | ||
@@ -140,3 +140,3 @@ } | ||
return this.client.revokeDevice(request, { | ||
metadata: await this.buildMetadata(proto_1.RevokeDeviceRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.RevokeDeviceRequest.encode(request).finish()), | ||
}); | ||
@@ -146,3 +146,3 @@ } | ||
return this.client.authorizeWebhook(request, { | ||
metadata: await this.buildMetadata(proto_1.AuthorizeWebhookRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.AuthorizeWebhookRequest.encode(request).finish()), | ||
}); | ||
@@ -149,0 +149,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
const proto_1 = require("./proto"); | ||
const base64url_1 = __importDefault(require("base64url")); | ||
const js_base64_1 = require("js-base64"); | ||
class ProviderService extends ServiceBase_1.default { | ||
@@ -23,3 +23,3 @@ constructor(options) { | ||
: await this.client.createEcosystem(request); | ||
const authToken = (0, base64url_1.default)(Buffer.from(proto_1.AccountProfile.encode(response.profile).finish())); | ||
const authToken = js_base64_1.Base64.fromUint8Array((proto_1.AccountProfile.encode(response.profile).finish()), true); | ||
this.options.authToken = authToken; | ||
@@ -32,3 +32,3 @@ return response; | ||
return this.client.updateEcosystem(request, { | ||
metadata: await this.buildMetadata(proto_1.UpdateEcosystemRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.UpdateEcosystemRequest.encode(request).finish()), | ||
}); | ||
@@ -38,3 +38,3 @@ } | ||
return this.client.grantAuthorization(request, { | ||
metadata: await this.buildMetadata(proto_1.GrantAuthorizationRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.GrantAuthorizationRequest.encode(request).finish()), | ||
}); | ||
@@ -44,3 +44,3 @@ } | ||
return this.client.revokeAuthorization(request, { | ||
metadata: await this.buildMetadata(proto_1.RevokeAuthorizationRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.RevokeAuthorizationRequest.encode(request).finish()), | ||
}); | ||
@@ -50,3 +50,3 @@ } | ||
return this.client.getAuthorizations(request, { | ||
metadata: await this.buildMetadata(proto_1.GetAuthorizationsRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.GetAuthorizationsRequest.encode(request).finish()), | ||
}); | ||
@@ -56,3 +56,3 @@ } | ||
return this.client.addWebhook(request, { | ||
metadata: await this.buildMetadata(proto_1.AddWebhookRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.AddWebhookRequest.encode(request).finish()), | ||
}); | ||
@@ -62,3 +62,3 @@ } | ||
return this.client.deleteWebhook(request, { | ||
metadata: await this.buildMetadata(proto_1.DeleteWebhookRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.DeleteWebhookRequest.encode(request).finish()), | ||
}); | ||
@@ -68,3 +68,3 @@ } | ||
return this.client.ecosystemInfo(request, { | ||
metadata: await this.buildMetadata(proto_1.EcosystemInfoRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.EcosystemInfoRequest.encode(request).finish()), | ||
}); | ||
@@ -74,3 +74,3 @@ } | ||
return this.client.generateToken(request, { | ||
metadata: await this.buildMetadata(proto_1.GenerateTokenRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.GenerateTokenRequest.encode(request).finish()), | ||
}); | ||
@@ -80,3 +80,3 @@ } | ||
return this.client.invite(request, { | ||
metadata: await this.buildMetadata(proto_1.InviteRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.InviteRequest.encode(request).finish()), | ||
}); | ||
@@ -86,3 +86,3 @@ } | ||
return this.client.invitationStatus(request, { | ||
metadata: await this.buildMetadata(proto_1.InvitationStatusRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.InvitationStatusRequest.encode(request).finish()), | ||
}); | ||
@@ -92,3 +92,3 @@ } | ||
return this.client.getOberonKey(request, { | ||
metadata: await this.buildMetadata() | ||
metadata: await this.buildMetadata(), | ||
}); | ||
@@ -98,3 +98,3 @@ } | ||
return this.client.getEventToken(request, { | ||
metadata: await this.buildMetadata(proto_1.GetEventTokenRequest.encode(request).finish()) | ||
metadata: await this.buildMetadata(proto_1.GetEventTokenRequest.encode(request).finish()), | ||
}); | ||
@@ -101,0 +101,0 @@ } |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const proto_1 = require("./proto"); | ||
const nice_grpc_common_1 = require("nice-grpc-common"); | ||
const base64url_1 = __importDefault(require("base64url")); | ||
const js_base64_1 = require("js-base64"); | ||
const Version_1 = require("./Version"); | ||
@@ -34,3 +31,3 @@ const TokenProvider_1 = require("./TokenProvider"); | ||
} | ||
const profile = proto_1.AccountProfile.decode(base64url_1.default.toBuffer(authToken)); | ||
const profile = proto_1.AccountProfile.decode(js_base64_1.Base64.toUint8Array(authToken)); | ||
if ((_a = profile.protection) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
@@ -46,5 +43,5 @@ throw new Error("profile is protected; you must use security code to remove the protection first"); | ||
`ver=1,` + | ||
`proof=${(0, base64url_1.default)(Buffer.from(proof))},` + | ||
`data=${(0, base64url_1.default)(Buffer.from(profile.authData))},` + | ||
`nonce=${(0, base64url_1.default)(Buffer.from(nonceUint8))}`); | ||
`proof=${js_base64_1.Base64.fromUint8Array(proof, true)},` + | ||
`data=${js_base64_1.Base64.fromUint8Array(profile.authData, true)},` + | ||
`nonce=${js_base64_1.Base64.fromUint8Array(nonceUint8, true)}`); | ||
} | ||
@@ -51,0 +48,0 @@ return metadata; |
{ | ||
"name": "@trinsic/trinsic", | ||
"version": "1.7.1-rc1", | ||
"version": "1.7.1-rc2", | ||
"description": "Node and Browser wrapper for the Trinsic services", | ||
@@ -15,3 +15,4 @@ "browser": { | ||
".": "./lib/index.js", | ||
"./browser": "./lib/browser.js" | ||
"./browser": "./lib/browser/index.js", | ||
"./node": "./lib/node/index.js" | ||
}, | ||
@@ -47,8 +48,8 @@ "scripts": { | ||
"@trinsic/okapi-web": "^1.6.1-rc3", | ||
"base64url": "^3.0.1", | ||
"buffer": "^6.0.3", | ||
"google-protobuf": "^3.20.1", | ||
"long": "^5.2.0", | ||
"nice-grpc": "^1.2.0", | ||
"nice-grpc-web": "^1.1.0", | ||
"nice-grpc": "^1.2.0" | ||
"js-base64": "3.7.2" | ||
}, | ||
@@ -77,4 +78,4 @@ "devDependencies": { | ||
"karma": "^6.3.20", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-coverage": "^2.2.0", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-jasmine": "^5.0.1", | ||
@@ -81,0 +82,0 @@ "karma-jasmine-html-reporter": "^2.0.0", |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
1070173
16304
+ Addedjs-base64@3.7.2
+ Addedjs-base64@3.7.2(transitive)
- Removedbase64url@^3.0.1
- Removedbase64url@3.0.1(transitive)
- Removedjs-base64@3.7.7(transitive)