Skip to content

Commit ceac79e

Browse files
committed
New spec, new code
1 parent b761240 commit ceac79e

File tree

457 files changed

+8188
-8840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+8188
-8840
lines changed

code-generator/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"lower-case-first": "^2.0.2",
1313
"openapi-types": "^12.1.0",
1414
"ramda": "^0.28.0",
15-
"ringcentral-open-api-parser": "^0.8.10"
15+
"ringcentral-open-api-parser": "^0.9.13"
1616
},
1717
"devDependencies": {
1818
"@types/js-yaml": "^4.0.5",
19-
"@types/node": "^18.11.18",
20-
"@types/ramda": "^0.28.20",
19+
"@types/node": "^18.15.11",
20+
"@types/ramda": "^0.28.23",
2121
"dotenv-override-true": "^6.2.2",
2222
"gts": "^3.1.1",
2323
"ts-node": "^10.9.1",
24-
"typescript": "^4.9.4",
25-
"yarn-upgrade-all": "^0.7.1"
24+
"typescript": "^5.0.2",
25+
"yarn-upgrade-all": "^0.7.2"
2626
}
2727
}

code-generator/src/definitions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const normalizeField = (f: Field): Field => {
2525
f.type = 'Boolean';
2626
} else if (f.type === 'string') {
2727
f.type = 'String';
28+
} else if (f.type === 'object') {
29+
f.type = 'Object';
2830
}
2931
return f;
3032
};

code-generator/src/parser.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
import {parse} from 'ringcentral-open-api-parser';
2-
import fs from 'fs';
3-
import yaml from 'js-yaml';
4-
import {OpenAPIV3} from 'openapi-types';
1+
import {prepareSpec} from 'ringcentral-open-api-parser';
52

6-
const doc = yaml.load(
7-
fs.readFileSync(process.env.spec_file_path!, 'utf8')
8-
) as OpenAPIV3.Document;
9-
10-
export const parsed = parse(doc);
3+
export const parsed = prepareSpec(process.env.spec_file_path!);

