sst 2.5.8 → 2.7.1
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/constructs/future/Auth.js +7 -1
- package/node/api/index.d.ts +1 -4
- package/node/api/index.js +8 -9
- package/node/auth/auth.js +2 -2
- package/node/auth/index.js +1 -2
- package/node/bucket/index.js +2 -3
- package/node/config/index.js +4 -4
- package/node/event-bus/index.js +3 -3
- package/node/function/index.js +3 -3
- package/node/future/auth/adapter/link.d.ts +1 -1
- package/node/future/auth/adapter/link.js +5 -3
- package/node/future/auth/handler.js +7 -2
- package/node/future/auth/index.js +2 -3
- package/node/future/auth/session.js +3 -1
- package/node/graphql/index.d.ts +11 -38
- package/node/graphql/index.js +21 -45
- package/node/job/index.js +10 -7
- package/node/kinesis-stream/index.js +3 -3
- package/node/queue/index.js +2 -3
- package/node/rds/index.js +2 -3
- package/node/site/index.js +18 -19
- package/node/table/index.js +4 -3
- package/node/topic/index.js +4 -3
- package/node/util/index.d.ts +1 -1
- package/node/util/index.js +4 -2
- package/package.json +4 -3
- package/support/base-site-archiver.mjs +12 -12
- package/support/bootstrap-metadata-function/index.mjs +1409 -1345
- package/support/bridge/bridge.mjs +35 -46
- package/support/custom-resources/index.mjs +6503 -6439
- package/support/job-invoker/index.mjs +907 -90
- package/support/rds-migrator/index.mjs +16 -16
- package/support/script-function/index.mjs +907 -90
- package/support/ssr-site-function-archiver.mjs +9 -9
|
@@ -11469,12 +11469,160 @@ var require_dist_cjs36 = __commonJS({
|
|
|
11469
11469
|
}
|
|
11470
11470
|
});
|
|
11471
11471
|
|
|
11472
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11472
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/promise.js
|
|
11473
|
+
var require_promise = __commonJS({
|
|
11474
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/promise.js"(exports) {
|
|
11475
|
+
"use strict";
|
|
11476
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11477
|
+
exports.newLiftedPromise = exports.makeSelfCleaningPromise = void 0;
|
|
11478
|
+
function makeSelfCleaningPromise(promise, cleaner) {
|
|
11479
|
+
if (!cleaner) {
|
|
11480
|
+
return promise;
|
|
11481
|
+
}
|
|
11482
|
+
return promise.finally(() => {
|
|
11483
|
+
cleaner();
|
|
11484
|
+
});
|
|
11485
|
+
}
|
|
11486
|
+
__name(makeSelfCleaningPromise, "makeSelfCleaningPromise");
|
|
11487
|
+
exports.makeSelfCleaningPromise = makeSelfCleaningPromise;
|
|
11488
|
+
function newLiftedPromise(promiseBody) {
|
|
11489
|
+
let localResolve = void 0;
|
|
11490
|
+
let localReject = void 0;
|
|
11491
|
+
let promise = new Promise((resolve, reject) => {
|
|
11492
|
+
localResolve = resolve;
|
|
11493
|
+
localReject = reject;
|
|
11494
|
+
});
|
|
11495
|
+
if (!localResolve || !localReject) {
|
|
11496
|
+
throw new Error("Failed to bind resolve and reject when making lifted promise");
|
|
11497
|
+
}
|
|
11498
|
+
if (promiseBody) {
|
|
11499
|
+
promiseBody(localResolve, localReject);
|
|
11500
|
+
}
|
|
11501
|
+
return {
|
|
11502
|
+
promise,
|
|
11503
|
+
resolve: localResolve,
|
|
11504
|
+
reject: localReject
|
|
11505
|
+
};
|
|
11506
|
+
}
|
|
11507
|
+
__name(newLiftedPromise, "newLiftedPromise");
|
|
11508
|
+
exports.newLiftedPromise = newLiftedPromise;
|
|
11509
|
+
}
|
|
11510
|
+
});
|
|
11511
|
+
|
|
11512
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/cancel.js
|
|
11513
|
+
var require_cancel = __commonJS({
|
|
11514
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/cancel.js"(exports) {
|
|
11515
|
+
"use strict";
|
|
11516
|
+
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
11517
|
+
if (k2 === void 0)
|
|
11518
|
+
k2 = k;
|
|
11519
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11520
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11521
|
+
desc = { enumerable: true, get: function() {
|
|
11522
|
+
return m[k];
|
|
11523
|
+
} };
|
|
11524
|
+
}
|
|
11525
|
+
Object.defineProperty(o, k2, desc);
|
|
11526
|
+
} : function(o, m, k, k2) {
|
|
11527
|
+
if (k2 === void 0)
|
|
11528
|
+
k2 = k;
|
|
11529
|
+
o[k2] = m[k];
|
|
11530
|
+
});
|
|
11531
|
+
var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
11532
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11533
|
+
} : function(o, v) {
|
|
11534
|
+
o["default"] = v;
|
|
11535
|
+
});
|
|
11536
|
+
var __importStar2 = exports && exports.__importStar || function(mod) {
|
|
11537
|
+
if (mod && mod.__esModule)
|
|
11538
|
+
return mod;
|
|
11539
|
+
var result = {};
|
|
11540
|
+
if (mod != null) {
|
|
11541
|
+
for (var k in mod)
|
|
11542
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
11543
|
+
__createBinding2(result, mod, k);
|
|
11544
|
+
}
|
|
11545
|
+
__setModuleDefault2(result, mod);
|
|
11546
|
+
return result;
|
|
11547
|
+
};
|
|
11548
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11549
|
+
exports.newCancellablePromiseFromNextEvent = exports.CancelController = exports.EVENT_NAME = void 0;
|
|
11550
|
+
var events_1 = __require("events");
|
|
11551
|
+
var promise = __importStar2(require_promise());
|
|
11552
|
+
exports.EVENT_NAME = "cancelled";
|
|
11553
|
+
var CancelController = class {
|
|
11554
|
+
constructor(options) {
|
|
11555
|
+
this.cancelled = false;
|
|
11556
|
+
if (options && options.emitterFactory) {
|
|
11557
|
+
this.emitter = options.emitterFactory();
|
|
11558
|
+
} else {
|
|
11559
|
+
this.emitter = new events_1.EventEmitter();
|
|
11560
|
+
}
|
|
11561
|
+
}
|
|
11562
|
+
cancel() {
|
|
11563
|
+
if (!this.cancelled) {
|
|
11564
|
+
this.cancelled = true;
|
|
11565
|
+
this.emitter.emit(exports.EVENT_NAME);
|
|
11566
|
+
this.emitter.removeAllListeners(exports.EVENT_NAME);
|
|
11567
|
+
}
|
|
11568
|
+
}
|
|
11569
|
+
hasBeenCancelled() {
|
|
11570
|
+
return this.cancelled;
|
|
11571
|
+
}
|
|
11572
|
+
addListener(listener) {
|
|
11573
|
+
if (this.cancelled) {
|
|
11574
|
+
listener();
|
|
11575
|
+
return void 0;
|
|
11576
|
+
}
|
|
11577
|
+
this.emitter.on(exports.EVENT_NAME, listener);
|
|
11578
|
+
return () => {
|
|
11579
|
+
this.emitter.removeListener(exports.EVENT_NAME, listener);
|
|
11580
|
+
};
|
|
11581
|
+
}
|
|
11582
|
+
};
|
|
11583
|
+
__name(CancelController, "CancelController");
|
|
11584
|
+
exports.CancelController = CancelController;
|
|
11585
|
+
function newCancellablePromiseFromNextEvent(config) {
|
|
11586
|
+
let onEvent = void 0;
|
|
11587
|
+
let cancelRemoveListener = void 0;
|
|
11588
|
+
let liftedPromise = promise.newLiftedPromise();
|
|
11589
|
+
onEvent = /* @__PURE__ */ __name((eventData) => {
|
|
11590
|
+
try {
|
|
11591
|
+
if (config.eventDataTransformer) {
|
|
11592
|
+
liftedPromise.resolve(config.eventDataTransformer(eventData));
|
|
11593
|
+
} else {
|
|
11594
|
+
liftedPromise.resolve(eventData);
|
|
11595
|
+
}
|
|
11596
|
+
} catch (err) {
|
|
11597
|
+
liftedPromise.reject(err);
|
|
11598
|
+
}
|
|
11599
|
+
}, "onEvent");
|
|
11600
|
+
config.emitter.addListener(config.eventName, onEvent);
|
|
11601
|
+
if (config.cancelController) {
|
|
11602
|
+
cancelRemoveListener = config.cancelController.addListener(() => {
|
|
11603
|
+
liftedPromise.reject(config.cancelMessage);
|
|
11604
|
+
});
|
|
11605
|
+
}
|
|
11606
|
+
return promise.makeSelfCleaningPromise(liftedPromise.promise, () => {
|
|
11607
|
+
if (onEvent) {
|
|
11608
|
+
config.emitter.removeListener(config.eventName, onEvent);
|
|
11609
|
+
}
|
|
11610
|
+
if (cancelRemoveListener) {
|
|
11611
|
+
cancelRemoveListener();
|
|
11612
|
+
}
|
|
11613
|
+
});
|
|
11614
|
+
}
|
|
11615
|
+
__name(newCancellablePromiseFromNextEvent, "newCancellablePromiseFromNextEvent");
|
|
11616
|
+
exports.newCancellablePromiseFromNextEvent = newCancellablePromiseFromNextEvent;
|
|
11617
|
+
}
|
|
11618
|
+
});
|
|
11619
|
+
|
|
11620
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/package.json
|
|
11473
11621
|
var require_package4 = __commonJS({
|
|
11474
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11622
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/package.json"(exports, module) {
|
|
11475
11623
|
module.exports = {
|
|
11476
11624
|
name: "aws-crt",
|
|
11477
|
-
version: "1.15.
|
|
11625
|
+
version: "1.15.15",
|
|
11478
11626
|
description: "NodeJS/browser bindings to the aws-c-* libraries",
|
|
11479
11627
|
homepage: "https://github.com/awslabs/aws-crt-nodejs",
|
|
11480
11628
|
repository: {
|
|
@@ -11504,40 +11652,42 @@ var require_package4 = __commonJS({
|
|
|
11504
11652
|
"@types/jest": "^27.0.1",
|
|
11505
11653
|
"@types/node": "^10.17.54",
|
|
11506
11654
|
"@types/prettier": "2.6.0",
|
|
11507
|
-
"@types/puppeteer": "^5.4.
|
|
11655
|
+
"@types/puppeteer": "^5.4.7",
|
|
11508
11656
|
"@types/uuid": "^3.4.8",
|
|
11509
11657
|
"@types/ws": "^7.4.7",
|
|
11510
11658
|
"aws-sdk": "^2.848.0",
|
|
11659
|
+
"cmake-js": "^6.3.2",
|
|
11511
11660
|
"https-proxy-agent": "^5.0.1",
|
|
11512
11661
|
jest: "^27.2.1",
|
|
11513
11662
|
"jest-puppeteer": "^5.0.4",
|
|
11514
11663
|
"jest-runtime": "^27.2.1",
|
|
11515
11664
|
puppeteer: "^3.3.0",
|
|
11665
|
+
tar: "^6.1.11",
|
|
11516
11666
|
"ts-jest": "^27.0.5",
|
|
11517
11667
|
typedoc: "^0.22.18",
|
|
11518
11668
|
"typedoc-plugin-merge-modules": "^3.1.0",
|
|
11519
11669
|
typescript: "^4.7.4",
|
|
11520
11670
|
uuid: "^8.3.2",
|
|
11521
|
-
yargs: "^17.2.1"
|
|
11522
|
-
"cmake-js": "^6.3.2",
|
|
11523
|
-
tar: "^6.1.11"
|
|
11671
|
+
yargs: "^17.2.1"
|
|
11524
11672
|
},
|
|
11525
11673
|
dependencies: {
|
|
11526
11674
|
"@aws-sdk/util-utf8-browser": "^3.109.0",
|
|
11527
11675
|
"@httptoolkit/websocket-stream": "^6.0.0",
|
|
11528
11676
|
axios: "^0.24.0",
|
|
11677
|
+
buffer: "^6.0.3",
|
|
11678
|
+
"cmake-js": "^6.3.2",
|
|
11529
11679
|
"crypto-js": "^4.0.0",
|
|
11530
11680
|
mqtt: "^4.3.7",
|
|
11531
|
-
|
|
11681
|
+
process: "^0.11.10",
|
|
11532
11682
|
tar: "^6.1.11"
|
|
11533
11683
|
}
|
|
11534
11684
|
};
|
|
11535
11685
|
}
|
|
11536
11686
|
});
|
|
11537
11687
|
|
|
11538
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11688
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/platform.js
|
|
11539
11689
|
var require_platform = __commonJS({
|
|
11540
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11690
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/platform.js"(exports) {
|
|
11541
11691
|
"use strict";
|
|
11542
11692
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11543
11693
|
exports.crt_version = exports.package_info = exports.is_browser = exports.is_nodejs = void 0;
|
|
@@ -11573,9 +11723,9 @@ var require_platform = __commonJS({
|
|
|
11573
11723
|
}
|
|
11574
11724
|
});
|
|
11575
11725
|
|
|
11576
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11726
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/resource_safety.js
|
|
11577
11727
|
var require_resource_safety = __commonJS({
|
|
11578
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11728
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/resource_safety.js"(exports) {
|
|
11579
11729
|
"use strict";
|
|
11580
11730
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
11581
11731
|
function adopt(value) {
|
|
@@ -11624,9 +11774,9 @@ var require_resource_safety = __commonJS({
|
|
|
11624
11774
|
}
|
|
11625
11775
|
});
|
|
11626
11776
|
|
|
11627
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11777
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/binding.js
|
|
11628
11778
|
var require_binding = __commonJS({
|
|
11629
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11779
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/binding.js"(exports) {
|
|
11630
11780
|
"use strict";
|
|
11631
11781
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
11632
11782
|
if (k2 === void 0)
|
|
@@ -11699,9 +11849,9 @@ var require_binding = __commonJS({
|
|
|
11699
11849
|
}
|
|
11700
11850
|
});
|
|
11701
11851
|
|
|
11702
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11852
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/error.js
|
|
11703
11853
|
var require_error = __commonJS({
|
|
11704
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11854
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/error.js"(exports) {
|
|
11705
11855
|
"use strict";
|
|
11706
11856
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
11707
11857
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -11749,9 +11899,9 @@ var require_error = __commonJS({
|
|
|
11749
11899
|
}
|
|
11750
11900
|
});
|
|
11751
11901
|
|
|
11752
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11902
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/native_resource.js
|
|
11753
11903
|
var require_native_resource = __commonJS({
|
|
11754
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11904
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/native_resource.js"(exports) {
|
|
11755
11905
|
"use strict";
|
|
11756
11906
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11757
11907
|
exports.NativeResourceMixin = exports.NativeResource = void 0;
|
|
@@ -11785,9 +11935,9 @@ var require_native_resource = __commonJS({
|
|
|
11785
11935
|
}
|
|
11786
11936
|
});
|
|
11787
11937
|
|
|
11788
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11938
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/io.js
|
|
11789
11939
|
var require_io = __commonJS({
|
|
11790
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11940
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/io.js"(exports) {
|
|
11791
11941
|
"use strict";
|
|
11792
11942
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11793
11943
|
exports.SocketDomain = exports.SocketType = exports.TlsVersion = void 0;
|
|
@@ -11814,9 +11964,9 @@ var require_io = __commonJS({
|
|
|
11814
11964
|
}
|
|
11815
11965
|
});
|
|
11816
11966
|
|
|
11817
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
11967
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/io.js
|
|
11818
11968
|
var require_io2 = __commonJS({
|
|
11819
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
11969
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/io.js"(exports) {
|
|
11820
11970
|
"use strict";
|
|
11821
11971
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
11822
11972
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -11836,6 +11986,7 @@ var require_io2 = __commonJS({
|
|
|
11836
11986
|
Object.defineProperty(exports, "SocketDomain", { enumerable: true, get: function() {
|
|
11837
11987
|
return io_2.SocketDomain;
|
|
11838
11988
|
} });
|
|
11989
|
+
var error_1 = require_error();
|
|
11839
11990
|
function error_code_to_string(error_code) {
|
|
11840
11991
|
return binding_1.default.error_code_to_string(error_code);
|
|
11841
11992
|
}
|
|
@@ -11871,7 +12022,7 @@ var require_io2 = __commonJS({
|
|
|
11871
12022
|
super(binding_1.default.io_input_stream_new(16 * 1024));
|
|
11872
12023
|
this.source = source;
|
|
11873
12024
|
this.source.on("data", (data) => {
|
|
11874
|
-
data = Buffer.isBuffer(data) ? data :
|
|
12025
|
+
data = Buffer.isBuffer(data) ? data : Buffer.from(data.toString());
|
|
11875
12026
|
binding_1.default.io_input_stream_append(this.native_handle(), data);
|
|
11876
12027
|
});
|
|
11877
12028
|
this.source.on("end", () => {
|
|
@@ -11963,6 +12114,9 @@ var require_io2 = __commonJS({
|
|
|
11963
12114
|
exports.TlsContextOptions = TlsContextOptions;
|
|
11964
12115
|
var TlsContext = class extends native_resource_1.NativeResource {
|
|
11965
12116
|
constructor(ctx_opt) {
|
|
12117
|
+
if (ctx_opt == null || ctx_opt == void 0) {
|
|
12118
|
+
throw new error_1.CrtError("TlsContext constructor: ctx_opt not defined");
|
|
12119
|
+
}
|
|
11966
12120
|
super(binding_1.default.io_tls_ctx_new(ctx_opt.min_tls_version, ctx_opt.ca_filepath, ctx_opt.ca_dirpath, ctx_opt.certificate_authority, ctx_opt.alpn_list && ctx_opt.alpn_list.length > 0 ? ctx_opt.alpn_list.join(";") : void 0, ctx_opt.certificate_filepath, ctx_opt.certificate, ctx_opt.private_key_filepath, ctx_opt.private_key, ctx_opt.pkcs12_filepath, ctx_opt.pkcs12_password, ctx_opt.pkcs11_options, ctx_opt.windows_cert_store_path, ctx_opt.verify_peer));
|
|
11967
12121
|
}
|
|
11968
12122
|
};
|
|
@@ -11992,6 +12146,9 @@ var require_io2 = __commonJS({
|
|
|
11992
12146
|
exports.ServerTlsContext = ServerTlsContext;
|
|
11993
12147
|
var TlsConnectionOptions = class extends native_resource_1.NativeResource {
|
|
11994
12148
|
constructor(tls_ctx, server_name, alpn_list = []) {
|
|
12149
|
+
if (tls_ctx == null || tls_ctx == void 0) {
|
|
12150
|
+
throw new error_1.CrtError("TlsConnectionOptions constructor: tls_ctx not defined");
|
|
12151
|
+
}
|
|
11995
12152
|
super(binding_1.default.io_tls_connection_options_new(tls_ctx.native_handle(), server_name, alpn_list && alpn_list.length > 0 ? alpn_list.join(";") : void 0));
|
|
11996
12153
|
this.tls_ctx = tls_ctx;
|
|
11997
12154
|
this.server_name = server_name;
|
|
@@ -12021,9 +12178,9 @@ var require_io2 = __commonJS({
|
|
|
12021
12178
|
}
|
|
12022
12179
|
});
|
|
12023
12180
|
|
|
12024
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12181
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/auth.js
|
|
12025
12182
|
var require_auth = __commonJS({
|
|
12026
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
12183
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/auth.js"(exports) {
|
|
12027
12184
|
"use strict";
|
|
12028
12185
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
12029
12186
|
function adopt(value) {
|
|
@@ -12072,8 +12229,17 @@ var require_auth = __commonJS({
|
|
|
12072
12229
|
return super.newStatic(access_key, secret_key, session_token);
|
|
12073
12230
|
}
|
|
12074
12231
|
static newCognito(config) {
|
|
12232
|
+
if (config == null || config == void 0) {
|
|
12233
|
+
throw new error_1.CrtError("AwsCredentialsProvider newCognito: Cognito config not defined");
|
|
12234
|
+
}
|
|
12075
12235
|
return super.newCognito(config, config.tlsContext != null ? config.tlsContext.native_handle() : new io_1.ClientTlsContext().native_handle(), config.bootstrap != null ? config.bootstrap.native_handle() : null, config.httpProxyOptions ? config.httpProxyOptions.create_native_handle() : null);
|
|
12076
12236
|
}
|
|
12237
|
+
static newX509(config) {
|
|
12238
|
+
if (config == null || config == void 0) {
|
|
12239
|
+
throw new error_1.CrtError("AwsCredentialsProvider newX509: X509 config not defined");
|
|
12240
|
+
}
|
|
12241
|
+
return super.newX509(config, config.tlsContext.native_handle(), config.httpProxyOptions ? config.httpProxyOptions.create_native_handle() : null);
|
|
12242
|
+
}
|
|
12077
12243
|
};
|
|
12078
12244
|
__name(AwsCredentialsProvider, "AwsCredentialsProvider");
|
|
12079
12245
|
exports.AwsCredentialsProvider = AwsCredentialsProvider;
|
|
@@ -12128,9 +12294,9 @@ var require_auth = __commonJS({
|
|
|
12128
12294
|
}
|
|
12129
12295
|
});
|
|
12130
12296
|
|
|
12131
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12297
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/checksums.js
|
|
12132
12298
|
var require_checksums = __commonJS({
|
|
12133
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
12299
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/checksums.js"(exports) {
|
|
12134
12300
|
"use strict";
|
|
12135
12301
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
12136
12302
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -12151,9 +12317,9 @@ var require_checksums = __commonJS({
|
|
|
12151
12317
|
}
|
|
12152
12318
|
});
|
|
12153
12319
|
|
|
12154
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12320
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crt.js
|
|
12155
12321
|
var require_crt = __commonJS({
|
|
12156
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
12322
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crt.js"(exports) {
|
|
12157
12323
|
"use strict";
|
|
12158
12324
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
12159
12325
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -12174,9 +12340,9 @@ var require_crt = __commonJS({
|
|
|
12174
12340
|
}
|
|
12175
12341
|
});
|
|
12176
12342
|
|
|
12177
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12343
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crypto.js
|
|
12178
12344
|
var require_crypto = __commonJS({
|
|
12179
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
12345
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crypto.js"(exports) {
|
|
12180
12346
|
"use strict";
|
|
12181
12347
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
12182
12348
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -12260,41 +12426,9 @@ var require_crypto = __commonJS({
|
|
|
12260
12426
|
}
|
|
12261
12427
|
});
|
|
12262
12428
|
|
|
12263
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12264
|
-
var require_http = __commonJS({
|
|
12265
|
-
"../../node_modules/.pnpm/aws-crt@1.15.9/node_modules/aws-crt/dist/common/http.js"(exports) {
|
|
12266
|
-
"use strict";
|
|
12267
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12268
|
-
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
|
|
12269
|
-
var HttpVersion;
|
|
12270
|
-
(function(HttpVersion2) {
|
|
12271
|
-
HttpVersion2[HttpVersion2["Unknown"] = 0] = "Unknown";
|
|
12272
|
-
HttpVersion2[HttpVersion2["Http1_0"] = 1] = "Http1_0";
|
|
12273
|
-
HttpVersion2[HttpVersion2["Http1_1"] = 2] = "Http1_1";
|
|
12274
|
-
HttpVersion2[HttpVersion2["Http2"] = 3] = "Http2";
|
|
12275
|
-
})(HttpVersion = exports.HttpVersion || (exports.HttpVersion = {}));
|
|
12276
|
-
var HttpProxyAuthenticationType;
|
|
12277
|
-
(function(HttpProxyAuthenticationType2) {
|
|
12278
|
-
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["None"] = 0] = "None";
|
|
12279
|
-
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["Basic"] = 1] = "Basic";
|
|
12280
|
-
})(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));
|
|
12281
|
-
var CommonHttpProxyOptions = class {
|
|
12282
|
-
constructor(host_name, port, auth_method = HttpProxyAuthenticationType.None, auth_username, auth_password) {
|
|
12283
|
-
this.host_name = host_name;
|
|
12284
|
-
this.port = port;
|
|
12285
|
-
this.auth_method = auth_method;
|
|
12286
|
-
this.auth_username = auth_username;
|
|
12287
|
-
this.auth_password = auth_password;
|
|
12288
|
-
}
|
|
12289
|
-
};
|
|
12290
|
-
__name(CommonHttpProxyOptions, "CommonHttpProxyOptions");
|
|
12291
|
-
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
|
|
12292
|
-
}
|
|
12293
|
-
});
|
|
12294
|
-
|
|
12295
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.9/node_modules/aws-crt/dist/common/event.js
|
|
12429
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/event.js
|
|
12296
12430
|
var require_event = __commonJS({
|
|
12297
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
12431
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/event.js"(exports) {
|
|
12298
12432
|
"use strict";
|
|
12299
12433
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12300
12434
|
exports.BufferedEventEmitter = void 0;
|
|
@@ -12341,9 +12475,659 @@ var require_event = __commonJS({
|
|
|
12341
12475
|
}
|
|
12342
12476
|
});
|
|
12343
12477
|
|
|
12344
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
12478
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream_utils.js
|
|
12479
|
+
var require_eventstream_utils = __commonJS({
|
|
12480
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream_utils.js"(exports) {
|
|
12481
|
+
"use strict";
|
|
12482
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12483
|
+
exports.unmarshalInt64BigintFromBuffer = exports.marshalInt64BigintAsBuffer = exports.MIN_INT64 = exports.MAX_INT64 = exports.MIN_INT32 = exports.MAX_INT32 = exports.MIN_INT16 = exports.MAX_INT16 = exports.MIN_INT8 = exports.MAX_INT8 = void 0;
|
|
12484
|
+
var error_1 = require_error();
|
|
12485
|
+
exports.MAX_INT8 = 127;
|
|
12486
|
+
exports.MIN_INT8 = -128;
|
|
12487
|
+
exports.MAX_INT16 = 32767;
|
|
12488
|
+
exports.MIN_INT16 = -32768;
|
|
12489
|
+
exports.MAX_INT32 = 2147483647;
|
|
12490
|
+
exports.MIN_INT32 = -2147483648;
|
|
12491
|
+
exports.MAX_INT64 = BigInt("9223372036854775807");
|
|
12492
|
+
exports.MIN_INT64 = BigInt("-9223372036854775808");
|
|
12493
|
+
var MAX_UINT8_AS_BIGINT = BigInt("256");
|
|
12494
|
+
function marshalInt64BigintAsBuffer(value) {
|
|
12495
|
+
if (value < exports.MIN_INT64 || value > exports.MAX_INT64) {
|
|
12496
|
+
throw new error_1.CrtError("marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes");
|
|
12497
|
+
}
|
|
12498
|
+
let buffer = new Uint8Array(8);
|
|
12499
|
+
if (value < 0) {
|
|
12500
|
+
value = -value - BigInt(1);
|
|
12501
|
+
for (let i = 0; i < 8; ++i) {
|
|
12502
|
+
buffer[i] = 255 - Number(value % MAX_UINT8_AS_BIGINT);
|
|
12503
|
+
value /= MAX_UINT8_AS_BIGINT;
|
|
12504
|
+
}
|
|
12505
|
+
} else {
|
|
12506
|
+
for (let i = 0; i < 8; ++i) {
|
|
12507
|
+
buffer[i] = Number(value % MAX_UINT8_AS_BIGINT);
|
|
12508
|
+
value /= MAX_UINT8_AS_BIGINT;
|
|
12509
|
+
}
|
|
12510
|
+
}
|
|
12511
|
+
return buffer;
|
|
12512
|
+
}
|
|
12513
|
+
__name(marshalInt64BigintAsBuffer, "marshalInt64BigintAsBuffer");
|
|
12514
|
+
exports.marshalInt64BigintAsBuffer = marshalInt64BigintAsBuffer;
|
|
12515
|
+
function unmarshalInt64BigintFromBuffer(buffer) {
|
|
12516
|
+
let value = BigInt(0);
|
|
12517
|
+
let byteView = new Uint8Array(buffer);
|
|
12518
|
+
if (byteView.length != 8) {
|
|
12519
|
+
throw new error_1.CrtError("unmarshalInt64BigintFromBuffer expects a byte buffer of length 8");
|
|
12520
|
+
}
|
|
12521
|
+
let shift = BigInt(1);
|
|
12522
|
+
let isNegative = (byteView[7] & 128) != 0;
|
|
12523
|
+
if (isNegative) {
|
|
12524
|
+
for (let i = 0; i < byteView.length; ++i) {
|
|
12525
|
+
let byteValue = BigInt(255 - byteView[i]);
|
|
12526
|
+
value += byteValue * shift;
|
|
12527
|
+
shift *= MAX_UINT8_AS_BIGINT;
|
|
12528
|
+
}
|
|
12529
|
+
value += BigInt(1);
|
|
12530
|
+
value = -value;
|
|
12531
|
+
} else {
|
|
12532
|
+
for (let i = 0; i < byteView.length; ++i) {
|
|
12533
|
+
let byteValue = BigInt(byteView[i]);
|
|
12534
|
+
value += byteValue * shift;
|
|
12535
|
+
shift *= MAX_UINT8_AS_BIGINT;
|
|
12536
|
+
}
|
|
12537
|
+
}
|
|
12538
|
+
return value;
|
|
12539
|
+
}
|
|
12540
|
+
__name(unmarshalInt64BigintFromBuffer, "unmarshalInt64BigintFromBuffer");
|
|
12541
|
+
exports.unmarshalInt64BigintFromBuffer = unmarshalInt64BigintFromBuffer;
|
|
12542
|
+
}
|
|
12543
|
+
});
|
|
12544
|
+
|
|
12545
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream.js
|
|
12546
|
+
var require_eventstream = __commonJS({
|
|
12547
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream.js"(exports) {
|
|
12548
|
+
"use strict";
|
|
12549
|
+
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12550
|
+
if (k2 === void 0)
|
|
12551
|
+
k2 = k;
|
|
12552
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12553
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12554
|
+
desc = { enumerable: true, get: function() {
|
|
12555
|
+
return m[k];
|
|
12556
|
+
} };
|
|
12557
|
+
}
|
|
12558
|
+
Object.defineProperty(o, k2, desc);
|
|
12559
|
+
} : function(o, m, k, k2) {
|
|
12560
|
+
if (k2 === void 0)
|
|
12561
|
+
k2 = k;
|
|
12562
|
+
o[k2] = m[k];
|
|
12563
|
+
});
|
|
12564
|
+
var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
12565
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
12566
|
+
} : function(o, v) {
|
|
12567
|
+
o["default"] = v;
|
|
12568
|
+
});
|
|
12569
|
+
var __importStar2 = exports && exports.__importStar || function(mod) {
|
|
12570
|
+
if (mod && mod.__esModule)
|
|
12571
|
+
return mod;
|
|
12572
|
+
var result = {};
|
|
12573
|
+
if (mod != null) {
|
|
12574
|
+
for (var k in mod)
|
|
12575
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
12576
|
+
__createBinding2(result, mod, k);
|
|
12577
|
+
}
|
|
12578
|
+
__setModuleDefault2(result, mod);
|
|
12579
|
+
return result;
|
|
12580
|
+
};
|
|
12581
|
+
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
12582
|
+
function adopt(value) {
|
|
12583
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
12584
|
+
resolve(value);
|
|
12585
|
+
});
|
|
12586
|
+
}
|
|
12587
|
+
__name(adopt, "adopt");
|
|
12588
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
12589
|
+
function fulfilled(value) {
|
|
12590
|
+
try {
|
|
12591
|
+
step(generator.next(value));
|
|
12592
|
+
} catch (e) {
|
|
12593
|
+
reject(e);
|
|
12594
|
+
}
|
|
12595
|
+
}
|
|
12596
|
+
__name(fulfilled, "fulfilled");
|
|
12597
|
+
function rejected(value) {
|
|
12598
|
+
try {
|
|
12599
|
+
step(generator["throw"](value));
|
|
12600
|
+
} catch (e) {
|
|
12601
|
+
reject(e);
|
|
12602
|
+
}
|
|
12603
|
+
}
|
|
12604
|
+
__name(rejected, "rejected");
|
|
12605
|
+
function step(result) {
|
|
12606
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
12607
|
+
}
|
|
12608
|
+
__name(step, "step");
|
|
12609
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12610
|
+
});
|
|
12611
|
+
};
|
|
12612
|
+
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
12613
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12614
|
+
};
|
|
12615
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12616
|
+
exports.ClientStream = exports.ClientConnection = exports.MessageType = exports.MessageFlags = exports.Header = exports.HeaderType = void 0;
|
|
12617
|
+
var native_resource_1 = require_native_resource();
|
|
12618
|
+
var event_1 = require_event();
|
|
12619
|
+
var error_1 = require_error();
|
|
12620
|
+
var io = __importStar2(require_io2());
|
|
12621
|
+
var eventstream_utils = __importStar2(require_eventstream_utils());
|
|
12622
|
+
var promise = __importStar2(require_promise());
|
|
12623
|
+
var binding_1 = __importDefault2(require_binding());
|
|
12624
|
+
var HeaderType;
|
|
12625
|
+
(function(HeaderType2) {
|
|
12626
|
+
HeaderType2[HeaderType2["BooleanTrue"] = 0] = "BooleanTrue";
|
|
12627
|
+
HeaderType2[HeaderType2["BooleanFalse"] = 1] = "BooleanFalse";
|
|
12628
|
+
HeaderType2[HeaderType2["Byte"] = 2] = "Byte";
|
|
12629
|
+
HeaderType2[HeaderType2["Int16"] = 3] = "Int16";
|
|
12630
|
+
HeaderType2[HeaderType2["Int32"] = 4] = "Int32";
|
|
12631
|
+
HeaderType2[HeaderType2["Int64"] = 5] = "Int64";
|
|
12632
|
+
HeaderType2[HeaderType2["ByteBuffer"] = 6] = "ByteBuffer";
|
|
12633
|
+
HeaderType2[HeaderType2["String"] = 7] = "String";
|
|
12634
|
+
HeaderType2[HeaderType2["Timestamp"] = 8] = "Timestamp";
|
|
12635
|
+
HeaderType2[HeaderType2["UUID"] = 9] = "UUID";
|
|
12636
|
+
})(HeaderType = exports.HeaderType || (exports.HeaderType = {}));
|
|
12637
|
+
var AWS_MAXIMUM_EVENT_STREAM_HEADER_NAME_LENGTH = 127;
|
|
12638
|
+
var Header = class {
|
|
12639
|
+
constructor(name, type, value) {
|
|
12640
|
+
this.name = name;
|
|
12641
|
+
this.type = type;
|
|
12642
|
+
this.value = value;
|
|
12643
|
+
}
|
|
12644
|
+
static validateHeaderName(name) {
|
|
12645
|
+
if (name.length == 0 || name.length > AWS_MAXIMUM_EVENT_STREAM_HEADER_NAME_LENGTH) {
|
|
12646
|
+
throw new error_1.CrtError(`Event stream header name (${name}) is not valid`);
|
|
12647
|
+
}
|
|
12648
|
+
}
|
|
12649
|
+
static newBoolean(name, value) {
|
|
12650
|
+
Header.validateHeaderName(name);
|
|
12651
|
+
if (value) {
|
|
12652
|
+
return new Header(name, HeaderType.BooleanTrue);
|
|
12653
|
+
} else {
|
|
12654
|
+
return new Header(name, HeaderType.BooleanFalse);
|
|
12655
|
+
}
|
|
12656
|
+
}
|
|
12657
|
+
static newByte(name, value) {
|
|
12658
|
+
Header.validateHeaderName(name);
|
|
12659
|
+
if (value >= eventstream_utils.MIN_INT8 && value <= eventstream_utils.MAX_INT8 && Number.isSafeInteger(value)) {
|
|
12660
|
+
return new Header(name, HeaderType.Byte, value);
|
|
12661
|
+
}
|
|
12662
|
+
throw new error_1.CrtError(`Illegal value for eventstream byte-valued header: ${value}`);
|
|
12663
|
+
}
|
|
12664
|
+
static newInt16(name, value) {
|
|
12665
|
+
Header.validateHeaderName(name);
|
|
12666
|
+
if (value >= eventstream_utils.MIN_INT16 && value <= eventstream_utils.MAX_INT16 && Number.isSafeInteger(value)) {
|
|
12667
|
+
return new Header(name, HeaderType.Int16, value);
|
|
12668
|
+
}
|
|
12669
|
+
throw new error_1.CrtError(`Illegal value for eventstream int16-valued header: ${value}`);
|
|
12670
|
+
}
|
|
12671
|
+
static newInt32(name, value) {
|
|
12672
|
+
Header.validateHeaderName(name);
|
|
12673
|
+
if (value >= eventstream_utils.MIN_INT32 && value <= eventstream_utils.MAX_INT32 && Number.isSafeInteger(value)) {
|
|
12674
|
+
return new Header(name, HeaderType.Int32, value);
|
|
12675
|
+
}
|
|
12676
|
+
throw new error_1.CrtError(`Illegal value for eventstream int32-valued header: ${value}`);
|
|
12677
|
+
}
|
|
12678
|
+
static newInt64FromNumber(name, value) {
|
|
12679
|
+
Header.validateHeaderName(name);
|
|
12680
|
+
if (Number.isSafeInteger(value)) {
|
|
12681
|
+
return new Header(name, HeaderType.Int64, eventstream_utils.marshalInt64BigintAsBuffer(BigInt(value)));
|
|
12682
|
+
}
|
|
12683
|
+
throw new error_1.CrtError(`Illegal value for eventstream int64-valued header: ${value}`);
|
|
12684
|
+
}
|
|
12685
|
+
static newInt64FromBigint(name, value) {
|
|
12686
|
+
Header.validateHeaderName(name);
|
|
12687
|
+
if (value >= eventstream_utils.MIN_INT64 && value <= eventstream_utils.MAX_INT64) {
|
|
12688
|
+
return new Header(name, HeaderType.Int64, eventstream_utils.marshalInt64BigintAsBuffer(value));
|
|
12689
|
+
}
|
|
12690
|
+
throw new error_1.CrtError(`Illegal value for eventstream int64-valued header: ${value}`);
|
|
12691
|
+
}
|
|
12692
|
+
static newByteBuffer(name, value) {
|
|
12693
|
+
Header.validateHeaderName(name);
|
|
12694
|
+
return new Header(name, HeaderType.ByteBuffer, value);
|
|
12695
|
+
}
|
|
12696
|
+
static newString(name, value) {
|
|
12697
|
+
Header.validateHeaderName(name);
|
|
12698
|
+
return new Header(name, HeaderType.String, value);
|
|
12699
|
+
}
|
|
12700
|
+
static newTimeStampFromSecondsSinceEpoch(name, secondsSinceEpoch) {
|
|
12701
|
+
Header.validateHeaderName(name);
|
|
12702
|
+
if (Number.isSafeInteger(secondsSinceEpoch) && secondsSinceEpoch >= 0) {
|
|
12703
|
+
return new Header(name, HeaderType.Timestamp, secondsSinceEpoch);
|
|
12704
|
+
}
|
|
12705
|
+
throw new error_1.CrtError(`Illegal value for eventstream timestamp-valued header: ${secondsSinceEpoch}`);
|
|
12706
|
+
}
|
|
12707
|
+
static newTimeStampFromDate(name, date) {
|
|
12708
|
+
Header.validateHeaderName(name);
|
|
12709
|
+
const secondsSinceEpoch = date.getTime();
|
|
12710
|
+
if (Number.isSafeInteger(secondsSinceEpoch)) {
|
|
12711
|
+
return new Header(name, HeaderType.Timestamp, secondsSinceEpoch);
|
|
12712
|
+
}
|
|
12713
|
+
throw new error_1.CrtError(`Illegal value for eventstream timestamp-valued header: ${date}`);
|
|
12714
|
+
}
|
|
12715
|
+
static newUUID(name, value) {
|
|
12716
|
+
Header.validateHeaderName(name);
|
|
12717
|
+
if (value.byteLength == 16) {
|
|
12718
|
+
return new Header(name, HeaderType.UUID, value);
|
|
12719
|
+
}
|
|
12720
|
+
throw new error_1.CrtError(`Illegal value for eventstream uuid-valued header: ${value}`);
|
|
12721
|
+
}
|
|
12722
|
+
toValue(type) {
|
|
12723
|
+
if (type != this.type) {
|
|
12724
|
+
throw new error_1.CrtError(`Header of type (${this.type}) cannot be converted to type (${type})`);
|
|
12725
|
+
}
|
|
12726
|
+
return this.value;
|
|
12727
|
+
}
|
|
12728
|
+
asBoolean() {
|
|
12729
|
+
switch (this.type) {
|
|
12730
|
+
case HeaderType.BooleanFalse:
|
|
12731
|
+
return false;
|
|
12732
|
+
case HeaderType.BooleanTrue:
|
|
12733
|
+
return true;
|
|
12734
|
+
default:
|
|
12735
|
+
throw new error_1.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`);
|
|
12736
|
+
}
|
|
12737
|
+
}
|
|
12738
|
+
asByte() {
|
|
12739
|
+
return this.toValue(HeaderType.Byte);
|
|
12740
|
+
}
|
|
12741
|
+
asInt16() {
|
|
12742
|
+
return this.toValue(HeaderType.Int16);
|
|
12743
|
+
}
|
|
12744
|
+
asInt32() {
|
|
12745
|
+
return this.toValue(HeaderType.Int32);
|
|
12746
|
+
}
|
|
12747
|
+
asInt64() {
|
|
12748
|
+
return eventstream_utils.unmarshalInt64BigintFromBuffer(this.toValue(HeaderType.Int64));
|
|
12749
|
+
}
|
|
12750
|
+
asByteBuffer() {
|
|
12751
|
+
return this.toValue(HeaderType.ByteBuffer);
|
|
12752
|
+
}
|
|
12753
|
+
asString() {
|
|
12754
|
+
return this.toValue(HeaderType.String);
|
|
12755
|
+
}
|
|
12756
|
+
asTimestamp() {
|
|
12757
|
+
return this.toValue(HeaderType.Timestamp);
|
|
12758
|
+
}
|
|
12759
|
+
asUUID() {
|
|
12760
|
+
return this.toValue(HeaderType.UUID);
|
|
12761
|
+
}
|
|
12762
|
+
};
|
|
12763
|
+
__name(Header, "Header");
|
|
12764
|
+
exports.Header = Header;
|
|
12765
|
+
var MessageFlags;
|
|
12766
|
+
(function(MessageFlags2) {
|
|
12767
|
+
MessageFlags2[MessageFlags2["None"] = 0] = "None";
|
|
12768
|
+
MessageFlags2[MessageFlags2["ConnectionAccepted"] = 1] = "ConnectionAccepted";
|
|
12769
|
+
MessageFlags2[MessageFlags2["TerminateStream"] = 2] = "TerminateStream";
|
|
12770
|
+
})(MessageFlags = exports.MessageFlags || (exports.MessageFlags = {}));
|
|
12771
|
+
var MessageType;
|
|
12772
|
+
(function(MessageType2) {
|
|
12773
|
+
MessageType2[MessageType2["ApplicationMessage"] = 0] = "ApplicationMessage";
|
|
12774
|
+
MessageType2[MessageType2["ApplicationError"] = 1] = "ApplicationError";
|
|
12775
|
+
MessageType2[MessageType2["Ping"] = 2] = "Ping";
|
|
12776
|
+
MessageType2[MessageType2["PingResponse"] = 3] = "PingResponse";
|
|
12777
|
+
MessageType2[MessageType2["Connect"] = 4] = "Connect";
|
|
12778
|
+
MessageType2[MessageType2["ConnectAck"] = 5] = "ConnectAck";
|
|
12779
|
+
MessageType2[MessageType2["ProtocolError"] = 6] = "ProtocolError";
|
|
12780
|
+
MessageType2[MessageType2["InternalError"] = 7] = "InternalError";
|
|
12781
|
+
})(MessageType = exports.MessageType || (exports.MessageType = {}));
|
|
12782
|
+
function mapPodHeadersToJSHeaders(headers) {
|
|
12783
|
+
return Array.from(headers, (header) => {
|
|
12784
|
+
return new Header(header.name, header.type, header.value);
|
|
12785
|
+
});
|
|
12786
|
+
}
|
|
12787
|
+
__name(mapPodHeadersToJSHeaders, "mapPodHeadersToJSHeaders");
|
|
12788
|
+
function mapPodMessageToJSMessage(message) {
|
|
12789
|
+
let jsMessage = {
|
|
12790
|
+
type: message.type,
|
|
12791
|
+
flags: message.flags,
|
|
12792
|
+
payload: message.payload
|
|
12793
|
+
};
|
|
12794
|
+
if (message.headers) {
|
|
12795
|
+
jsMessage.headers = mapPodHeadersToJSHeaders(message.headers);
|
|
12796
|
+
}
|
|
12797
|
+
return jsMessage;
|
|
12798
|
+
}
|
|
12799
|
+
__name(mapPodMessageToJSMessage, "mapPodMessageToJSMessage");
|
|
12800
|
+
var ClientConnectionState;
|
|
12801
|
+
(function(ClientConnectionState2) {
|
|
12802
|
+
ClientConnectionState2[ClientConnectionState2["None"] = 0] = "None";
|
|
12803
|
+
ClientConnectionState2[ClientConnectionState2["Connecting"] = 1] = "Connecting";
|
|
12804
|
+
ClientConnectionState2[ClientConnectionState2["Connected"] = 2] = "Connected";
|
|
12805
|
+
ClientConnectionState2[ClientConnectionState2["Disconnected"] = 3] = "Disconnected";
|
|
12806
|
+
ClientConnectionState2[ClientConnectionState2["Closed"] = 4] = "Closed";
|
|
12807
|
+
})(ClientConnectionState || (ClientConnectionState = {}));
|
|
12808
|
+
var ClientConnection = class extends (0, native_resource_1.NativeResourceMixin)(event_1.BufferedEventEmitter) {
|
|
12809
|
+
constructor(config) {
|
|
12810
|
+
if (config === void 0) {
|
|
12811
|
+
throw new error_1.CrtError("Invalid configuration passed to eventstream ClientConnection constructor");
|
|
12812
|
+
}
|
|
12813
|
+
super();
|
|
12814
|
+
this.state = ClientConnectionState.None;
|
|
12815
|
+
this._super(binding_1.default.event_stream_client_connection_new(this, config, (connection, errorCode) => {
|
|
12816
|
+
ClientConnection._s_on_disconnect(connection, errorCode);
|
|
12817
|
+
}, (connection, message) => {
|
|
12818
|
+
ClientConnection._s_on_protocol_message(connection, message);
|
|
12819
|
+
}, config.socketOptions ? config.socketOptions.native_handle() : null, config.tlsCtx ? config.tlsCtx.native_handle() : null));
|
|
12820
|
+
}
|
|
12821
|
+
close() {
|
|
12822
|
+
if (this.state != ClientConnectionState.Closed) {
|
|
12823
|
+
this.state = ClientConnectionState.Closed;
|
|
12824
|
+
binding_1.default.event_stream_client_connection_close(this.native_handle());
|
|
12825
|
+
}
|
|
12826
|
+
}
|
|
12827
|
+
connect(options) {
|
|
12828
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
12829
|
+
let cleanupCancelListener = void 0;
|
|
12830
|
+
let connectPromise = new Promise((resolve, reject) => {
|
|
12831
|
+
if (!options) {
|
|
12832
|
+
reject(new error_1.CrtError("Invalid options passed to event stream ClientConnection.connect"));
|
|
12833
|
+
return;
|
|
12834
|
+
}
|
|
12835
|
+
if (this.state != ClientConnectionState.None) {
|
|
12836
|
+
reject(new error_1.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));
|
|
12837
|
+
return;
|
|
12838
|
+
}
|
|
12839
|
+
this.state = ClientConnectionState.Connecting;
|
|
12840
|
+
if (options.cancelController) {
|
|
12841
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
12842
|
+
reject(new error_1.CrtError(`Event stream connection connect() cancelled by external request.`));
|
|
12843
|
+
setImmediate(() => {
|
|
12844
|
+
this.close();
|
|
12845
|
+
});
|
|
12846
|
+
}, "cancel");
|
|
12847
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
12848
|
+
if (!cleanupCancelListener) {
|
|
12849
|
+
return;
|
|
12850
|
+
}
|
|
12851
|
+
}
|
|
12852
|
+
function curriedPromiseCallback(connection, errorCode) {
|
|
12853
|
+
return ClientConnection._s_on_connection_setup(resolve, reject, connection, errorCode);
|
|
12854
|
+
}
|
|
12855
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
12856
|
+
try {
|
|
12857
|
+
binding_1.default.event_stream_client_connection_connect(this.native_handle(), curriedPromiseCallback);
|
|
12858
|
+
} catch (e) {
|
|
12859
|
+
this.state = ClientConnectionState.Disconnected;
|
|
12860
|
+
reject(e);
|
|
12861
|
+
}
|
|
12862
|
+
});
|
|
12863
|
+
return promise.makeSelfCleaningPromise(connectPromise, cleanupCancelListener);
|
|
12864
|
+
});
|
|
12865
|
+
}
|
|
12866
|
+
sendProtocolMessage(options) {
|
|
12867
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
12868
|
+
let cleanupCancelListener = void 0;
|
|
12869
|
+
let sendProtocolMessagePromise = new Promise((resolve, reject) => {
|
|
12870
|
+
try {
|
|
12871
|
+
let curriedPromiseCallback = function(errorCode) {
|
|
12872
|
+
return ClientConnection._s_on_connection_send_protocol_message_completion(resolve, reject, errorCode);
|
|
12873
|
+
};
|
|
12874
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
12875
|
+
if (!options) {
|
|
12876
|
+
reject(new error_1.CrtError("Invalid options passed to event stream ClientConnection.sendProtocolMessage"));
|
|
12877
|
+
return;
|
|
12878
|
+
}
|
|
12879
|
+
if (!this.isConnected()) {
|
|
12880
|
+
reject(new error_1.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));
|
|
12881
|
+
return;
|
|
12882
|
+
}
|
|
12883
|
+
if (options.cancelController) {
|
|
12884
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
12885
|
+
reject(new error_1.CrtError(`Event stream connection sendProtocolMessage() cancelled by external request.`));
|
|
12886
|
+
setImmediate(() => {
|
|
12887
|
+
this.close();
|
|
12888
|
+
});
|
|
12889
|
+
}, "cancel");
|
|
12890
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
12891
|
+
if (!cleanupCancelListener) {
|
|
12892
|
+
return;
|
|
12893
|
+
}
|
|
12894
|
+
}
|
|
12895
|
+
binding_1.default.event_stream_client_connection_send_protocol_message(this.native_handle(), options, curriedPromiseCallback);
|
|
12896
|
+
} catch (e) {
|
|
12897
|
+
reject(e);
|
|
12898
|
+
}
|
|
12899
|
+
});
|
|
12900
|
+
return promise.makeSelfCleaningPromise(sendProtocolMessagePromise, cleanupCancelListener);
|
|
12901
|
+
});
|
|
12902
|
+
}
|
|
12903
|
+
isConnected() {
|
|
12904
|
+
return this.state == ClientConnectionState.Connected;
|
|
12905
|
+
}
|
|
12906
|
+
newStream() {
|
|
12907
|
+
if (!this.isConnected()) {
|
|
12908
|
+
throw new error_1.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);
|
|
12909
|
+
}
|
|
12910
|
+
return new ClientStream(this);
|
|
12911
|
+
}
|
|
12912
|
+
on(event, listener) {
|
|
12913
|
+
super.on(event, listener);
|
|
12914
|
+
return this;
|
|
12915
|
+
}
|
|
12916
|
+
static _s_on_connection_setup(resolve, reject, connection, errorCode) {
|
|
12917
|
+
if (errorCode == 0 && connection.state == ClientConnectionState.Connecting) {
|
|
12918
|
+
connection.state = ClientConnectionState.Connected;
|
|
12919
|
+
resolve();
|
|
12920
|
+
} else {
|
|
12921
|
+
if (connection.state != ClientConnectionState.Closed) {
|
|
12922
|
+
connection.state = ClientConnectionState.Disconnected;
|
|
12923
|
+
}
|
|
12924
|
+
reject(io.error_code_to_string(errorCode));
|
|
12925
|
+
}
|
|
12926
|
+
}
|
|
12927
|
+
static _s_on_disconnect(connection, errorCode) {
|
|
12928
|
+
if (connection.state != ClientConnectionState.Closed) {
|
|
12929
|
+
connection.state = ClientConnectionState.Disconnected;
|
|
12930
|
+
}
|
|
12931
|
+
process.nextTick(() => {
|
|
12932
|
+
connection.emit("disconnection", { errorCode });
|
|
12933
|
+
});
|
|
12934
|
+
}
|
|
12935
|
+
static _s_on_protocol_message(connection, message) {
|
|
12936
|
+
process.nextTick(() => {
|
|
12937
|
+
connection.emit("protocolMessage", { message: mapPodMessageToJSMessage(message) });
|
|
12938
|
+
});
|
|
12939
|
+
}
|
|
12940
|
+
static _s_on_connection_send_protocol_message_completion(resolve, reject, errorCode) {
|
|
12941
|
+
if (errorCode == 0) {
|
|
12942
|
+
resolve();
|
|
12943
|
+
} else {
|
|
12944
|
+
reject(io.error_code_to_string(errorCode));
|
|
12945
|
+
}
|
|
12946
|
+
}
|
|
12947
|
+
};
|
|
12948
|
+
__name(ClientConnection, "ClientConnection");
|
|
12949
|
+
exports.ClientConnection = ClientConnection;
|
|
12950
|
+
ClientConnection.DISCONNECTION = "disconnection";
|
|
12951
|
+
ClientConnection.PROTOCOL_MESSAGE = "protocolMessage";
|
|
12952
|
+
var ClientStreamState;
|
|
12953
|
+
(function(ClientStreamState2) {
|
|
12954
|
+
ClientStreamState2[ClientStreamState2["None"] = 0] = "None";
|
|
12955
|
+
ClientStreamState2[ClientStreamState2["Activating"] = 1] = "Activating";
|
|
12956
|
+
ClientStreamState2[ClientStreamState2["Activated"] = 2] = "Activated";
|
|
12957
|
+
ClientStreamState2[ClientStreamState2["Ended"] = 3] = "Ended";
|
|
12958
|
+
ClientStreamState2[ClientStreamState2["Closed"] = 4] = "Closed";
|
|
12959
|
+
})(ClientStreamState || (ClientStreamState = {}));
|
|
12960
|
+
var ClientStream = class extends (0, native_resource_1.NativeResourceMixin)(event_1.BufferedEventEmitter) {
|
|
12961
|
+
constructor(connection) {
|
|
12962
|
+
super();
|
|
12963
|
+
this._super(binding_1.default.event_stream_client_stream_new(this, connection.native_handle(), (stream) => {
|
|
12964
|
+
ClientStream._s_on_stream_ended(stream);
|
|
12965
|
+
}, (stream, message) => {
|
|
12966
|
+
ClientStream._s_on_stream_message(stream, message);
|
|
12967
|
+
}));
|
|
12968
|
+
this.state = ClientStreamState.None;
|
|
12969
|
+
}
|
|
12970
|
+
close() {
|
|
12971
|
+
if (this.state != ClientStreamState.Closed) {
|
|
12972
|
+
this.state = ClientStreamState.Closed;
|
|
12973
|
+
binding_1.default.event_stream_client_stream_close(this.native_handle());
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
activate(options) {
|
|
12977
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
12978
|
+
let cleanupCancelListener = void 0;
|
|
12979
|
+
let activatePromise = new Promise((resolve, reject) => {
|
|
12980
|
+
try {
|
|
12981
|
+
let curriedPromiseCallback = function(stream, errorCode) {
|
|
12982
|
+
return ClientStream._s_on_stream_activated(resolve, reject, stream, errorCode);
|
|
12983
|
+
};
|
|
12984
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
12985
|
+
if (this.state != ClientStreamState.None) {
|
|
12986
|
+
reject(new error_1.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));
|
|
12987
|
+
return;
|
|
12988
|
+
}
|
|
12989
|
+
if (options === void 0) {
|
|
12990
|
+
this.state = ClientStreamState.Ended;
|
|
12991
|
+
reject(new error_1.CrtError("Invalid options passed to ClientStream.activate"));
|
|
12992
|
+
return;
|
|
12993
|
+
}
|
|
12994
|
+
this.state = ClientStreamState.Activating;
|
|
12995
|
+
if (options.cancelController) {
|
|
12996
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
12997
|
+
reject(new error_1.CrtError(`Event stream activate() cancelled by external request.`));
|
|
12998
|
+
setImmediate(() => {
|
|
12999
|
+
this.close();
|
|
13000
|
+
});
|
|
13001
|
+
}, "cancel");
|
|
13002
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
13003
|
+
if (!cleanupCancelListener) {
|
|
13004
|
+
return;
|
|
13005
|
+
}
|
|
13006
|
+
}
|
|
13007
|
+
binding_1.default.event_stream_client_stream_activate(this.native_handle(), options, curriedPromiseCallback);
|
|
13008
|
+
} catch (e) {
|
|
13009
|
+
this.state = ClientStreamState.Ended;
|
|
13010
|
+
reject(e);
|
|
13011
|
+
}
|
|
13012
|
+
});
|
|
13013
|
+
return promise.makeSelfCleaningPromise(activatePromise, cleanupCancelListener);
|
|
13014
|
+
});
|
|
13015
|
+
}
|
|
13016
|
+
sendMessage(options) {
|
|
13017
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
13018
|
+
let cleanupCancelListener = void 0;
|
|
13019
|
+
let sendMessagePromise = new Promise((resolve, reject) => {
|
|
13020
|
+
try {
|
|
13021
|
+
let curriedPromiseCallback = function(errorCode) {
|
|
13022
|
+
return ClientStream._s_on_stream_send_message_completion(resolve, reject, errorCode);
|
|
13023
|
+
};
|
|
13024
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
13025
|
+
if (!options) {
|
|
13026
|
+
reject(new error_1.CrtError("Invalid options passed to ClientStream.sendMessage"));
|
|
13027
|
+
return;
|
|
13028
|
+
}
|
|
13029
|
+
if (this.state != ClientStreamState.Activated) {
|
|
13030
|
+
reject(new error_1.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));
|
|
13031
|
+
return;
|
|
13032
|
+
}
|
|
13033
|
+
if (options.cancelController) {
|
|
13034
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
13035
|
+
reject(new error_1.CrtError(`Event stream sendMessage() cancelled by external request.`));
|
|
13036
|
+
setImmediate(() => {
|
|
13037
|
+
this.close();
|
|
13038
|
+
});
|
|
13039
|
+
}, "cancel");
|
|
13040
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
13041
|
+
if (!cleanupCancelListener) {
|
|
13042
|
+
return;
|
|
13043
|
+
}
|
|
13044
|
+
}
|
|
13045
|
+
binding_1.default.event_stream_client_stream_send_message(this.native_handle(), options, curriedPromiseCallback);
|
|
13046
|
+
} catch (e) {
|
|
13047
|
+
reject(e);
|
|
13048
|
+
}
|
|
13049
|
+
});
|
|
13050
|
+
return promise.makeSelfCleaningPromise(sendMessagePromise, cleanupCancelListener);
|
|
13051
|
+
});
|
|
13052
|
+
}
|
|
13053
|
+
isActive() {
|
|
13054
|
+
return this.state == ClientStreamState.Activated;
|
|
13055
|
+
}
|
|
13056
|
+
on(event, listener) {
|
|
13057
|
+
super.on(event, listener);
|
|
13058
|
+
return this;
|
|
13059
|
+
}
|
|
13060
|
+
static _s_on_stream_activated(resolve, reject, stream, errorCode) {
|
|
13061
|
+
if (errorCode == 0 && stream.state == ClientStreamState.Activating) {
|
|
13062
|
+
stream.state = ClientStreamState.Activated;
|
|
13063
|
+
resolve();
|
|
13064
|
+
} else {
|
|
13065
|
+
if (stream.state != ClientStreamState.Closed) {
|
|
13066
|
+
stream.state = ClientStreamState.Ended;
|
|
13067
|
+
}
|
|
13068
|
+
reject(io.error_code_to_string(errorCode));
|
|
13069
|
+
}
|
|
13070
|
+
}
|
|
13071
|
+
static _s_on_stream_send_message_completion(resolve, reject, errorCode) {
|
|
13072
|
+
if (errorCode == 0) {
|
|
13073
|
+
resolve();
|
|
13074
|
+
} else {
|
|
13075
|
+
reject(io.error_code_to_string(errorCode));
|
|
13076
|
+
}
|
|
13077
|
+
}
|
|
13078
|
+
static _s_on_stream_ended(stream) {
|
|
13079
|
+
process.nextTick(() => {
|
|
13080
|
+
stream.emit(ClientStream.ENDED, {});
|
|
13081
|
+
});
|
|
13082
|
+
}
|
|
13083
|
+
static _s_on_stream_message(stream, message) {
|
|
13084
|
+
process.nextTick(() => {
|
|
13085
|
+
stream.emit(ClientStream.MESSAGE, { message: mapPodMessageToJSMessage(message) });
|
|
13086
|
+
});
|
|
13087
|
+
}
|
|
13088
|
+
};
|
|
13089
|
+
__name(ClientStream, "ClientStream");
|
|
13090
|
+
exports.ClientStream = ClientStream;
|
|
13091
|
+
ClientStream.ENDED = "ended";
|
|
13092
|
+
ClientStream.MESSAGE = "message";
|
|
13093
|
+
}
|
|
13094
|
+
});
|
|
13095
|
+
|
|
13096
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/http.js
|
|
13097
|
+
var require_http = __commonJS({
|
|
13098
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/http.js"(exports) {
|
|
13099
|
+
"use strict";
|
|
13100
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13101
|
+
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
|
|
13102
|
+
var HttpVersion;
|
|
13103
|
+
(function(HttpVersion2) {
|
|
13104
|
+
HttpVersion2[HttpVersion2["Unknown"] = 0] = "Unknown";
|
|
13105
|
+
HttpVersion2[HttpVersion2["Http1_0"] = 1] = "Http1_0";
|
|
13106
|
+
HttpVersion2[HttpVersion2["Http1_1"] = 2] = "Http1_1";
|
|
13107
|
+
HttpVersion2[HttpVersion2["Http2"] = 3] = "Http2";
|
|
13108
|
+
})(HttpVersion = exports.HttpVersion || (exports.HttpVersion = {}));
|
|
13109
|
+
var HttpProxyAuthenticationType;
|
|
13110
|
+
(function(HttpProxyAuthenticationType2) {
|
|
13111
|
+
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["None"] = 0] = "None";
|
|
13112
|
+
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["Basic"] = 1] = "Basic";
|
|
13113
|
+
})(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));
|
|
13114
|
+
var CommonHttpProxyOptions = class {
|
|
13115
|
+
constructor(host_name, port, auth_method = HttpProxyAuthenticationType.None, auth_username, auth_password) {
|
|
13116
|
+
this.host_name = host_name;
|
|
13117
|
+
this.port = port;
|
|
13118
|
+
this.auth_method = auth_method;
|
|
13119
|
+
this.auth_username = auth_username;
|
|
13120
|
+
this.auth_password = auth_password;
|
|
13121
|
+
}
|
|
13122
|
+
};
|
|
13123
|
+
__name(CommonHttpProxyOptions, "CommonHttpProxyOptions");
|
|
13124
|
+
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
|
|
13125
|
+
}
|
|
13126
|
+
});
|
|
13127
|
+
|
|
13128
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/http.js
|
|
12345
13129
|
var require_http2 = __commonJS({
|
|
12346
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13130
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/http.js"(exports) {
|
|
12347
13131
|
"use strict";
|
|
12348
13132
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
12349
13133
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -12411,6 +13195,9 @@ var require_http2 = __commonJS({
|
|
|
12411
13195
|
exports.HttpProxyOptions = HttpProxyOptions;
|
|
12412
13196
|
var HttpClientConnection = class extends HttpConnection {
|
|
12413
13197
|
constructor(bootstrap, host_name, port, socket_options, tls_opts, proxy_options, handle) {
|
|
13198
|
+
if (socket_options == null || socket_options == void 0) {
|
|
13199
|
+
throw new error_1.CrtError("HttpClientConnection constructor: socket_options not defined");
|
|
13200
|
+
}
|
|
12414
13201
|
super(handle ? handle : binding_1.default.http_connection_new(bootstrap != null ? bootstrap.native_handle() : null, (handle2, error_code) => {
|
|
12415
13202
|
this._on_setup(handle2, error_code);
|
|
12416
13203
|
}, (handle2, error_code) => {
|
|
@@ -12513,6 +13300,9 @@ var require_http2 = __commonJS({
|
|
|
12513
13300
|
HttpClientStream.HEADERS = "headers";
|
|
12514
13301
|
var HttpClientConnectionManager = class extends native_resource_1.NativeResource {
|
|
12515
13302
|
constructor(bootstrap, host, port, max_connections, initial_window_size, socket_options, tls_opts, proxy_options) {
|
|
13303
|
+
if (socket_options == null || socket_options == void 0) {
|
|
13304
|
+
throw new error_1.CrtError("HttpClientConnectionManager constructor: socket_options not defined");
|
|
13305
|
+
}
|
|
12516
13306
|
super(binding_1.default.http_connection_manager_new(bootstrap != null ? bootstrap.native_handle() : null, host, port, max_connections, initial_window_size, socket_options.native_handle(), tls_opts ? tls_opts.native_handle() : void 0, proxy_options ? proxy_options.create_native_handle() : void 0, void 0));
|
|
12517
13307
|
this.bootstrap = bootstrap;
|
|
12518
13308
|
this.host = host;
|
|
@@ -12545,6 +13335,9 @@ var require_http2 = __commonJS({
|
|
|
12545
13335
|
});
|
|
12546
13336
|
}
|
|
12547
13337
|
release(connection) {
|
|
13338
|
+
if (connection == null || connection == void 0) {
|
|
13339
|
+
throw new error_1.CrtError("HttpClientConnectionManager release: connection not defined");
|
|
13340
|
+
}
|
|
12548
13341
|
binding_1.default.http_connection_manager_release(this.native_handle(), connection.native_handle());
|
|
12549
13342
|
}
|
|
12550
13343
|
close() {
|
|
@@ -12556,9 +13349,9 @@ var require_http2 = __commonJS({
|
|
|
12556
13349
|
}
|
|
12557
13350
|
});
|
|
12558
13351
|
|
|
12559
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13352
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt.js
|
|
12560
13353
|
var require_mqtt = __commonJS({
|
|
12561
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13354
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt.js"(exports) {
|
|
12562
13355
|
"use strict";
|
|
12563
13356
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12564
13357
|
exports.DEFAULT_RECONNECT_MIN_SEC = exports.DEFAULT_RECONNECT_MAX_SEC = exports.MqttWill = exports.QoS = void 0;
|
|
@@ -12583,9 +13376,9 @@ var require_mqtt = __commonJS({
|
|
|
12583
13376
|
}
|
|
12584
13377
|
});
|
|
12585
13378
|
|
|
12586
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13379
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/aws_iot_shared.js
|
|
12587
13380
|
var require_aws_iot_shared = __commonJS({
|
|
12588
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13381
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/aws_iot_shared.js"(exports) {
|
|
12589
13382
|
"use strict";
|
|
12590
13383
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12591
13384
|
if (k2 === void 0)
|
|
@@ -12719,9 +13512,9 @@ var require_aws_iot_shared = __commonJS({
|
|
|
12719
13512
|
}
|
|
12720
13513
|
});
|
|
12721
13514
|
|
|
12722
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13515
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot.js
|
|
12723
13516
|
var require_aws_iot = __commonJS({
|
|
12724
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13517
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot.js"(exports) {
|
|
12725
13518
|
"use strict";
|
|
12726
13519
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12727
13520
|
if (k2 === void 0)
|
|
@@ -12857,6 +13650,9 @@ var require_aws_iot = __commonJS({
|
|
|
12857
13650
|
}
|
|
12858
13651
|
static configure_websocket_handshake(builder, options) {
|
|
12859
13652
|
if (options) {
|
|
13653
|
+
if (builder == null || builder == void 0) {
|
|
13654
|
+
throw new error_1.CrtError("AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined");
|
|
13655
|
+
}
|
|
12860
13656
|
builder.params.websocket_handshake_transform = (request, done) => __awaiter2(this, void 0, void 0, function* () {
|
|
12861
13657
|
var _a, _b, _c;
|
|
12862
13658
|
const signing_config = (_b = (_a = options.create_signing_config) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _b !== void 0 ? _b : {
|
|
@@ -12897,6 +13693,9 @@ var require_aws_iot = __commonJS({
|
|
|
12897
13693
|
this.configure_websocket_handshake(builder, options);
|
|
12898
13694
|
return builder;
|
|
12899
13695
|
}
|
|
13696
|
+
static new_builder_for_websocket() {
|
|
13697
|
+
return this.new_with_websockets();
|
|
13698
|
+
}
|
|
12900
13699
|
with_certificate_authority_from_path(ca_dirpath, ca_filepath) {
|
|
12901
13700
|
this.tls_ctx_options.override_default_trust_store_from_path(ca_dirpath, ca_filepath);
|
|
12902
13701
|
return this;
|
|
@@ -13021,9 +13820,9 @@ var require_aws_iot = __commonJS({
|
|
|
13021
13820
|
}
|
|
13022
13821
|
});
|
|
13023
13822
|
|
|
13024
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13823
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt_shared.js
|
|
13025
13824
|
var require_mqtt_shared = __commonJS({
|
|
13026
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13825
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt_shared.js"(exports) {
|
|
13027
13826
|
"use strict";
|
|
13028
13827
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13029
13828
|
exports.DEFAULT_KEEP_ALIVE = exports.normalize_payload = void 0;
|
|
@@ -13055,9 +13854,9 @@ var require_mqtt_shared = __commonJS({
|
|
|
13055
13854
|
}
|
|
13056
13855
|
});
|
|
13057
13856
|
|
|
13058
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13857
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5.js
|
|
13059
13858
|
var require_mqtt5 = __commonJS({
|
|
13060
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13859
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5.js"(exports) {
|
|
13061
13860
|
"use strict";
|
|
13062
13861
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13063
13862
|
exports.RetryJitterType = exports.ClientSessionBehavior = void 0;
|
|
@@ -13078,9 +13877,9 @@ var require_mqtt5 = __commonJS({
|
|
|
13078
13877
|
}
|
|
13079
13878
|
});
|
|
13080
13879
|
|
|
13081
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
13880
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5_packet.js
|
|
13082
13881
|
var require_mqtt5_packet = __commonJS({
|
|
13083
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
13882
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5_packet.js"(exports) {
|
|
13084
13883
|
"use strict";
|
|
13085
13884
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13086
13885
|
exports.PacketType = exports.RetainHandlingType = exports.QoS = exports.PayloadFormatIndicator = exports.isSuccessfulPubackReasonCode = exports.PubackReasonCode = exports.isSuccessfulUnsubackReasonCode = exports.UnsubackReasonCode = exports.isSuccessfulSubackReasonCode = exports.SubackReasonCode = exports.isSuccessfulDisconnectReasonCode = exports.DisconnectReasonCode = exports.isSuccessfulConnectReasonCode = exports.ConnectReasonCode = void 0;
|
|
@@ -13241,9 +14040,9 @@ var require_mqtt5_packet = __commonJS({
|
|
|
13241
14040
|
}
|
|
13242
14041
|
});
|
|
13243
14042
|
|
|
13244
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
14043
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt5.js
|
|
13245
14044
|
var require_mqtt52 = __commonJS({
|
|
13246
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
14045
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt5.js"(exports) {
|
|
13247
14046
|
"use strict";
|
|
13248
14047
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13249
14048
|
if (k2 === void 0)
|
|
@@ -13508,9 +14307,9 @@ var require_mqtt52 = __commonJS({
|
|
|
13508
14307
|
}
|
|
13509
14308
|
});
|
|
13510
14309
|
|
|
13511
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
14310
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot_mqtt5.js
|
|
13512
14311
|
var require_aws_iot_mqtt5 = __commonJS({
|
|
13513
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
14312
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot_mqtt5.js"(exports) {
|
|
13514
14313
|
"use strict";
|
|
13515
14314
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13516
14315
|
if (k2 === void 0)
|
|
@@ -13754,9 +14553,9 @@ var require_aws_iot_mqtt5 = __commonJS({
|
|
|
13754
14553
|
}
|
|
13755
14554
|
});
|
|
13756
14555
|
|
|
13757
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
14556
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/iot.js
|
|
13758
14557
|
var require_iot = __commonJS({
|
|
13759
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
14558
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/iot.js"(exports) {
|
|
13760
14559
|
"use strict";
|
|
13761
14560
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13762
14561
|
if (k2 === void 0)
|
|
@@ -13784,9 +14583,9 @@ var require_iot = __commonJS({
|
|
|
13784
14583
|
}
|
|
13785
14584
|
});
|
|
13786
14585
|
|
|
13787
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
14586
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt.js
|
|
13788
14587
|
var require_mqtt2 = __commonJS({
|
|
13789
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
14588
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt.js"(exports) {
|
|
13790
14589
|
"use strict";
|
|
13791
14590
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13792
14591
|
if (k2 === void 0)
|
|
@@ -13890,6 +14689,9 @@ var require_mqtt2 = __commonJS({
|
|
|
13890
14689
|
super();
|
|
13891
14690
|
this.client = client;
|
|
13892
14691
|
this.config = config;
|
|
14692
|
+
if (config == null || config == void 0) {
|
|
14693
|
+
throw new error_1.CrtError("MqttClientConnection constructor: config not defined");
|
|
14694
|
+
}
|
|
13893
14695
|
const will = config.will ? {
|
|
13894
14696
|
topic: config.will.topic,
|
|
13895
14697
|
qos: config.will.qos,
|
|
@@ -13906,6 +14708,12 @@ var require_mqtt2 = __commonJS({
|
|
|
13906
14708
|
max_sec = config.reconnect_max_sec;
|
|
13907
14709
|
min_sec = Math.min(min_sec, max_sec);
|
|
13908
14710
|
}
|
|
14711
|
+
if (client == void 0 || client == null) {
|
|
14712
|
+
throw new error_1.CrtError("MqttClientConnection constructor: client not defined");
|
|
14713
|
+
}
|
|
14714
|
+
if (config.socket_options == void 0 || config.socket_options == null) {
|
|
14715
|
+
throw new error_1.CrtError("MqttClientConnection constructor: socket_options in configuration not defined");
|
|
14716
|
+
}
|
|
13909
14717
|
this._super(binding_1.default.mqtt_client_connection_new(client.native_handle(), (error_code) => {
|
|
13910
14718
|
this._on_connection_interrupted(error_code);
|
|
13911
14719
|
}, (return_code, session_present) => {
|
|
@@ -13932,6 +14740,9 @@ var require_mqtt2 = __commonJS({
|
|
|
13932
14740
|
return __awaiter2(this, void 0, void 0, function* () {
|
|
13933
14741
|
return new Promise((resolve, reject) => {
|
|
13934
14742
|
reject = this._reject(reject);
|
|
14743
|
+
if (this.config.socket_options == null || this.config.socket_options == void 0) {
|
|
14744
|
+
throw new error_1.CrtError("MqttClientConnection connect: socket_options in configuration not defined");
|
|
14745
|
+
}
|
|
13935
14746
|
try {
|
|
13936
14747
|
binding_1.default.mqtt_client_connection_connect(this.native_handle(), this.config.client_id, this.config.host_name, this.config.port, this.config.socket_options.native_handle(), this.config.keep_alive, this.config.ping_timeout, this.config.protocol_operation_timeout, this.config.clean_session, this._on_connect_callback.bind(this, resolve, reject));
|
|
13937
14748
|
} catch (e) {
|
|
@@ -14068,9 +14879,9 @@ var require_mqtt2 = __commonJS({
|
|
|
14068
14879
|
}
|
|
14069
14880
|
});
|
|
14070
14881
|
|
|
14071
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
14882
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/index.js
|
|
14072
14883
|
var require_dist = __commonJS({
|
|
14073
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
14884
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/index.js"(exports) {
|
|
14074
14885
|
"use strict";
|
|
14075
14886
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14076
14887
|
if (k2 === void 0)
|
|
@@ -14105,9 +14916,13 @@ var require_dist = __commonJS({
|
|
|
14105
14916
|
return result;
|
|
14106
14917
|
};
|
|
14107
14918
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14108
|
-
exports.CrtError = exports.resource_safety = exports.platform = exports.mqtt5 = exports.mqtt = exports.iot = exports.io = exports.http = exports.crt = exports.crypto = exports.checksums = exports.auth = void 0;
|
|
14919
|
+
exports.CrtError = exports.resource_safety = exports.promise = exports.platform = exports.mqtt5 = exports.mqtt = exports.iot = exports.io = exports.http = exports.eventstream = exports.crt = exports.crypto = exports.checksums = exports.cancel = exports.auth = void 0;
|
|
14920
|
+
var cancel = __importStar2(require_cancel());
|
|
14921
|
+
exports.cancel = cancel;
|
|
14109
14922
|
var platform = __importStar2(require_platform());
|
|
14110
14923
|
exports.platform = platform;
|
|
14924
|
+
var promise = __importStar2(require_promise());
|
|
14925
|
+
exports.promise = promise;
|
|
14111
14926
|
var resource_safety = __importStar2(require_resource_safety());
|
|
14112
14927
|
exports.resource_safety = resource_safety;
|
|
14113
14928
|
var auth = __importStar2(require_auth());
|
|
@@ -14118,6 +14933,8 @@ var require_dist = __commonJS({
|
|
|
14118
14933
|
exports.crt = crt;
|
|
14119
14934
|
var crypto4 = __importStar2(require_crypto());
|
|
14120
14935
|
exports.crypto = crypto4;
|
|
14936
|
+
var eventstream = __importStar2(require_eventstream());
|
|
14937
|
+
exports.eventstream = eventstream;
|
|
14121
14938
|
var http = __importStar2(require_http2());
|
|
14122
14939
|
exports.http = http;
|
|
14123
14940
|
var io = __importStar2(require_io2());
|