@voxgig/sdkgen 4.34.5 → 4.34.6

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/voxgig-sdkgen CHANGED
@@ -8,7 +8,7 @@ const { Shape, One, Skip } = require('shape')
8
8
 
9
9
  const { SdkGen } = require('../dist/sdkgen.js')
10
10
 
11
- const VERSION = '4.34.5'
11
+ const VERSION = '4.34.6'
12
12
  const KONSOLE = console
13
13
 
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "4.34.5",
3
+ "version": "4.34.6",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -11,6 +11,7 @@ import {
11
11
  isConfigData,
12
12
  resolveAuthIn,
13
13
  resolveAuthName,
14
+ isHttpBasicAuth,
14
15
  resolveAuthPrefix,
15
16
  targetFeatures,
16
17
  } from '@voxgig/sdkgen'
@@ -304,6 +305,7 @@ const Config = cmp(async function Config(props: any) {
304
305
  // to what it generated before (Config_ts and Config_go do the same).
305
306
  const authIn = resolveAuthIn(model)
306
307
  const authName = resolveAuthName(model)
308
+ const authBasic = isHttpBasicAuth(model)
307
309
 
308
310
  let baseUrl = ''
309
311
  try { baseUrl = getModelPath(model, `main.${KIT}.info.servers.0.url`) } catch (_e) { }
@@ -336,6 +338,9 @@ const Config = cmp(async function Config(props: any) {
336
338
  }
337
339
  if (authActive) {
338
340
  options.auth = { prefix: authPrefix }
341
+ if (authBasic) {
342
+ options.auth.basic = true
343
+ }
339
344
  if ('header' !== authIn) {
340
345
  options.auth.in = authIn
341
346
  }
@@ -16,6 +16,7 @@ import {
16
16
  isConfigData,
17
17
  resolveAuthIn,
18
18
  resolveAuthName,
19
+ isHttpBasicAuth,
19
20
  resolveAuthPrefix,
20
21
  serverVariables,
21
22
  targetFeatures,
@@ -67,9 +68,11 @@ const Config = cmp(async function Config(props: any) {
67
68
  // what it generated before.
68
69
  const authIn = resolveAuthIn(model)
69
70
  const authName = resolveAuthName(model)
71
+ const authBasic = isHttpBasicAuth(model)
70
72
  const authBlock = authActive
71
73
  ? ` "auth": map[string]any{
72
- "prefix": "${authPrefix}",${'header' === authIn ? '' : `
74
+ "prefix": "${authPrefix}",${authBasic ? `
75
+ "basic": true,` : ''}${'header' === authIn ? '' : `
73
76
  "in": "${authIn}",`}${'Authorization' === authName ? '' : `
74
77
  "name": "${authName}",`}
75
78
  },\n`
@@ -16,6 +16,7 @@ import {
16
16
  isConfigData,
17
17
  resolveAuthIn,
18
18
  resolveAuthName,
19
+ isHttpBasicAuth,
19
20
  resolveAuthPrefix,
20
21
  serverVariables,
21
22
  targetFeatures,
@@ -57,9 +58,11 @@ const Config = cmp(async function Config(props: any) {
57
58
  // what it generated before.
58
59
  const authIn = resolveAuthIn(model)
59
60
  const authName = resolveAuthName(model)
61
+ const authBasic = isHttpBasicAuth(model)
60
62
  const authBlock = authActive
61
63
  ? `auth: {
62
- prefix: '${authPrefix}',${'header' === authIn ? '' : `
64
+ prefix: '${authPrefix}',${authBasic ? `
65
+ basic: true,` : ''}${'header' === authIn ? '' : `
63
66
  in: '${authIn}',`}${'Authorization' === authName ? '' : `
64
67
  name: '${authName}',`}
65
68
  },
@@ -15,6 +15,7 @@ import {
15
15
  isConfigData,
16
16
  resolveAuthIn,
17
17
  resolveAuthName,
18
+ isHttpBasicAuth,
18
19
  resolveAuthPrefix,
19
20
  serverVariables,
20
21
  targetFeatures,
@@ -97,9 +98,11 @@ const Config = cmp(async function Config(props: any) {
97
98
 
98
99
  const authIn = resolveAuthIn(model)
99
100
  const authName = resolveAuthName(model)
101
+ const authBasic = isHttpBasicAuth(model)
100
102
  const authBlock = authActive
101
103
  ? ` auth = {
102
- prefix = "${authPrefix}",${'header' === authIn ? '' : `
104
+ prefix = "${authPrefix}",${authBasic ? `
105
+ basic = true,` : ''}${'header' === authIn ? '' : `
103
106
  ["in"] = "${authIn}",`}${'Authorization' === authName ? '' : `
104
107
  name = "${authName}",`}
105
108
  },\n`
@@ -16,6 +16,7 @@ import {
16
16
  rawStringLiteral,
17
17
  resolveAuthIn,
18
18
  resolveAuthName,
19
+ isHttpBasicAuth,
19
20
  resolveAuthPrefix,
20
21
  serverVariables,
21
22
  targetFeatures,
@@ -88,6 +89,7 @@ const Config = cmp(async function Config(props: any) {
88
89
  // what it generated before.
89
90
  const authIn = resolveAuthIn(model)
90
91
  const authName = resolveAuthName(model)
92
+ const authBasic = isHttpBasicAuth(model)
91
93
 
92
94
  let baseUrl = ''
93
95
  try { baseUrl = getModelPath(model, `main.${KIT}.info.servers.0.url`) } catch (_e) { }
@@ -101,7 +103,8 @@ const Config = cmp(async function Config(props: any) {
101
103
 
102
104
  const authBlock = authActive
103
105
  ? ` "auth" => [
104
- "prefix" => "${authPrefix}",${'header' === authIn ? '' : `
106
+ "prefix" => "${authPrefix}",${authBasic ? `
107
+ "basic" => true,` : ''}${'header' === authIn ? '' : `
105
108
  "in" => ${phps(authIn)},`}${'Authorization' === authName ? '' : `
106
109
  "name" => ${phps(authName)},`}
107
110
  ],\n`
@@ -15,6 +15,7 @@ import {
15
15
  isConfigData,
16
16
  resolveAuthIn,
17
17
  resolveAuthName,
18
+ isHttpBasicAuth,
18
19
  resolveAuthPrefix,
19
20
  serverVariables,
20
21
  targetFeatures,
@@ -89,6 +90,7 @@ const Config = cmp(async function Config(props: any) {
89
90
  // what it generated before.
90
91
  const authIn = resolveAuthIn(model)
91
92
  const authName = resolveAuthName(model)
93
+ const authBasic = isHttpBasicAuth(model)
92
94
 
93
95
  let baseUrl = ''
94
96
  try { baseUrl = getModelPath(model, `main.${KIT}.info.servers.0.url`) } catch (_e) { }
@@ -101,7 +103,8 @@ const Config = cmp(async function Config(props: any) {
101
103
 
102
104
  const authBlock = authActive
103
105
  ? ` "auth": {
104
- "prefix": "${authPrefix}",${'header' === authIn ? '' : `
106
+ "prefix": "${authPrefix}",${authBasic ? `
107
+ "basic": True,` : ''}${'header' === authIn ? '' : `
105
108
  "in": "${authIn}",`}${'Authorization' === authName ? '' : `
106
109
  "name": "${authName}",`}
107
110
  },\n`
@@ -403,7 +403,7 @@ static void test_prepare_auth_guards_missing_spec(void) {
403
403
  }
404
404
 
405
405
  static void test_prepare_auth_apikey_with_prefix_space_joined(void) {
406
- pl_client(cmap(2, "apikey", v_str("K"), "auth", cmap(1, "prefix", v_str("Bearer"))));
406
+ pl_client(cmap(2, "apikey", v_str("K"), "auth", cmap(2, "prefix", v_str("Bearer"), "basic", v_bool(false))));
407
407
  Context* ctx = pl_ctx(NULL);
408
408
  ctx->spec = auth_spec(v_undef());
409
409
  PNError* err = NULL;
@@ -413,7 +413,7 @@ static void test_prepare_auth_apikey_with_prefix_space_joined(void) {
413
413
  }
414
414
 
415
415
  static void test_prepare_auth_raw_apikey_empty_prefix_as_is(void) {
416
- pl_client(cmap(2, "apikey", v_str("K"), "auth", cmap(1, "prefix", v_str(""))));
416
+ pl_client(cmap(2, "apikey", v_str("K"), "auth", cmap(2, "prefix", v_str(""), "basic", v_bool(false))));
417
417
  Context* ctx = pl_ctx(NULL);
418
418
  ctx->spec = auth_spec(v_undef());
419
419
  PNError* err = NULL;
@@ -422,7 +422,7 @@ static void test_prepare_auth_raw_apikey_empty_prefix_as_is(void) {
422
422
  }
423
423
 
424
424
  static void test_prepare_auth_empty_apikey_drops_header(void) {
425
- pl_client(cmap(2, "apikey", v_str(""), "auth", cmap(1, "prefix", v_str("Bearer"))));
425
+ pl_client(cmap(2, "apikey", v_str(""), "auth", cmap(2, "prefix", v_str("Bearer"), "basic", v_bool(false))));
426
426
  Context* ctx = pl_ctx(NULL);
427
427
  ctx->spec = auth_spec(cmap(1, "authorization", v_str("stale")));
428
428
  PNError* err = NULL;
@@ -432,7 +432,7 @@ static void test_prepare_auth_empty_apikey_drops_header(void) {
432
432
  }
433
433
 
434
434
  static void test_prepare_auth_missing_apikey_drops_header(void) {
435
- pl_client(cmap(1, "auth", cmap(1, "prefix", v_str("Bearer"))));
435
+ pl_client(cmap(1, "auth", cmap(2, "prefix", v_str("Bearer"), "basic", v_bool(false))));
436
436
  voxgig_value* options = sdk_options_map(PL_CLIENT);
437
437
  const char* k = get_str(options, "apikey");
438
438
  if (k && k[0] != '\0') {
@@ -3,7 +3,7 @@
3
3
  "package": 1
4
4
  },
5
5
  "name": "@voxgig/sdkgen",
6
- "version": "4.34.5",
6
+ "version": "4.34.6",
7
7
  "provides": {
8
8
  "target": [
9
9
  "c",