code-generator/src/paths.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,19 @@ const generateOperationMethod = (
140140
// methodParams
141141
const methodParams: string[] = [];
142142
if (operation.bodyParameters) {
143-
methodParams.push(
144-
`${capitalizeFirstLetter(operation.bodyParameters)} ${
145-
operation.bodyParameters
146-
}`
147-
);
143+
if (operation.bodyType) {
144+
methodParams.push(
145+
`${capitalizeFirstLetter(operation.bodyType)} ${
146+
operation.bodyParameters
147+
}`
148+
);
149+
} else {
150+
methodParams.push(
151+
`${capitalizeFirstLetter(operation.bodyParameters)} ${
152+
operation.bodyParameters
153+
}`
154+
);
155+
}
148156
}
149157
if (operation.queryParameters) {
150158
methodParams.push(

code-generator/yarn.lock

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@
145145
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
146146
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
147147

148-
"@types/node@^18.11.18":
149-
version "18.11.18"
150-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f"
151-
integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==
148+
"@types/node@^18.15.11":
149+
version "18.15.11"
150+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f"
151+
integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==
152152

153153
"@types/normalize-package-data@^2.4.0":
154154
version "2.4.1"
155155
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"
156156
integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==
157157

158-
"@types/ramda@^0.28.20":
159-
version "0.28.20"
160-
resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.28.20.tgz#df93bb5674f0051464c075480ca3075d1c1361ba"
161-
integrity sha512-MeUhzGSXQTRsY19JGn5LIBTLxVEnyF6HDNr08KSJqybsm4DlfLIgK1jBHjhpiSyk252tXYmp+UOe0UFg0UiFsA==
158+
"@types/ramda@^0.28.23":
159+
version "0.28.23"
160+
resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.28.23.tgz#d04279865a86c330c03c99ac61161d9905f276f5"
161+
integrity sha512-9TYWiwkew+mCMsL7jZ+kkzy6QXn8PL5/SKmBPmjgUlTpkokZWTBr+OhiIUDztpAEbslWyt24NNfEmZUBFmnXig==
162162
dependencies:
163163
ts-toolbelt "^6.15.1"
164164

@@ -1183,7 +1183,7 @@ lodash.truncate@^4.4.2:
11831183
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
11841184
integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=
11851185

1186-
lodash@^4.17.19:
1186+
lodash@^4.17.19, lodash@^4.17.21:
11871187
version "4.17.21"
11881188
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
11891189
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -1585,13 +1585,14 @@ rimraf@^3.0.2:
15851585
dependencies:
15861586
glob "^7.1.3"
15871587

1588-
ringcentral-open-api-parser@^0.8.10:
1589-
version "0.8.10"
1590-
resolved "https://registry.yarnpkg.com/ringcentral-open-api-parser/-/ringcentral-open-api-parser-0.8.10.tgz#f8b897c7437a453bd73e18e62f989f587d3f7013"
1591-
integrity sha512-Og1/DWQ7Z5mQ07tQRixg12PYzO5O+I2PZpDMb79UGa3fgH3VXo5sF7pm5skBm/tvdhIUMDDybfGpbp4x37lnWw==
1588+
ringcentral-open-api-parser@^0.9.13:
1589+
version "0.9.13"
1590+
resolved "https://registry.yarnpkg.com/ringcentral-open-api-parser/-/ringcentral-open-api-parser-0.9.13.tgz#6982d8b98142b7b0ce00443351e8c8d12e37406b"
1591+
integrity sha512-O1EJ5IuFZ0NIvRyo4PNSC82C5mXnG6yXDT1CJImiZT6SqJfourCp/fYLXcFgq3VRnmLE8SajJL8ve+nKn+3gVw==
15921592
dependencies:
1593+
js-yaml "^4.1.0"
1594+
lodash "^4.17.21"
15931595
openapi-types "^12.1.0"
1594-
ramda "^0.28.0"
15951596

15961597
run-async@^2.4.0:
15971598
version "2.4.1"
@@ -1885,10 +1886,10 @@ typedarray-to-buffer@^3.1.5:
18851886
dependencies:
18861887
is-typedarray "^1.0.0"
18871888

1888-
typescript@^4.9.4:
1889-
version "4.9.4"
1890-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
1891-
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
1889+
typescript@^5.0.2:
1890+
version "5.0.2"
1891+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
1892+
integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==
18921893

18931894
upper-case-first@^2.0.2:
18941895
version "2.0.2"
@@ -1966,10 +1967,10 @@ yargs-parser@^20.2.3:
19661967
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
19671968
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
19681969

1969-
yarn-upgrade-all@^0.7.1:
1970-
version "0.7.1"
1971-
resolved "https://registry.yarnpkg.com/yarn-upgrade-all/-/yarn-upgrade-all-0.7.1.tgz#167a5a78127c7051c4ed15396bd5f68e3b5cc744"
1972-
integrity sha512-KoYfSs8jGH5fp4+12ezF3uMMIxx70X8l9efmUvsI0KQmmF4nVssEmXw4Q2aZVrRZHF30b3+cyzMIp8iU6sb9aw==
1970+
yarn-upgrade-all@^0.7.2:
1971+
version "0.7.2"
1972+
resolved "https://registry.yarnpkg.com/yarn-upgrade-all/-/yarn-upgrade-all-0.7.2.tgz#5d2afa9230661c55f22d3f848f22258db732ae20"
1973+
integrity sha512-iVxmoBuNdpxeahAIehJ039Pp6S8zQ/qTENQRMV5hp7x/2tLGUzytCODIKZFjfUwcRRKT3boGgHheUEWC7+VlQw==
19731974

19741975
19751976
version "3.1.1"

0 commit comments

Comments
 (0)