Code Monkey home page Code Monkey logo

api-client-typescript's People

Contributors

brooswit avatar bwoskow-ld avatar chadmorrow avatar intheclouddan avatar ldhenry avatar rudavko avatar xiex avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-client-typescript's Issues

How is this meant to be consumed?

Hey, thanks for publishing this client. But how is it meant to be consumed? The repo doesn't have a package.json file, which prevents it from being installed as a git dependency and I also couldn't find it on npm.

I thought maybe you intend users to vendor the api.ts file, but then I realized that it actually has some dependencies. Installing those and crossing fingers that they line up sounds very brittle.

No API for `turnFlagOn`?

Using the REST api over HTTPs, you can make the following request:

 const requestInfo = {
      hostname: `app.launchdarkly.com`,
      path: `/api/v2/flags/${projectKey}/${flagKey}`,
      method: 'PATCH',
      headers: {
        Authorization: LAUNCHDARKLY_ACCESS_TOKEN,
        'Content-Type': 'application/json; domain-model=launchdarkly.semanticpatch',
      },
    };
 const requestBody = {
      environmentKey,
      instructions: [{ kind: 'turnFlagOn' }],
    };
do_request(requestInfo, requestBody);

See the patchFeatureFlag REST API docs

I couldn't find this functionality exposed on the FeatureFlagsApi object in this API. Is that an accidental omission? Or did I miss it somewhere?

Can't send addValuesToClause operation via api-client

Hey,

I know this is auto generated client, but hopefully you would have a solution.

When i use the api-client-typescript package, and try to send a .patchFeatureFlag() with a payload example:

    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addValuesToClause",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed",
        "values": ["beta_testers"]
    }]
}

There are 2 problems:

  1. type PatchOperation only supports properties: op, path and value, so there is a TS compile error.
  2. Even after getting over the compile error, i've debugged and noticed that the request being sent with the following payload:
    "patch": [
        {
            "environmentKey": "environment-key-123abc",
            "instructions": [
                {
                    "kind": "addValuesToClause",
                    "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29,
                    "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed",
                    "values": [
                        "please-work"
                    ]
                }
            ]
        }
    ]
}

And the response from the REST API is 400 Error

    "code": "invalid_patch",
    "message": "must have at least one instruction"
}

Please advise, is there a way to use all the different patch operations via the client?

Reached heap limit Allocation failed - error

I'm using this library in a Node project but at the time of building it in my server it fails with a Javascript out of memory message.

It seems to happen as soon as I create an apiInstance

const apiInstance = new FeatureFlagsApi(config);

For now I will have to refactor and deploy code using the fetch api to interact with the LaunchDarkly API directly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.