quicktype 18.0.6 → 19.0.4

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 (174) hide show
  1. package/README.md +1 -1
  2. package/dist/{cli/CompressedJSONFromStream.d.ts → CompressedJSONFromStream.d.ts} +1 -1
  3. package/dist/{cli/CompressedJSONFromStream.js → CompressedJSONFromStream.js} +2 -2
  4. package/dist/{cli/GraphQLIntrospection.d.ts → GraphQLIntrospection.d.ts} +0 -0
  5. package/dist/{cli/GraphQLIntrospection.js → GraphQLIntrospection.js} +1 -1
  6. package/dist/{cli/TypeSource.d.ts → TypeSource.d.ts} +2 -2
  7. package/dist/{cli/TypeSource.js → TypeSource.js} +0 -0
  8. package/dist/{cli/URLGrammar.d.ts → URLGrammar.d.ts} +0 -0
  9. package/dist/{cli/URLGrammar.js → URLGrammar.js} +1 -1
  10. package/dist/{cli/index.d.ts → index.d.ts} +1 -1
  11. package/dist/{cli/index.js → index.js} +4 -5
  12. package/package.json +61 -77
  13. package/dist/quicktype-core/Annotation.d.ts +0 -8
  14. package/dist/quicktype-core/Annotation.js +0 -16
  15. package/dist/quicktype-core/ConvenienceRenderer.d.ts +0 -138
  16. package/dist/quicktype-core/ConvenienceRenderer.js +0 -668
  17. package/dist/quicktype-core/DateTime.d.ts +0 -10
  18. package/dist/quicktype-core/DateTime.js +0 -57
  19. package/dist/quicktype-core/DeclarationIR.d.ts +0 -14
  20. package/dist/quicktype-core/DeclarationIR.js +0 -167
  21. package/dist/quicktype-core/EncodedMarkovChain.d.ts +0 -1
  22. package/dist/quicktype-core/EncodedMarkovChain.js +0 -4
  23. package/dist/quicktype-core/GatherNames.d.ts +0 -2
  24. package/dist/quicktype-core/GatherNames.js +0 -333
  25. package/dist/quicktype-core/Graph.d.ts +0 -12
  26. package/dist/quicktype-core/Graph.js +0 -220
  27. package/dist/quicktype-core/GraphRewriting.d.ts +0 -87
  28. package/dist/quicktype-core/GraphRewriting.js +0 -421
  29. package/dist/quicktype-core/MakeTransformations.d.ts +0 -4
  30. package/dist/quicktype-core/MakeTransformations.js +0 -193
  31. package/dist/quicktype-core/MarkovChain.d.ts +0 -15
  32. package/dist/quicktype-core/MarkovChain.js +0 -154
  33. package/dist/quicktype-core/Messages.d.ts +0 -294
  34. package/dist/quicktype-core/Messages.js +0 -105
  35. package/dist/quicktype-core/Naming.d.ts +0 -64
  36. package/dist/quicktype-core/Naming.js +0 -356
  37. package/dist/quicktype-core/Renderer.d.ts +0 -50
  38. package/dist/quicktype-core/Renderer.js +0 -274
  39. package/dist/quicktype-core/RendererOptions.d.ts +0 -71
  40. package/dist/quicktype-core/RendererOptions.js +0 -141
  41. package/dist/quicktype-core/Run.d.ts +0 -174
  42. package/dist/quicktype-core/Run.js +0 -393
  43. package/dist/quicktype-core/Source.d.ts +0 -65
  44. package/dist/quicktype-core/Source.js +0 -204
  45. package/dist/quicktype-core/TargetLanguage.d.ts +0 -34
  46. package/dist/quicktype-core/TargetLanguage.js +0 -66
  47. package/dist/quicktype-core/Transformers.d.ts +0 -209
  48. package/dist/quicktype-core/Transformers.js +0 -836
  49. package/dist/quicktype-core/Type.d.ts +0 -206
  50. package/dist/quicktype-core/Type.js +0 -716
  51. package/dist/quicktype-core/TypeBuilder.d.ts +0 -61
  52. package/dist/quicktype-core/TypeBuilder.js +0 -324
  53. package/dist/quicktype-core/TypeGraph.d.ts +0 -75
  54. package/dist/quicktype-core/TypeGraph.js +0 -420
  55. package/dist/quicktype-core/TypeUtils.d.ts +0 -33
  56. package/dist/quicktype-core/TypeUtils.js +0 -230
  57. package/dist/quicktype-core/UnifyClasses.d.ts +0 -16
  58. package/dist/quicktype-core/UnifyClasses.js +0 -159
  59. package/dist/quicktype-core/UnionBuilder.d.ts +0 -49
  60. package/dist/quicktype-core/UnionBuilder.js +0 -282
  61. package/dist/quicktype-core/attributes/AccessorNames.d.ts +0 -18
  62. package/dist/quicktype-core/attributes/AccessorNames.js +0 -182
  63. package/dist/quicktype-core/attributes/Constraints.d.ts +0 -38
  64. package/dist/quicktype-core/attributes/Constraints.js +0 -172
  65. package/dist/quicktype-core/attributes/Description.d.ts +0 -9
  66. package/dist/quicktype-core/attributes/Description.js +0 -97
  67. package/dist/quicktype-core/attributes/EnumValues.d.ts +0 -8
  68. package/dist/quicktype-core/attributes/EnumValues.js +0 -31
  69. package/dist/quicktype-core/attributes/StringTypes.d.ts +0 -28
  70. package/dist/quicktype-core/attributes/StringTypes.js +0 -189
  71. package/dist/quicktype-core/attributes/TypeAttributes.d.ts +0 -34
  72. package/dist/quicktype-core/attributes/TypeAttributes.js +0 -119
  73. package/dist/quicktype-core/attributes/TypeNames.d.ts +0 -46
  74. package/dist/quicktype-core/attributes/TypeNames.js +0 -274
  75. package/dist/quicktype-core/attributes/URIAttributes.d.ts +0 -8
  76. package/dist/quicktype-core/attributes/URIAttributes.js +0 -85
  77. package/dist/quicktype-core/index.d.ts +0 -48
  78. package/dist/quicktype-core/index.js +0 -180
  79. package/dist/quicktype-core/input/CompressedJSON.d.ts +0 -69
  80. package/dist/quicktype-core/input/CompressedJSON.js +0 -276
  81. package/dist/quicktype-core/input/FetchingJSONSchemaStore.d.ts +0 -6
  82. package/dist/quicktype-core/input/FetchingJSONSchemaStore.js +0 -18
  83. package/dist/quicktype-core/input/Inference.d.ts +0 -22
  84. package/dist/quicktype-core/input/Inference.js +0 -240
  85. package/dist/quicktype-core/input/Inputs.d.ts +0 -48
  86. package/dist/quicktype-core/input/Inputs.js +0 -145
  87. package/dist/quicktype-core/input/JSONSchemaInput.d.ts +0 -91
  88. package/dist/quicktype-core/input/JSONSchemaInput.js +0 -1041
  89. package/dist/quicktype-core/input/JSONSchemaStore.d.ts +0 -8
  90. package/dist/quicktype-core/input/JSONSchemaStore.js +0 -36
  91. package/dist/quicktype-core/input/PostmanCollection.d.ts +0 -5
  92. package/dist/quicktype-core/input/PostmanCollection.js +0 -60
  93. package/dist/quicktype-core/input/io/NodeIO.d.ts +0 -3
  94. package/dist/quicktype-core/input/io/NodeIO.js +0 -87
  95. package/dist/quicktype-core/input/io/get-stream/buffer-stream.d.ts +0 -2
  96. package/dist/quicktype-core/input/io/get-stream/buffer-stream.js +0 -45
  97. package/dist/quicktype-core/input/io/get-stream/index.d.ts +0 -9
  98. package/dist/quicktype-core/input/io/get-stream/index.js +0 -52
  99. package/dist/quicktype-core/language/All.d.ts +0 -3
  100. package/dist/quicktype-core/language/All.js +0 -57
  101. package/dist/quicktype-core/language/CPlusPlus.d.ts +0 -241
  102. package/dist/quicktype-core/language/CPlusPlus.js +0 -1847
  103. package/dist/quicktype-core/language/CSharp.d.ts +0 -201
  104. package/dist/quicktype-core/language/CSharp.js +0 -1850
  105. package/dist/quicktype-core/language/Crystal.d.ts +0 -37
  106. package/dist/quicktype-core/language/Crystal.js +0 -337
  107. package/dist/quicktype-core/language/Dart.d.ts +0 -66
  108. package/dist/quicktype-core/language/Dart.js +0 -576
  109. package/dist/quicktype-core/language/Elm.d.ts +0 -58
  110. package/dist/quicktype-core/language/Elm.js +0 -522
  111. package/dist/quicktype-core/language/Golang.d.ts +0 -51
  112. package/dist/quicktype-core/language/Golang.js +0 -460
  113. package/dist/quicktype-core/language/Haskell.d.ts +0 -56
  114. package/dist/quicktype-core/language/Haskell.js +0 -411
  115. package/dist/quicktype-core/language/JSONSchema.d.ts +0 -31
  116. package/dist/quicktype-core/language/JSONSchema.js +0 -169
  117. package/dist/quicktype-core/language/Java.d.ts +0 -125
  118. package/dist/quicktype-core/language/Java.js +0 -1081
  119. package/dist/quicktype-core/language/JavaScript.d.ts +0 -68
  120. package/dist/quicktype-core/language/JavaScript.js +0 -435
  121. package/dist/quicktype-core/language/JavaScriptPropTypes.d.ts +0 -40
  122. package/dist/quicktype-core/language/JavaScriptPropTypes.js +0 -213
  123. package/dist/quicktype-core/language/JavaScriptUnicodeMaps.d.ts +0 -2
  124. package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +0 -134
  125. package/dist/quicktype-core/language/Kotlin.d.ts +0 -109
  126. package/dist/quicktype-core/language/Kotlin.js +0 -832
  127. package/dist/quicktype-core/language/Objective-C.d.ts +0 -79
  128. package/dist/quicktype-core/language/Objective-C.js +0 -777
  129. package/dist/quicktype-core/language/Php.d.ts +0 -80
  130. package/dist/quicktype-core/language/Php.js +0 -702
  131. package/dist/quicktype-core/language/Pike.d.ts +0 -37
  132. package/dist/quicktype-core/language/Pike.js +0 -276
  133. package/dist/quicktype-core/language/Python.d.ts +0 -107
  134. package/dist/quicktype-core/language/Python.js +0 -969
  135. package/dist/quicktype-core/language/Rust.d.ts +0 -56
  136. package/dist/quicktype-core/language/Rust.js +0 -309
  137. package/dist/quicktype-core/language/Swift.d.ts +0 -96
  138. package/dist/quicktype-core/language/Swift.js +0 -1211
  139. package/dist/quicktype-core/language/TypeScriptFlow.d.ts +0 -77
  140. package/dist/quicktype-core/language/TypeScriptFlow.js +0 -286
  141. package/dist/quicktype-core/language/ruby/index.d.ts +0 -52
  142. package/dist/quicktype-core/language/ruby/index.js +0 -557
  143. package/dist/quicktype-core/language/ruby/keywords.d.ts +0 -3
  144. package/dist/quicktype-core/language/ruby/keywords.js +0 -358
  145. package/dist/quicktype-core/rewrites/CombineClasses.d.ts +0 -3
  146. package/dist/quicktype-core/rewrites/CombineClasses.js +0 -125
  147. package/dist/quicktype-core/rewrites/ExpandStrings.d.ts +0 -4
  148. package/dist/quicktype-core/rewrites/ExpandStrings.js +0 -143
  149. package/dist/quicktype-core/rewrites/FlattenStrings.d.ts +0 -3
  150. package/dist/quicktype-core/rewrites/FlattenStrings.js +0 -45
  151. package/dist/quicktype-core/rewrites/FlattenUnions.d.ts +0 -3
  152. package/dist/quicktype-core/rewrites/FlattenUnions.js +0 -47
  153. package/dist/quicktype-core/rewrites/InferMaps.d.ts +0 -3
  154. package/dist/quicktype-core/rewrites/InferMaps.js +0 -117
  155. package/dist/quicktype-core/rewrites/ReplaceObjectType.d.ts +0 -3
  156. package/dist/quicktype-core/rewrites/ReplaceObjectType.js +0 -60
  157. package/dist/quicktype-core/rewrites/ResolveIntersections.d.ts +0 -3
  158. package/dist/quicktype-core/rewrites/ResolveIntersections.js +0 -244
  159. package/dist/quicktype-core/support/Acronyms.d.ts +0 -10
  160. package/dist/quicktype-core/support/Acronyms.js +0 -1128
  161. package/dist/quicktype-core/support/Chance.d.ts +0 -38
  162. package/dist/quicktype-core/support/Chance.js +0 -2146
  163. package/dist/quicktype-core/support/Converters.d.ts +0 -6
  164. package/dist/quicktype-core/support/Converters.js +0 -16
  165. package/dist/quicktype-core/support/Strings.d.ts +0 -44
  166. package/dist/quicktype-core/support/Strings.js +0 -525
  167. package/dist/quicktype-core/support/Support.d.ts +0 -29
  168. package/dist/quicktype-core/support/Support.js +0 -162
  169. package/dist/quicktype-graphql-input/GraphQLSchema.d.ts +0 -645
  170. package/dist/quicktype-graphql-input/GraphQLSchema.js +0 -39
  171. package/dist/quicktype-graphql-input/index.d.ts +0 -17
  172. package/dist/quicktype-graphql-input/index.js +0 -407
  173. package/dist/quicktype-typescript-input/index.d.ts +0 -2
  174. package/dist/quicktype-typescript-input/index.js +0 -98
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![](https://raw.githubusercontent.com/quicktype/quicktype/master/quicktype-logo.svg?sanitize=true)
1
+ ![](https://raw.githubusercontent.com/quicktype/quicktype/master/media/quicktype-logo.svg?sanitize=true)
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/quicktype.svg)](https://badge.fury.io/js/quicktype)
4
4
  ![Build status](https://github.com/quicktype/quicktype/actions/workflows/master.yaml/badge.svg)
@@ -1,5 +1,5 @@
1
1
  import { Readable } from "readable-stream";
2
- import { CompressedJSON, Value } from "../quicktype-core/input/CompressedJSON";
2
+ import { CompressedJSON, Value } from "quicktype-core";
3
3
  export declare class CompressedJSONFromStream extends CompressedJSON<Readable> {
4
4
  parse(readStream: Readable): Promise<Value>;
5
5
  protected handleStartNumber: () => void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompressedJSONFromStream = void 0;
4
- const CompressedJSON_1 = require("../quicktype-core/input/CompressedJSON");
4
+ const quicktype_core_1 = require("quicktype-core");
5
5
  const { Parser } = require("stream-json");
6
6
  const methodMap = {
7
7
  startObject: "pushObjectContext",
@@ -17,7 +17,7 @@ const methodMap = {
17
17
  trueValue: "handleTrueValue",
18
18
  falseValue: "handleFalseValue"
19
19
  };
20
- class CompressedJSONFromStream extends CompressedJSON_1.CompressedJSON {
20
+ class CompressedJSONFromStream extends quicktype_core_1.CompressedJSON {
21
21
  async parse(readStream) {
22
22
  const combo = new Parser({ packKeys: true, packStrings: true });
23
23
  combo.on("data", (item) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.introspectServer = void 0;
4
- const quicktype_core_1 = require("../quicktype-core");
4
+ const quicktype_core_1 = require("quicktype-core");
5
5
  const graphql_1 = require("graphql");
6
6
  const ts_necessities_1 = require("@glideapps/ts-necessities");
7
7
  const fetch = require("node-fetch");
@@ -1,6 +1,6 @@
1
1
  import { Readable } from "readable-stream";
2
- import { JSONSourceData, JSONSchemaSourceData } from "../quicktype-core";
3
- import { GraphQLSourceData } from "../quicktype-graphql-input";
2
+ import { JSONSourceData, JSONSchemaSourceData } from "quicktype-core";
3
+ import { GraphQLSourceData } from "quicktype-graphql-input";
4
4
  export interface JSONTypeSource extends JSONSourceData<Readable> {
5
5
  kind: "json";
6
6
  }
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.urlsFromURLGrammar = void 0;
4
- const quicktype_core_1 = require("../quicktype-core");
4
+ const quicktype_core_1 = require("quicktype-core");
5
5
  function expand(json) {
6
6
  if (typeof json === "string") {
7
7
  return [json];
@@ -1,5 +1,5 @@
1
1
  import { Readable } from "readable-stream";
2
- import { Options, RendererOptions, SerializedRenderResult, TargetLanguage, JSONInput } from "../quicktype-core";
2
+ import { Options, RendererOptions, SerializedRenderResult, TargetLanguage, JSONInput } from "quicktype-core";
3
3
  export interface CLIOptions {
4
4
  lang: string;
5
5
  topLevel: string;
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  "use strict";
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
@@ -30,9 +29,9 @@ const path = __importStar(require("path"));
30
29
  const _ = __importStar(require("lodash"));
31
30
  const collection_utils_1 = require("collection-utils");
32
31
  const ts_necessities_1 = require("@glideapps/ts-necessities");
33
- const quicktype_core_1 = require("../quicktype-core");
34
- const quicktype_typescript_input_1 = require("../quicktype-typescript-input");
35
- const quicktype_graphql_input_1 = require("../quicktype-graphql-input");
32
+ const quicktype_core_1 = require("quicktype-core");
33
+ const quicktype_typescript_input_1 = require("quicktype-typescript-input");
34
+ const quicktype_graphql_input_1 = require("quicktype-graphql-input");
36
35
  const URLGrammar_1 = require("./URLGrammar");
37
36
  const GraphQLIntrospection_1 = require("./GraphQLIntrospection");
38
37
  const CompressedJSONFromStream_1 = require("./CompressedJSONFromStream");
@@ -41,7 +40,7 @@ const commandLineArgs = require("command-line-args");
41
40
  const getUsage = require("command-line-usage");
42
41
  const chalk = require("chalk");
43
42
  const wordWrap = require("wordwrap")(90);
44
- const packageJSON = require("../../package.json");
43
+ const packageJSON = require("../package.json");
45
44
  const defaultDefaultTargetLanguageName = "go";
46
45
  async function sourceFromFileOrUrlArray(name, filesOrUrls, httpHeaders) {
47
46
  const samples = await Promise.all(filesOrUrls.map(file => (0, quicktype_core_1.readableFromFileOrURL)(file, httpHeaders)));
package/package.json CHANGED
@@ -1,79 +1,63 @@
1
1
  {
2
- "name": "quicktype",
3
- "version": "18.0.6",
4
- "license": "Apache-2.0",
5
- "main": "dist/cli/index.js",
6
- "types": "dist/cli/index.d.ts",
7
- "repository": "https://github.com/quicktype/quicktype",
8
- "engines": {
9
- "node": ">=18.13.0"
10
- },
11
- "scripts": {
12
- "pub": "script/publish.sh",
13
- "build": "script/build.ts",
14
- "test": "script/test",
15
- "start": "script/watch",
16
- "pkg": "script/make-pkgs.sh",
17
- "tslint": "tslint --project src/cli --exclude 'src/__tests__/**' --exclude 'src/quicktype-core/input/io/get-stream/**'",
18
- "clean": "rm -rf dist node_modules *~",
19
- "debug": "node --inspect-brk --max-old-space-size=4096 ./dist/cli/index.js"
20
- },
21
- "dependencies": {
22
- "@glideapps/ts-necessities": "2.1.2",
23
- "@mark.probst/typescript-json-schema": "0.55.0",
24
- "browser-or-node": "^1.2.1",
25
- "chalk": "^2.4.1",
26
- "collection-utils": "^1.0.1",
27
- "command-line-args": "^4.0.6",
28
- "command-line-usage": "^5.0.5",
29
- "graphql": "^0.11.7",
30
- "is-url": "^1.2.4",
31
- "isomorphic-fetch": "^3.0.0",
32
- "js-base64": "^2.4.3",
33
- "lodash": "^4.17.21",
34
- "moment": "^2.22.1",
35
- "node-fetch": "^2.6.1",
36
- "pako": "^1.0.6",
37
- "pluralize": "^7.0.0",
38
- "readable-stream": "2.3.7",
39
- "stream-json": "1.1.3",
40
- "string-to-stream": "^1.1.0",
41
- "typescript": "4.9.4",
42
- "unicode-properties": "^1.4.1",
43
- "urijs": "^1.19.11",
44
- "uuid": "^9.0.0",
45
- "wordwrap": "^1.0.0",
46
- "yaml": "^1.5.0"
47
- },
48
- "devDependencies": {
49
- "@tsconfig/node18": "^1.0.1",
50
- "@types/browser-or-node": "^1.2.0",
51
- "@types/graphql": "^0.11.7",
52
- "@types/is-url": "^1.2.28",
53
- "@types/js-base64": "^2.3.1",
54
- "@types/lodash": "^4.14.108",
55
- "@types/node": "18.11.18",
56
- "@types/pako": "^1.0.0",
57
- "@types/pluralize": "0.0.28",
58
- "@types/readable-stream": "2.3.15",
59
- "@types/semver": "^5.5.0",
60
- "@types/shelljs": "^0.7.8",
61
- "@types/urijs": "^1.19.8",
62
- "@types/yaml": "^1.0.2",
63
- "ajv": "^5.5.2",
64
- "deep-equal": "^1.0.1",
65
- "exit": "^0.1.2",
66
- "prettier": "^2.8.1",
67
- "promise-timeout": "^1.3.0",
68
- "semver": "^5.5.0",
69
- "shelljs": "^0.8.5",
70
- "ts-node": "^10.9.1",
71
- "tslint": "^5.11.0",
72
- "uglify-js": "^3.3.22",
73
- "watch": "^1.0.2"
74
- },
75
- "files": [
76
- "dist/**"
77
- ],
78
- "bin": "dist/cli/index.js"
2
+ "name": "quicktype",
3
+ "version": "19.0.4",
4
+ "license": "Apache-2.0",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "repository": "https://github.com/quicktype/quicktype",
8
+ "engines": {
9
+ "node": ">=18.13.0"
10
+ },
11
+ "scripts": {
12
+ "pub": "script/publish.sh",
13
+ "build": "npm run build --workspaces --if-present && tsc",
14
+ "test": "script/test",
15
+ "start": "script/watch",
16
+ "clean": "rm -rf dist node_modules *~ packages/*/{dist,node_modules}",
17
+ "debug": "node --inspect-brk --max-old-space-size=4096 ./dist/index.js"
18
+ },
19
+ "workspaces": [
20
+ "./packages/quicktype-core",
21
+ "./packages/quicktype-graphql-input",
22
+ "./packages/quicktype-typescript-input"
23
+ ],
24
+ "dependencies": {
25
+ "readable-stream": "^4.3.0",
26
+ "stream-json": "1.1.3",
27
+ "graphql": "^0.11.7",
28
+ "@glideapps/ts-necessities": "^2.1.2",
29
+ "chalk": "^2.4.1",
30
+ "command-line-args": "^4.0.6",
31
+ "command-line-usage": "^5.0.5",
32
+ "lodash": "^4.17.21",
33
+ "moment": "^2.22.1",
34
+ "node-fetch": "^2.6.1",
35
+ "string-to-stream": "^1.1.0",
36
+ "typescript": "4.9.4",
37
+ "quicktype-core": "v19.0.4",
38
+ "quicktype-graphql-input": "v19.0.4",
39
+ "quicktype-typescript-input": "v19.0.4"
40
+ },
41
+ "devDependencies": {
42
+ "@tsconfig/node18": "^1.0.1",
43
+ "@types/graphql": "^0.11.7",
44
+ "@types/is-url": "^1.2.28",
45
+ "@types/lodash": "^4.14.108",
46
+ "@types/shelljs": "^0.7.8",
47
+ "@types/urijs": "^1.19.8",
48
+ "ajv": "^5.5.2",
49
+ "deep-equal": "^1.0.1",
50
+ "exit": "^0.1.2",
51
+ "prettier": "^2.8.1",
52
+ "promise-timeout": "^1.3.0",
53
+ "shelljs": "^0.8.5",
54
+ "ts-node": "^10.9.1",
55
+ "tslint": "^5.11.0",
56
+ "uglify-js": "^3.3.22",
57
+ "watch": "^1.0.2"
58
+ },
59
+ "files": [
60
+ "dist"
61
+ ],
62
+ "bin": "dist/index.js"
79
63
  }
@@ -1,8 +0,0 @@
1
- export declare class AnnotationData {
2
- }
3
- export declare class IssueAnnotationData extends AnnotationData {
4
- readonly message: string;
5
- constructor(message: string);
6
- }
7
- export declare const anyTypeIssueAnnotation: IssueAnnotationData;
8
- export declare const nullTypeIssueAnnotation: IssueAnnotationData;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nullTypeIssueAnnotation = exports.anyTypeIssueAnnotation = exports.IssueAnnotationData = exports.AnnotationData = void 0;
4
- class AnnotationData {
5
- }
6
- exports.AnnotationData = AnnotationData;
7
- class IssueAnnotationData extends AnnotationData {
8
- message;
9
- constructor(message) {
10
- super();
11
- this.message = message;
12
- }
13
- }
14
- exports.IssueAnnotationData = IssueAnnotationData;
15
- exports.anyTypeIssueAnnotation = new IssueAnnotationData("quicktype cannot infer this type because there is no data about it in the input.");
16
- exports.nullTypeIssueAnnotation = new IssueAnnotationData("The only value for this in the input is null, which means you probably need a more complete input sample.");
@@ -1,138 +0,0 @@
1
- import { Type, ClassType, EnumType, UnionType, TypeKind, ClassProperty, ObjectType } from "./Type";
2
- import { Namespace, Name, Namer, DependencyName } from "./Naming";
3
- import { Renderer, BlankLineConfig, RenderContext, ForEachPosition } from "./Renderer";
4
- import { Sourcelike } from "./Source";
5
- import { Declaration } from "./DeclarationIR";
6
- import { Transformation } from "./Transformers";
7
- import { TargetLanguage } from "./TargetLanguage";
8
- export declare const topLevelNameOrder = 1;
9
- export declare const inferredNameOrder = 30;
10
- export type ForbiddenWordsInfo = {
11
- names: (Name | string)[];
12
- includeGlobalForbidden: boolean;
13
- };
14
- export declare abstract class ConvenienceRenderer extends Renderer {
15
- private _globalForbiddenNamespace;
16
- private _otherForbiddenNamespaces;
17
- private _globalNamespace;
18
- private _nameStoreView;
19
- private _propertyNamesStoreView;
20
- private _memberNamesStoreView;
21
- private _caseNamesStoreView;
22
- private _namesForTransformations;
23
- private _namedTypeNamer;
24
- private _unionMemberNamer;
25
- private _enumCaseNamer;
26
- private _declarationIR;
27
- private _namedTypes;
28
- private _namedObjects;
29
- private _namedEnums;
30
- private _namedUnions;
31
- private _haveUnions;
32
- private _haveMaps;
33
- private _haveOptionalProperties;
34
- private _cycleBreakerTypes?;
35
- private _alphabetizeProperties;
36
- constructor(targetLanguage: TargetLanguage, renderContext: RenderContext);
37
- get topLevels(): ReadonlyMap<string, Type>;
38
- /**
39
- * Return an array of strings which are not allowed as names in the global
40
- * namespace. Since names of generated types are in the global namespace,
41
- * this will include anything built into the language or default libraries
42
- * that can conflict with that, such as reserved keywords or common type
43
- * names.
44
- */
45
- protected forbiddenNamesForGlobalNamespace(): string[];
46
- /**
47
- * Returns which names are forbidden for the property names of an object
48
- * type. `names` can contain strings as well as `Name`s. In some
49
- * languages, the class name can't be used as the name for a property, for
50
- * example, in which case `_className` would have to be return in `names`.
51
- * If `includeGlobalForbidden` is set, then all names that are forbidden
52
- * in the global namespace will also be forbidden for the properties.
53
- * Note: That doesn't mean that the names in the global namespace will be
54
- * forbidden, too!
55
- */
56
- protected forbiddenForObjectProperties(_o: ObjectType, _className: Name): ForbiddenWordsInfo;
57
- protected forbiddenForUnionMembers(_u: UnionType, _unionName: Name): ForbiddenWordsInfo;
58
- protected forbiddenForEnumCases(_e: EnumType, _enumName: Name): ForbiddenWordsInfo;
59
- protected makeTopLevelDependencyNames(_t: Type, _topLevelName: Name): DependencyName[];
60
- protected makeNamedTypeDependencyNames(_t: Type, _name: Name): DependencyName[];
61
- protected abstract makeNamedTypeNamer(): Namer;
62
- protected abstract namerForObjectProperty(o: ObjectType, p: ClassProperty): Namer | null;
63
- protected abstract makeUnionMemberNamer(): Namer | null;
64
- protected abstract makeEnumCaseNamer(): Namer | null;
65
- protected abstract emitSourceStructure(givenOutputFilename: string): void;
66
- protected makeNameForTransformation(_xf: Transformation, _typeName: Name | undefined): Name | undefined;
67
- protected namedTypeToNameForTopLevel(type: Type): Type | undefined;
68
- protected get unionMembersInGlobalNamespace(): boolean;
69
- protected get enumCasesInGlobalNamespace(): boolean;
70
- protected get needsTypeDeclarationBeforeUse(): boolean;
71
- protected canBeForwardDeclared(_t: Type): boolean;
72
- protected unionNeedsName(u: UnionType): boolean;
73
- private get globalNamespace();
74
- private get nameStoreView();
75
- protected descriptionForType(t: Type): string[] | undefined;
76
- protected descriptionForClassProperty(o: ObjectType, name: string): string[] | undefined;
77
- protected setUpNaming(): ReadonlySet<Namespace>;
78
- private addDependenciesForNamedType;
79
- protected makeNameForTopLevel(_t: Type, givenName: string, _maybeNamedType: Type | undefined): Name;
80
- private addNameForTopLevel;
81
- private makeNameForType;
82
- protected makeNameForNamedType(t: Type): Name;
83
- private addNameForNamedType;
84
- protected get typesWithNamedTransformations(): ReadonlyMap<Type, Name>;
85
- protected nameForTransformation(t: Type): Name | undefined;
86
- private addNameForTransformation;
87
- private processForbiddenWordsInfo;
88
- protected makeNameForProperty(o: ObjectType, _className: Name, p: ClassProperty, jsonName: string, assignedName: string | undefined): Name | undefined;
89
- protected makePropertyDependencyNames(_o: ObjectType, _className: Name, _p: ClassProperty, _jsonName: string, _name: Name): Name[];
90
- private addPropertyNames;
91
- protected makeNameForUnionMember(u: UnionType, unionName: Name, t: Type): Name;
92
- private addUnionMemberNames;
93
- protected makeNameForEnumCase(e: EnumType, _enumName: Name, caseName: string, assignedName: string | undefined): Name;
94
- private addEnumCaseNames;
95
- private childrenOfType;
96
- protected get namedUnions(): ReadonlySet<UnionType>;
97
- protected get haveNamedUnions(): boolean;
98
- protected get haveNamedTypes(): boolean;
99
- protected get haveUnions(): boolean;
100
- protected get haveMaps(): boolean;
101
- protected get haveOptionalProperties(): boolean;
102
- protected get enums(): ReadonlySet<EnumType>;
103
- protected get haveEnums(): boolean;
104
- protected proposedUnionMemberNameForTypeKind(_kind: TypeKind): string | null;
105
- protected proposeUnionMemberName(_u: UnionType, _unionName: Name, fieldType: Type, lookup: (n: Name) => string): string;
106
- protected nameForNamedType(t: Type): Name;
107
- protected isForwardDeclaredType(t: Type): boolean;
108
- protected isImplicitCycleBreaker(_t: Type): boolean;
109
- protected canBreakCycles(_t: Type): boolean;
110
- protected isCycleBreakerType(t: Type): boolean;
111
- protected forEachTopLevel(blankLocations: BlankLineConfig, f: (t: Type, name: Name, position: ForEachPosition) => void, predicate?: (t: Type) => boolean): boolean;
112
- protected forEachDeclaration(blankLocations: BlankLineConfig, f: (decl: Declaration, position: ForEachPosition) => void): void;
113
- setAlphabetizeProperties(value: boolean): void;
114
- protected getAlphabetizeProperties(): boolean;
115
- protected propertyCount(o: ObjectType): number;
116
- protected sortClassProperties(properties: ReadonlyMap<string, ClassProperty>, propertyNames: ReadonlyMap<string, Name>): ReadonlyMap<string, ClassProperty>;
117
- protected forEachClassProperty(o: ObjectType, blankLocations: BlankLineConfig, f: (name: Name, jsonName: string, p: ClassProperty, position: ForEachPosition) => void): void;
118
- protected nameForUnionMember(u: UnionType, t: Type): Name;
119
- protected nameForEnumCase(e: EnumType, caseName: string): Name;
120
- protected forEachUnionMember(u: UnionType, members: ReadonlySet<Type> | null, blankLocations: BlankLineConfig, sortOrder: ((n: Name, t: Type) => string) | null, f: (name: Name, t: Type, position: ForEachPosition) => void): void;
121
- protected forEachEnumCase(e: EnumType, blankLocations: BlankLineConfig, f: (name: Name, jsonName: string, position: ForEachPosition) => void): void;
122
- protected forEachTransformation(blankLocations: BlankLineConfig, f: (n: Name, t: Type, position: ForEachPosition) => void): void;
123
- protected forEachSpecificNamedType<T extends Type>(blankLocations: BlankLineConfig, types: Iterable<[any, T]>, f: (t: T, name: Name, position: ForEachPosition) => void): void;
124
- protected forEachObject(blankLocations: BlankLineConfig, f: ((c: ClassType, className: Name, position: ForEachPosition) => void) | ((o: ObjectType, objectName: Name, position: ForEachPosition) => void)): void;
125
- protected forEachEnum(blankLocations: BlankLineConfig, f: (u: EnumType, enumName: Name, position: ForEachPosition) => void): void;
126
- protected forEachUnion(blankLocations: BlankLineConfig, f: (u: UnionType, unionName: Name, position: ForEachPosition) => void): void;
127
- protected forEachUniqueUnion<T>(blankLocations: BlankLineConfig, uniqueValue: (u: UnionType) => T, f: (firstUnion: UnionType, value: T, position: ForEachPosition) => void): void;
128
- protected forEachNamedType(blankLocations: BlankLineConfig, objectFunc: ((c: ClassType, className: Name, position: ForEachPosition) => void) | ((o: ObjectType, objectName: Name, position: ForEachPosition) => void), enumFunc: (e: EnumType, enumName: Name, position: ForEachPosition) => void, unionFunc: (u: UnionType, unionName: Name, position: ForEachPosition) => void): void;
129
- protected sourcelikeToString(src: Sourcelike): string;
130
- protected get commentLineStart(): string;
131
- protected emitCommentLines(lines: Sourcelike[], lineStart?: string, beforeLine?: string, afterLine?: string, firstLineStart?: string): void;
132
- protected emitDescription(description: Sourcelike[] | undefined): void;
133
- protected emitDescriptionBlock(lines: Sourcelike[]): void;
134
- protected emitPropertyTable(c: ClassType, makePropertyRow: (name: Name, jsonName: string, p: ClassProperty) => Sourcelike[]): void;
135
- private processGraph;
136
- protected emitSource(givenOutputFilename: string): void;
137
- protected forEachType<TResult>(process: (t: Type) => TResult): Set<TResult>;
138
- }