- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
New Components - launchdarkly #17973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 4 commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            50 changes: 50 additions & 0 deletions
          
          50 
        
  components/launchdarkly/actions/get-feature-flag-status/get-feature-flag-status.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import app from "../../launchdarkly.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "launchdarkly-get-feature-flag-status", | ||
| name: "Get Feature Flag Status", | ||
| description: "Get the status of a feature flag. [See the documentation](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag-status).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| projectKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "project", | ||
| ], | ||
| }, | ||
| environmentKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "environment", | ||
| ({ projectKey }) => ({ | ||
| projectKey, | ||
| }), | ||
| ], | ||
| }, | ||
| featureFlagKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "flag", | ||
| ({ | ||
| projectKey, environmentKey, | ||
| }) => ({ | ||
| projectKey, | ||
| environmentKey, | ||
| }), | ||
| ], | ||
| description: "The key of the feature flag to retrieve the status of", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const status = await this.app.getFeatureFlagStatus({ | ||
| $, | ||
| projectKey: this.projectKey, | ||
| environmentKey: this.environmentKey, | ||
| featureFlagKey: this.featureFlagKey, | ||
| }); | ||
| $.export("$summary", `Found feature flag status: ${status.name}`); | ||
| return status; | ||
| }, | ||
| }; | 
        
          
          
            49 changes: 49 additions & 0 deletions
          
          49 
        
  components/launchdarkly/actions/get-feature-flag/get-feature-flag.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import app from "../../launchdarkly.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "launchdarkly-get-feature-flag", | ||
| name: "Get Feature Flag", | ||
| description: "Get a feature flag by key. [See the documentation](https://launchdarkly.com/docs/api/feature-flags/get-feature-flag).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| projectKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "project", | ||
| ], | ||
| }, | ||
| environmentKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "environment", | ||
| ({ projectKey }) => ({ | ||
| projectKey, | ||
| }), | ||
| ], | ||
| }, | ||
| featureFlagKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "flag", | ||
| ({ | ||
| projectKey, environmentKey, | ||
| }) => ({ | ||
| projectKey, | ||
| environmentKey, | ||
| }), | ||
| ], | ||
| description: "The key of the feature flag to retrieve", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const flag = await this.app.getFeatureFlag({ | ||
| $, | ||
| projectKey: this.projectKey, | ||
| featureFlagKey: this.featureFlagKey, | ||
| }); | ||
| $.export("$summary", `Found feature flag ${flag.key}`); | ||
| return flag; | ||
| }, | ||
| }; | 
        
          
          
            25 changes: 25 additions & 0 deletions
          
          25 
        
  components/launchdarkly/actions/get-project/get-project.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import app from "../../launchdarkly.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "launchdarkly-get-project", | ||
| name: "Get Project", | ||
| description: "Get a project by key. [See the documentation](https://launchdarkly.com/docs/api/projects/get-project).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| projectKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "project", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const project = await this.app.getProject({ | ||
| projectKey: this.projectKey, | ||
| }); | ||
| $.export("$summary", `Found project: ${project.name}`); | ||
| return project; | ||
| }, | ||
| }; | 
        
          
          
            79 changes: 79 additions & 0 deletions
          
          79 
        
  components/launchdarkly/actions/list-environments/list-environments.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import app from "../../launchdarkly.app.mjs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|  | ||
