@hasna/connectors 1.3.18 → 1.3.19

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/bin/index.js CHANGED
@@ -1909,7 +1909,7 @@ var package_default;
1909
1909
  var init_package = __esm(() => {
1910
1910
  package_default = {
1911
1911
  name: "@hasna/connectors",
1912
- version: "1.3.18",
1912
+ version: "1.3.19",
1913
1913
  description: "Open source connector library - Install API connectors with a single command",
1914
1914
  type: "module",
1915
1915
  bin: {
@@ -29837,7 +29837,19 @@ function serveStaticFile(filePath) {
29837
29837
  headers: { "Content-Type": contentType }
29838
29838
  });
29839
29839
  }
29840
- async function findAvailablePort(preferred) {
29840
+ async function findAvailablePort(preferred, strict = false) {
29841
+ if (strict) {
29842
+ try {
29843
+ const server = Bun.serve({ port: preferred, fetch() {
29844
+ return new Response;
29845
+ } });
29846
+ server.stop(true);
29847
+ return preferred;
29848
+ } catch {
29849
+ throw new Error(`Port ${preferred} is already in use. OAuth requires a fixed port.
29850
+ ` + `Free the port and try again: lsof -ti :${preferred} | xargs kill`);
29851
+ }
29852
+ }
29841
29853
  for (let port = preferred;port < preferred + 100; port++) {
29842
29854
  try {
29843
29855
  const server = Bun.serve({ port, fetch() {
@@ -29851,6 +29863,7 @@ async function findAvailablePort(preferred) {
29851
29863
  }
29852
29864
  async function startServer(requestedPort, options) {
29853
29865
  const shouldOpen = options?.open ?? true;
29866
+ const strict = options?.strict ?? false;
29854
29867
  loadConnectorVersions();
29855
29868
  const dashboardDir = resolveDashboardDir();
29856
29869
  const dashboardExists = existsSync17(dashboardDir);
@@ -29866,7 +29879,7 @@ Dashboard not found at: ${dashboardDir}`);
29866
29879
  console.error(` bun run build:dashboard
29867
29880
  `);
29868
29881
  }
29869
- const port = await findAvailablePort(requestedPort);
29882
+ const port = await findAvailablePort(requestedPort, strict);
29870
29883
  if (port !== requestedPort) {
29871
29884
  console.log(`Port ${requestedPort} is in use, using port ${port} instead`);
29872
29885
  }
@@ -32665,7 +32678,7 @@ Categories:
32665
32678
  console.log(` ${category} (${count})`);
32666
32679
  }
32667
32680
  });
32668
- program2.command("serve").alias("dashboard").alias("open").option("-p, --port <port>", "Port to run the dashboard on", "19426").option("--open", "Open dashboard in browser (default)", true).option("--no-open", "Don't open browser automatically").description("Start local dashboard for connector auth management").action(async (options) => {
32681
+ program2.command("serve").alias("dashboard").alias("open").option("-p, --port <port>", "Port to run the dashboard on", "9876").option("--open", "Open dashboard in browser (default)", true).option("--no-open", "Don't open browser automatically").description("Start local dashboard for connector auth management").action(async (options) => {
32669
32682
  const port = parseInt(options.port, 10);
32670
32683
  if (isNaN(port) || port < 1 || port > 65535) {
32671
32684
  console.log(chalk3.red("Invalid port number"));
@@ -33050,10 +33063,10 @@ ${meta.displayName} \u2014 Auth Configuration
33050
33063
  console.log(chalk5.yellow("OAuth connectors require browser-based authentication."));
33051
33064
  console.log();
33052
33065
  try {
33053
- const port = 19426;
33066
+ const port = 9876;
33054
33067
  const { startServer: startServer2 } = await Promise.resolve().then(() => (init_serve(), exports_serve));
33055
33068
  console.log(chalk5.dim(`Starting temporary server on port ${port}...`));
33056
- await startServer2(port, { open: false });
33069
+ await startServer2(port, { open: false, strict: true });
33057
33070
  const oauthUrl = `http://localhost:${port}/oauth/${connector}/start`;
33058
33071
  console.log(chalk5.bold(`
33059
33072
  Open this URL to authenticate:
@@ -34327,9 +34340,9 @@ Setting up ${meta.displayName}...
34327
34340
  }
34328
34341
  console.log(` ${chalk7.yellow("\u27F3")} OAuth authentication required \u2014 starting server...`);
34329
34342
  try {
34330
- const port = 19426;
34343
+ const port = 9876;
34331
34344
  const { startServer: startServer2 } = await Promise.resolve().then(() => (init_serve(), exports_serve));
34332
- await startServer2(port, { open: false });
34345
+ await startServer2(port, { open: false, strict: true });
34333
34346
  const oauthUrl = `http://localhost:${port}/oauth/${name}/start`;
34334
34347
  console.log(`
34335
34348
  ${chalk7.bold("Open this URL to authenticate:")}`);
package/bin/mcp.js CHANGED
@@ -11443,7 +11443,7 @@ var package_default;
11443
11443
  var init_package = __esm(() => {
11444
11444
  package_default = {
11445
11445
  name: "@hasna/connectors",
11446
- version: "1.3.18",
11446
+ version: "1.3.19",
11447
11447
  description: "Open source connector library - Install API connectors with a single command",
11448
11448
  type: "module",
11449
11449
  bin: {
package/bin/serve.js CHANGED
@@ -15160,7 +15160,7 @@ var githubConnector = defineConnector({
15160
15160
  // package.json
15161
15161
  var package_default = {
15162
15162
  name: "@hasna/connectors",
15163
- version: "1.3.18",
15163
+ version: "1.3.19",
15164
15164
  description: "Open source connector library - Install API connectors with a single command",
15165
15165
  type: "module",
15166
15166
  bin: {
@@ -24235,7 +24235,19 @@ function serveStaticFile(filePath) {
24235
24235
  headers: { "Content-Type": contentType }
24236
24236
  });
24237
24237
  }
24238
- async function findAvailablePort(preferred) {
24238
+ async function findAvailablePort(preferred, strict = false) {
24239
+ if (strict) {
24240
+ try {
24241
+ const server = Bun.serve({ port: preferred, fetch() {
24242
+ return new Response;
24243
+ } });
24244
+ server.stop(true);
24245
+ return preferred;
24246
+ } catch {
24247
+ throw new Error(`Port ${preferred} is already in use. OAuth requires a fixed port.
24248
+ ` + `Free the port and try again: lsof -ti :${preferred} | xargs kill`);
24249
+ }
24250
+ }
24239
24251
  for (let port = preferred;port < preferred + 100; port++) {
24240
24252
  try {
24241
24253
  const server = Bun.serve({ port, fetch() {
@@ -24249,6 +24261,7 @@ async function findAvailablePort(preferred) {
24249
24261
  }
24250
24262
  async function startServer(requestedPort, options) {
24251
24263
  const shouldOpen = options?.open ?? true;
24264
+ const strict = options?.strict ?? false;
24252
24265
  loadConnectorVersions();
24253
24266
  const dashboardDir = resolveDashboardDir();
24254
24267
  const dashboardExists = existsSync15(dashboardDir);
@@ -24264,7 +24277,7 @@ Dashboard not found at: ${dashboardDir}`);
24264
24277
  console.error(` bun run build:dashboard
24265
24278
  `);
24266
24279
  }
24267
- const port = await findAvailablePort(requestedPort);
24280
+ const port = await findAvailablePort(requestedPort, strict);
24268
24281
  if (port !== requestedPort) {
24269
24282
  console.log(`Port ${requestedPort} is in use, using port ${port} instead`);
24270
24283
  }
@@ -24866,7 +24879,7 @@ ${result.stderr}`;
24866
24879
  }
24867
24880
 
24868
24881
  // src/server/index.ts
24869
- var DEFAULT_PORT = 19426;
24882
+ var DEFAULT_PORT = 9876;
24870
24883
  function hasFlag(flag) {
24871
24884
  return process.argv.includes(flag);
24872
24885
  }
@@ -15,7 +15,6 @@ export type ImageModel =
15
15
  export interface ImageGenerationOptions {
16
16
  aspectRatio?: ImageConfig['aspectRatio'];
17
17
  imageSize?: ImageConfig['imageSize'];
18
- numberOfImages?: number;
19
18
  }
20
19
 
21
20
  export interface GeneratedImage {
@@ -43,7 +42,6 @@ export class ImagesApi {
43
42
  imageConfig: {
44
43
  aspectRatio: options?.aspectRatio || '16:9',
45
44
  imageSize: options?.imageSize || '2K',
46
- numberOfImages: options?.numberOfImages || 1,
47
45
  },
48
46
  };
49
47
 
@@ -87,7 +85,6 @@ export class ImagesApi {
87
85
  imageConfig: {
88
86
  aspectRatio: options?.aspectRatio,
89
87
  imageSize: options?.imageSize,
90
- numberOfImages: options?.numberOfImages || 1,
91
88
  },
92
89
  };
93
90
 
@@ -289,7 +289,6 @@ imageCmd
289
289
  model: options.model,
290
290
  aspectRatio: options.aspectRatio as ImageConfig['aspectRatio'],
291
291
  imageSize: options.imageSize as ImageConfig['imageSize'],
292
- numberOfImages: parseInt(options.number),
293
292
  filenamePrefix: outputName,
294
293
  });
295
294
 
@@ -300,7 +299,6 @@ imageCmd
300
299
  model: options.model,
301
300
  aspectRatio: options.aspectRatio as ImageConfig['aspectRatio'],
302
301
  imageSize: options.size as ImageConfig['imageSize'],
303
- numberOfImages: parseInt(options.number),
304
302
  });
305
303
 
306
304
  success(`Generated ${images.length} image(s)`);
@@ -81,7 +81,6 @@ export interface GenerationConfig {
81
81
  export interface ImageConfig {
82
82
  aspectRatio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9';
83
83
  imageSize?: '1K' | '2K' | '4K';
84
- numberOfImages?: number;
85
84
  }
86
85
 
87
86
  export interface SpeechConfig {
package/dist/index.js CHANGED
@@ -4969,7 +4969,7 @@ var githubConnector = defineConnector({
4969
4969
  // package.json
4970
4970
  var package_default = {
4971
4971
  name: "@hasna/connectors",
4972
- version: "1.3.18",
4972
+ version: "1.3.19",
4973
4973
  description: "Open source connector library - Install API connectors with a single command",
4974
4974
  type: "module",
4975
4975
  bin: {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  /**
3
3
  * Standalone entry point for the connector auth dashboard server.
4
- * Usage: connectors-serve [--port 19426]
4
+ * Usage: connectors-serve [--port 9876]
5
5
  */
6
6
  export {};
@@ -9,4 +9,5 @@ export interface ServeOptions {
9
9
  }
10
10
  export declare function startServer(requestedPort: number, options?: {
11
11
  open?: boolean;
12
+ strict?: boolean;
12
13
  }): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/connectors",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "description": "Open source connector library - Install API connectors with a single command",
5
5
  "type": "module",
6
6
  "bin": {