@versori/run 0.1.0-alpha.10 → 0.1.0-alpha.11

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.
Files changed (155) hide show
  1. package/esm/_dnt.shims.d.ts +1 -5
  2. package/esm/_dnt.shims.d.ts.map +1 -1
  3. package/esm/_dnt.shims.js +1 -5
  4. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
  5. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
  6. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -12
  7. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
  8. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  9. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
  10. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
  11. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -2
  12. package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
  13. package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -8
  14. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  15. package/esm/src/dsl/http/versori/configloader.js +2 -3
  16. package/esm/src/dsl/http/versori/internalauth.d.ts.map +1 -1
  17. package/esm/src/dsl/http/versori/internalauth.js +5 -6
  18. package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  19. package/esm/src/dsl/http/versori/platformapi.js +3 -4
  20. package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  21. package/esm/src/dsl/http/versori/roundtripper.js +4 -5
  22. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  23. package/esm/src/interpreter/memory/MemoryInterpreter.js +7 -5
  24. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +1 -2
  25. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  26. package/esm/src/kv/nats/NatsKeyValueProvider.js +8 -9
  27. package/package.json +2 -6
  28. package/script/_dnt.shims.d.ts +1 -5
  29. package/script/_dnt.shims.d.ts.map +1 -1
  30. package/script/_dnt.shims.js +2 -7
  31. package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
  32. package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
  33. package/script/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -35
  34. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
  35. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  36. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
  37. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
  38. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -25
  39. package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
  40. package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -31
  41. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  42. package/script/src/dsl/http/versori/configloader.js +2 -26
  43. package/script/src/dsl/http/versori/internalauth.d.ts.map +1 -1
  44. package/script/src/dsl/http/versori/internalauth.js +5 -29
  45. package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  46. package/script/src/dsl/http/versori/platformapi.js +3 -27
  47. package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  48. package/script/src/dsl/http/versori/roundtripper.js +4 -28
  49. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  50. package/script/src/interpreter/memory/MemoryInterpreter.js +7 -28
  51. package/script/src/kv/nats/NatsKeyValueProvider.d.ts +1 -2
  52. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  53. package/script/src/kv/nats/NatsKeyValueProvider.js +10 -34
  54. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +0 -3
  55. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +0 -1
  56. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +0 -28
  57. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +0 -36
  58. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +0 -1
  59. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +0 -329
  60. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +0 -3
  61. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +0 -1
  62. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +0 -2
  63. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +0 -2
  64. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +0 -2
  66. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +0 -9
  67. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +0 -2
  69. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +0 -21
  70. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.js +0 -32
  72. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +0 -41
  73. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.js +0 -50
  75. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts +0 -3
  76. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/io/0.225.2/_common.js +0 -8
  78. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +0 -3
  79. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +0 -1
  80. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.js +0 -4
  81. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +0 -321
  82. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +0 -1
  83. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.js +0 -488
  84. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts +0 -25
  85. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/io/0.225.2/copy.js +0 -36
  87. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +0 -80
  88. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +0 -96
  90. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts +0 -25
  91. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/io/0.225.2/mod.js +0 -25
  93. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +0 -42
  94. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.js +0 -72
  96. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +0 -20
  97. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +0 -1
  98. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +0 -36
  99. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +0 -40
  100. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +0 -54
  102. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +0 -27
  103. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +0 -44
  105. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +0 -3
  106. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +0 -1
  107. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +0 -31
  108. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +0 -36
  109. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +0 -1
  110. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +0 -357
  111. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +0 -3
  112. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +0 -1
  113. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +0 -20
  114. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +0 -2
  115. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +0 -1
  116. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +0 -5
  117. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +0 -9
  118. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +0 -1
  119. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +0 -3
  120. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +0 -21
  121. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +0 -1
  122. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +0 -35
  123. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +0 -41
  124. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +0 -1
  125. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.js +0 -53
  126. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts +0 -3
  127. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +0 -1
  128. package/script/deps/jsr.io/@std/io/0.225.2/_common.js +0 -11
  129. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +0 -3
  130. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +0 -1
  131. package/script/deps/jsr.io/@std/io/0.225.2/_constants.js +0 -7
  132. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +0 -321
  133. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +0 -1
  134. package/script/deps/jsr.io/@std/io/0.225.2/buffer.js +0 -492
  135. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts +0 -25
  136. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +0 -1
  137. package/script/deps/jsr.io/@std/io/0.225.2/copy.js +0 -39
  138. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +0 -80
  139. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +0 -1
  140. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +0 -100
  141. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts +0 -25
  142. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +0 -1
  143. package/script/deps/jsr.io/@std/io/0.225.2/mod.js +0 -41
  144. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +0 -42
  145. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +0 -1
  146. package/script/deps/jsr.io/@std/io/0.225.2/read_all.js +0 -76
  147. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +0 -20
  148. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +0 -1
  149. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +0 -39
  150. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +0 -40
  151. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +0 -1
  152. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +0 -57
  153. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +0 -27
  154. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +0 -1
  155. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +0 -47
