@reboot-dev/reboot 0.21.0 → 0.22.0
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 -1
- package/index.js +3 -3
- package/package.json +2 -2
- package/reboot_native.cc +4 -9
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class Reboot {
|
|
|
12
12
|
createExternalContext(name: string, options?: {
|
|
13
13
|
idempotencySeed?: string;
|
|
14
14
|
bearerToken?: string;
|
|
15
|
-
|
|
15
|
+
appInternal?: boolean;
|
|
16
16
|
}): ExternalContext;
|
|
17
17
|
start(): Promise<void>;
|
|
18
18
|
stop(): Promise<void>;
|
package/index.js
CHANGED
|
@@ -59,10 +59,10 @@ export class Reboot {
|
|
|
59
59
|
__classPrivateFieldSet(this, _Reboot_external, reboot_native.Reboot_constructor(), "f");
|
|
60
60
|
}
|
|
61
61
|
createExternalContext(name, options) {
|
|
62
|
-
if (options?.bearerToken && options?.
|
|
63
|
-
throw new Error("At most one of `bearerToken` and `
|
|
62
|
+
if (options?.bearerToken && options?.appInternal) {
|
|
63
|
+
throw new Error("At most one of `bearerToken` and `appInternal` may be set.");
|
|
64
64
|
}
|
|
65
|
-
return reboot_native.Reboot_createExternalContext(__classPrivateFieldGet(this, _Reboot_external, "f"), ExternalContext.fromNativeExternal, name, options?.idempotencySeed, options?.bearerToken, options?.
|
|
65
|
+
return reboot_native.Reboot_createExternalContext(__classPrivateFieldGet(this, _Reboot_external, "f"), ExternalContext.fromNativeExternal, name, options?.idempotencySeed, options?.bearerToken, options?.appInternal);
|
|
66
66
|
}
|
|
67
67
|
async start() {
|
|
68
68
|
await reboot_native.Reboot_start(__classPrivateFieldGet(this, _Reboot_external, "f"));
|
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.
|
|
6
|
+
"@reboot-dev/reboot-api": "0.22.0",
|
|
7
7
|
"chalk": "^4.1.2",
|
|
8
8
|
"node-addon-api": "^7.0.0",
|
|
9
9
|
"node-gyp": ">=10.2.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"name": "@reboot-dev/reboot",
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.22.0",
|
|
18
18
|
"description": "npm package for Reboot",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postinstall": "rbt || exit 0",
|
package/reboot_native.cc
CHANGED
|
@@ -437,9 +437,9 @@ Napi::Value Reboot_createExternalContext(const Napi::CallbackInfo& info) {
|
|
|
437
437
|
bearer_token = info[4].As<Napi::String>().Utf8Value();
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
|
|
440
|
+
bool app_internal = false;
|
|
441
441
|
if (!info[5].IsUndefined()) {
|
|
442
|
-
|
|
442
|
+
app_internal = info[5].As<Napi::Boolean>();
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
std::promise<py::object*> promise;
|
|
@@ -449,7 +449,7 @@ Napi::Value Reboot_createExternalContext(const Napi::CallbackInfo& info) {
|
|
|
449
449
|
&name,
|
|
450
450
|
&idempotency_seed,
|
|
451
451
|
&bearer_token,
|
|
452
|
-
|
|
452
|
+
app_internal,
|
|
453
453
|
&promise]() {
|
|
454
454
|
py::object py_idempotency_seed = py::none();
|
|
455
455
|
if (idempotency_seed.has_value()) {
|
|
@@ -461,18 +461,13 @@ Napi::Value Reboot_createExternalContext(const Napi::CallbackInfo& info) {
|
|
|
461
461
|
if (bearer_token.has_value()) {
|
|
462
462
|
py_bearer_token = py::str(*bearer_token);
|
|
463
463
|
}
|
|
464
|
-
py::object py_use_internal_api_key_from = py::none();
|
|
465
|
-
if (use_internal_api_key_from.has_value()) {
|
|
466
|
-
py_use_internal_api_key_from = py::str(*use_internal_api_key_from);
|
|
467
|
-
}
|
|
468
464
|
promise.set_value(
|
|
469
465
|
new py::object(
|
|
470
466
|
py_reboot->attr("create_external_context")(
|
|
471
467
|
"name"_a = name,
|
|
472
468
|
"idempotency_seed"_a = py_idempotency_seed,
|
|
473
469
|
"bearer_token"_a = py_bearer_token,
|
|
474
|
-
"
|
|
475
|
-
py_use_internal_api_key_from)));
|
|
470
|
+
"app_internal"_a = app_internal)));
|
|
476
471
|
});
|
|
477
472
|
|
|
478
473
|
py::object* py_context = promise.get_future().get();
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REBOOT_VERSION = "0.
|
|
1
|
+
export declare const REBOOT_VERSION = "0.22.0";
|
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const REBOOT_VERSION = "0.
|
|
1
|
+
export const REBOOT_VERSION = "0.22.0";
|