- Notifications
You must be signed in to change notification settings - Fork279
Versions for API based Datasources#1103
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
24 commits Select commitHold shift + click to select a range
6b54810
add version field to plugin definition.
goldantsda3c0aa
refactor code and test with twilio plugin
goldants733591c
Add s3 spec version
goldantsa3fc994
Add dynamo spec version
goldantsf4a3592
Add firebase spec version
goldants7059b79
Add couchdb spec version
goldants10d5859
Add woocommerce spec version
goldantsceeec59
Add openai spec version
goldantsdf93bd8
Add gcstorage spec version
goldants70101b7
Add stripe spec version
goldantse3866a9
Add asana, circleci spec version
goldantscd4c117
Add front, github spec version
goldants222cf9c
Add huggingface, jira, onesignal spec version
goldants206e03c
Add cloudinary, datadog, lowcoder, notion, postmanecho, sendgrid spec…
goldants998625e
remove test code
goldants13212ef
backward compatibility when no version is selected
goldants3819c30
Merge branch 'dev' into feature/spec_version
goldants21bf504
resolve test issue
goldantsc158d44
Merge branch 'dev' into feature/spec_version
goldants03688bf
add test case
goldants1ca3b02
Merge branch 'versions-for-datasources' into feature/spec_version
FalkWolsky15e33f0
Merge pull request #1078 from goldants/feature/spec_version
FalkWolskyb831451
Sorting Twilio into Versions
1a50316
Merge branch 'dev' into versions-for-datasources
FalkWolskyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
112 changes: 112 additions & 0 deletionsserver/node-service/src/common/util.test.ts
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,112 @@ | ||
import { specsToOptions, version2spec } from "./util"; | ||
describe('version2spec', () => { | ||
test('should return the spec for the given version', () => { | ||
const specs = { | ||
v1: 'spec for version 1', | ||
v2: 'spec for version 2', | ||
v3: 'spec for version 3' | ||
}; | ||
expect(version2spec(specs, 'v2')).toBe('spec for version 2'); | ||
}); | ||
test('should return the first spec if version is undefined', () => { | ||
const specs = { | ||
v1: 'spec for version 1', | ||
v2: 'spec for version 2', | ||
v3: 'spec for version 3' | ||
}; | ||
expect(version2spec(specs, undefined)).toBe('spec for version 1'); | ||
}); | ||
test('should return the first spec if version is an empty string', () => { | ||
const specs = { | ||
v1: 'spec for version 1', | ||
v2: 'spec for version 2', | ||
v3: 'spec for version 3' | ||
}; | ||
expect(version2spec(specs, "")).toBe('spec for version 1'); | ||
}); | ||
test('should return undefined if specs is an empty object and version is undefined', () => { | ||
const specs = {}; | ||
expect(version2spec(specs, undefined)).toBeUndefined(); | ||
}); | ||
test('should return undefined if specs is an empty object and version is an empty string', () => { | ||
const specs = {}; | ||
expect(version2spec(specs, "")).toBeUndefined(); | ||
}); | ||
test('should return undefined if the specified version does not exist in specs', () => { | ||
const specs = { | ||
v1: 'spec for version 1', | ||
v2: 'spec for version 2', | ||
v3: 'spec for version 3' | ||
}; | ||
expect(version2spec(specs, 'v4')).toBeUndefined(); | ||
}); | ||
}); | ||
describe('specsToOptions', () => { | ||
test('should convert specs object to options array', () => { | ||
const specs = { | ||
color: 'red', | ||
size: 'large', | ||
weight: 'light' | ||
}; | ||
const expectedOptions = [ | ||
{ value: 'color', label: 'color' }, | ||
{ value: 'size', label: 'size' }, | ||
{ value: 'weight', label: 'weight' } | ||
]; | ||
expect(specsToOptions(specs)).toEqual(expectedOptions); | ||
}); | ||
test('should return an empty array if specs object is empty', () => { | ||
const specs = {}; | ||
const expectedOptions: any[] = []; | ||
expect(specsToOptions(specs)).toEqual(expectedOptions); | ||
}); | ||
test('should handle specs object with non-string values', () => { | ||
const specs = { | ||
color: 'red', | ||
size: 42, | ||
available: true | ||
}; | ||
const expectedOptions = [ | ||
{ value: 'color', label: 'color' }, | ||
{ value: 'size', label: 'size' }, | ||
{ value: 'available', label: 'available' } | ||
]; | ||
expect(specsToOptions(specs)).toEqual(expectedOptions); | ||
}); | ||
test('should handle specs object with numeric keys', () => { | ||
const specs = { | ||
1: 'one', | ||
2: 'two', | ||
3: 'three' | ||
}; | ||
const expectedOptions = [ | ||
{ value: '1', label: '1' }, | ||
{ value: '2', label: '2' }, | ||
{ value: '3', label: '3' } | ||
]; | ||
expect(specsToOptions(specs)).toEqual(expectedOptions); | ||
}); | ||
}); |
46 changes: 46 additions & 0 deletionsserver/node-service/src/common/util.ts
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
23 changes: 17 additions & 6 deletionsserver/node-service/src/plugins/asana/index.ts
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
19 changes: 16 additions & 3 deletionsserver/node-service/src/plugins/circleCi/index.ts
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
28 changes: 20 additions & 8 deletionsserver/node-service/src/plugins/cloudinary/index.ts
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
20 changes: 16 additions & 4 deletionsserver/node-service/src/plugins/couchdb/index.ts
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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.