@softr/sdk 0.0.3 → 0.0.5
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/dist/index.d.ts +35 -82
- package/dist/index.js +153 -56
- package/dist/query-C6022JhD.js +528 -0
- package/dist/tanstack.d.ts +1 -1
- package/dist/tanstack.js +162 -26
- package/dist/types-BYfW8LV3.d.ts +640 -0
- package/package.json +9 -5
- package/dist/types-BLLUI6MI.d.ts +0 -75
package/dist/types-BLLUI6MI.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
|
-
interface SoftrUser {
|
|
3
|
-
id: string;
|
|
4
|
-
email: string;
|
|
5
|
-
name: string;
|
|
6
|
-
userGroupIds: Array<SoftrUserGroupId>;
|
|
7
|
-
}
|
|
8
|
-
interface DatasourcePermissions {
|
|
9
|
-
read: boolean;
|
|
10
|
-
create: boolean;
|
|
11
|
-
update: boolean;
|
|
12
|
-
delete: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface SoftrPermissions {
|
|
15
|
-
datasources: Record<string, DatasourcePermissions>;
|
|
16
|
-
workflows: Record<string, boolean>;
|
|
17
|
-
}
|
|
18
|
-
interface SoftrMe {
|
|
19
|
-
user: SoftrUser | null;
|
|
20
|
-
permissions: SoftrPermissions;
|
|
21
|
-
}
|
|
22
|
-
interface ListOptions {
|
|
23
|
-
page?: number;
|
|
24
|
-
limit?: number;
|
|
25
|
-
filters?: Array<{
|
|
26
|
-
field: string;
|
|
27
|
-
operator: string;
|
|
28
|
-
value: unknown;
|
|
29
|
-
}>;
|
|
30
|
-
sort?: Array<{
|
|
31
|
-
field: string;
|
|
32
|
-
direction: 'asc' | 'desc';
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
interface ListResult<T = SoftrRecord> {
|
|
36
|
-
records: T[];
|
|
37
|
-
total: number;
|
|
38
|
-
page: number;
|
|
39
|
-
limit: number;
|
|
40
|
-
}
|
|
41
|
-
interface SoftrRecord {
|
|
42
|
-
id: string;
|
|
43
|
-
[field: string]: unknown;
|
|
44
|
-
}
|
|
45
|
-
interface DatasourceAPI {
|
|
46
|
-
list(options?: ListOptions): Promise<ListResult>;
|
|
47
|
-
get(recordId: string): Promise<SoftrRecord>;
|
|
48
|
-
create(data: Record<string, unknown>): Promise<SoftrRecord>;
|
|
49
|
-
update(recordId: string, data: Record<string, unknown>): Promise<SoftrRecord>;
|
|
50
|
-
delete(recordId: string): Promise<void>;
|
|
51
|
-
}
|
|
52
|
-
interface WorkflowAPI {
|
|
53
|
-
trigger(payload?: Record<string, unknown>): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
interface AuthAPI {
|
|
56
|
-
/** Sign in with email and password. Clears the cached me() result. */
|
|
57
|
-
login(credentials: {
|
|
58
|
-
email: string;
|
|
59
|
-
password: string;
|
|
60
|
-
}): Promise<void>;
|
|
61
|
-
/** Sign out the current user. Clears the cached me() result. */
|
|
62
|
-
logout(): Promise<void>;
|
|
63
|
-
}
|
|
64
|
-
interface SoftrSDK {
|
|
65
|
-
/**
|
|
66
|
-
* Fetch the current user and their permissions from /me.
|
|
67
|
-
* Cached for the lifetime of the instance — create a new instance per request on the server.
|
|
68
|
-
*/
|
|
69
|
-
me(): Promise<SoftrMe>;
|
|
70
|
-
auth: AuthAPI;
|
|
71
|
-
datasource(id: string): DatasourceAPI;
|
|
72
|
-
workflow(id: string): WorkflowAPI;
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { ListResult as a, SoftrRecord as c, WorkflowAPI as d, ListOptions as i, SoftrSDK as l, DatasourceAPI as n, SoftrMe as o, DatasourcePermissions as r, SoftrPermissions as s, AuthAPI as t, SoftrUser as u };
|