0.1.4 • Published 6 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
6 months ago
0.1.4-next.0-experimental-76b1041
6 months ago
0.1.4-next.0-experimental-bebf085
6 months ago
0.1.4-next.0-experimental-1b788f1
6 months ago
0.1.4-next.0-experimental-786d4ac
6 months ago
0.1.4-next.0-experimental-f44d099
6 months ago
0.1.4-next.0
6 months ago
0.1.3
6 months ago
0.1.3-next.0
6 months ago
0.1.2
7 months ago
0.1.2-next.1-experimental-1aaebb0
8 months ago
0.1.2-next.1-experimental-99739ec
8 months ago
0.1.2-next.1
8 months ago
0.1.2-next.0-experimental-beb5acf
8 months ago
0.1.2-next.0-experimental-8477be1
8 months ago
0.1.2-next.0-experimental-f55f6f2
8 months ago
0.1.2-next.0
8 months ago
0.1.1
8 months ago
0.1.1-next.1-experimental-02bb545
8 months ago
0.1.1-next.1-experimental-26b1489
8 months ago
0.1.1-next.1-experimental-ebf5733
8 months ago
0.1.1-next.1-experimental-4c15b3a
8 months ago
0.1.1-next.1-experimental-472292d
8 months ago
0.1.1-next.1-experimental-d22b31e
8 months ago
0.1.1-next.1
8 months ago
0.1.1-next.0
8 months ago
0.1.0
9 months ago
0.1.0-next.6
9 months ago
0.1.0-next.5
9 months ago
0.1.0-next.4
9 months ago
0.1.0-next.3
9 months ago
0.0.2-next.2-experimental-edac07a
9 months ago
0.0.2-next.2
9 months ago
0.0.2-next.1
9 months ago
0.0.2-next.0
9 months ago