@reboot-dev/reboot 0.25.2 → 0.25.4
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/index.d.ts +1 -0
- package/index.js +3 -0
- package/package.json +4 -3
- package/reboot_native.cc +31 -1
- package/reboot_native.cjs +2 -0
- package/reboot_native.d.ts +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -176,6 +176,9 @@ export class Context {
|
|
|
176
176
|
get stateId() {
|
|
177
177
|
return reboot_native.Context_stateId(__classPrivateFieldGet(this, _Context_external, "f"));
|
|
178
178
|
}
|
|
179
|
+
get callerBearerToken() {
|
|
180
|
+
return reboot_native.Context_callerBearerToken(__classPrivateFieldGet(this, _Context_external, "f"));
|
|
181
|
+
}
|
|
179
182
|
get iteration() {
|
|
180
183
|
return reboot_native.Context_iteration(__classPrivateFieldGet(this, _Context_external, "f"));
|
|
181
184
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"@bufbuild/protobuf": "1.3.2",
|
|
4
4
|
"@bufbuild/protoplugin": "1.3.2",
|
|
5
5
|
"@bufbuild/protoc-gen-es": "1.3.2",
|
|
6
|
-
"@reboot-dev/reboot-api": "0.25.
|
|
6
|
+
"@reboot-dev/reboot-api": "0.25.4",
|
|
7
7
|
"chalk": "^4.1.2",
|
|
8
8
|
"node-addon-api": "^7.0.0",
|
|
9
9
|
"node-gyp": ">=10.2.0",
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
"which-pm-runs": "^1.1.0",
|
|
12
12
|
"extensionless": "^1.9.9",
|
|
13
13
|
"esbuild": "^0.24.0",
|
|
14
|
-
"express": "^5.1.0"
|
|
14
|
+
"express": "^5.1.0",
|
|
15
|
+
"@scarf/scarf": "1.4.0"
|
|
15
16
|
},
|
|
16
17
|
"type": "module",
|
|
17
18
|
"name": "@reboot-dev/reboot",
|
|
18
|
-
"version": "0.25.
|
|
19
|
+
"version": "0.25.4",
|
|
19
20
|
"description": "npm package for Reboot",
|
|
20
21
|
"scripts": {
|
|
21
22
|
"postinstall": "rbt || exit 0",
|
package/reboot_native.cc
CHANGED
|
@@ -1504,7 +1504,7 @@ py::object make_py_token_verifier(NapiSafeObjectReference js_token_verifier) {
|
|
|
1504
1504
|
if (token.has_value()) {
|
|
1505
1505
|
js_args.push_back(Napi::String::New(env, *token));
|
|
1506
1506
|
} else {
|
|
1507
|
-
js_args.push_back(env.
|
|
1507
|
+
js_args.push_back(env.Null());
|
|
1508
1508
|
}
|
|
1509
1509
|
|
|
1510
1510
|
Napi::Object js_token_verifier =
|
|
@@ -2291,6 +2291,32 @@ Napi::Value Context_stateId(const Napi::CallbackInfo& info) {
|
|
|
2291
2291
|
return Napi::String::New(info.Env(), state_id);
|
|
2292
2292
|
}
|
|
2293
2293
|
|
|
2294
|
+
Napi::Value Context_callerBearerToken(
|
|
2295
|
+
const Napi::CallbackInfo& info) {
|
|
2296
|
+
Napi::External<py::object> js_external_context =
|
|
2297
|
+
info[0].As<Napi::External<py::object>>();
|
|
2298
|
+
|
|
2299
|
+
// CHECK(...CheckTypeTag(...));
|
|
2300
|
+
|
|
2301
|
+
py::object* py_context = js_external_context.Data();
|
|
2302
|
+
|
|
2303
|
+
std::optional<std::string> caller_bearer_token = RunCallbackOnPythonEventLoop(
|
|
2304
|
+
[py_context]() -> std::optional<std::string> {
|
|
2305
|
+
py::object caller_bearer_token = py_context->attr(
|
|
2306
|
+
"caller_bearer_token");
|
|
2307
|
+
if (caller_bearer_token.is_none()) {
|
|
2308
|
+
return std::nullopt;
|
|
2309
|
+
} else {
|
|
2310
|
+
return std::string(py::str(caller_bearer_token));
|
|
2311
|
+
}
|
|
2312
|
+
});
|
|
2313
|
+
if (caller_bearer_token.has_value()) {
|
|
2314
|
+
return Napi::String::New(info.Env(), *caller_bearer_token);
|
|
2315
|
+
} else {
|
|
2316
|
+
return info.Env().Null();
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2294
2320
|
|
|
2295
2321
|
Napi::Value Context_iteration(const Napi::CallbackInfo& info) {
|
|
2296
2322
|
Napi::External<py::object> js_external_context =
|
|
@@ -2702,6 +2728,10 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
|
|
2702
2728
|
Napi::String::New(env, "Context_stateId"),
|
|
2703
2729
|
Napi::Function::New<Context_stateId>(env));
|
|
2704
2730
|
|
|
2731
|
+
exports.Set(
|
|
2732
|
+
Napi::String::New(env, "Context_callerBearerToken"),
|
|
2733
|
+
Napi::Function::New<Context_callerBearerToken>(env));
|
|
2734
|
+
|
|
2705
2735
|
exports.Set(
|
|
2706
2736
|
Napi::String::New(env, "Context_iteration"),
|
|
2707
2737
|
Napi::Function::New<Context_iteration>(env));
|
package/reboot_native.cjs
CHANGED
|
@@ -76,6 +76,8 @@ exports.Reboot_down = reboot_native.exports.Reboot_down;
|
|
|
76
76
|
exports.Reboot_url = reboot_native.exports.Reboot_url;
|
|
77
77
|
exports.Context_auth = reboot_native.exports.Context_auth;
|
|
78
78
|
exports.Context_stateId = reboot_native.exports.Context_stateId;
|
|
79
|
+
exports.Context_callerBearerToken =
|
|
80
|
+
reboot_native.exports.Context_callerBearerToken;
|
|
79
81
|
exports.Context_cookie = reboot_native.exports.Context_cookie;
|
|
80
82
|
exports.Context_appInternal = reboot_native.exports.Context_appInternal;
|
|
81
83
|
exports.Context_iteration = reboot_native.exports.Context_iteration;
|
package/reboot_native.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export namespace rbt_native {
|
|
|
74
74
|
// This will take an ApplicationConfig proto.
|
|
75
75
|
function Reboot_down(external: NapiExternal): void;
|
|
76
76
|
function Context_stateId(external: NapiExternal): string;
|
|
77
|
+
function Context_callerBearerToken(external: NapiExternal): string;
|
|
77
78
|
function Context_iteration(external: NapiExternal): number;
|
|
78
79
|
function Context_cookie(external: NapiExternal): string;
|
|
79
80
|
function Context_appInternal(external: NapiExternal): boolean;
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REBOOT_VERSION = "0.25.
|
|
1
|
+
export declare const REBOOT_VERSION = "0.25.4";
|
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const REBOOT_VERSION = "0.25.
|
|
1
|
+
export const REBOOT_VERSION = "0.25.4";
|