@forge/kvs 0.0.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE.txt +7 -0
  2. package/README.md +41 -0
  3. package/package.json +24 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2025 Atlassian
2
+ Permission is hereby granted to use this software in accordance with the terms
3
+ and conditions outlined in the Atlassian Developer Terms, which can be found
4
+ at the following URL:
5
+ https://developer.atlassian.com/platform/marketplace/atlassian-developer-terms/
6
+ By using this software, you agree to comply with these terms and conditions.
7
+ If you do not agree with these terms, you are not permitted to use this software.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ Library for Forge KVS.
2
+
3
+ Usage example:
4
+ ```typescript
5
+ import kvs, { Conditions, Sort, Filter } from "@forge/kvs";
6
+
7
+ await kvs.set<string>('example-key', 'bar');
8
+ await kvs.get<string>('example-key');
9
+ await kvs.delete('example-key');
10
+ await kvs.query().where('key', Conditions.beginsWith('example'))
11
+
12
+ type Employee = {
13
+ surname: string;
14
+ age: number;
15
+ employmentyear: number;
16
+ gender: string;
17
+ nationality: string;
18
+ }
19
+
20
+ await kvs.entity<Employee>("employee").set('example-key', {
21
+ surname: "Davis",
22
+ age: 30,
23
+ employmentyear: 2022,
24
+ gender: "male",
25
+ nationality: "Australian"
26
+ });
27
+ await kvs.entity<Employee>("employee").get('example-key');
28
+ await kvs.entity('employee').delete('example-key');
29
+ await kvs
30
+ .entity<Employee>('employee')
31
+ .query()
32
+ .index('by-age')
33
+ .where(Conditions.greaterThan(30))
34
+ .filters(new Filter<Employee>().and('employmentyear', Conditions.equalTo(2025)))
35
+ .sort(Sort.DESC)
36
+ .getMany()
37
+
38
+ await kvs.setSecret('example-key', 'Hello world');
39
+ await kvs.getSecret('example-key');
40
+ await kvs.deleteSecret('example-key');
41
+ ```
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@forge/kvs",
3
+ "version": "0.0.2-next.0",
4
+ "description": "Forge Key Value Store SDK",
5
+ "author": "Atlassian",
6
+ "license": "UNLICENSED",
7
+ "main": "out/index.js",
8
+ "types": "out/index.d.ts",
9
+ "files": [
10
+ "out"
11
+ ],
12
+ "scripts": {
13
+ "build": "yarn run clean && yarn run compile",
14
+ "clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo",
15
+ "compile": "tsc -b -v",
16
+ "postbuild": "yarn bolt w forge-scripts preserve-deprecated-tags ../forge-kvs"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "14.18.63"
20
+ },
21
+ "dependencies": {
22
+ "@forge/api": "^5.0.2-next.0"
23
+ }
24
+ }