benji-sdk 0.1.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.
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/client/client/client.gen.d.ts +3 -0
- package/dist/client/client/client.gen.d.ts.map +1 -0
- package/dist/client/client/client.gen.js +229 -0
- package/dist/client/client/index.d.ts +9 -0
- package/dist/client/client/index.d.ts.map +1 -0
- package/dist/client/client/index.js +6 -0
- package/dist/client/client/types.gen.d.ts +118 -0
- package/dist/client/client/types.gen.d.ts.map +1 -0
- package/dist/client/client/types.gen.js +2 -0
- package/dist/client/client/utils.gen.d.ts +34 -0
- package/dist/client/client/utils.gen.d.ts.map +1 -0
- package/dist/client/client/utils.gen.js +233 -0
- package/dist/client/client.gen.d.ts +13 -0
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/client.gen.js +3 -0
- package/dist/client/core/auth.gen.d.ts +19 -0
- package/dist/client/core/auth.gen.d.ts.map +1 -0
- package/dist/client/core/auth.gen.js +14 -0
- package/dist/client/core/bodySerializer.gen.d.ts +26 -0
- package/dist/client/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/bodySerializer.gen.js +57 -0
- package/dist/client/core/params.gen.d.ts +44 -0
- package/dist/client/core/params.gen.d.ts.map +1 -0
- package/dist/client/core/params.gen.js +100 -0
- package/dist/client/core/pathSerializer.gen.d.ts +34 -0
- package/dist/client/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/client/core/pathSerializer.gen.js +114 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.js +99 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/client/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/client/core/serverSentEvents.gen.js +137 -0
- package/dist/client/core/types.gen.d.ts +79 -0
- package/dist/client/core/types.gen.d.ts.map +1 -0
- package/dist/client/core/types.gen.js +2 -0
- package/dist/client/core/utils.gen.d.ts +20 -0
- package/dist/client/core/utils.gen.d.ts.map +1 -0
- package/dist/client/core/utils.gen.js +87 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/sdk.gen.d.ts +908 -0
- package/dist/client/sdk.gen.d.ts.map +1 -0
- package/dist/client/sdk.gen.js +2232 -0
- package/dist/client/types.gen.d.ts +11857 -0
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/types.gen.js +2 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from "./client";
|
|
2
|
+
import { client } from "./client/client.gen";
|
|
3
|
+
export interface BenjiConfig {
|
|
4
|
+
/** Your Benji API key */
|
|
5
|
+
apiKey: string;
|
|
6
|
+
/** Optional custom base URL (defaults to https://app.benji.so/api/rest) */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Configure the Benji SDK with your API key
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { configure, Todos, Habits } from "benji-sdk";
|
|
15
|
+
*
|
|
16
|
+
* configure({ apiKey: "your-api-key" });
|
|
17
|
+
*
|
|
18
|
+
* // List today's todos
|
|
19
|
+
* const { data } = await Todos.todosList({ body: { screen: "today" } });
|
|
20
|
+
*
|
|
21
|
+
* // Create a habit
|
|
22
|
+
* await Habits.habitsCreate({ body: { name: "Drink water", emoji: "💧" } });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function configure(options: BenjiConfig): void;
|
|
26
|
+
export { client };
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,QAO7C;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Re-export everything from generated client
|
|
2
|
+
export * from "./client";
|
|
3
|
+
// Import client config
|
|
4
|
+
import { client } from "./client/client.gen";
|
|
5
|
+
/**
|
|
6
|
+
* Configure the Benji SDK with your API key
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { configure, Todos, Habits } from "benji-sdk";
|
|
11
|
+
*
|
|
12
|
+
* configure({ apiKey: "your-api-key" });
|
|
13
|
+
*
|
|
14
|
+
* // List today's todos
|
|
15
|
+
* const { data } = await Todos.todosList({ body: { screen: "today" } });
|
|
16
|
+
*
|
|
17
|
+
* // Create a habit
|
|
18
|
+
* await Habits.habitsCreate({ body: { name: "Drink water", emoji: "💧" } });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function configure(options) {
|
|
22
|
+
client.setConfig({
|
|
23
|
+
baseUrl: options.baseUrl ?? "https://app.benji.so/api/rest",
|
|
24
|
+
headers: {
|
|
25
|
+
"x-api-key": options.apiKey,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { client };
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "benji-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official TypeScript SDK for the Benji API - Your personal life operating system",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"generate": "openapi-ts",
|
|
20
|
+
"build": "pnpm generate && tsc",
|
|
21
|
+
"prepublishOnly": "pnpm build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"benji",
|
|
25
|
+
"api",
|
|
26
|
+
"sdk",
|
|
27
|
+
"typescript",
|
|
28
|
+
"productivity",
|
|
29
|
+
"habits",
|
|
30
|
+
"todos",
|
|
31
|
+
"journal",
|
|
32
|
+
"health",
|
|
33
|
+
"wellness"
|
|
34
|
+
],
|
|
35
|
+
"author": "Kitze",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/kitze/benji-sdk.git"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/kitze/benji-sdk/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/kitze/benji-sdk#readme",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@hey-api/openapi-ts": "0.90.0",
|
|
47
|
+
"typescript": "^5.5.0"
|
|
48
|
+
}
|
|
49
|
+
}
|