launchdarkly-api-typescript
Advanced tools
Comparing version 5.4.0 to 6.0.0
{ | ||
"name": "launchdarkly-api-typescript", | ||
"version": "5.4.0", | ||
"description": "Build custom integrations with the LaunchDarkly REST API", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/launchdarkly/api-client-typescript.git" | ||
}, | ||
"main": "api.js", | ||
"scripts": { | ||
"clean": "rm -Rf node_modules/ *.js *.js.map api.d.ts package-lock.json", | ||
"build": "./node_modules/.bin/tsc", | ||
"test": "echo No tests are defined." | ||
}, | ||
"author": "Swagger Codegen Contributors", | ||
"license": "Apache 2.0", | ||
"dependencies": { | ||
"bluebird": "^3.5.0", | ||
"request": "^2.81.0", | ||
"@types/bluebird": "*", | ||
"@types/request": "*" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.9.3" | ||
} | ||
"name": "launchdarkly-api-typescript", | ||
"version": "6.0.0", | ||
"description": "OpenAPI client for launchdarkly-api-typescript", | ||
"author": "OpenAPI-Generator Contributors", | ||
"keywords": [ | ||
"axios", | ||
"typescript", | ||
"openapi-client", | ||
"openapi-generator", | ||
"launchdarkly-api-typescript" | ||
], | ||
"license": "Unlicense", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc --outDir dist/", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^12.11.5", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
This repository contains a client library for LaunchDarkly's REST API. This client was automatically | ||
generated from our [OpenAPI specification](https://github.com/launchdarkly/ld-openapi). | ||
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](#sample-code) for example usage. | ||
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, please see the [SDK documentation](https://docs.launchdarkly.com/v2.0/docs) | ||
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). | ||
## launchdarkly-api-typescript@6.0.0 | ||
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 launchdarkly-api-typescript@6.0.0 --save | ||
``` | ||
_unPublished (not recommended):_ | ||
``` | ||
npm install PATH_TO_GENERATED_PACKAGE --save | ||
## Sample Code | ||
```ts | ||
import { FeatureFlagsApi, FeatureFlagsApiApiKeys, FeatureFlagBody } from "launchdarkly-api-typescript"; | ||
import { FeatureFlagsApi, Configuration, FeatureFlagBody } from "launchdarkly-api-typescript"; | ||
let apiInstance = new FeatureFlagsApi(); | ||
const apiKey = process.env.LD_API_KEY || ''; | ||
apiInstance.setApiKey(FeatureFlagsApiApiKeys.Token, apiKey); | ||
const apiToken = process.env.LD_API_KEY; | ||
const config = new Configuration({apiKey: apiToken}); | ||
let apiInstance = new FeatureFlagsApi(config); | ||
const successCallback = function(data){ | ||
console.log('API called successfully. Returned data: ' + JSON.stringify(data)); | ||
const successCallback = function(res){ | ||
console.log('API called successfully. Returned data: ' + JSON.stringify(res.data)); | ||
}; | ||
@@ -23,4 +67,4 @@ const errorCallback = function(error) { | ||
const createSuccessCallback = function(data){ | ||
successCallback(data); | ||
const createSuccessCallback = function(res){ | ||
successCallback(res); | ||
@@ -39,3 +83,15 @@ // Clean up | ||
apiInstance.postFeatureFlag(projectName, flagBody).then(createSuccessCallback, errorCallback); | ||
apiInstance.deleteFeatureFlag(projectName, keyName) | ||
.then(() => { | ||
console.log("flag deleted") | ||
apiInstance.postFeatureFlag(projectName, flagBody).then(createSuccessCallback, errorCallback); | ||
}) | ||
.catch((err) => { | ||
if (err?.response?.status == 404) { | ||
console.log("No flag to cleanup") | ||
} else { | ||
errorCallback(err) | ||
} | ||
apiInstance.postFeatureFlag(projectName, flagBody).then(createSuccessCallback, errorCallback); | ||
}) | ||
``` |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"noImplicitAny": false, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"target": "es2016", | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"removeComments": true, | ||
"sourceMap": true, | ||
"noLib": false, | ||
"declaration": true, | ||
"lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"] | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
"compilerOptions": { | ||
"declaration": true, | ||
"target": "es6", | ||
"module": "commonjs", | ||
"noImplicitAny": true, | ||
"outDir": "dist", | ||
"rootDir": ".", | ||
"typeRoots": [ | ||
"node_modules/@types" | ||
] | ||
}, | ||
"exclude": [ | ||
"dist", | ||
"node_modules" | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
2263312
1
20
40280
1
96
2
1
1
1
+ Addedaxios@^0.21.1
+ Addedaxios@0.21.4(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
- Removed@types/bluebird@*
- Removed@types/request@*
- Removedbluebird@^3.5.0
- Removedrequest@^2.81.0
- Removed@types/bluebird@3.5.42(transitive)
- Removed@types/caseless@0.12.5(transitive)
- Removed@types/node@22.10.2(transitive)
- Removed@types/request@2.48.12(transitive)
- Removed@types/tough-cookie@4.0.5(transitive)
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.32.5.2(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removedundici-types@6.20.0(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)