@voxgig/sdkgen 3.3.0 → 3.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -47,7 +47,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
47
47
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
48
48
  const testModeExample = primaryOp
49
49
  ? `# Entity ops return the ENTITY and dies on error;
50
- // call data_get for the record.
50
+ # call data_get for the record.
51
51
  my $${eVar} = $client->${eName}->${primaryOp}(${testArg});
52
52
  # $${eVar} contains the mock response record`
53
53
  : `my $result = $client->direct({ 'path' => '/api/resource', 'method' => 'GET' });
@@ -55,7 +55,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
55
55
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
56
56
  const testModeExample = primaryOp
57
57
  ? `# Entity ops return the ENTITY and raises on error;
58
- // call data_get() for the record.
58
+ # call data_get() for the record.
59
59
  ${eVar} = client.${eName}().${primaryOp}(${testArg})
60
60
  # ${eVar} contains the mock response record`
61
61
  : `result = client.direct({"path": "/api/resource", "method": "GET"})
@@ -66,7 +66,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
66
66
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
67
67
  const testModeExample = primaryOp
68
68
  ? `# Entity ops return the ENTITY (raises on error);
69
- // call data_get for the mock record.
69
+ # call data_get for the mock record.
70
70
  ${eVar} = client.${eName}.${primaryOp}(${testCallArg})
71
71
  puts ${eVar}`
72
72
  : `result = client.direct({ "path" => "/api/resource", "method" => "GET" })
@@ -1026,7 +1026,13 @@ ${!provider.liveApp ? '' : `
1026
1026
  echo "server did not start; live tests will skip"
1027
1027
  `}
1028
1028
  - run: npm install
1029
- - run: npm i seneca seneca-entity seneca-promisify @seneca/provider @seneca/env
1029
+
1030
+ # The Seneca host framework is a PEER dependency, so the test suite needs
1031
+ # it installed explicitly. --no-save keeps npm from rewriting the peer
1032
+ # ranges in package.json to carets on what it happened to resolve, which
1033
+ # would have the build testing a manifest the repo never authored.
1034
+ - run: npm i --no-save seneca seneca-entity seneca-promisify @seneca/provider @seneca/env
1035
+
1030
1036
  - run: npm run build --if-present
1031
1037
  - run: npm test
1032
1038
  `)
@@ -1107,7 +1113,14 @@ jobs:
1107
1113
 
1108
1114
  # The Seneca host framework is a PEER dependency, so the test suite
1109
1115
  # needs it installed explicitly.
1110
- - run: npm i seneca seneca-entity seneca-promisify @seneca/provider @seneca/env
1116
+ #
1117
+ # --no-save IS LOAD-BEARING. Without it npm rewrites the peer ranges in
1118
+ # package.json to carets on whatever it resolved, and \`npm publish\`
1119
+ # below then ships that rewritten manifest — so an authored \`>=26\`
1120
+ # reaches consumers as \`^28.1.0\` and the package refuses to install for
1121
+ # anyone on a newer major. The repo looks fine; only the artifact is
1122
+ # narrowed. Install into node_modules, leave the manifest alone.
1123
+ - run: npm i --no-save seneca seneca-entity seneca-promisify @seneca/provider @seneca/env
1111
1124
 
1112
1125
  - run: npm run build
1113
1126
  - run: npm test
@@ -1,7 +1,7 @@
1
1
  # ProjectName SDK error
2
2
 
3
3
  class ProjectNameError < StandardError
4
- attr_accessor :is_sdk_error, :sdk, :code, :msg, :ctx, :result, :spec
4
+ attr_accessor :is_sdk_error, :sdk, :code, :msg, :ctx, :result, :spec, :status
5
5
 
6
6
  def initialize(code = "", msg = "", ctx = nil)
7
7
  super(msg)
@@ -12,6 +12,11 @@ class ProjectNameError < StandardError
12
12
  @ctx = ctx
13
13
  @result = nil
14
14
  @spec = nil
15
+ # make_error promotes the HTTP status here so a consumer can branch on
16
+ # `err.status` without reaching into `err.result`. Ruby needs the
17
+ # accessor declared: unlike Python or Lua, assigning an undeclared
18
+ # attribute is a NoMethodError, not a new field.
19
+ @status = -1
15
20
  end
16
21
 
17
22
  def error