@bracket-games/common 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,4 +19,14 @@ export declare const GRPC_CLIENTS: {
19
19
  readonly protoPath: string;
20
20
  readonly env: "FILES_GRPC_URL";
21
21
  };
22
+ readonly GAMES_PACKAGE: {
23
+ readonly package: "games.v1";
24
+ readonly protoPath: string;
25
+ readonly env: "GAMES_GRPC_URL";
26
+ };
27
+ readonly ASSETS_PACKAGE: {
28
+ readonly package: "assets.v1";
29
+ readonly protoPath: string;
30
+ readonly env: "ASSETS_GRPC_URL";
31
+ };
22
32
  };
@@ -23,4 +23,14 @@ exports.GRPC_CLIENTS = {
23
23
  protoPath: contracts_1.PROTO_PATHS.FILES,
24
24
  env: "FILES_GRPC_URL",
25
25
  },
26
+ GAMES_PACKAGE: {
27
+ package: "games.v1",
28
+ protoPath: contracts_1.PROTO_PATHS.GAMES,
29
+ env: "GAMES_GRPC_URL",
30
+ },
31
+ ASSETS_PACKAGE: {
32
+ package: "assets.v1",
33
+ protoPath: contracts_1.PROTO_PATHS.ASSETS,
34
+ env: "ASSETS_GRPC_URL",
35
+ },
26
36
  };
@@ -0,0 +1,2 @@
1
+ export declare function base64UrlEncode(buf: Buffer | string): string;
2
+ export declare function base64UrlDecode(str: string): string;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.base64UrlEncode = base64UrlEncode;
4
+ exports.base64UrlDecode = base64UrlDecode;
5
+ function base64UrlEncode(buf) {
6
+ const s = typeof buf === 'string' ? Buffer.from(buf) : buf;
7
+ return s
8
+ .toString('base64')
9
+ .replace(/\+/g, '-')
10
+ .replace(/\//g, '_')
11
+ .replace(/=+$/, '');
12
+ }
13
+ function base64UrlDecode(str) {
14
+ str = str.replace(/-/g, '+').replace(/_/g, '/');
15
+ while (str.length % 4) {
16
+ str += '=';
17
+ }
18
+ return Buffer.from(str, 'base64').toString();
19
+ }
@@ -0,0 +1 @@
1
+ export declare function constantTimeEqual(a: string, b: string): boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constantTimeEqual = constantTimeEqual;
4
+ const crypto_1 = require("crypto");
5
+ function constantTimeEqual(a, b) {
6
+ const bufA = Buffer.from(a);
7
+ const bufB = Buffer.from(b);
8
+ if (bufA.length !== bufB.length)
9
+ return false;
10
+ return (0, crypto_1.timingSafeEqual)(bufA, bufB);
11
+ }
@@ -1,2 +1,4 @@
1
1
  export * from './convert-enum.util';
2
2
  export * from './grpc-to-http-status.util';
3
+ export * from './base64.util';
4
+ export * from './crypto.util';
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./convert-enum.util"), exports);
18
18
  __exportStar(require("./grpc-to-http-status.util"), exports);
19
+ __exportStar(require("./base64.util"), exports);
20
+ __exportStar(require("./crypto.util"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bracket-games/common",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Common utils",
5
5
  "publishConfig": {
6
6
  "access": "public"