0.1.4 • Published 5 months ago
@forge/kvs v0.1.4
Library for Forge KVS.
Usage example:
import kvs, { FilterConditons, WhereConditions, Sort, Filter } from "@forge/kvs";
await kvs.set<string>('example-key', 'bar');
await kvs.get<string>('example-key');
await kvs.delete('example-key');
await kvs.query().where('key', WhereConditions.beginsWith('example'))
type Employee = {
surname: string;
age: number;
employmentyear: number;
gender: string;
nationality: string;
}
await kvs.entity<Employee>("employee").set('example-key', {
surname: "Davis",
age: 30,
employmentyear: 2022,
gender: "male",
nationality: "Australian"
});
await kvs.entity<Employee>("employee").get('example-key');
await kvs.entity('employee').delete('example-key');
await kvs
.entity<Employee>('employee')
.query()
.index('by-age')
.where(WhereConditions.greaterThan(30))
.filters(new Filter<Employee>().and('employmentyear', FilterConditions.equalTo(2025)))
.sort(Sort.DESC)
.getMany()
await kvs.setSecret('example-key', 'Hello world');
await kvs.getSecret('example-key');
await kvs.deleteSecret('example-key');
const conditions = new Filter<Employee>().and('lastName', FilterConditions.beginsWith('S'))
.and('firstName', FilterConditions.beginsWith('blah'));
await kvs
.transact()
.set('key', 'value')
.set('entityKey', 'value', {
entityName: 'author',
conditions: new Filter<Employee>().and('lastName', FilterConditions.beginsWith('S'))
.and('firstName', FilterConditions.beginsWith('blah'))
})
.delete('some-key')
.delete('another-key', { entityName: 'employee', conditions })
.check('third-key', conditions)
.check('fourth-key', conditions, { entityName: 'author' })
.execute();
0.1.4
5 months ago
0.1.4-next.0-experimental-76b1041
5 months ago
0.1.4-next.0-experimental-bebf085
5 months ago
0.1.4-next.0-experimental-1b788f1
5 months ago
0.1.4-next.0-experimental-786d4ac
5 months ago
0.1.4-next.0-experimental-f44d099
5 months ago
0.1.4-next.0
5 months ago
0.1.3
5 months ago
0.1.3-next.0
5 months ago
0.1.2
6 months ago
0.1.2-next.1-experimental-1aaebb0
7 months ago
0.1.2-next.1-experimental-99739ec
7 months ago
0.1.2-next.1
7 months ago
0.1.2-next.0-experimental-beb5acf
7 months ago
0.1.2-next.0-experimental-8477be1
7 months ago
0.1.2-next.0-experimental-f55f6f2
7 months ago
0.1.2-next.0
7 months ago
0.1.1
7 months ago
0.1.1-next.1-experimental-02bb545
7 months ago
0.1.1-next.1-experimental-26b1489
7 months ago
0.1.1-next.1-experimental-ebf5733
7 months ago
0.1.1-next.1-experimental-4c15b3a
7 months ago
0.1.1-next.1-experimental-472292d
7 months ago
0.1.1-next.1-experimental-d22b31e
7 months ago
0.1.1-next.1
7 months ago
0.1.1-next.0
7 months ago
0.1.0
7 months ago
0.1.0-next.6
7 months ago
0.1.0-next.5
7 months ago
0.1.0-next.4
8 months ago
0.1.0-next.3
8 months ago
0.0.2-next.2-experimental-edac07a
8 months ago
0.0.2-next.2
8 months ago
0.0.2-next.1
8 months ago
0.0.2-next.0
8 months ago