@hahnfeld/msrelay-provider 0.1.5 → 0.1.7

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 (2) hide show
  1. package/dist/plugin.js +15 -24
  2. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -85,7 +85,7 @@ export function createRelayPlugin() {
85
85
  let provider = null;
86
86
  return {
87
87
  name: "@hahnfeld/msrelay-provider",
88
- version: "0.1.5",
88
+ version: "0.1.7",
89
89
  description: "Azure Relay Hybrid Connections tunnel provider — private HTTP tunneling via Azure backbone",
90
90
  essential: false,
91
91
  permissions: [
@@ -109,7 +109,7 @@ export function createRelayPlugin() {
109
109
  // ── Step 1: Collect names ──
110
110
  const resourceGroup = await terminal.text({
111
111
  message: "Azure resource group:",
112
- defaultValue: existing.resourceGroup ?? undefined,
112
+ initialValue: existing.resourceGroup ?? undefined,
113
113
  validate: (v) => {
114
114
  if (!v.trim())
115
115
  return "Resource group is required";
@@ -119,7 +119,7 @@ export function createRelayPlugin() {
119
119
  const rg = resourceGroup.trim();
120
120
  const namespaceInput = await terminal.text({
121
121
  message: "Relay namespace name (becomes <name>.servicebus.windows.net):",
122
- defaultValue: existing.relayNamespace?.replace(".servicebus.windows.net", "") ?? undefined,
122
+ initialValue: existing.relayNamespace?.replace(".servicebus.windows.net", "") ?? undefined,
123
123
  validate: (v) => {
124
124
  if (!v.trim())
125
125
  return "Namespace is required";
@@ -133,7 +133,7 @@ export function createRelayPlugin() {
133
133
  }
134
134
  const connectionName = await terminal.text({
135
135
  message: "Hybrid Connection name:",
136
- defaultValue: existing.hybridConnectionName ?? "bot-endpoint",
136
+ initialValue: existing.hybridConnectionName ?? `${nsName}-hybrid`,
137
137
  validate: (v) => {
138
138
  const trimmed = v.trim();
139
139
  if (!trimmed)
@@ -146,7 +146,7 @@ export function createRelayPlugin() {
146
146
  const hc = connectionName.trim();
147
147
  const keyName = await terminal.text({
148
148
  message: "SAS policy name (listen-only auth rule):",
149
- defaultValue: existing.sasKeyName ?? "ListenOnly",
149
+ initialValue: existing.sasKeyName ?? `${nsName}-hybrid-policy`,
150
150
  validate: (v) => {
151
151
  if (!v.trim())
152
152
  return "Policy name is required";
@@ -156,21 +156,15 @@ export function createRelayPlugin() {
156
156
  const sasName = keyName.trim();
157
157
  // ── Step 2: Show the public URL and exact az commands ──
158
158
  terminal.log.step("Your public endpoint will be:");
159
- terminal.log.info(` https://${ns}/${hc}/api/messages`);
159
+ terminal.log.info(`https://${ns}/${hc}/api/messages`);
160
160
  terminal.log.info("");
161
161
  terminal.log.step("Run these commands to create the Azure resources:");
162
162
  terminal.log.info("");
163
- terminal.log.info(`az relay namespace create \\`);
164
- terminal.log.info(` --resource-group ${rg} --name ${nsName} --location westus2`);
163
+ terminal.log.info(`az relay namespace create --resource-group ${rg} --name ${nsName} --location westus2`);
165
164
  terminal.log.info("");
166
- terminal.log.info(`az relay hyco create \\`);
167
- terminal.log.info(` --resource-group ${rg} --namespace-name ${nsName} \\`);
168
- terminal.log.info(` --name ${hc} --requires-client-authorization false`);
165
+ terminal.log.info(`az relay hyco create --resource-group ${rg} --namespace-name ${nsName} --name ${hc} --requires-client-authorization false`);
169
166
  terminal.log.info("");
170
- terminal.log.info(`az relay hyco authorization-rule create \\`);
171
- terminal.log.info(` --resource-group ${rg} --namespace-name ${nsName} \\`);
172
- terminal.log.info(` --hybrid-connection-name ${hc} \\`);
173
- terminal.log.info(` --name ${sasName} --rights Listen`);
167
+ terminal.log.info(`az relay hyco authorization-rule create --resource-group ${rg} --namespace-name ${nsName} --hybrid-connection-name ${hc} --name ${sasName} --rights Listen`);
174
168
  terminal.log.info("");
175
169
  terminal.log.warning("--requires-client-authorization cannot be changed after creation.");
176
170
  terminal.log.warning("If you need to change it, delete and recreate the connection.");
@@ -178,10 +172,7 @@ export function createRelayPlugin() {
178
172
  // ── Step 3: SAS Key ──
179
173
  terminal.log.step("Retrieve the SAS key:");
180
174
  terminal.log.info("");
181
- terminal.log.info(`az relay hyco authorization-rule keys list \\`);
182
- terminal.log.info(` --resource-group ${rg} --namespace-name ${nsName} \\`);
183
- terminal.log.info(` --hybrid-connection-name ${hc} --name ${sasName} \\`);
184
- terminal.log.info(` --query primaryKey -o tsv`);
175
+ terminal.log.info(`az relay hyco authorization-rule keys list --resource-group ${rg} --namespace-name ${nsName} --hybrid-connection-name ${hc} --name ${sasName} --query primaryKey -o tsv`);
185
176
  terminal.log.info("");
186
177
  const hasExistingKey = !!(existing.sasKeyValue);
187
178
  let keyValue = await terminal.password({
@@ -218,7 +209,7 @@ export function createRelayPlugin() {
218
209
  if (portChoice === "custom") {
219
210
  const portStr = await terminal.text({
220
211
  message: "Local port to expose:",
221
- defaultValue: existingPort ? String(existingPort) : undefined,
212
+ initialValue: existingPort ? String(existingPort) : undefined,
222
213
  validate: (v) => {
223
214
  const trimmed = v.trim();
224
215
  if (!trimmed)
@@ -295,7 +286,7 @@ export function createRelayPlugin() {
295
286
  case "namespace": {
296
287
  const val = await terminal.text({
297
288
  message: "Azure Relay namespace:",
298
- defaultValue: current.relayNamespace ?? "",
289
+ initialValue: current.relayNamespace ?? "",
299
290
  validate: (v) => {
300
291
  const trimmed = v.trim();
301
292
  if (!trimmed)
@@ -312,7 +303,7 @@ export function createRelayPlugin() {
312
303
  case "connection": {
313
304
  const val = await terminal.text({
314
305
  message: "Hybrid Connection name:",
315
- defaultValue: current.hybridConnectionName ?? "",
306
+ initialValue: current.hybridConnectionName ?? "",
316
307
  validate: (v) => {
317
308
  const trimmed = v.trim();
318
309
  if (!trimmed)
@@ -329,7 +320,7 @@ export function createRelayPlugin() {
329
320
  case "sasKeyName": {
330
321
  const val = await terminal.text({
331
322
  message: "SAS policy name:",
332
- defaultValue: current.sasKeyName ?? "ListenOnly",
323
+ initialValue: current.sasKeyName ?? "ListenOnly",
333
324
  validate: (v) => {
334
325
  if (!v.trim())
335
326
  return "Required";
@@ -356,7 +347,7 @@ export function createRelayPlugin() {
356
347
  case "port": {
357
348
  const val = await terminal.text({
358
349
  message: "Port:",
359
- defaultValue: current.port != null ? String(current.port) : "3978",
350
+ initialValue: current.port != null ? String(current.port) : "3978",
360
351
  validate: (v) => {
361
352
  const trimmed = v.trim();
362
353
  if (!trimmed)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnfeld/msrelay-provider",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Azure Relay Hybrid Connections tunnel provider plugin for OpenACP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",