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
|
@@ -23532,12 +23532,160 @@ var require_dist_cjs36 = __commonJS({
|
|
|
23532
23532
|
}
|
|
23533
23533
|
});
|
|
23534
23534
|
|
|
23535
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23535
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/promise.js
|
|
23536
|
+
var require_promise = __commonJS({
|
|
23537
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/promise.js"(exports) {
|
|
23538
|
+
"use strict";
|
|
23539
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23540
|
+
exports.newLiftedPromise = exports.makeSelfCleaningPromise = void 0;
|
|
23541
|
+
function makeSelfCleaningPromise(promise, cleaner) {
|
|
23542
|
+
if (!cleaner) {
|
|
23543
|
+
return promise;
|
|
23544
|
+
}
|
|
23545
|
+
return promise.finally(() => {
|
|
23546
|
+
cleaner();
|
|
23547
|
+
});
|
|
23548
|
+
}
|
|
23549
|
+
__name(makeSelfCleaningPromise, "makeSelfCleaningPromise");
|
|
23550
|
+
exports.makeSelfCleaningPromise = makeSelfCleaningPromise;
|
|
23551
|
+
function newLiftedPromise(promiseBody) {
|
|
23552
|
+
let localResolve = void 0;
|
|
23553
|
+
let localReject = void 0;
|
|
23554
|
+
let promise = new Promise((resolve, reject) => {
|
|
23555
|
+
localResolve = resolve;
|
|
23556
|
+
localReject = reject;
|
|
23557
|
+
});
|
|
23558
|
+
if (!localResolve || !localReject) {
|
|
23559
|
+
throw new Error("Failed to bind resolve and reject when making lifted promise");
|
|
23560
|
+
}
|
|
23561
|
+
if (promiseBody) {
|
|
23562
|
+
promiseBody(localResolve, localReject);
|
|
23563
|
+
}
|
|
23564
|
+
return {
|
|
23565
|
+
promise,
|
|
23566
|
+
resolve: localResolve,
|
|
23567
|
+
reject: localReject
|
|
23568
|
+
};
|
|
23569
|
+
}
|
|
23570
|
+
__name(newLiftedPromise, "newLiftedPromise");
|
|
23571
|
+
exports.newLiftedPromise = newLiftedPromise;
|
|
23572
|
+
}
|
|
23573
|
+
});
|
|
23574
|
+
|
|
23575
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/cancel.js
|
|
23576
|
+
var require_cancel = __commonJS({
|
|
23577
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/cancel.js"(exports) {
|
|
23578
|
+
"use strict";
|
|
23579
|
+
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
23580
|
+
if (k2 === void 0)
|
|
23581
|
+
k2 = k;
|
|
23582
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23583
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23584
|
+
desc = { enumerable: true, get: function() {
|
|
23585
|
+
return m[k];
|
|
23586
|
+
} };
|
|
23587
|
+
}
|
|
23588
|
+
Object.defineProperty(o, k2, desc);
|
|
23589
|
+
} : function(o, m, k, k2) {
|
|
23590
|
+
if (k2 === void 0)
|
|
23591
|
+
k2 = k;
|
|
23592
|
+
o[k2] = m[k];
|
|
23593
|
+
});
|
|
23594
|
+
var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
23595
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23596
|
+
} : function(o, v) {
|
|
23597
|
+
o["default"] = v;
|
|
23598
|
+
});
|
|
23599
|
+
var __importStar2 = exports && exports.__importStar || function(mod) {
|
|
23600
|
+
if (mod && mod.__esModule)
|
|
23601
|
+
return mod;
|
|
23602
|
+
var result = {};
|
|
23603
|
+
if (mod != null) {
|
|
23604
|
+
for (var k in mod)
|
|
23605
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
23606
|
+
__createBinding2(result, mod, k);
|
|
23607
|
+
}
|
|
23608
|
+
__setModuleDefault2(result, mod);
|
|
23609
|
+
return result;
|
|
23610
|
+
};
|
|
23611
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23612
|
+
exports.newCancellablePromiseFromNextEvent = exports.CancelController = exports.EVENT_NAME = void 0;
|
|
23613
|
+
var events_1 = __require("events");
|
|
23614
|
+
var promise = __importStar2(require_promise());
|
|
23615
|
+
exports.EVENT_NAME = "cancelled";
|
|
23616
|
+
var CancelController = class {
|
|
23617
|
+
constructor(options) {
|
|
23618
|
+
this.cancelled = false;
|
|
23619
|
+
if (options && options.emitterFactory) {
|
|
23620
|
+
this.emitter = options.emitterFactory();
|
|
23621
|
+
} else {
|
|
23622
|
+
this.emitter = new events_1.EventEmitter();
|
|
23623
|
+
}
|
|
23624
|
+
}
|
|
23625
|
+
cancel() {
|
|
23626
|
+
if (!this.cancelled) {
|
|
23627
|
+
this.cancelled = true;
|
|
23628
|
+
this.emitter.emit(exports.EVENT_NAME);
|
|
23629
|
+
this.emitter.removeAllListeners(exports.EVENT_NAME);
|
|
23630
|
+
}
|
|
23631
|
+
}
|
|
23632
|
+
hasBeenCancelled() {
|
|
23633
|
+
return this.cancelled;
|
|
23634
|
+
}
|
|
23635
|
+
addListener(listener) {
|
|
23636
|
+
if (this.cancelled) {
|
|
23637
|
+
listener();
|
|
23638
|
+
return void 0;
|
|
23639
|
+
}
|
|
23640
|
+
this.emitter.on(exports.EVENT_NAME, listener);
|
|
23641
|
+
return () => {
|
|
23642
|
+
this.emitter.removeListener(exports.EVENT_NAME, listener);
|
|
23643
|
+
};
|
|
23644
|
+
}
|
|
23645
|
+
};
|
|
23646
|
+
__name(CancelController, "CancelController");
|
|
23647
|
+
exports.CancelController = CancelController;
|
|
23648
|
+
function newCancellablePromiseFromNextEvent(config) {
|
|
23649
|
+
let onEvent = void 0;
|
|
23650
|
+
let cancelRemoveListener = void 0;
|
|
23651
|
+
let liftedPromise = promise.newLiftedPromise();
|
|
23652
|
+
onEvent = /* @__PURE__ */ __name((eventData) => {
|
|
23653
|
+
try {
|
|
23654
|
+
if (config.eventDataTransformer) {
|
|
23655
|
+
liftedPromise.resolve(config.eventDataTransformer(eventData));
|
|
23656
|
+
} else {
|
|
23657
|
+
liftedPromise.resolve(eventData);
|
|
23658
|
+
}
|
|
23659
|
+
} catch (err) {
|
|
23660
|
+
liftedPromise.reject(err);
|
|
23661
|
+
}
|
|
23662
|
+
}, "onEvent");
|
|
23663
|
+
config.emitter.addListener(config.eventName, onEvent);
|
|
23664
|
+
if (config.cancelController) {
|
|
23665
|
+
cancelRemoveListener = config.cancelController.addListener(() => {
|
|
23666
|
+
liftedPromise.reject(config.cancelMessage);
|
|
23667
|
+
});
|
|
23668
|
+
}
|
|
23669
|
+
return promise.makeSelfCleaningPromise(liftedPromise.promise, () => {
|
|
23670
|
+
if (onEvent) {
|
|
23671
|
+
config.emitter.removeListener(config.eventName, onEvent);
|
|
23672
|
+
}
|
|
23673
|
+
if (cancelRemoveListener) {
|
|
23674
|
+
cancelRemoveListener();
|
|
23675
|
+
}
|
|
23676
|
+
});
|
|
23677
|
+
}
|
|
23678
|
+
__name(newCancellablePromiseFromNextEvent, "newCancellablePromiseFromNextEvent");
|
|
23679
|
+
exports.newCancellablePromiseFromNextEvent = newCancellablePromiseFromNextEvent;
|
|
23680
|
+
}
|
|
23681
|
+
});
|
|
23682
|
+
|
|
23683
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/package.json
|
|
23536
23684
|
var require_package4 = __commonJS({
|
|
23537
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23685
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/package.json"(exports, module) {
|
|
23538
23686
|
module.exports = {
|
|
23539
23687
|
name: "aws-crt",
|
|
23540
|
-
version: "1.15.
|
|
23688
|
+
version: "1.15.15",
|
|
23541
23689
|
description: "NodeJS/browser bindings to the aws-c-* libraries",
|
|
23542
23690
|
homepage: "https://github.com/awslabs/aws-crt-nodejs",
|
|
23543
23691
|
repository: {
|
|
@@ -23567,40 +23715,42 @@ var require_package4 = __commonJS({
|
|
|
23567
23715
|
"@types/jest": "^27.0.1",
|
|
23568
23716
|
"@types/node": "^10.17.54",
|
|
23569
23717
|
"@types/prettier": "2.6.0",
|
|
23570
|
-
"@types/puppeteer": "^5.4.
|
|
23718
|
+
"@types/puppeteer": "^5.4.7",
|
|
23571
23719
|
"@types/uuid": "^3.4.8",
|
|
23572
23720
|
"@types/ws": "^7.4.7",
|
|
23573
23721
|
"aws-sdk": "^2.848.0",
|
|
23722
|
+
"cmake-js": "^6.3.2",
|
|
23574
23723
|
"https-proxy-agent": "^5.0.1",
|
|
23575
23724
|
jest: "^27.2.1",
|
|
23576
23725
|
"jest-puppeteer": "^5.0.4",
|
|
23577
23726
|
"jest-runtime": "^27.2.1",
|
|
23578
23727
|
puppeteer: "^3.3.0",
|
|
23728
|
+
tar: "^6.1.11",
|
|
23579
23729
|
"ts-jest": "^27.0.5",
|
|
23580
23730
|
typedoc: "^0.22.18",
|
|
23581
23731
|
"typedoc-plugin-merge-modules": "^3.1.0",
|
|
23582
23732
|
typescript: "^4.7.4",
|
|
23583
23733
|
uuid: "^8.3.2",
|
|
23584
|
-
yargs: "^17.2.1"
|
|
23585
|
-
"cmake-js": "^6.3.2",
|
|
23586
|
-
tar: "^6.1.11"
|
|
23734
|
+
yargs: "^17.2.1"
|
|
23587
23735
|
},
|
|
23588
23736
|
dependencies: {
|
|
23589
23737
|
"@aws-sdk/util-utf8-browser": "^3.109.0",
|
|
23590
23738
|
"@httptoolkit/websocket-stream": "^6.0.0",
|
|
23591
23739
|
axios: "^0.24.0",
|
|
23740
|
+
buffer: "^6.0.3",
|
|
23741
|
+
"cmake-js": "^6.3.2",
|
|
23592
23742
|
"crypto-js": "^4.0.0",
|
|
23593
23743
|
mqtt: "^4.3.7",
|
|
23594
|
-
|
|
23744
|
+
process: "^0.11.10",
|
|
23595
23745
|
tar: "^6.1.11"
|
|
23596
23746
|
}
|
|
23597
23747
|
};
|
|
23598
23748
|
}
|
|
23599
23749
|
});
|
|
23600
23750
|
|
|
23601
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23751
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/platform.js
|
|
23602
23752
|
var require_platform = __commonJS({
|
|
23603
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23753
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/platform.js"(exports) {
|
|
23604
23754
|
"use strict";
|
|
23605
23755
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23606
23756
|
exports.crt_version = exports.package_info = exports.is_browser = exports.is_nodejs = void 0;
|
|
@@ -23636,9 +23786,9 @@ var require_platform = __commonJS({
|
|
|
23636
23786
|
}
|
|
23637
23787
|
});
|
|
23638
23788
|
|
|
23639
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23789
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/resource_safety.js
|
|
23640
23790
|
var require_resource_safety = __commonJS({
|
|
23641
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23791
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/resource_safety.js"(exports) {
|
|
23642
23792
|
"use strict";
|
|
23643
23793
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
23644
23794
|
function adopt(value) {
|
|
@@ -23687,9 +23837,9 @@ var require_resource_safety = __commonJS({
|
|
|
23687
23837
|
}
|
|
23688
23838
|
});
|
|
23689
23839
|
|
|
23690
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23840
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/binding.js
|
|
23691
23841
|
var require_binding = __commonJS({
|
|
23692
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23842
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/binding.js"(exports) {
|
|
23693
23843
|
"use strict";
|
|
23694
23844
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
23695
23845
|
if (k2 === void 0)
|
|
@@ -23762,9 +23912,9 @@ var require_binding = __commonJS({
|
|
|
23762
23912
|
}
|
|
23763
23913
|
});
|
|
23764
23914
|
|
|
23765
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23915
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/error.js
|
|
23766
23916
|
var require_error = __commonJS({
|
|
23767
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23917
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/error.js"(exports) {
|
|
23768
23918
|
"use strict";
|
|
23769
23919
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
23770
23920
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -23812,9 +23962,9 @@ var require_error = __commonJS({
|
|
|
23812
23962
|
}
|
|
23813
23963
|
});
|
|
23814
23964
|
|
|
23815
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
23965
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/native_resource.js
|
|
23816
23966
|
var require_native_resource = __commonJS({
|
|
23817
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
23967
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/native_resource.js"(exports) {
|
|
23818
23968
|
"use strict";
|
|
23819
23969
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23820
23970
|
exports.NativeResourceMixin = exports.NativeResource = void 0;
|
|
@@ -23848,9 +23998,9 @@ var require_native_resource = __commonJS({
|
|
|
23848
23998
|
}
|
|
23849
23999
|
});
|
|
23850
24000
|
|
|
23851
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24001
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/io.js
|
|
23852
24002
|
var require_io = __commonJS({
|
|
23853
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24003
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/io.js"(exports) {
|
|
23854
24004
|
"use strict";
|
|
23855
24005
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23856
24006
|
exports.SocketDomain = exports.SocketType = exports.TlsVersion = void 0;
|
|
@@ -23877,9 +24027,9 @@ var require_io = __commonJS({
|
|
|
23877
24027
|
}
|
|
23878
24028
|
});
|
|
23879
24029
|
|
|
23880
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24030
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/io.js
|
|
23881
24031
|
var require_io2 = __commonJS({
|
|
23882
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24032
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/io.js"(exports) {
|
|
23883
24033
|
"use strict";
|
|
23884
24034
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
23885
24035
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -23899,6 +24049,7 @@ var require_io2 = __commonJS({
|
|
|
23899
24049
|
Object.defineProperty(exports, "SocketDomain", { enumerable: true, get: function() {
|
|
23900
24050
|
return io_2.SocketDomain;
|
|
23901
24051
|
} });
|
|
24052
|
+
var error_1 = require_error();
|
|
23902
24053
|
function error_code_to_string(error_code) {
|
|
23903
24054
|
return binding_1.default.error_code_to_string(error_code);
|
|
23904
24055
|
}
|
|
@@ -23934,7 +24085,7 @@ var require_io2 = __commonJS({
|
|
|
23934
24085
|
super(binding_1.default.io_input_stream_new(16 * 1024));
|
|
23935
24086
|
this.source = source;
|
|
23936
24087
|
this.source.on("data", (data) => {
|
|
23937
|
-
data = Buffer.isBuffer(data) ? data :
|
|
24088
|
+
data = Buffer.isBuffer(data) ? data : Buffer.from(data.toString());
|
|
23938
24089
|
binding_1.default.io_input_stream_append(this.native_handle(), data);
|
|
23939
24090
|
});
|
|
23940
24091
|
this.source.on("end", () => {
|
|
@@ -24026,6 +24177,9 @@ var require_io2 = __commonJS({
|
|
|
24026
24177
|
exports.TlsContextOptions = TlsContextOptions;
|
|
24027
24178
|
var TlsContext = class extends native_resource_1.NativeResource {
|
|
24028
24179
|
constructor(ctx_opt) {
|
|
24180
|
+
if (ctx_opt == null || ctx_opt == void 0) {
|
|
24181
|
+
throw new error_1.CrtError("TlsContext constructor: ctx_opt not defined");
|
|
24182
|
+
}
|
|
24029
24183
|
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));
|
|
24030
24184
|
}
|
|
24031
24185
|
};
|
|
@@ -24055,6 +24209,9 @@ var require_io2 = __commonJS({
|
|
|
24055
24209
|
exports.ServerTlsContext = ServerTlsContext;
|
|
24056
24210
|
var TlsConnectionOptions = class extends native_resource_1.NativeResource {
|
|
24057
24211
|
constructor(tls_ctx, server_name, alpn_list = []) {
|
|
24212
|
+
if (tls_ctx == null || tls_ctx == void 0) {
|
|
24213
|
+
throw new error_1.CrtError("TlsConnectionOptions constructor: tls_ctx not defined");
|
|
24214
|
+
}
|
|
24058
24215
|
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));
|
|
24059
24216
|
this.tls_ctx = tls_ctx;
|
|
24060
24217
|
this.server_name = server_name;
|
|
@@ -24084,9 +24241,9 @@ var require_io2 = __commonJS({
|
|
|
24084
24241
|
}
|
|
24085
24242
|
});
|
|
24086
24243
|
|
|
24087
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24244
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/auth.js
|
|
24088
24245
|
var require_auth = __commonJS({
|
|
24089
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24246
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/auth.js"(exports) {
|
|
24090
24247
|
"use strict";
|
|
24091
24248
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
24092
24249
|
function adopt(value) {
|
|
@@ -24135,8 +24292,17 @@ var require_auth = __commonJS({
|
|
|
24135
24292
|
return super.newStatic(access_key, secret_key, session_token);
|
|
24136
24293
|
}
|
|
24137
24294
|
static newCognito(config) {
|
|
24295
|
+
if (config == null || config == void 0) {
|
|
24296
|
+
throw new error_1.CrtError("AwsCredentialsProvider newCognito: Cognito config not defined");
|
|
24297
|
+
}
|
|
24138
24298
|
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);
|
|
24139
24299
|
}
|
|
24300
|
+
static newX509(config) {
|
|
24301
|
+
if (config == null || config == void 0) {
|
|
24302
|
+
throw new error_1.CrtError("AwsCredentialsProvider newX509: X509 config not defined");
|
|
24303
|
+
}
|
|
24304
|
+
return super.newX509(config, config.tlsContext.native_handle(), config.httpProxyOptions ? config.httpProxyOptions.create_native_handle() : null);
|
|
24305
|
+
}
|
|
24140
24306
|
};
|
|
24141
24307
|
__name(AwsCredentialsProvider, "AwsCredentialsProvider");
|
|
24142
24308
|
exports.AwsCredentialsProvider = AwsCredentialsProvider;
|
|
@@ -24191,9 +24357,9 @@ var require_auth = __commonJS({
|
|
|
24191
24357
|
}
|
|
24192
24358
|
});
|
|
24193
24359
|
|
|
24194
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24360
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/checksums.js
|
|
24195
24361
|
var require_checksums = __commonJS({
|
|
24196
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24362
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/checksums.js"(exports) {
|
|
24197
24363
|
"use strict";
|
|
24198
24364
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
24199
24365
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -24214,9 +24380,9 @@ var require_checksums = __commonJS({
|
|
|
24214
24380
|
}
|
|
24215
24381
|
});
|
|
24216
24382
|
|
|
24217
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24383
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crt.js
|
|
24218
24384
|
var require_crt = __commonJS({
|
|
24219
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24385
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crt.js"(exports) {
|
|
24220
24386
|
"use strict";
|
|
24221
24387
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
24222
24388
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -24237,9 +24403,9 @@ var require_crt = __commonJS({
|
|
|
24237
24403
|
}
|
|
24238
24404
|
});
|
|
24239
24405
|
|
|
24240
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24406
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crypto.js
|
|
24241
24407
|
var require_crypto = __commonJS({
|
|
24242
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24408
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/crypto.js"(exports) {
|
|
24243
24409
|
"use strict";
|
|
24244
24410
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
24245
24411
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -24323,41 +24489,9 @@ var require_crypto = __commonJS({
|
|
|
24323
24489
|
}
|
|
24324
24490
|
});
|
|
24325
24491
|
|
|
24326
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24327
|
-
var require_http = __commonJS({
|
|
24328
|
-
"../../node_modules/.pnpm/aws-crt@1.15.9/node_modules/aws-crt/dist/common/http.js"(exports) {
|
|
24329
|
-
"use strict";
|
|
24330
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24331
|
-
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
|
|
24332
|
-
var HttpVersion;
|
|
24333
|
-
(function(HttpVersion2) {
|
|
24334
|
-
HttpVersion2[HttpVersion2["Unknown"] = 0] = "Unknown";
|
|
24335
|
-
HttpVersion2[HttpVersion2["Http1_0"] = 1] = "Http1_0";
|
|
24336
|
-
HttpVersion2[HttpVersion2["Http1_1"] = 2] = "Http1_1";
|
|
24337
|
-
HttpVersion2[HttpVersion2["Http2"] = 3] = "Http2";
|
|
24338
|
-
})(HttpVersion = exports.HttpVersion || (exports.HttpVersion = {}));
|
|
24339
|
-
var HttpProxyAuthenticationType;
|
|
24340
|
-
(function(HttpProxyAuthenticationType2) {
|
|
24341
|
-
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["None"] = 0] = "None";
|
|
24342
|
-
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["Basic"] = 1] = "Basic";
|
|
24343
|
-
})(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));
|
|
24344
|
-
var CommonHttpProxyOptions = class {
|
|
24345
|
-
constructor(host_name, port, auth_method = HttpProxyAuthenticationType.None, auth_username, auth_password) {
|
|
24346
|
-
this.host_name = host_name;
|
|
24347
|
-
this.port = port;
|
|
24348
|
-
this.auth_method = auth_method;
|
|
24349
|
-
this.auth_username = auth_username;
|
|
24350
|
-
this.auth_password = auth_password;
|
|
24351
|
-
}
|
|
24352
|
-
};
|
|
24353
|
-
__name(CommonHttpProxyOptions, "CommonHttpProxyOptions");
|
|
24354
|
-
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
|
|
24355
|
-
}
|
|
24356
|
-
});
|
|
24357
|
-
|
|
24358
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.9/node_modules/aws-crt/dist/common/event.js
|
|
24492
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/event.js
|
|
24359
24493
|
var require_event = __commonJS({
|
|
24360
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
24494
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/event.js"(exports) {
|
|
24361
24495
|
"use strict";
|
|
24362
24496
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24363
24497
|
exports.BufferedEventEmitter = void 0;
|
|
@@ -24404,9 +24538,659 @@ var require_event = __commonJS({
|
|
|
24404
24538
|
}
|
|
24405
24539
|
});
|
|
24406
24540
|
|
|
24407
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
24541
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream_utils.js
|
|
24542
|
+
var require_eventstream_utils = __commonJS({
|
|
24543
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream_utils.js"(exports) {
|
|
24544
|
+
"use strict";
|
|
24545
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24546
|
+
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;
|
|
24547
|
+
var error_1 = require_error();
|
|
24548
|
+
exports.MAX_INT8 = 127;
|
|
24549
|
+
exports.MIN_INT8 = -128;
|
|
24550
|
+
exports.MAX_INT16 = 32767;
|
|
24551
|
+
exports.MIN_INT16 = -32768;
|
|
24552
|
+
exports.MAX_INT32 = 2147483647;
|
|
24553
|
+
exports.MIN_INT32 = -2147483648;
|
|
24554
|
+
exports.MAX_INT64 = BigInt("9223372036854775807");
|
|
24555
|
+
exports.MIN_INT64 = BigInt("-9223372036854775808");
|
|
24556
|
+
var MAX_UINT8_AS_BIGINT = BigInt("256");
|
|
24557
|
+
function marshalInt64BigintAsBuffer(value) {
|
|
24558
|
+
if (value < exports.MIN_INT64 || value > exports.MAX_INT64) {
|
|
24559
|
+
throw new error_1.CrtError("marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes");
|
|
24560
|
+
}
|
|
24561
|
+
let buffer = new Uint8Array(8);
|
|
24562
|
+
if (value < 0) {
|
|
24563
|
+
value = -value - BigInt(1);
|
|
24564
|
+
for (let i = 0; i < 8; ++i) {
|
|
24565
|
+
buffer[i] = 255 - Number(value % MAX_UINT8_AS_BIGINT);
|
|
24566
|
+
value /= MAX_UINT8_AS_BIGINT;
|
|
24567
|
+
}
|
|
24568
|
+
} else {
|
|
24569
|
+
for (let i = 0; i < 8; ++i) {
|
|
24570
|
+
buffer[i] = Number(value % MAX_UINT8_AS_BIGINT);
|
|
24571
|
+
value /= MAX_UINT8_AS_BIGINT;
|
|
24572
|
+
}
|
|
24573
|
+
}
|
|
24574
|
+
return buffer;
|
|
24575
|
+
}
|
|
24576
|
+
__name(marshalInt64BigintAsBuffer, "marshalInt64BigintAsBuffer");
|
|
24577
|
+
exports.marshalInt64BigintAsBuffer = marshalInt64BigintAsBuffer;
|
|
24578
|
+
function unmarshalInt64BigintFromBuffer(buffer) {
|
|
24579
|
+
let value = BigInt(0);
|
|
24580
|
+
let byteView = new Uint8Array(buffer);
|
|
24581
|
+
if (byteView.length != 8) {
|
|
24582
|
+
throw new error_1.CrtError("unmarshalInt64BigintFromBuffer expects a byte buffer of length 8");
|
|
24583
|
+
}
|
|
24584
|
+
let shift = BigInt(1);
|
|
24585
|
+
let isNegative = (byteView[7] & 128) != 0;
|
|
24586
|
+
if (isNegative) {
|
|
24587
|
+
for (let i = 0; i < byteView.length; ++i) {
|
|
24588
|
+
let byteValue = BigInt(255 - byteView[i]);
|
|
24589
|
+
value += byteValue * shift;
|
|
24590
|
+
shift *= MAX_UINT8_AS_BIGINT;
|
|
24591
|
+
}
|
|
24592
|
+
value += BigInt(1);
|
|
24593
|
+
value = -value;
|
|
24594
|
+
} else {
|
|
24595
|
+
for (let i = 0; i < byteView.length; ++i) {
|
|
24596
|
+
let byteValue = BigInt(byteView[i]);
|
|
24597
|
+
value += byteValue * shift;
|
|
24598
|
+
shift *= MAX_UINT8_AS_BIGINT;
|
|
24599
|
+
}
|
|
24600
|
+
}
|
|
24601
|
+
return value;
|
|
24602
|
+
}
|
|
24603
|
+
__name(unmarshalInt64BigintFromBuffer, "unmarshalInt64BigintFromBuffer");
|
|
24604
|
+
exports.unmarshalInt64BigintFromBuffer = unmarshalInt64BigintFromBuffer;
|
|
24605
|
+
}
|
|
24606
|
+
});
|
|
24607
|
+
|
|
24608
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream.js
|
|
24609
|
+
var require_eventstream = __commonJS({
|
|
24610
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/eventstream.js"(exports) {
|
|
24611
|
+
"use strict";
|
|
24612
|
+
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
24613
|
+
if (k2 === void 0)
|
|
24614
|
+
k2 = k;
|
|
24615
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24616
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24617
|
+
desc = { enumerable: true, get: function() {
|
|
24618
|
+
return m[k];
|
|
24619
|
+
} };
|
|
24620
|
+
}
|
|
24621
|
+
Object.defineProperty(o, k2, desc);
|
|
24622
|
+
} : function(o, m, k, k2) {
|
|
24623
|
+
if (k2 === void 0)
|
|
24624
|
+
k2 = k;
|
|
24625
|
+
o[k2] = m[k];
|
|
24626
|
+
});
|
|
24627
|
+
var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
24628
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24629
|
+
} : function(o, v) {
|
|
24630
|
+
o["default"] = v;
|
|
24631
|
+
});
|
|
24632
|
+
var __importStar2 = exports && exports.__importStar || function(mod) {
|
|
24633
|
+
if (mod && mod.__esModule)
|
|
24634
|
+
return mod;
|
|
24635
|
+
var result = {};
|
|
24636
|
+
if (mod != null) {
|
|
24637
|
+
for (var k in mod)
|
|
24638
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
24639
|
+
__createBinding2(result, mod, k);
|
|
24640
|
+
}
|
|
24641
|
+
__setModuleDefault2(result, mod);
|
|
24642
|
+
return result;
|
|
24643
|
+
};
|
|
24644
|
+
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
24645
|
+
function adopt(value) {
|
|
24646
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
24647
|
+
resolve(value);
|
|
24648
|
+
});
|
|
24649
|
+
}
|
|
24650
|
+
__name(adopt, "adopt");
|
|
24651
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
24652
|
+
function fulfilled(value) {
|
|
24653
|
+
try {
|
|
24654
|
+
step(generator.next(value));
|
|
24655
|
+
} catch (e) {
|
|
24656
|
+
reject(e);
|
|
24657
|
+
}
|
|
24658
|
+
}
|
|
24659
|
+
__name(fulfilled, "fulfilled");
|
|
24660
|
+
function rejected(value) {
|
|
24661
|
+
try {
|
|
24662
|
+
step(generator["throw"](value));
|
|
24663
|
+
} catch (e) {
|
|
24664
|
+
reject(e);
|
|
24665
|
+
}
|
|
24666
|
+
}
|
|
24667
|
+
__name(rejected, "rejected");
|
|
24668
|
+
function step(result) {
|
|
24669
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
24670
|
+
}
|
|
24671
|
+
__name(step, "step");
|
|
24672
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24673
|
+
});
|
|
24674
|
+
};
|
|
24675
|
+
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
24676
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
24677
|
+
};
|
|
24678
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24679
|
+
exports.ClientStream = exports.ClientConnection = exports.MessageType = exports.MessageFlags = exports.Header = exports.HeaderType = void 0;
|
|
24680
|
+
var native_resource_1 = require_native_resource();
|
|
24681
|
+
var event_1 = require_event();
|
|
24682
|
+
var error_1 = require_error();
|
|
24683
|
+
var io = __importStar2(require_io2());
|
|
24684
|
+
var eventstream_utils = __importStar2(require_eventstream_utils());
|
|
24685
|
+
var promise = __importStar2(require_promise());
|
|
24686
|
+
var binding_1 = __importDefault2(require_binding());
|
|
24687
|
+
var HeaderType;
|
|
24688
|
+
(function(HeaderType2) {
|
|
24689
|
+
HeaderType2[HeaderType2["BooleanTrue"] = 0] = "BooleanTrue";
|
|
24690
|
+
HeaderType2[HeaderType2["BooleanFalse"] = 1] = "BooleanFalse";
|
|
24691
|
+
HeaderType2[HeaderType2["Byte"] = 2] = "Byte";
|
|
24692
|
+
HeaderType2[HeaderType2["Int16"] = 3] = "Int16";
|
|
24693
|
+
HeaderType2[HeaderType2["Int32"] = 4] = "Int32";
|
|
24694
|
+
HeaderType2[HeaderType2["Int64"] = 5] = "Int64";
|
|
24695
|
+
HeaderType2[HeaderType2["ByteBuffer"] = 6] = "ByteBuffer";
|
|
24696
|
+
HeaderType2[HeaderType2["String"] = 7] = "String";
|
|
24697
|
+
HeaderType2[HeaderType2["Timestamp"] = 8] = "Timestamp";
|
|
24698
|
+
HeaderType2[HeaderType2["UUID"] = 9] = "UUID";
|
|
24699
|
+
})(HeaderType = exports.HeaderType || (exports.HeaderType = {}));
|
|
24700
|
+
var AWS_MAXIMUM_EVENT_STREAM_HEADER_NAME_LENGTH = 127;
|
|
24701
|
+
var Header = class {
|
|
24702
|
+
constructor(name, type, value) {
|
|
24703
|
+
this.name = name;
|
|
24704
|
+
this.type = type;
|
|
24705
|
+
this.value = value;
|
|
24706
|
+
}
|
|
24707
|
+
static validateHeaderName(name) {
|
|
24708
|
+
if (name.length == 0 || name.length > AWS_MAXIMUM_EVENT_STREAM_HEADER_NAME_LENGTH) {
|
|
24709
|
+
throw new error_1.CrtError(`Event stream header name (${name}) is not valid`);
|
|
24710
|
+
}
|
|
24711
|
+
}
|
|
24712
|
+
static newBoolean(name, value) {
|
|
24713
|
+
Header.validateHeaderName(name);
|
|
24714
|
+
if (value) {
|
|
24715
|
+
return new Header(name, HeaderType.BooleanTrue);
|
|
24716
|
+
} else {
|
|
24717
|
+
return new Header(name, HeaderType.BooleanFalse);
|
|
24718
|
+
}
|
|
24719
|
+
}
|
|
24720
|
+
static newByte(name, value) {
|
|
24721
|
+
Header.validateHeaderName(name);
|
|
24722
|
+
if (value >= eventstream_utils.MIN_INT8 && value <= eventstream_utils.MAX_INT8 && Number.isSafeInteger(value)) {
|
|
24723
|
+
return new Header(name, HeaderType.Byte, value);
|
|
24724
|
+
}
|
|
24725
|
+
throw new error_1.CrtError(`Illegal value for eventstream byte-valued header: ${value}`);
|
|
24726
|
+
}
|
|
24727
|
+
static newInt16(name, value) {
|
|
24728
|
+
Header.validateHeaderName(name);
|
|
24729
|
+
if (value >= eventstream_utils.MIN_INT16 && value <= eventstream_utils.MAX_INT16 && Number.isSafeInteger(value)) {
|
|
24730
|
+
return new Header(name, HeaderType.Int16, value);
|
|
24731
|
+
}
|
|
24732
|
+
throw new error_1.CrtError(`Illegal value for eventstream int16-valued header: ${value}`);
|
|
24733
|
+
}
|
|
24734
|
+
static newInt32(name, value) {
|
|
24735
|
+
Header.validateHeaderName(name);
|
|
24736
|
+
if (value >= eventstream_utils.MIN_INT32 && value <= eventstream_utils.MAX_INT32 && Number.isSafeInteger(value)) {
|
|
24737
|
+
return new Header(name, HeaderType.Int32, value);
|
|
24738
|
+
}
|
|
24739
|
+
throw new error_1.CrtError(`Illegal value for eventstream int32-valued header: ${value}`);
|
|
24740
|
+
}
|
|
24741
|
+
static newInt64FromNumber(name, value) {
|
|
24742
|
+
Header.validateHeaderName(name);
|
|
24743
|
+
if (Number.isSafeInteger(value)) {
|
|
24744
|
+
return new Header(name, HeaderType.Int64, eventstream_utils.marshalInt64BigintAsBuffer(BigInt(value)));
|
|
24745
|
+
}
|
|
24746
|
+
throw new error_1.CrtError(`Illegal value for eventstream int64-valued header: ${value}`);
|
|
24747
|
+
}
|
|
24748
|
+
static newInt64FromBigint(name, value) {
|
|
24749
|
+
Header.validateHeaderName(name);
|
|
24750
|
+
if (value >= eventstream_utils.MIN_INT64 && value <= eventstream_utils.MAX_INT64) {
|
|
24751
|
+
return new Header(name, HeaderType.Int64, eventstream_utils.marshalInt64BigintAsBuffer(value));
|
|
24752
|
+
}
|
|
24753
|
+
throw new error_1.CrtError(`Illegal value for eventstream int64-valued header: ${value}`);
|
|
24754
|
+
}
|
|
24755
|
+
static newByteBuffer(name, value) {
|
|
24756
|
+
Header.validateHeaderName(name);
|
|
24757
|
+
return new Header(name, HeaderType.ByteBuffer, value);
|
|
24758
|
+
}
|
|
24759
|
+
static newString(name, value) {
|
|
24760
|
+
Header.validateHeaderName(name);
|
|
24761
|
+
return new Header(name, HeaderType.String, value);
|
|
24762
|
+
}
|
|
24763
|
+
static newTimeStampFromSecondsSinceEpoch(name, secondsSinceEpoch) {
|
|
24764
|
+
Header.validateHeaderName(name);
|
|
24765
|
+
if (Number.isSafeInteger(secondsSinceEpoch) && secondsSinceEpoch >= 0) {
|
|
24766
|
+
return new Header(name, HeaderType.Timestamp, secondsSinceEpoch);
|
|
24767
|
+
}
|
|
24768
|
+
throw new error_1.CrtError(`Illegal value for eventstream timestamp-valued header: ${secondsSinceEpoch}`);
|
|
24769
|
+
}
|
|
24770
|
+
static newTimeStampFromDate(name, date) {
|
|
24771
|
+
Header.validateHeaderName(name);
|
|
24772
|
+
const secondsSinceEpoch = date.getTime();
|
|
24773
|
+
if (Number.isSafeInteger(secondsSinceEpoch)) {
|
|
24774
|
+
return new Header(name, HeaderType.Timestamp, secondsSinceEpoch);
|
|
24775
|
+
}
|
|
24776
|
+
throw new error_1.CrtError(`Illegal value for eventstream timestamp-valued header: ${date}`);
|
|
24777
|
+
}
|
|
24778
|
+
static newUUID(name, value) {
|
|
24779
|
+
Header.validateHeaderName(name);
|
|
24780
|
+
if (value.byteLength == 16) {
|
|
24781
|
+
return new Header(name, HeaderType.UUID, value);
|
|
24782
|
+
}
|
|
24783
|
+
throw new error_1.CrtError(`Illegal value for eventstream uuid-valued header: ${value}`);
|
|
24784
|
+
}
|
|
24785
|
+
toValue(type) {
|
|
24786
|
+
if (type != this.type) {
|
|
24787
|
+
throw new error_1.CrtError(`Header of type (${this.type}) cannot be converted to type (${type})`);
|
|
24788
|
+
}
|
|
24789
|
+
return this.value;
|
|
24790
|
+
}
|
|
24791
|
+
asBoolean() {
|
|
24792
|
+
switch (this.type) {
|
|
24793
|
+
case HeaderType.BooleanFalse:
|
|
24794
|
+
return false;
|
|
24795
|
+
case HeaderType.BooleanTrue:
|
|
24796
|
+
return true;
|
|
24797
|
+
default:
|
|
24798
|
+
throw new error_1.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`);
|
|
24799
|
+
}
|
|
24800
|
+
}
|
|
24801
|
+
asByte() {
|
|
24802
|
+
return this.toValue(HeaderType.Byte);
|
|
24803
|
+
}
|
|
24804
|
+
asInt16() {
|
|
24805
|
+
return this.toValue(HeaderType.Int16);
|
|
24806
|
+
}
|
|
24807
|
+
asInt32() {
|
|
24808
|
+
return this.toValue(HeaderType.Int32);
|
|
24809
|
+
}
|
|
24810
|
+
asInt64() {
|
|
24811
|
+
return eventstream_utils.unmarshalInt64BigintFromBuffer(this.toValue(HeaderType.Int64));
|
|
24812
|
+
}
|
|
24813
|
+
asByteBuffer() {
|
|
24814
|
+
return this.toValue(HeaderType.ByteBuffer);
|
|
24815
|
+
}
|
|
24816
|
+
asString() {
|
|
24817
|
+
return this.toValue(HeaderType.String);
|
|
24818
|
+
}
|
|
24819
|
+
asTimestamp() {
|
|
24820
|
+
return this.toValue(HeaderType.Timestamp);
|
|
24821
|
+
}
|
|
24822
|
+
asUUID() {
|
|
24823
|
+
return this.toValue(HeaderType.UUID);
|
|
24824
|
+
}
|
|
24825
|
+
};
|
|
24826
|
+
__name(Header, "Header");
|
|
24827
|
+
exports.Header = Header;
|
|
24828
|
+
var MessageFlags;
|
|
24829
|
+
(function(MessageFlags2) {
|
|
24830
|
+
MessageFlags2[MessageFlags2["None"] = 0] = "None";
|
|
24831
|
+
MessageFlags2[MessageFlags2["ConnectionAccepted"] = 1] = "ConnectionAccepted";
|
|
24832
|
+
MessageFlags2[MessageFlags2["TerminateStream"] = 2] = "TerminateStream";
|
|
24833
|
+
})(MessageFlags = exports.MessageFlags || (exports.MessageFlags = {}));
|
|
24834
|
+
var MessageType;
|
|
24835
|
+
(function(MessageType2) {
|
|
24836
|
+
MessageType2[MessageType2["ApplicationMessage"] = 0] = "ApplicationMessage";
|
|
24837
|
+
MessageType2[MessageType2["ApplicationError"] = 1] = "ApplicationError";
|
|
24838
|
+
MessageType2[MessageType2["Ping"] = 2] = "Ping";
|
|
24839
|
+
MessageType2[MessageType2["PingResponse"] = 3] = "PingResponse";
|
|
24840
|
+
MessageType2[MessageType2["Connect"] = 4] = "Connect";
|
|
24841
|
+
MessageType2[MessageType2["ConnectAck"] = 5] = "ConnectAck";
|
|
24842
|
+
MessageType2[MessageType2["ProtocolError"] = 6] = "ProtocolError";
|
|
24843
|
+
MessageType2[MessageType2["InternalError"] = 7] = "InternalError";
|
|
24844
|
+
})(MessageType = exports.MessageType || (exports.MessageType = {}));
|
|
24845
|
+
function mapPodHeadersToJSHeaders(headers) {
|
|
24846
|
+
return Array.from(headers, (header) => {
|
|
24847
|
+
return new Header(header.name, header.type, header.value);
|
|
24848
|
+
});
|
|
24849
|
+
}
|
|
24850
|
+
__name(mapPodHeadersToJSHeaders, "mapPodHeadersToJSHeaders");
|
|
24851
|
+
function mapPodMessageToJSMessage(message) {
|
|
24852
|
+
let jsMessage = {
|
|
24853
|
+
type: message.type,
|
|
24854
|
+
flags: message.flags,
|
|
24855
|
+
payload: message.payload
|
|
24856
|
+
};
|
|
24857
|
+
if (message.headers) {
|
|
24858
|
+
jsMessage.headers = mapPodHeadersToJSHeaders(message.headers);
|
|
24859
|
+
}
|
|
24860
|
+
return jsMessage;
|
|
24861
|
+
}
|
|
24862
|
+
__name(mapPodMessageToJSMessage, "mapPodMessageToJSMessage");
|
|
24863
|
+
var ClientConnectionState;
|
|
24864
|
+
(function(ClientConnectionState2) {
|
|
24865
|
+
ClientConnectionState2[ClientConnectionState2["None"] = 0] = "None";
|
|
24866
|
+
ClientConnectionState2[ClientConnectionState2["Connecting"] = 1] = "Connecting";
|
|
24867
|
+
ClientConnectionState2[ClientConnectionState2["Connected"] = 2] = "Connected";
|
|
24868
|
+
ClientConnectionState2[ClientConnectionState2["Disconnected"] = 3] = "Disconnected";
|
|
24869
|
+
ClientConnectionState2[ClientConnectionState2["Closed"] = 4] = "Closed";
|
|
24870
|
+
})(ClientConnectionState || (ClientConnectionState = {}));
|
|
24871
|
+
var ClientConnection = class extends (0, native_resource_1.NativeResourceMixin)(event_1.BufferedEventEmitter) {
|
|
24872
|
+
constructor(config) {
|
|
24873
|
+
if (config === void 0) {
|
|
24874
|
+
throw new error_1.CrtError("Invalid configuration passed to eventstream ClientConnection constructor");
|
|
24875
|
+
}
|
|
24876
|
+
super();
|
|
24877
|
+
this.state = ClientConnectionState.None;
|
|
24878
|
+
this._super(binding_1.default.event_stream_client_connection_new(this, config, (connection, errorCode) => {
|
|
24879
|
+
ClientConnection._s_on_disconnect(connection, errorCode);
|
|
24880
|
+
}, (connection, message) => {
|
|
24881
|
+
ClientConnection._s_on_protocol_message(connection, message);
|
|
24882
|
+
}, config.socketOptions ? config.socketOptions.native_handle() : null, config.tlsCtx ? config.tlsCtx.native_handle() : null));
|
|
24883
|
+
}
|
|
24884
|
+
close() {
|
|
24885
|
+
if (this.state != ClientConnectionState.Closed) {
|
|
24886
|
+
this.state = ClientConnectionState.Closed;
|
|
24887
|
+
binding_1.default.event_stream_client_connection_close(this.native_handle());
|
|
24888
|
+
}
|
|
24889
|
+
}
|
|
24890
|
+
connect(options) {
|
|
24891
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
24892
|
+
let cleanupCancelListener = void 0;
|
|
24893
|
+
let connectPromise = new Promise((resolve, reject) => {
|
|
24894
|
+
if (!options) {
|
|
24895
|
+
reject(new error_1.CrtError("Invalid options passed to event stream ClientConnection.connect"));
|
|
24896
|
+
return;
|
|
24897
|
+
}
|
|
24898
|
+
if (this.state != ClientConnectionState.None) {
|
|
24899
|
+
reject(new error_1.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));
|
|
24900
|
+
return;
|
|
24901
|
+
}
|
|
24902
|
+
this.state = ClientConnectionState.Connecting;
|
|
24903
|
+
if (options.cancelController) {
|
|
24904
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
24905
|
+
reject(new error_1.CrtError(`Event stream connection connect() cancelled by external request.`));
|
|
24906
|
+
setImmediate(() => {
|
|
24907
|
+
this.close();
|
|
24908
|
+
});
|
|
24909
|
+
}, "cancel");
|
|
24910
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
24911
|
+
if (!cleanupCancelListener) {
|
|
24912
|
+
return;
|
|
24913
|
+
}
|
|
24914
|
+
}
|
|
24915
|
+
function curriedPromiseCallback(connection, errorCode) {
|
|
24916
|
+
return ClientConnection._s_on_connection_setup(resolve, reject, connection, errorCode);
|
|
24917
|
+
}
|
|
24918
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
24919
|
+
try {
|
|
24920
|
+
binding_1.default.event_stream_client_connection_connect(this.native_handle(), curriedPromiseCallback);
|
|
24921
|
+
} catch (e) {
|
|
24922
|
+
this.state = ClientConnectionState.Disconnected;
|
|
24923
|
+
reject(e);
|
|
24924
|
+
}
|
|
24925
|
+
});
|
|
24926
|
+
return promise.makeSelfCleaningPromise(connectPromise, cleanupCancelListener);
|
|
24927
|
+
});
|
|
24928
|
+
}
|
|
24929
|
+
sendProtocolMessage(options) {
|
|
24930
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
24931
|
+
let cleanupCancelListener = void 0;
|
|
24932
|
+
let sendProtocolMessagePromise = new Promise((resolve, reject) => {
|
|
24933
|
+
try {
|
|
24934
|
+
let curriedPromiseCallback = function(errorCode) {
|
|
24935
|
+
return ClientConnection._s_on_connection_send_protocol_message_completion(resolve, reject, errorCode);
|
|
24936
|
+
};
|
|
24937
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
24938
|
+
if (!options) {
|
|
24939
|
+
reject(new error_1.CrtError("Invalid options passed to event stream ClientConnection.sendProtocolMessage"));
|
|
24940
|
+
return;
|
|
24941
|
+
}
|
|
24942
|
+
if (!this.isConnected()) {
|
|
24943
|
+
reject(new error_1.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));
|
|
24944
|
+
return;
|
|
24945
|
+
}
|
|
24946
|
+
if (options.cancelController) {
|
|
24947
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
24948
|
+
reject(new error_1.CrtError(`Event stream connection sendProtocolMessage() cancelled by external request.`));
|
|
24949
|
+
setImmediate(() => {
|
|
24950
|
+
this.close();
|
|
24951
|
+
});
|
|
24952
|
+
}, "cancel");
|
|
24953
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
24954
|
+
if (!cleanupCancelListener) {
|
|
24955
|
+
return;
|
|
24956
|
+
}
|
|
24957
|
+
}
|
|
24958
|
+
binding_1.default.event_stream_client_connection_send_protocol_message(this.native_handle(), options, curriedPromiseCallback);
|
|
24959
|
+
} catch (e) {
|
|
24960
|
+
reject(e);
|
|
24961
|
+
}
|
|
24962
|
+
});
|
|
24963
|
+
return promise.makeSelfCleaningPromise(sendProtocolMessagePromise, cleanupCancelListener);
|
|
24964
|
+
});
|
|
24965
|
+
}
|
|
24966
|
+
isConnected() {
|
|
24967
|
+
return this.state == ClientConnectionState.Connected;
|
|
24968
|
+
}
|
|
24969
|
+
newStream() {
|
|
24970
|
+
if (!this.isConnected()) {
|
|
24971
|
+
throw new error_1.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);
|
|
24972
|
+
}
|
|
24973
|
+
return new ClientStream(this);
|
|
24974
|
+
}
|
|
24975
|
+
on(event, listener) {
|
|
24976
|
+
super.on(event, listener);
|
|
24977
|
+
return this;
|
|
24978
|
+
}
|
|
24979
|
+
static _s_on_connection_setup(resolve, reject, connection, errorCode) {
|
|
24980
|
+
if (errorCode == 0 && connection.state == ClientConnectionState.Connecting) {
|
|
24981
|
+
connection.state = ClientConnectionState.Connected;
|
|
24982
|
+
resolve();
|
|
24983
|
+
} else {
|
|
24984
|
+
if (connection.state != ClientConnectionState.Closed) {
|
|
24985
|
+
connection.state = ClientConnectionState.Disconnected;
|
|
24986
|
+
}
|
|
24987
|
+
reject(io.error_code_to_string(errorCode));
|
|
24988
|
+
}
|
|
24989
|
+
}
|
|
24990
|
+
static _s_on_disconnect(connection, errorCode) {
|
|
24991
|
+
if (connection.state != ClientConnectionState.Closed) {
|
|
24992
|
+
connection.state = ClientConnectionState.Disconnected;
|
|
24993
|
+
}
|
|
24994
|
+
process.nextTick(() => {
|
|
24995
|
+
connection.emit("disconnection", { errorCode });
|
|
24996
|
+
});
|
|
24997
|
+
}
|
|
24998
|
+
static _s_on_protocol_message(connection, message) {
|
|
24999
|
+
process.nextTick(() => {
|
|
25000
|
+
connection.emit("protocolMessage", { message: mapPodMessageToJSMessage(message) });
|
|
25001
|
+
});
|
|
25002
|
+
}
|
|
25003
|
+
static _s_on_connection_send_protocol_message_completion(resolve, reject, errorCode) {
|
|
25004
|
+
if (errorCode == 0) {
|
|
25005
|
+
resolve();
|
|
25006
|
+
} else {
|
|
25007
|
+
reject(io.error_code_to_string(errorCode));
|
|
25008
|
+
}
|
|
25009
|
+
}
|
|
25010
|
+
};
|
|
25011
|
+
__name(ClientConnection, "ClientConnection");
|
|
25012
|
+
exports.ClientConnection = ClientConnection;
|
|
25013
|
+
ClientConnection.DISCONNECTION = "disconnection";
|
|
25014
|
+
ClientConnection.PROTOCOL_MESSAGE = "protocolMessage";
|
|
25015
|
+
var ClientStreamState;
|
|
25016
|
+
(function(ClientStreamState2) {
|
|
25017
|
+
ClientStreamState2[ClientStreamState2["None"] = 0] = "None";
|
|
25018
|
+
ClientStreamState2[ClientStreamState2["Activating"] = 1] = "Activating";
|
|
25019
|
+
ClientStreamState2[ClientStreamState2["Activated"] = 2] = "Activated";
|
|
25020
|
+
ClientStreamState2[ClientStreamState2["Ended"] = 3] = "Ended";
|
|
25021
|
+
ClientStreamState2[ClientStreamState2["Closed"] = 4] = "Closed";
|
|
25022
|
+
})(ClientStreamState || (ClientStreamState = {}));
|
|
25023
|
+
var ClientStream = class extends (0, native_resource_1.NativeResourceMixin)(event_1.BufferedEventEmitter) {
|
|
25024
|
+
constructor(connection) {
|
|
25025
|
+
super();
|
|
25026
|
+
this._super(binding_1.default.event_stream_client_stream_new(this, connection.native_handle(), (stream) => {
|
|
25027
|
+
ClientStream._s_on_stream_ended(stream);
|
|
25028
|
+
}, (stream, message) => {
|
|
25029
|
+
ClientStream._s_on_stream_message(stream, message);
|
|
25030
|
+
}));
|
|
25031
|
+
this.state = ClientStreamState.None;
|
|
25032
|
+
}
|
|
25033
|
+
close() {
|
|
25034
|
+
if (this.state != ClientStreamState.Closed) {
|
|
25035
|
+
this.state = ClientStreamState.Closed;
|
|
25036
|
+
binding_1.default.event_stream_client_stream_close(this.native_handle());
|
|
25037
|
+
}
|
|
25038
|
+
}
|
|
25039
|
+
activate(options) {
|
|
25040
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
25041
|
+
let cleanupCancelListener = void 0;
|
|
25042
|
+
let activatePromise = new Promise((resolve, reject) => {
|
|
25043
|
+
try {
|
|
25044
|
+
let curriedPromiseCallback = function(stream, errorCode) {
|
|
25045
|
+
return ClientStream._s_on_stream_activated(resolve, reject, stream, errorCode);
|
|
25046
|
+
};
|
|
25047
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
25048
|
+
if (this.state != ClientStreamState.None) {
|
|
25049
|
+
reject(new error_1.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));
|
|
25050
|
+
return;
|
|
25051
|
+
}
|
|
25052
|
+
if (options === void 0) {
|
|
25053
|
+
this.state = ClientStreamState.Ended;
|
|
25054
|
+
reject(new error_1.CrtError("Invalid options passed to ClientStream.activate"));
|
|
25055
|
+
return;
|
|
25056
|
+
}
|
|
25057
|
+
this.state = ClientStreamState.Activating;
|
|
25058
|
+
if (options.cancelController) {
|
|
25059
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
25060
|
+
reject(new error_1.CrtError(`Event stream activate() cancelled by external request.`));
|
|
25061
|
+
setImmediate(() => {
|
|
25062
|
+
this.close();
|
|
25063
|
+
});
|
|
25064
|
+
}, "cancel");
|
|
25065
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
25066
|
+
if (!cleanupCancelListener) {
|
|
25067
|
+
return;
|
|
25068
|
+
}
|
|
25069
|
+
}
|
|
25070
|
+
binding_1.default.event_stream_client_stream_activate(this.native_handle(), options, curriedPromiseCallback);
|
|
25071
|
+
} catch (e) {
|
|
25072
|
+
this.state = ClientStreamState.Ended;
|
|
25073
|
+
reject(e);
|
|
25074
|
+
}
|
|
25075
|
+
});
|
|
25076
|
+
return promise.makeSelfCleaningPromise(activatePromise, cleanupCancelListener);
|
|
25077
|
+
});
|
|
25078
|
+
}
|
|
25079
|
+
sendMessage(options) {
|
|
25080
|
+
return __awaiter2(this, void 0, void 0, function* () {
|
|
25081
|
+
let cleanupCancelListener = void 0;
|
|
25082
|
+
let sendMessagePromise = new Promise((resolve, reject) => {
|
|
25083
|
+
try {
|
|
25084
|
+
let curriedPromiseCallback = function(errorCode) {
|
|
25085
|
+
return ClientStream._s_on_stream_send_message_completion(resolve, reject, errorCode);
|
|
25086
|
+
};
|
|
25087
|
+
__name(curriedPromiseCallback, "curriedPromiseCallback");
|
|
25088
|
+
if (!options) {
|
|
25089
|
+
reject(new error_1.CrtError("Invalid options passed to ClientStream.sendMessage"));
|
|
25090
|
+
return;
|
|
25091
|
+
}
|
|
25092
|
+
if (this.state != ClientStreamState.Activated) {
|
|
25093
|
+
reject(new error_1.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));
|
|
25094
|
+
return;
|
|
25095
|
+
}
|
|
25096
|
+
if (options.cancelController) {
|
|
25097
|
+
let cancel = /* @__PURE__ */ __name(() => {
|
|
25098
|
+
reject(new error_1.CrtError(`Event stream sendMessage() cancelled by external request.`));
|
|
25099
|
+
setImmediate(() => {
|
|
25100
|
+
this.close();
|
|
25101
|
+
});
|
|
25102
|
+
}, "cancel");
|
|
25103
|
+
cleanupCancelListener = options.cancelController.addListener(cancel);
|
|
25104
|
+
if (!cleanupCancelListener) {
|
|
25105
|
+
return;
|
|
25106
|
+
}
|
|
25107
|
+
}
|
|
25108
|
+
binding_1.default.event_stream_client_stream_send_message(this.native_handle(), options, curriedPromiseCallback);
|
|
25109
|
+
} catch (e) {
|
|
25110
|
+
reject(e);
|
|
25111
|
+
}
|
|
25112
|
+
});
|
|
25113
|
+
return promise.makeSelfCleaningPromise(sendMessagePromise, cleanupCancelListener);
|
|
25114
|
+
});
|
|
25115
|
+
}
|
|
25116
|
+
isActive() {
|
|
25117
|
+
return this.state == ClientStreamState.Activated;
|
|
25118
|
+
}
|
|
25119
|
+
on(event, listener) {
|
|
25120
|
+
super.on(event, listener);
|
|
25121
|
+
return this;
|
|
25122
|
+
}
|
|
25123
|
+
static _s_on_stream_activated(resolve, reject, stream, errorCode) {
|
|
25124
|
+
if (errorCode == 0 && stream.state == ClientStreamState.Activating) {
|
|
25125
|
+
stream.state = ClientStreamState.Activated;
|
|
25126
|
+
resolve();
|
|
25127
|
+
} else {
|
|
25128
|
+
if (stream.state != ClientStreamState.Closed) {
|
|
25129
|
+
stream.state = ClientStreamState.Ended;
|
|
25130
|
+
}
|
|
25131
|
+
reject(io.error_code_to_string(errorCode));
|
|
25132
|
+
}
|
|
25133
|
+
}
|
|
25134
|
+
static _s_on_stream_send_message_completion(resolve, reject, errorCode) {
|
|
25135
|
+
if (errorCode == 0) {
|
|
25136
|
+
resolve();
|
|
25137
|
+
} else {
|
|
25138
|
+
reject(io.error_code_to_string(errorCode));
|
|
25139
|
+
}
|
|
25140
|
+
}
|
|
25141
|
+
static _s_on_stream_ended(stream) {
|
|
25142
|
+
process.nextTick(() => {
|
|
25143
|
+
stream.emit(ClientStream.ENDED, {});
|
|
25144
|
+
});
|
|
25145
|
+
}
|
|
25146
|
+
static _s_on_stream_message(stream, message) {
|
|
25147
|
+
process.nextTick(() => {
|
|
25148
|
+
stream.emit(ClientStream.MESSAGE, { message: mapPodMessageToJSMessage(message) });
|
|
25149
|
+
});
|
|
25150
|
+
}
|
|
25151
|
+
};
|
|
25152
|
+
__name(ClientStream, "ClientStream");
|
|
25153
|
+
exports.ClientStream = ClientStream;
|
|
25154
|
+
ClientStream.ENDED = "ended";
|
|
25155
|
+
ClientStream.MESSAGE = "message";
|
|
25156
|
+
}
|
|
25157
|
+
});
|
|
25158
|
+
|
|
25159
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/http.js
|
|
25160
|
+
var require_http = __commonJS({
|
|
25161
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/http.js"(exports) {
|
|
25162
|
+
"use strict";
|
|
25163
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25164
|
+
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
|
|
25165
|
+
var HttpVersion;
|
|
25166
|
+
(function(HttpVersion2) {
|
|
25167
|
+
HttpVersion2[HttpVersion2["Unknown"] = 0] = "Unknown";
|
|
25168
|
+
HttpVersion2[HttpVersion2["Http1_0"] = 1] = "Http1_0";
|
|
25169
|
+
HttpVersion2[HttpVersion2["Http1_1"] = 2] = "Http1_1";
|
|
25170
|
+
HttpVersion2[HttpVersion2["Http2"] = 3] = "Http2";
|
|
25171
|
+
})(HttpVersion = exports.HttpVersion || (exports.HttpVersion = {}));
|
|
25172
|
+
var HttpProxyAuthenticationType;
|
|
25173
|
+
(function(HttpProxyAuthenticationType2) {
|
|
25174
|
+
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["None"] = 0] = "None";
|
|
25175
|
+
HttpProxyAuthenticationType2[HttpProxyAuthenticationType2["Basic"] = 1] = "Basic";
|
|
25176
|
+
})(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));
|
|
25177
|
+
var CommonHttpProxyOptions = class {
|
|
25178
|
+
constructor(host_name, port, auth_method = HttpProxyAuthenticationType.None, auth_username, auth_password) {
|
|
25179
|
+
this.host_name = host_name;
|
|
25180
|
+
this.port = port;
|
|
25181
|
+
this.auth_method = auth_method;
|
|
25182
|
+
this.auth_username = auth_username;
|
|
25183
|
+
this.auth_password = auth_password;
|
|
25184
|
+
}
|
|
25185
|
+
};
|
|
25186
|
+
__name(CommonHttpProxyOptions, "CommonHttpProxyOptions");
|
|
25187
|
+
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
|
|
25188
|
+
}
|
|
25189
|
+
});
|
|
25190
|
+
|
|
25191
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/http.js
|
|
24408
25192
|
var require_http2 = __commonJS({
|
|
24409
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25193
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/http.js"(exports) {
|
|
24410
25194
|
"use strict";
|
|
24411
25195
|
var __importDefault2 = exports && exports.__importDefault || function(mod) {
|
|
24412
25196
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -24474,6 +25258,9 @@ var require_http2 = __commonJS({
|
|
|
24474
25258
|
exports.HttpProxyOptions = HttpProxyOptions;
|
|
24475
25259
|
var HttpClientConnection = class extends HttpConnection {
|
|
24476
25260
|
constructor(bootstrap, host_name, port, socket_options, tls_opts, proxy_options, handle) {
|
|
25261
|
+
if (socket_options == null || socket_options == void 0) {
|
|
25262
|
+
throw new error_1.CrtError("HttpClientConnection constructor: socket_options not defined");
|
|
25263
|
+
}
|
|
24477
25264
|
super(handle ? handle : binding_1.default.http_connection_new(bootstrap != null ? bootstrap.native_handle() : null, (handle2, error_code) => {
|
|
24478
25265
|
this._on_setup(handle2, error_code);
|
|
24479
25266
|
}, (handle2, error_code) => {
|
|
@@ -24576,6 +25363,9 @@ var require_http2 = __commonJS({
|
|
|
24576
25363
|
HttpClientStream.HEADERS = "headers";
|
|
24577
25364
|
var HttpClientConnectionManager = class extends native_resource_1.NativeResource {
|
|
24578
25365
|
constructor(bootstrap, host, port, max_connections, initial_window_size, socket_options, tls_opts, proxy_options) {
|
|
25366
|
+
if (socket_options == null || socket_options == void 0) {
|
|
25367
|
+
throw new error_1.CrtError("HttpClientConnectionManager constructor: socket_options not defined");
|
|
25368
|
+
}
|
|
24579
25369
|
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));
|
|
24580
25370
|
this.bootstrap = bootstrap;
|
|
24581
25371
|
this.host = host;
|
|
@@ -24608,6 +25398,9 @@ var require_http2 = __commonJS({
|
|
|
24608
25398
|
});
|
|
24609
25399
|
}
|
|
24610
25400
|
release(connection) {
|
|
25401
|
+
if (connection == null || connection == void 0) {
|
|
25402
|
+
throw new error_1.CrtError("HttpClientConnectionManager release: connection not defined");
|
|
25403
|
+
}
|
|
24611
25404
|
binding_1.default.http_connection_manager_release(this.native_handle(), connection.native_handle());
|
|
24612
25405
|
}
|
|
24613
25406
|
close() {
|
|
@@ -24619,9 +25412,9 @@ var require_http2 = __commonJS({
|
|
|
24619
25412
|
}
|
|
24620
25413
|
});
|
|
24621
25414
|
|
|
24622
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25415
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt.js
|
|
24623
25416
|
var require_mqtt = __commonJS({
|
|
24624
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25417
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt.js"(exports) {
|
|
24625
25418
|
"use strict";
|
|
24626
25419
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24627
25420
|
exports.DEFAULT_RECONNECT_MIN_SEC = exports.DEFAULT_RECONNECT_MAX_SEC = exports.MqttWill = exports.QoS = void 0;
|
|
@@ -24646,9 +25439,9 @@ var require_mqtt = __commonJS({
|
|
|
24646
25439
|
}
|
|
24647
25440
|
});
|
|
24648
25441
|
|
|
24649
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25442
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/aws_iot_shared.js
|
|
24650
25443
|
var require_aws_iot_shared = __commonJS({
|
|
24651
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25444
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/aws_iot_shared.js"(exports) {
|
|
24652
25445
|
"use strict";
|
|
24653
25446
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
24654
25447
|
if (k2 === void 0)
|
|
@@ -24782,9 +25575,9 @@ var require_aws_iot_shared = __commonJS({
|
|
|
24782
25575
|
}
|
|
24783
25576
|
});
|
|
24784
25577
|
|
|
24785
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25578
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot.js
|
|
24786
25579
|
var require_aws_iot = __commonJS({
|
|
24787
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25580
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot.js"(exports) {
|
|
24788
25581
|
"use strict";
|
|
24789
25582
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
24790
25583
|
if (k2 === void 0)
|
|
@@ -24920,6 +25713,9 @@ var require_aws_iot = __commonJS({
|
|
|
24920
25713
|
}
|
|
24921
25714
|
static configure_websocket_handshake(builder, options) {
|
|
24922
25715
|
if (options) {
|
|
25716
|
+
if (builder == null || builder == void 0) {
|
|
25717
|
+
throw new error_1.CrtError("AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined");
|
|
25718
|
+
}
|
|
24923
25719
|
builder.params.websocket_handshake_transform = (request, done) => __awaiter2(this, void 0, void 0, function* () {
|
|
24924
25720
|
var _a, _b, _c;
|
|
24925
25721
|
const signing_config = (_b = (_a = options.create_signing_config) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _b !== void 0 ? _b : {
|
|
@@ -24960,6 +25756,9 @@ var require_aws_iot = __commonJS({
|
|
|
24960
25756
|
this.configure_websocket_handshake(builder, options);
|
|
24961
25757
|
return builder;
|
|
24962
25758
|
}
|
|
25759
|
+
static new_builder_for_websocket() {
|
|
25760
|
+
return this.new_with_websockets();
|
|
25761
|
+
}
|
|
24963
25762
|
with_certificate_authority_from_path(ca_dirpath, ca_filepath) {
|
|
24964
25763
|
this.tls_ctx_options.override_default_trust_store_from_path(ca_dirpath, ca_filepath);
|
|
24965
25764
|
return this;
|
|
@@ -25084,9 +25883,9 @@ var require_aws_iot = __commonJS({
|
|
|
25084
25883
|
}
|
|
25085
25884
|
});
|
|
25086
25885
|
|
|
25087
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25886
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt_shared.js
|
|
25088
25887
|
var require_mqtt_shared = __commonJS({
|
|
25089
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25888
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt_shared.js"(exports) {
|
|
25090
25889
|
"use strict";
|
|
25091
25890
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25092
25891
|
exports.DEFAULT_KEEP_ALIVE = exports.normalize_payload = void 0;
|
|
@@ -25118,9 +25917,9 @@ var require_mqtt_shared = __commonJS({
|
|
|
25118
25917
|
}
|
|
25119
25918
|
});
|
|
25120
25919
|
|
|
25121
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25920
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5.js
|
|
25122
25921
|
var require_mqtt5 = __commonJS({
|
|
25123
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25922
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5.js"(exports) {
|
|
25124
25923
|
"use strict";
|
|
25125
25924
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25126
25925
|
exports.RetryJitterType = exports.ClientSessionBehavior = void 0;
|
|
@@ -25141,9 +25940,9 @@ var require_mqtt5 = __commonJS({
|
|
|
25141
25940
|
}
|
|
25142
25941
|
});
|
|
25143
25942
|
|
|
25144
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
25943
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5_packet.js
|
|
25145
25944
|
var require_mqtt5_packet = __commonJS({
|
|
25146
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
25945
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/common/mqtt5_packet.js"(exports) {
|
|
25147
25946
|
"use strict";
|
|
25148
25947
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25149
25948
|
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;
|
|
@@ -25304,9 +26103,9 @@ var require_mqtt5_packet = __commonJS({
|
|
|
25304
26103
|
}
|
|
25305
26104
|
});
|
|
25306
26105
|
|
|
25307
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
26106
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt5.js
|
|
25308
26107
|
var require_mqtt52 = __commonJS({
|
|
25309
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
26108
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt5.js"(exports) {
|
|
25310
26109
|
"use strict";
|
|
25311
26110
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
25312
26111
|
if (k2 === void 0)
|
|
@@ -25571,9 +26370,9 @@ var require_mqtt52 = __commonJS({
|
|
|
25571
26370
|
}
|
|
25572
26371
|
});
|
|
25573
26372
|
|
|
25574
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
26373
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot_mqtt5.js
|
|
25575
26374
|
var require_aws_iot_mqtt5 = __commonJS({
|
|
25576
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
26375
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/aws_iot_mqtt5.js"(exports) {
|
|
25577
26376
|
"use strict";
|
|
25578
26377
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
25579
26378
|
if (k2 === void 0)
|
|
@@ -25817,9 +26616,9 @@ var require_aws_iot_mqtt5 = __commonJS({
|
|
|
25817
26616
|
}
|
|
25818
26617
|
});
|
|
25819
26618
|
|
|
25820
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
26619
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/iot.js
|
|
25821
26620
|
var require_iot = __commonJS({
|
|
25822
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
26621
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/iot.js"(exports) {
|
|
25823
26622
|
"use strict";
|
|
25824
26623
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
25825
26624
|
if (k2 === void 0)
|
|
@@ -25847,9 +26646,9 @@ var require_iot = __commonJS({
|
|
|
25847
26646
|
}
|
|
25848
26647
|
});
|
|
25849
26648
|
|
|
25850
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
26649
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt.js
|
|
25851
26650
|
var require_mqtt2 = __commonJS({
|
|
25852
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
26651
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/native/mqtt.js"(exports) {
|
|
25853
26652
|
"use strict";
|
|
25854
26653
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
25855
26654
|
if (k2 === void 0)
|
|
@@ -25953,6 +26752,9 @@ var require_mqtt2 = __commonJS({
|
|
|
25953
26752
|
super();
|
|
25954
26753
|
this.client = client;
|
|
25955
26754
|
this.config = config;
|
|
26755
|
+
if (config == null || config == void 0) {
|
|
26756
|
+
throw new error_1.CrtError("MqttClientConnection constructor: config not defined");
|
|
26757
|
+
}
|
|
25956
26758
|
const will = config.will ? {
|
|
25957
26759
|
topic: config.will.topic,
|
|
25958
26760
|
qos: config.will.qos,
|
|
@@ -25969,6 +26771,12 @@ var require_mqtt2 = __commonJS({
|
|
|
25969
26771
|
max_sec = config.reconnect_max_sec;
|
|
25970
26772
|
min_sec = Math.min(min_sec, max_sec);
|
|
25971
26773
|
}
|
|
26774
|
+
if (client == void 0 || client == null) {
|
|
26775
|
+
throw new error_1.CrtError("MqttClientConnection constructor: client not defined");
|
|
26776
|
+
}
|
|
26777
|
+
if (config.socket_options == void 0 || config.socket_options == null) {
|
|
26778
|
+
throw new error_1.CrtError("MqttClientConnection constructor: socket_options in configuration not defined");
|
|
26779
|
+
}
|
|
25972
26780
|
this._super(binding_1.default.mqtt_client_connection_new(client.native_handle(), (error_code) => {
|
|
25973
26781
|
this._on_connection_interrupted(error_code);
|
|
25974
26782
|
}, (return_code, session_present) => {
|
|
@@ -25995,6 +26803,9 @@ var require_mqtt2 = __commonJS({
|
|
|
25995
26803
|
return __awaiter2(this, void 0, void 0, function* () {
|
|
25996
26804
|
return new Promise((resolve, reject) => {
|
|
25997
26805
|
reject = this._reject(reject);
|
|
26806
|
+
if (this.config.socket_options == null || this.config.socket_options == void 0) {
|
|
26807
|
+
throw new error_1.CrtError("MqttClientConnection connect: socket_options in configuration not defined");
|
|
26808
|
+
}
|
|
25998
26809
|
try {
|
|
25999
26810
|
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));
|
|
26000
26811
|
} catch (e) {
|
|
@@ -26131,9 +26942,9 @@ var require_mqtt2 = __commonJS({
|
|
|
26131
26942
|
}
|
|
26132
26943
|
});
|
|
26133
26944
|
|
|
26134
|
-
// ../../node_modules/.pnpm/aws-crt@1.15.
|
|
26945
|
+
// ../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/index.js
|
|
26135
26946
|
var require_dist = __commonJS({
|
|
26136
|
-
"../../node_modules/.pnpm/aws-crt@1.15.
|
|
26947
|
+
"../../node_modules/.pnpm/aws-crt@1.15.15/node_modules/aws-crt/dist/index.js"(exports) {
|
|
26137
26948
|
"use strict";
|
|
26138
26949
|
var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
26139
26950
|
if (k2 === void 0)
|
|
@@ -26168,9 +26979,13 @@ var require_dist = __commonJS({
|
|
|
26168
26979
|
return result;
|
|
26169
26980
|
};
|
|
26170
26981
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26171
|
-
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;
|
|
26982
|
+
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;
|
|
26983
|
+
var cancel = __importStar2(require_cancel());
|
|
26984
|
+
exports.cancel = cancel;
|
|
26172
26985
|
var platform = __importStar2(require_platform());
|
|
26173
26986
|
exports.platform = platform;
|
|
26987
|
+
var promise = __importStar2(require_promise());
|
|
26988
|
+
exports.promise = promise;
|
|
26174
26989
|
var resource_safety = __importStar2(require_resource_safety());
|
|
26175
26990
|
exports.resource_safety = resource_safety;
|
|
26176
26991
|
var auth = __importStar2(require_auth());
|
|
@@ -26181,6 +26996,8 @@ var require_dist = __commonJS({
|
|
|
26181
26996
|
exports.crt = crt;
|
|
26182
26997
|
var crypto4 = __importStar2(require_crypto());
|
|
26183
26998
|
exports.crypto = crypto4;
|
|
26999
|
+
var eventstream = __importStar2(require_eventstream());
|
|
27000
|
+
exports.eventstream = eventstream;
|
|
26184
27001
|
var http = __importStar2(require_http2());
|
|
26185
27002
|
exports.http = http;
|
|
26186
27003
|
var io = __importStar2(require_io2());
|