@bracket-games/common 1.1.7 → 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.
- package/dist/grpc/abstract/index.d.ts +1 -0
- package/dist/grpc/abstract/index.js +17 -0
- package/dist/grpc/index.d.ts +1 -0
- package/dist/grpc/index.js +1 -0
- package/dist/grpc/registry/grpc.registry.d.ts +10 -0
- package/dist/grpc/registry/grpc.registry.js +10 -0
- package/dist/utils/base64.util.d.ts +2 -0
- package/dist/utils/base64.util.js +19 -0
- package/dist/utils/crypto.util.d.ts +1 -0
- package/dist/utils/crypto.util.js +11 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './abstract-client-grpc';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./abstract-client-grpc"), exports);
|
package/dist/grpc/index.d.ts
CHANGED
package/dist/grpc/index.js
CHANGED
|
@@ -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,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
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -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);
|