![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@bandada/api-sdk
Advanced tools
A Typescript SDK for the Bandada API.
This package provides a list of functions to make it easier to work with the Bandada API. |
---|
Install the @bandada/api-sdk
package with npm:
npm i @bandada/api-sdk
or yarn:
yarn add @bandada/api-sdk
# new ApiSdk(url: SupportedUrl | string, config?: object): ApiSdk
Creates a new instance of ApiSdk using the API URL and the config.
This is what you need if you are using the production Bandada API.
import { ApiSdk } from "@bandada/api-sdk"
const apiSdk = new ApiSdk()
This is useful when working with the development environment.
import { ApiSdk, SupportedUrl } from "@bandada/api-sdk"
const apiSdk = new ApiSdk(SupportedUrl.DEV)
import { ApiSdk } from "@bandada/api-sdk"
const apiSdk = new ApiSdk("https://example.com/api")
import { ApiSdk } from "@bandada/api-sdk"
const url = "https://example.com/api"
const config = {
headers: {
"Content-Type": "text/html"
}
}
const apiSdk = new ApiSdk(url, config)
# createGroup(): Promise<Group>
Creates a Bandada group.
const groupCreateDetails = {
name: "Group 1",
description: "This is Group 1.",
treeDepth: 16,
fingerprintDuration: 3600
}
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
const group = await apiSdk.createGroup(groupCreateDetails, apiKey)
# createGroups(): Promise<Group[]>
Creates one or many Bandada groups.
const groupsCreateDetails = [
{
name: "Group 1",
description: "This is Group 1.",
treeDepth: 16,
fingerprintDuration: 3600
},
{
name: "Group 2",
description: "This is Group 2.",
treeDepth: 16,
fingerprintDuration: 3600
}
]
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
const groups = await apiSdk.createGroups(groupsCreateDetails, apiKey)
# removeGroup(): Promise<void>
Removes a specific Bandada group.
const groupId = "10402173435763029700781503965100"
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.removeGroup(groupId, apiKey)
# removeGroups(): Promise<void>
Removes one or many Bandada groups.
const groupIds = [
"10402173435763029700781503965100",
"20402173435763029700781503965200"
]
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.removeGroups(groupIds, apiKey)
# updateGroup(): Promise<Group>
Updates a specific Bandada group.
const groupId = "10402173435763029700781503965100"
const groupUpdateDetails = {
description: "This is a new group.",
treeDepth: 20,
fingerprintDuration: 4000
}
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.updateGroup(groupId, groupUpdateDetails, apiKey)
# updateGroups(): Promise<Group[]>
Updates one or many Bandada groups.
const groupIds = [
"10402173435763029700781503965100",
"20402173435763029700781503965200"
]
const updatedGroups: Array<GroupUpdateDetails> = [
{
description: "This is a new group1.",
treeDepth: 32,
fingerprintDuration: 7200
},
{
description: "This is a new group2.",
treeDepth: 32,
fingerprintDuration: 7200
}
]
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.updateGroups(groupId, groupUpdateDetails, apiKey)
# getGroups(): Promise<Group[]>
Returns the list of groups.
const groups = await apiSdk.getGroups()
# getGroup(): Promise<Group>
Returns a specific group.
const groupId = "10402173435763029700781503965100"
const group = await apiSdk.getGroup(groupId)
# isGroupMember(): Promise<boolean>
Returns true if the member is in the group and false otherwise.
const groupId = "10402173435763029700781503965100"
const memberId = "1"
const isMember = await apiSdk.isGroupMember(groupId, memberId)
# generateMerkleProof(): Promise<string>
Returns the Merkle Proof for a member in a group.
const groupId = "10402173435763029700781503965100"
const memberId = "1"
const proof = await apiSdk.generateMerkleProof(groupId, memberId)
# addMemberByApiKey(): Promise<void>
Adds a member to a group using an API Key.
const groupId = "10402173435763029700781503965100"
const memberId = "1"
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.addMemberByApiKey(groupId, memberId, apiKey)
# addMembersByApiKey(): Promise<void>
Adds multiple members to a group using an API Key.
const groupId = "10402173435763029700781503965100"
const memberIds = ["1", "2", "3"]
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.addMembersByApiKey(groupId, memberIds, apiKey)
# addMemberByInviteCode(): Promise<void>
Adds a member to a group using an Invite Code.
const groupId = "10402173435763029700781503965100"
const memberId = "1"
const inviteCode = "MQYS4UR5"
await apiSdk.addMemberByInviteCode(groupId, memberId, inviteCode)
# removeMemberByApiKey(): Promise<void>
Removes a member from a group using an API Key.
const groupId = "10402173435763029700781503965100"
const memberId = "1"
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.removeMemberByApiKey(groupId, memberId, apiKey)
# removeMembersByApiKey(): Promise<void>
Removes multiple members from a group using an API Key.
const groupId = "10402173435763029700781503965100"
const memberIds = ["1", "2", "3"]
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
await apiSdk.removeMembersByApiKey(groupId, memberIds, apiKey)
# getInvite(): Promise<Invite>
Returns a specific invite.
const inviteCode = "C5VAG4HD"
const apiKey = "70f07d0d-6aa2-4fe1-b4b9-06c271a641dc"
const invite = await apiSdk.getInvite(inviteCode)
FAQs
A Typescript SDK for the Bandada API.
The npm package @bandada/api-sdk receives a total of 27 weekly downloads. As such, @bandada/api-sdk popularity was classified as not popular.
We found that @bandada/api-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.