From 0d065e9a606fc5828ee771179569da3e39fbec1b Mon Sep 17 00:00:00 2001 From: LaunchDarklyReleaseBot <86431345+LaunchDarklyReleaseBot@users.noreply.github.com> Date: Thu, 16 May 2024 03:10:42 -0700 Subject: [PATCH] prepare 16.1.0 release (#118) * use gonfalon generated openapi 3 spec * clean up circle config * get openapi spec from prod gonfalon * use staging url * update go sample to use updated go client * revert back to production openapi spec * fix Python sample * fix swagger-client import name * update typescript target to axios * update java sample code to use new java client * update javascript sample code to use new javascript client * update ruby sample code to use new ruby client * update ruby client for testing * update java sample * [ch103716] Correct typo in big segment update operation name * [ch105622] add flag dependencies endpoints to openapi (#190) * add flag dependencies endpoints * fix list dep flags resp description * Bw/ch109131/generator migration start (#192) * first stab at migrating generators. ran out of time to fix errors. * Go client generating remove old README template for Go ignoring openapi-generator binary from git * download generator if not there * update Go example add back go folder temporarily to build * working go example * template cleanup * updates for python and go * add ruby support * temporary reorder of build * wget json file again build all clients fix up docs there is no more yaml generation * updates for java * small cleanup * basic README cleanup to kick off CI Co-authored-by: Ben Woskow * update releaser (#193) * first stab at migrating generators. ran out of time to fix errors. * Go client generating remove old README template for Go ignoring openapi-generator binary from git * download generator if not there * update Go example add back go folder temporarily to build * working go example * template cleanup * updates for python and go * add ruby support * temporary reorder of build * wget json file again build all clients fix up docs there is no more yaml generation * updates for java * small cleanup * basic README cleanup to kick off CI * update releaser * updates for javascript * wrong directory * fix java * update typescript build * minor js updates * clean up flag in conflict * updates for PHP * remove commented out dependency java Co-authored-by: Ben Woskow * Updating sample codes to work with latest spec (#194) * update readme links (#195) * Adding the DX squad as codeowners * Update docs for environment approval settings (#196) * Update docs for environment approval settings Co-authored-by: Sarah Day * add sample code link (#198) * temporarily remove csharp from publication process (#197) * Remove vestigial files * Update readme * Rev to open api generator 5.2 * Skip spec validation to avoid breaking it * Update README.md Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com> * Update readme * Clean description refs from openapi spec before generating * Revert "Clean description refs from openapi spec before generating" This reverts commit 21e2da16350dcf83b72740454bdb563aa25799ee. * Skip spec validation * 86 github pages * Revert removal of java sdk gh page * Remove validation skipping * Samples sans reps2 * s/GlobalFlagRep/FlagPost * s/VariateRep/FlagPostVariations * pass in git info to every clinet (#200) * update docs for approvals copy flag (#201) * Update go example * Use patched version of openapi-generator-cli temporarily * Update ld-openapi-generator-cli.jar * further implementation of Dockerized Releaser (#204) * Update examples * Fix python sample * Fix ruby sample * verify that client code builds, fix (most) Java build issues, make dry run more useful (#205) * update goas branch for new release process (#206) * fix problems with Java and JavaScript client builds (#207) * Fix typescript sample code (#208) * updates for typescript * add node t types remove finally * remove commented out code * fixes based on feedback * Fix bad merge * adding github host key (#210) * add ssh dir * back out previous ssh changes and correctly use https (#212) * Java Client Changes (#213) * move Java to end of publish add gradle.properties file to set longer timeout to Sonatype * move Java to end of publish * Update .ldrelease/publish-dry-run.sh Co-authored-by: carmenquan Co-authored-by: carmenquan * Replace deprecated docker image usage with newer CircleCI docker images (#214) * api-client-javascript 6.0.0 doesn't work due to incorrect package generation (#215) * update to copy hidden files * remove python * Revert "remove python" This reverts commit b5bc51b589406d4af33826be5a3da1ed7836583c. * fix python build (#216) * [sc124605] Removing custom template for ruby client (#217) * removing custom template for ruby client * remove whitespace * using token username (#218) * allow release to proceed if a per-target publish step failed only because it was already published * update Makefile (#220) add temporary template, plan to upstream change * renaming variate to variation (#222) * update generator (#221) * update .jar (#223) * update version template (#224) * switch to gradlew, update from deprecated ghpages library (#225) * allow execution of gradle wrapper (#226) * Remove publish to java gh pages (#228) * remove publish to java gh pages * adding whitespace * remove csharp dotnet references (#230) * Update branch from master to main (#229) * update branch from master to main * adding fetch all * test if main exists * test if main exists * test clone * Removed git submodule -b to checkout the default branch automatically. * Update Makefile * Update Makefile * Update Makefile * Removed c# * Update Makefile * Replaced make foreach with bash for loop. * Apply suggestions from code review * Update Makefile * Update Makefile * Rollback to working version. * Update Makefile * add git fetch * remove variable * adding back version * using prev branch variable * remove version Co-authored-by: Yusinto Ngadiman * update codeowners (#235) * [sc-156083] Add php sample app (#234) * Update to OpenAPI Generator 6.0.0 (#233) * updating to use 6.0.0-beta * update version to 6.0.0 * remove ld-openapi-generator-cli.jar * update gradle file * update gradle file * update gradle file * update gradle file * update gradle file * updating axios * remove files * remove extra gradle * add typescript tsconfig.mustache * adding a projects sample * adding println * adding println for projects * remove delete action * testing new config * testing new api key * removing load prior targets * revert java sample change * updating java config * cleanup in case of bad run for java * Revert "cleanup in case of bad run for java" This reverts commit 205bed7a6d9035f8483e2c23662ed6a7b0bfdb3d. * updating go sample * removing projects * Update tsconfig.mustache (#236) * add blurb about versioning * fixing link * Update samples/java/src/main/java/com/launchdarkly/sample/Main.java * Update README-PREFIX.md Co-authored-by: Molly * Update README-PREFIX.md Co-authored-by: Yusinto Ngadiman Co-authored-by: Molly * Adding template for fixing restructuredtext issue (#238) * adding template for fixing restructuredtext issue * missing second line * adding .gitignore file (#239) * Rename gitignore mustache file (#240) * adding .gitignore file * rename file * only updating java (#241) * add wildcards (#242) * fix: [sc-160524] Need to remove all old files before copying new targets to git repo (#244) * adding back other clients * remove contents of the newly cloned git folder * revert change from old PR * add comment * adding back other clients (#243) * Update codeowners (#245) * Update codeowners * fix squad name * Update SSM parameter paths (#247) Co-authored-by: Lucy Voigt * Only include 'View code' link if sample code is available (#248) * Only include 'View code' link if sample code is available * Add description to Typescript README --------- Co-authored-by: Lucy Voigt * Update Axios dependency in Typescript client (#251) * Update .gitignore * Try updating axios * Update package.json * Update sample * Generate go interface (#252) --------- Co-authored-by: Kevin Brackbill Co-authored-by: Raymond Ho Co-authored-by: Lexi Ross Co-authored-by: Matt Wagner Co-authored-by: Henry Jacobs Co-authored-by: LaunchDarklyCI Co-authored-by: Dan O'Brien Co-authored-by: Ben Woskow Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com> Co-authored-by: vatasha <21329981+vatasha@users.noreply.github.com> Co-authored-by: Sarah Day Co-authored-by: Christie Williams Co-authored-by: LaunchDarklyReleaseBot Co-authored-by: Eli Bishop Co-authored-by: carmenquan Co-authored-by: Yusinto Ngadiman Co-authored-by: Jaz White Co-authored-by: Jaz White Co-authored-by: Molly Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt Co-authored-by: Henry Barrow --- .gitignore | 3 +- Makefile | 7 ++- README-PREFIX.md | 2 +- samples/typescript-axios/package.json | 2 +- .../typescript-axios/README.mustache | 50 +++++++++++++++++++ .../typescript-axios/package.moustache | 40 +++++++++++++++ 6 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 swagger-codegen-templates/typescript-axios/README.mustache create mode 100644 swagger-codegen-templates/typescript-axios/package.moustache diff --git a/.gitignore b/.gitignore index a12ce3d..ef2852b 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,5 @@ scripts/release/java/.gradle/* .classpath .project .settings/ -.idea \ No newline at end of file +.idea +.vscode/ diff --git a/Makefile b/Makefile index c1b5699..bca204f 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ SAMPLES_PATH ?= ./samples # The following variables define any special command-line parameters that need to be passed # to openapi-generator for each language/platform. CODEGEN_PARAMS_go = --additional-properties=packageName=ldapi \ + --additional-properties=generateInterfaces=true \ --additional-properties=email=support@launchdarkly.com \ --additional-properties=developerName=LaunchDarkly \ --additional-properties=developerEmail=support@launchdarkly.com \ @@ -136,12 +137,16 @@ $(API_TARGETS): $(TARGET_OPENAPI_JSON) $(CODEGEN) generate -i $(TARGET_OPENAPI_JSON) $(CODEGEN_PARAMS_$@) -g $@ --additional-properties=artifactVersion=$(LD_RELEASE_VERSION) --git-host=github.com --git-user-id=launchdarkly --git-repo-id=api-client-$@ -o $(BUILD_DIR) cp ./LICENSE.txt $(BUILD_DIR)/LICENSE.txt mv $(BUILD_DIR)/README.md $(BUILD_DIR)/README-ORIGINAL.md || touch $(BUILD_DIR)/README-ORIGINAL.md - cat ./README-PREFIX.md $(BUILD_DIR)/README-ORIGINAL.md > $(BUILD_DIR)/README.md if [ -f "$(SAMPLES_PATH)/$@/$(SAMPLE_FILE_$@)" ]; then \ + cat ./README-PREFIX.md > $(BUILD_DIR)/README.md; \ + echo -e "View our [sample code](#sample-code) for example usage.\n" >> $(BUILD_DIR)/README.md; \ + cat $(BUILD_DIR)/README-ORIGINAL.md >> $(BUILD_DIR)/README.md; \ echo -e "## Sample Code\n" >> $(BUILD_DIR)/README.md; \ echo '```${SAMPLE_FORMAT_$@}' >> $(BUILD_DIR)/README.md; \ cat $(SAMPLES_PATH)/$@/$(SAMPLE_FILE_$@) >> $(BUILD_DIR)/README.md; \ echo '```' >> $(BUILD_DIR)/README.md; \ + else \ + cat ./README-PREFIX.md $(BUILD_DIR)/README-ORIGINAL.md > $(BUILD_DIR)/README.md; \ fi rm $(BUILD_DIR)/README-ORIGINAL.md diff --git a/README-PREFIX.md b/README-PREFIX.md index 6ffac73..274e918 100644 --- a/README-PREFIX.md +++ b/README-PREFIX.md @@ -1,5 +1,5 @@ This repository contains a client library for LaunchDarkly's REST API. This client was automatically -generated from our [OpenAPI specification](https://app.launchdarkly.com/api/v2/openapi.json) using a [code generation library](https://github.com/launchdarkly/ld-openapi). View our [sample code](#getting-started) for example usage. +generated from our [OpenAPI specification](https://app.launchdarkly.com/api/v2/openapi.json) using a [code generation library](https://github.com/launchdarkly/ld-openapi). This REST API is for custom integrations, data export, or automating your feature flag workflows. *DO NOT* use this client library to include feature flags in your web or mobile application. To integrate feature flags with your application, read the [SDK documentation](https://docs.launchdarkly.com/sdk). diff --git a/samples/typescript-axios/package.json b/samples/typescript-axios/package.json index e1e48f2..17ea92e 100644 --- a/samples/typescript-axios/package.json +++ b/samples/typescript-axios/package.json @@ -14,6 +14,6 @@ }, "devDependencies": { "@types/node": "^16.7.8", - "typescript": "^3.9.3" + "typescript": "^4.0.0" } } diff --git a/swagger-codegen-templates/typescript-axios/README.mustache b/swagger-codegen-templates/typescript-axios/README.mustache new file mode 100644 index 0000000..78e37e7 --- /dev/null +++ b/swagger-codegen-templates/typescript-axios/README.mustache @@ -0,0 +1,50 @@ +## {{npmName}}@{{npmVersion}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install {{npmName}}@{{npmVersion}} --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save +``` diff --git a/swagger-codegen-templates/typescript-axios/package.moustache b/swagger-codegen-templates/typescript-axios/package.moustache new file mode 100644 index 0000000..da599f1 --- /dev/null +++ b/swagger-codegen-templates/typescript-axios/package.moustache @@ -0,0 +1,40 @@ +{ + "name": "{{npmName}}", + "version": "{{npmVersion}}", + "description": "OpenAPI client for {{npmName}}", + "author": "OpenAPI-Generator Contributors", + "repository": { + "type": "git", + "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" + }, + "keywords": [ + "axios", + "typescript", + "openapi-client", + "openapi-generator", + "{{npmName}}" + ], + "license": "Unlicense", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", +{{#supportsES6}} + "module": "./dist/esm/index.js", + "sideEffects": false, +{{/supportsES6}} + "scripts": { + "build": "tsc{{#supportsES6}} && tsc -p tsconfig.esm.json{{/supportsES6}}", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.1" + }, + "devDependencies": { + "@types/node": "^12.11.5", + "typescript": "^4.0" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig": { + "registry": "{{npmRepository}}" + } +{{/npmRepository}} +}