Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gpdb-api-client
Advanced tools
Simple wrapper around NameCoach GPDB (General Pronunciation Database) API. It is useful to external developers who wish to add NameCoach services to an application.
The package is a simple wrapper around NameCoach GPDB (General Pronunciation Database) API. It is useful to external developers who wish to add NameCoach services to an application.
For more information on NameCoach GPDB APi, you can visit documentation page.
Using npm:
npm i --save gpdb-api-client
Specify all needed values through environment variables:
GPDB_API_URL
- api url (e.x. https://gpdb.name-coach.com/api/public/v1
)
GPDB_ANALYTICS_API_URL
- analytics api url (e.x. https://analytics-api-staging.name-coach.com/api/v1
)
GPDB_ACCESS_KEY_ID
- access key id for your app
GPDB_SECRET_ACCESS_KEY
- secret access key for your app
Or pass it manually:
import { Configuration } from "gpdb-client";
const config = new Configuration({
accessKeyId: 'access key',
secretAccessKey: 'secret access key',
apiUrl: 'https://gpdb.name-coach.com/api/public/v1',
analyticsApiUrl: 'https://analytics-api-staging.name-coach.com/api/v1'
});
You need to create a client instance to perform requests. Basic example:
import { Client, TargetTypeSig } from "gpdb-client";
// ... configuration
const client = new Client({ instanceSig: 'example.com', typeSig: 'dns' }, config);
const result = await client.pronunciations.simpleSearch({ target: "Sergey", targetTypeSig: TargetTypeSig.FirstName, targetOwnerSig: "sergey" })
You can find detailed information about all possible parameters and the response format on the documentation page. Links to the specific methods are placed at the end of each paragraph.
All parameters should be in camelCase
Quick simple request to get pronunciation for a single target.
import { TargetTypeSig } from "gpdb-client";
const result = await client.pronunciations.simpleSearch({
target: "Sergey",
targetTypeSig: TargetTypeSig.FirstName,
targetOwnerSig: "sergey"
});
result
// { target_result: { ... }, meta: { ... } }
Perform a search in GPDB given between 1 and 10 search targets.
import { TargetTypeSig } from "gpdb-client";
const result = await client.pronunciations.complexSearch({
targets: [
{ target: "jack", targetTypeSig: TargetTypeSig.FirstName, targetOwnerContext: { signature: 'uuid' } },
{ target: "pavel", targetTypeSig: TargetTypeSig.FirstName, targetOwnerContext: { signature: 'uuid' } }
],
userContext: { signature: "uuid" }
});
result
// { target_result: { ... }, meta: { ... } }
Perform a search in GPDB by target owner signature.
const result = await client.pronunciations.searchBySig({
targetOwnerContext: { signature: "uuid" },
userContext: { signature: "uuid" }
});
result
// { target_result: { ... }, meta: { ... } }
TODO add link to docs after release
Create a user response to a pronunciation if your licensing allows it.
const result = await gpdbClient.pronunciations.userResponse({
recordingId: "some_id",
userResponse: "save",
userContext: { signature: "uuid" },
targetOwnerSig: "targetOwnerSig"
});
result
// {
// "response_id": "aGPDBResponseSig",
// "user_sig": "uuid",
// "name_owner_sig": "targetOwnerSig",
// "user_response": "save",
// "created_at": "timestamp"
// }
Create user response documentation
Creating a recording requires target (name), name owner context(not required but advised), user context and application context - required.
import { TargetTypeSig } from "gpdb-client";
const result = await gpdbClient.pronunciations.createRecording({
target: 'name',
targetTypeSig: TargetTypeSig.FirstName,
audioBase64: 'long_base64_string',
userContext: { signature: 'userSig' },
nameOwnerContext: { signature: 'nameOwnerSig' },
});
result
// {
// "id": "ABCDE",
// "name_text": "name",
// "audio_url": "https://a.name-coach.audiourl",
// ...
// }
Create recording documentation
Create analytics event:
await client.analyticsEvents.create({
customerId: "uuid",
entityId: "uuid",
entityType: "playback",
userId: "uuid"
});
Create analytics events documentation
Quick simple request to get resource permissions for current app.
const result = await client.permissions.load();
Quick simple request to retrieve custom attributes config.
const result = await client.customAttributes.retrieveConfig();
Post request to save user input for custom attributes.
const result = await client.customAttributes.saveValues({
userContext: { signature: 'userSig' },
targetOwnerContext: { signature: 'nameOwnerSig' },
customAttributesValues: { some_key: 'value', another_key: true }
});
Save preferred recordings with
await.client.preferredRecordings.save({
firstNameRecordingId: "123456",
lastNameRecordingId: "789012",
userContext: { signature: 'userSig@email.com', signatureType: 'email' }
})
Get saved preferred recordings with
await.client.preferredRecordings.get({
userContext: { signature: 'userSig@email.com', signatureType: 'email' }
})
Delete saved preferred recordings with
await.client.preferredRecordings.get({
firstNameRecordingId: "123456",
lastNameRecordingId: "789012",
userContext: { signature: 'userSig@email.com', signatureType: 'email' }
})
FAQs
Simple wrapper around NameCoach GPDB (General Pronunciation Database) API. It is useful to external developers who wish to add NameCoach services to an application.
The npm package gpdb-api-client receives a total of 65 weekly downloads. As such, gpdb-api-client popularity was classified as not popular.
We found that gpdb-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.