| export default { | ||
| key: "launchdarkly-list-environments", | ||
| name: "List Environments", | ||
| description: "List all environments. [See the documentation](https://launchdarkly.com/docs/api/environments/get-environments-by-project).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| projectKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "project", | ||
| ], | ||
| }, | ||
| filter: { | ||
| type: "string[]", | ||
| label: "Filter", | ||
| description: "A list of filters. Each filter is of the form `field:value`. Example: `query:abc`. [See the documentation](https://launchdarkly.com/docs/api/environments/get-environments-by-project#filtering-environments) for supported fields.", | ||
| optional: true, | ||
| }, | ||
| sort: { | ||
| type: "string", | ||
| label: "Sort Field", | ||
| description: "The field to sort by. Fields prefixed by a dash ( - ) sort in descending order.", | ||
| options: [ | ||
| "createdOn", | ||
| "-createdOn", | ||
| "critical", | ||
| "-critical", | ||
| "name", | ||
| "-name", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| app, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| // validate array props | ||
| if (this.filter && !Array.isArray(this.filter)) { | ||
| throw new ConfigurationError("Filter must be an array"); | ||
| } | ||
| if (this.expand && !Array.isArray(this.expand)) { | ||
| throw new ConfigurationError("Expand must be an array"); | ||
| } | ||
|  | ||
| const params = { | ||
| filter: this.filter?.join(","), | ||
| sort: this.sort, | ||
| }; | ||
|  | ||
| const environments = this.app.paginate({ | ||
| fn: this.app.listEnvironments, | ||
| args: { | ||
| $, | ||
| projectKey: this.projectKey, | ||
| params, | ||
| }, | ||
| max: this.maxResults, | ||
| }); | ||
|  | ||
| const results = []; | ||
| for await (const environment of environments) { | ||
| results.push(environment); | ||
| } | ||
|  | ||
| $.export("$summary", `Found ${results.length} environment${results.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return results; | ||
| }, | ||
| }; | ||
        
          
          
            109 changes: 109 additions & 0 deletions
          
          109 
        
  components/launchdarkly/actions/list-feature-flags/list-feature-flags.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| import app from "../../launchdarkly.app.mjs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|  | ||
| export default { | ||
| key: "launchdarkly-list-feature-flags", | ||
| name: "List Feature Flags", | ||
| description: "List all feature flags. [See the documentation](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| projectKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "project", | ||
| ], | ||
| }, | ||
| environmentKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "environment", | ||
| ({ projectKey }) => ({ | ||
| projectKey, | ||
| }), | ||
| ], | ||
| }, | ||
| filter: { | ||
| type: "string[]", | ||
| label: "Filter", | ||
| description: "A list of filters. Each filter is of the form `field:value`. Example: `query:dark-mode`. [See the documentation](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags#filtering-flags) for supported fields.", | ||
| optional: true, | ||
| }, | ||
| expand: { | ||
| type: "string[]", | ||
| label: "Expand", | ||
| description: "A list of properties that can reveal additional information in the response", | ||
| options: [ | ||
| "codeReferences", | ||
| "evaluation", | ||
| "migrationSettings", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| sort: { | ||
| type: "string", | ||
| label: "Sort Field", | ||
| description: "The field to sort by. Fields prefixed by a dash ( - ) sort in descending order.", | ||
| options: [ | ||
| "creationDate", | ||
| "-creationDate", | ||
| "key", | ||
| "-key", | ||
| "maintainerId", | ||
| "-maintainerId", | ||
| "name", | ||
| "-name", | ||
| "tags", | ||
| "-tags", | ||
| "targetingModifiedDate", | ||
| "-targetingModifiedDate", | ||
| "type", | ||
| "-type", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| app, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| // validate array props | ||
| if (this.filter && !Array.isArray(this.filter)) { | ||
| throw new ConfigurationError("Filter must be an array"); | ||
| } | ||
| if (this.expand && !Array.isArray(this.expand)) { | ||
| throw new ConfigurationError("Expand must be an array"); | ||
| } | ||
|  | ||
| const params = { | ||
| filter: this.filter?.join(","), | ||
| expand: this.expand?.join(","), | ||
| sort: this.sort, | ||
| env: this.environmentKey, | ||
| }; | ||
|  | ||
| const flags = this.app.paginate({ | ||
| fn: this.app.listFeatureFlags, | ||
| args: { | ||
| $, | ||
| projectKey: this.projectKey, | ||
| params, | ||
| }, | ||
| max: this.maxResults, | ||
| }); | ||
|  | ||
| const results = []; | ||
| for await (const flag of flags) { | ||
| results.push(flag); | ||
| } | ||
|  | ||
| $.export("$summary", `Found ${results.length} feature flag${results.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return results; | ||
| }, | ||
| }; | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.