@@ -1,357 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DenoTransport = void 0;
27
- exports.denoResolveHost = denoResolveHost;
28
- /*
29
- * Copyright 2020-2024 The NATS Authors
30
- * Licensed under the Apache License, Version 2.0 (the "License");
31
- * you may not use this file except in compliance with the License.
32
- * You may obtain a copy of the License at
33
- *
34
- * http://www.apache.org/licenses/LICENSE-2.0
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the License is distributed on an "AS IS" BASIS,
38
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- * See the License for the specific language governing permissions and
40
- * limitations under the License.
41
- */
42
- const dntShim = __importStar(require("../../../../../../_dnt.shims.js"));
43
- const internal_mod_js_1 = require("../../../nats-core/3.0.2/src/internal_mod.js");
44
- const mod_js_1 = require("../../../../@std/io/0.225.2/mod.js");
45
- const version_js_1 = require("./version.js");
46
- const VERSION = version_js_1.version;
47
- const LANG = "nats.deno";
48
- const ReadBufferSize = 1024 * 256;
49
- class DenoTransport {
50
- constructor() {
51
- Object.defineProperty(this, "version", {
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- value: VERSION
56
- });
57
- Object.defineProperty(this, "lang", {
58
- enumerable: true,
59
- configurable: true,
60
- writable: true,
61
- value: LANG
62
- });
63
- Object.defineProperty(this, "closeError", {
64
- enumerable: true,
65
- configurable: true,
66
- writable: true,
67
- value: void 0
68
- });
69
- Object.defineProperty(this, "options", {
70
- enumerable: true,
71
- configurable: true,
72
- writable: true,
73
- value: void 0
74
- });
75
- Object.defineProperty(this, "buf", {
76
- enumerable: true,
77
- configurable: true,
78
- writable: true,
79
- value: void 0
80
- });
81
- Object.defineProperty(this, "encrypted", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: false
86
- });
87
- Object.defineProperty(this, "done", {
88
- enumerable: true,
89
- configurable: true,
90
- writable: true,
91
- value: false
92
- });
93
- Object.defineProperty(this, "closedNotification", {
94
- enumerable: true,
95
- configurable: true,
96
- writable: true,
97
- value: (0, internal_mod_js_1.deferred)()
98
- });
99
- Object.defineProperty(this, "conn", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: void 0
104
- });
105
- Object.defineProperty(this, "frames", {
106
- enumerable: true,
107
- configurable: true,
108
- writable: true,
109
- value: void 0
110
- });
111
- Object.defineProperty(this, "pendingWrite", {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: void 0
116
- });
117
- this.buf = new Uint8Array(ReadBufferSize);
118
- this.frames = [];
119
- this.pendingWrite = null;
120
- }
121
- async connect(hp, options) {
122
- this.options = options;
123
- const { tls } = this.options;
124
- const { handshakeFirst } = tls || {};
125
- try {
126
- if (handshakeFirst === true) {
127
- const opts = await this.loadTlsOptions(hp.hostname);
128
- const ctls = {
129
- caCerts: opts.caCerts,
130
- hostname: hp.hostname,
131
- port: hp.port,
132
- };
133
- this.conn = await dntShim.Deno.connectTls(ctls);
134
- this.encrypted = true;
135
- // do nothing yet.
136
- }
137
- else {
138
- this.conn = await dntShim.Deno.connect(hp);
139
- }
140
- if (this.done) {
141
- this.conn.close();
142
- }
143
- const info = await this.peekInfo();
144
- (0, internal_mod_js_1.checkOptions)(info, this.options);
145
- const { tls_required: tlsRequired, tls_available: tlsAvailable } = info;
146
- const desired = tlsAvailable === true && options.tls !== null;
147
- if (!handshakeFirst && (tlsRequired || desired)) {
148
- const tlsn = hp.tlsName ? hp.tlsName : hp.hostname;
149
- await this.startTLS(tlsn);
150
- }
151
- if (this.done) {
152
- this.conn.close();
153
- }
154
- }
155
- catch (err) {
156
- this.conn?.close();
157
- const _err = err;
158
- throw new internal_mod_js_1.errors.ConnectionError(_err.message.toLowerCase(), {
159
- cause: err,
160
- });
161
- }
162
- }
163
- get isClosed() {
164
- return this.done;
165
- }
166
- async peekInfo() {
167
- const inbound = new internal_mod_js_1.DataBuffer();
168
- let pm;
169
- while (true) {
170
- const c = await this.conn.read(this.buf);
171
- if (c === null) {
172
- // EOF
173
- throw new Error("socket closed while expecting INFO");
174
- }
175
- else if (c) {
176
- const frame = this.buf.subarray(0, c);
177
- if (this.options.debug) {
178
- console.info(`> ${(0, internal_mod_js_1.render)(frame)}`);
179
- }
180
- inbound.fill(frame);
181
- const raw = inbound.peek();
182
- pm = (0, internal_mod_js_1.extractProtocolMessage)(raw);
183
- if (pm !== "") {
184
- break;
185
- }
186
- }
187
- }
188
- // reset the buffer to previously read, so the client
189
- // can validate the info matches the connection
190
- this.buf = new Uint8Array(inbound.drain());
191
- // expecting the info protocol
192
- const m = internal_mod_js_1.INFO.exec(pm);
193
- if (!m) {
194
- throw new Error("unexpected response from server");
195
- }
196
- return JSON.parse(m[1]);
197
- }
198
- async loadTlsOptions(hostname) {
199
- const tls = this.options && this.options.tls
200
- ? this.options.tls
201
- : {};
202
- // these options are not available in Deno
203
- (0, internal_mod_js_1.checkUnsupportedOption)("tls.ca", tls.ca);
204
- (0, internal_mod_js_1.checkUnsupportedOption)("tls.cert", tls.cert);
205
- (0, internal_mod_js_1.checkUnsupportedOption)("tls.certFile", tls.certFile);
206
- (0, internal_mod_js_1.checkUnsupportedOption)("tls.key", tls.key);
207
- (0, internal_mod_js_1.checkUnsupportedOption)("tls.keyFile", tls.keyFile);
208
- const sto = { hostname };
209
- if (tls.caFile) {
210
- const ca = await dntShim.Deno.readTextFile(tls.caFile);
211
- sto.caCerts = [ca];
212
- }
213
- return sto;
214
- }
215
- async startTLS(hostname) {
216
- const sto = await (this.loadTlsOptions(hostname));
217
- this.conn = await dntShim.Deno.startTls(
218
- //@ts-ignore: just the conn
219
- this.conn, sto);
220
- // this is necessary because the startTls process doesn't
221
- // reject a bad certificate, however the next write will.
222
- // to identify this as the error, we force it
223
- await this.conn.write(internal_mod_js_1.Empty);
224
- this.encrypted = true;
225
- }
226
- async *[Symbol.asyncIterator]() {
227
- let reason;
228
- // yield what we initially read
229
- yield this.buf;
230
- while (!this.done) {
231
- try {
232
- this.buf = new Uint8Array(ReadBufferSize);
233
- const c = await this.conn.read(this.buf);
234
- if (c === null) {
235
- break;
236
- }
237
- if (c) {
238
- const frame = this.buf.subarray(0, c);
239
- if (this.options.debug) {
240
- console.info(`> ${(0, internal_mod_js_1.render)(frame)}`);
241
- }
242
- yield frame;
243
- }
244
- }
245
- catch (err) {
246
- reason = err;
247
- break;
248
- }
249
- }
250
- this._closed(reason).then().catch();
251
- }
252
- maybeWriteFrame() {
253
- if (this.pendingWrite) {
254
- return;
255
- }
256
- const frame = this.frames.shift();
257
- if (!frame) {
258
- return;
259
- }
260
- this.pendingWrite = (0, mod_js_1.writeAll)(this.conn, frame).then(() => {
261
- this.pendingWrite = null;
262
- this.maybeWriteFrame();
263
- }).then(() => {
264
- if (this.options.debug) {
265
- console.info(`< ${(0, internal_mod_js_1.render)(frame)}`);
266
- }
267
- }).catch((err) => {
268
- if (this.options.debug) {
269
- console.error(`!!! ${(0, internal_mod_js_1.render)(frame)}: ${err}`);
270
- }
271
- });
272
- }
273
- send(frame) {
274
- // if we are closed, don't do anything
275
- if (this.done) {
276
- return;
277
- }
278
- // push the frame
279
- this.frames.push(frame);
280
- this.maybeWriteFrame();
281
- }
282
- isEncrypted() {
283
- return this.encrypted;
284
- }
285
- close(err) {
286
- return this._closed(err, false);
287
- }
288
- disconnect() {
289
- this._closed(undefined, true)
290
- .then().catch();
291
- }
292
- async _closed(err, internal = true) {
293
- if (this.done) {
294
- // it is possible for close to be called before the connection
295
- // ever happens or after the protocol requested a close (async connection/upgrade)
296
- // so even if we already cleaned up, attempt to close the connection
297
- try {
298
- this.conn?.close();
299
- }
300
- catch (_err) {
301
- // ignored
302
- }
303
- return;
304
- }
305
- this.done = true;
306
- this.closeError = err;
307
- if (!err && internal) {
308
- try {
309
- // this is a noop but gives us a place to hang
310
- // a close and ensure that we sent all before closing
311
- // we wait for the operation to fail or succeed
312
- this.frames.push(internal_mod_js_1.Empty);
313
- this.maybeWriteFrame();
314
- if (this.pendingWrite) {
315
- await this.pendingWrite;
316
- }
317
- }
318
- catch (err) {
319
- if (this.options.debug) {
320
- console.log("transport close terminated with an error", err);
321
- }
322
- }
323
- }
324
- try {
325
- this.conn?.close();
326
- }
327
- catch (_err) {
328
- // ignored
329
- }
330
- if (internal) {
331
- this.closedNotification.resolve(err);
332
- }
333
- }
334
- closed() {
335
- return this.closedNotification;
336
- }
337
- discard() {
338
- // ignored - this is not required, as there's no throttling
339
- }
340
- }
341
- exports.DenoTransport = DenoTransport;
342
- async function denoResolveHost(s) {
343
- const a = dntShim.Deno.resolveDns(s, "A");
344
- const aaaa = dntShim.Deno.resolveDns(s, "AAAA");
345
- const ips = [];
346
- const w = await Promise.allSettled([a, aaaa]);
347
- if (w[0].status === "fulfilled") {
348
- ips.push(...w[0].value);
349
- }
350
- if (w[1].status === "fulfilled") {
351
- ips.push(...w[1].value);
352
- }
353
- if (ips.length === 0) {
354
- ips.push(s);
355
- }
356
- return ips;
357
- }
@@ -1,3 +0,0 @@
1
- export { connect } from "./connect.js";
2
- export * from "../../../nats-core/3.0.2/src/mod.js";
3
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,qCAAqC,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.connect = void 0;
18
- var connect_js_1 = require("./connect.js");
19
- Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return connect_js_1.connect; } });
20
- __exportStar(require("../../../nats-core/3.0.2/src/mod.js"), exports);
@@ -1,2 +0,0 @@
1
- export declare const version = "3.0.2";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.version = void 0;
4
- // This file is generated - do not edit
5
- exports.version = "3.0.2";
@@ -1,9 +0,0 @@
1
- /**
2
- * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
- *
4
- * This type is internal utility type and should not be used directly.
5
- *
6
- * @internal @private
7
- */
8
- export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
- //# sourceMappingURL=_types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- /**
4
- * Concatenate an array of byte slices into a single slice.
5
- *
6
- * @param buffers Array of byte slices to concatenate.
7
- * @returns A new byte slice containing all the input slices concatenated.
8
- *
9
- * @example Basic usage
10
- * ```ts
11
- * import { concat } from "@std/bytes/concat";
12
- * import { assertEquals } from "@std/assert";
13
- *
14
- * const a = new Uint8Array([0, 1, 2]);
15
- * const b = new Uint8Array([3, 4, 5]);
16
- *
17
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
18
- * ```
19
- */
20
- export declare function concat(buffers: Uint8Array[]): Uint8Array_;
21
- //# sourceMappingURL=concat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/concat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAazD"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.concat = concat;
6
- /**
7
- * Concatenate an array of byte slices into a single slice.
8
- *
9
- * @param buffers Array of byte slices to concatenate.
10
- * @returns A new byte slice containing all the input slices concatenated.
11
- *
12
- * @example Basic usage
13
- * ```ts
14
- * import { concat } from "@std/bytes/concat";
15
- * import { assertEquals } from "@std/assert";
16
- *
17
- * const a = new Uint8Array([0, 1, 2]);
18
- * const b = new Uint8Array([3, 4, 5]);
19
- *
20
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
21
- * ```
22
- */
23
- function concat(buffers) {
24
- let length = 0;
25
- for (const buffer of buffers) {
26
- length += buffer.length;
27
- }
28
- const output = new Uint8Array(length);
29
- let index = 0;
30
- for (const buffer of buffers) {
31
- output.set(buffer, index);
32
- index += buffer.length;
33
- }
34
- return output;
35
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Copy bytes from the source array to the destination array and returns the
3
- * number of bytes copied.
4
- *
5
- * If the source array is larger than what the `dst` array can hold, only the
6
- * amount of bytes that fit in the `dst` array are copied.
7
- *
8
- * @param src Source array to copy from.
9
- * @param dst Destination array to copy to.
10
- * @param offset Offset in the destination array to start copying to. Defaults
11
- * to 0.
12
- * @returns Number of bytes copied.
13
- *
14
- * @example Basic usage
15
- * ```ts
16
- * import { copy } from "@std/bytes/copy";
17
- * import { assertEquals } from "@std/assert";
18
- *
19
- * const src = new Uint8Array([9, 8, 7]);
20
- * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
21
- *
22
- * assertEquals(copy(src, dst), 3);
23
- * assertEquals(dst, new Uint8Array([9, 8, 7, 3, 4, 5]));
24
- * ```
25
- *
26
- * @example Copy with offset
27
- * ```ts
28
- * import { copy } from "@std/bytes/copy";
29
- * import { assertEquals } from "@std/assert";
30
- *
31
- * const src = new Uint8Array([1, 1, 1, 1]);
32
- * const dst = new Uint8Array([0, 0, 0, 0]);
33
- *
34
- * assertEquals(copy(src, dst, 1), 3);
35
- * assertEquals(dst, new Uint8Array([0, 1, 1, 1]));
36
- * ```
37
- * Defining an offset will start copying at the specified index in the
38
- * destination array.
39
- */
40
- export declare function copy(src: Uint8Array, dst: Uint8Array, offset?: number): number;
41
- //# sourceMappingURL=copy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.copy = copy;
6
- /**
7
- * Copy bytes from the source array to the destination array and returns the
8
- * number of bytes copied.
9
- *
10
- * If the source array is larger than what the `dst` array can hold, only the
11
- * amount of bytes that fit in the `dst` array are copied.
12
- *
13
- * @param src Source array to copy from.
14
- * @param dst Destination array to copy to.
15
- * @param offset Offset in the destination array to start copying to. Defaults
16
- * to 0.
17
- * @returns Number of bytes copied.
18
- *
19
- * @example Basic usage
20
- * ```ts
21
- * import { copy } from "@std/bytes/copy";
22
- * import { assertEquals } from "@std/assert";
23
- *
24
- * const src = new Uint8Array([9, 8, 7]);
25
- * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
26
- *
27
- * assertEquals(copy(src, dst), 3);
28
- * assertEquals(dst, new Uint8Array([9, 8, 7, 3, 4, 5]));
29
- * ```
30
- *
31
- * @example Copy with offset
32
- * ```ts
33
- * import { copy } from "@std/bytes/copy";
34
- * import { assertEquals } from "@std/assert";
35
- *
36
- * const src = new Uint8Array([1, 1, 1, 1]);
37
- * const dst = new Uint8Array([0, 0, 0, 0]);
38
- *
39
- * assertEquals(copy(src, dst, 1), 3);
40
- * assertEquals(dst, new Uint8Array([0, 1, 1, 1]));
41
- * ```
42
- * Defining an offset will start copying at the specified index in the
43
- * destination array.
44
- */
45
- function copy(src, dst, offset = 0) {
46
- offset = Math.max(0, Math.min(offset, dst.byteLength));
47
- const dstBytesAvailable = dst.byteLength - offset;
48
- if (src.byteLength > dstBytesAvailable) {
49
- src = src.subarray(0, dstBytesAvailable);
50
- }
51
- dst.set(src, offset);
52
- return src.byteLength;
53
- }
@@ -1,3 +0,0 @@
1
- import type { Closer } from "./types.js";
2
- export declare function isCloser(value: unknown): value is Closer;
3
- //# sourceMappingURL=_common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_common.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/_common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAKxD"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isCloser = isCloser;
6
- function isCloser(value) {
7
- return typeof value === "object" && value !== null && value !== undefined &&
8
- "close" in value &&
9
- // deno-lint-ignore no-explicit-any
10
- typeof value["close"] === "function";
11
- }
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_CHUNK_SIZE = 16640;
2
- export declare const DEFAULT_BUFFER_SIZE: number;
3
- //# sourceMappingURL=_constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/_constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,mBAAmB,QAAY,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.DEFAULT_BUFFER_SIZE = exports.DEFAULT_CHUNK_SIZE = void 0;
6
- exports.DEFAULT_CHUNK_SIZE = 16_640;
7
- exports.DEFAULT_BUFFER_SIZE = 32 * 1024;