Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/mehanizm/airtable
A simple #golang package to access the Airtable API.
The Golang Airtable API has been tested compatible with Go 1.13 on up.
go get github.com/mehanizm/airtable
You should get your_api_token
in the airtable account page
client := airtable.NewClient("your_api_token")
You can use custom http client here
client.SetCustomClient(http.DefaultClient)
Each method below can be used with custom context. Simply use MethodNameContext
call and provide context as first argument.
bases, err := client.GetBases().WithOffset("").Do()
schema, err := client.GetBaseSchema("your_database_ID").Do()
To get the your_database_ID
you should go to main API page and select the database.
table := client.GetTable("your_database_ID", "your_table_name")
To get records from the table you can use something like this
records, err := table.GetRecords().
FromView("view_1").
WithFilterFormula("AND({Field1}='value_1',NOT({Field2}='value_2'))").
WithSort(sortQuery1, sortQuery2).
ReturnFields("Field1", "Field2").
InStringFormat("Europe/Moscow", "ru").
Do()
if err != nil {
// Handle error
}
recordsToSend := &airtable.Records{
Records: []*airtable.Record{
{
Fields: map[string]any{
"Field1": "value1",
"Field2": true,
},
},
},
}
receivedRecords, err := table.AddRecords(recordsToSend)
if err != nil {
// Handle error
}
record, err := table.GetRecord("recordID")
if err != nil {
// Handle error
}
To partial update one record
res, err := record.UpdateRecordPartial(map[string]any{"Field_2": false})
if err != nil {
// Handle error
}
To full update records
toUpdateRecords := &airtable.Records{
Records: []*airtable.Record{
{
Fields: map[string]any{
"Field1": "value1",
"Field2": true,
},
},
{
Fields: map[string]any{
"Field1": "value1",
"Field2": true,
},
},
},
}
updatedRecords, err := table.UpdateRecords(toUpdateRecords)
if err != nil {
// Handle error
}
res, err := record.DeleteRecord()
if err != nil {
// Handle error
}
To delete up to 10 records
records, err := table.DeleteRecords([]string{"recordID1", "recordsID2"})
if err != nil {
// Handle error
}
Inspired by Go Trello API
FAQs
Unknown package
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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.