lemma-sdk 0.2.1 → 0.2.2
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/browser/lemma-client.js +2138 -1094
- package/dist/client.d.ts +22 -7
- package/dist/client.js +27 -9
- package/dist/index.d.ts +14 -8
- package/dist/namespaces/assistants.d.ts +6 -1
- package/dist/namespaces/assistants.js +32 -10
- package/dist/namespaces/icons.d.ts +7 -0
- package/dist/namespaces/icons.js +13 -0
- package/dist/namespaces/organizations.d.ts +46 -0
- package/dist/namespaces/organizations.js +51 -0
- package/dist/namespaces/pod-members.d.ts +15 -0
- package/dist/namespaces/pod-members.js +19 -0
- package/dist/namespaces/pod-surfaces.d.ts +16 -0
- package/dist/namespaces/pod-surfaces.js +22 -0
- package/dist/namespaces/pods.d.ts +26 -0
- package/dist/namespaces/pods.js +41 -0
- package/dist/namespaces/records.d.ts +7 -3
- package/dist/namespaces/records.js +34 -3
- package/dist/namespaces/tables.d.ts +7 -1
- package/dist/namespaces/tables.js +11 -1
- package/dist/namespaces/users.d.ts +9 -0
- package/dist/namespaces/users.js +16 -0
- package/dist/namespaces/workflows.d.ts +8 -1
- package/dist/namespaces/workflows.js +23 -1
- package/dist/types.d.ts +13 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { type LemmaConfig } from "./config.js";
|
|
2
2
|
import { AuthManager, type AuthState, type AuthListener } from "./auth.js";
|
|
3
|
-
import { DatastoresNamespace } from "./namespaces/datastores.js";
|
|
4
|
-
import { TablesNamespace } from "./namespaces/tables.js";
|
|
5
|
-
import { RecordsNamespace } from "./namespaces/records.js";
|
|
6
|
-
import { FilesNamespace } from "./namespaces/files.js";
|
|
7
|
-
import { FunctionsNamespace } from "./namespaces/functions.js";
|
|
8
3
|
import { AgentsNamespace } from "./namespaces/agents.js";
|
|
9
|
-
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
10
4
|
import { AssistantsNamespace, ConversationsNamespace } from "./namespaces/assistants.js";
|
|
11
|
-
import {
|
|
5
|
+
import { DatastoresNamespace } from "./namespaces/datastores.js";
|
|
12
6
|
import { DesksNamespace } from "./namespaces/desks.js";
|
|
7
|
+
import { FilesNamespace } from "./namespaces/files.js";
|
|
8
|
+
import { FunctionsNamespace } from "./namespaces/functions.js";
|
|
9
|
+
import { IconsNamespace } from "./namespaces/icons.js";
|
|
13
10
|
import { IntegrationsNamespace } from "./namespaces/integrations.js";
|
|
11
|
+
import { OrganizationsNamespace } from "./namespaces/organizations.js";
|
|
12
|
+
import { PodMembersNamespace } from "./namespaces/pod-members.js";
|
|
13
|
+
import { PodsNamespace } from "./namespaces/pods.js";
|
|
14
|
+
import { PodSurfacesNamespace } from "./namespaces/pod-surfaces.js";
|
|
15
|
+
import { RecordsNamespace } from "./namespaces/records.js";
|
|
14
16
|
import { ResourcesNamespace } from "./namespaces/resources.js";
|
|
17
|
+
import { TablesNamespace } from "./namespaces/tables.js";
|
|
18
|
+
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
19
|
+
import { UsersNamespace } from "./namespaces/users.js";
|
|
20
|
+
import { WorkflowsNamespace } from "./namespaces/workflows.js";
|
|
15
21
|
export type { LemmaConfig };
|
|
16
22
|
export { AuthManager };
|
|
17
23
|
export type { AuthState, AuthListener };
|
|
@@ -36,6 +42,12 @@ export declare class LemmaClient {
|
|
|
36
42
|
readonly desks: DesksNamespace;
|
|
37
43
|
readonly integrations: IntegrationsNamespace;
|
|
38
44
|
readonly resources: ResourcesNamespace;
|
|
45
|
+
readonly users: UsersNamespace;
|
|
46
|
+
readonly icons: IconsNamespace;
|
|
47
|
+
readonly pods: PodsNamespace;
|
|
48
|
+
readonly podMembers: PodMembersNamespace;
|
|
49
|
+
readonly organizations: OrganizationsNamespace;
|
|
50
|
+
readonly podSurfaces: PodSurfacesNamespace;
|
|
39
51
|
constructor(overrides?: Partial<LemmaConfig>);
|
|
40
52
|
/** Change the active pod ID for subsequent calls. */
|
|
41
53
|
setPodId(podId: string): void;
|
|
@@ -53,5 +65,8 @@ export declare class LemmaClient {
|
|
|
53
65
|
request<T = unknown>(method: string, path: string, options?: {
|
|
54
66
|
params?: Record<string, string | number | boolean | undefined | null>;
|
|
55
67
|
body?: unknown;
|
|
68
|
+
headers?: HeadersInit;
|
|
69
|
+
isFormData?: boolean;
|
|
70
|
+
signal?: AbortSignal;
|
|
56
71
|
}): Promise<T>;
|
|
57
72
|
}
|
package/dist/client.js
CHANGED
|
@@ -2,18 +2,24 @@ import { resolveConfig } from "./config.js";
|
|
|
2
2
|
import { AuthManager } from "./auth.js";
|
|
3
3
|
import { GeneratedClientAdapter } from "./generated.js";
|
|
4
4
|
import { HttpClient } from "./http.js";
|
|
5
|
-
import { DatastoresNamespace } from "./namespaces/datastores.js";
|
|
6
|
-
import { TablesNamespace } from "./namespaces/tables.js";
|
|
7
|
-
import { RecordsNamespace } from "./namespaces/records.js";
|
|
8
|
-
import { FilesNamespace } from "./namespaces/files.js";
|
|
9
|
-
import { FunctionsNamespace } from "./namespaces/functions.js";
|
|
10
5
|
import { AgentsNamespace } from "./namespaces/agents.js";
|
|
11
|
-
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
12
6
|
import { AssistantsNamespace, ConversationsNamespace } from "./namespaces/assistants.js";
|
|
13
|
-
import {
|
|
7
|
+
import { DatastoresNamespace } from "./namespaces/datastores.js";
|
|
14
8
|
import { DesksNamespace } from "./namespaces/desks.js";
|
|
9
|
+
import { FilesNamespace } from "./namespaces/files.js";
|
|
10
|
+
import { FunctionsNamespace } from "./namespaces/functions.js";
|
|
11
|
+
import { IconsNamespace } from "./namespaces/icons.js";
|
|
15
12
|
import { IntegrationsNamespace } from "./namespaces/integrations.js";
|
|
13
|
+
import { OrganizationsNamespace } from "./namespaces/organizations.js";
|
|
14
|
+
import { PodMembersNamespace } from "./namespaces/pod-members.js";
|
|
15
|
+
import { PodsNamespace } from "./namespaces/pods.js";
|
|
16
|
+
import { PodSurfacesNamespace } from "./namespaces/pod-surfaces.js";
|
|
17
|
+
import { RecordsNamespace } from "./namespaces/records.js";
|
|
16
18
|
import { ResourcesNamespace } from "./namespaces/resources.js";
|
|
19
|
+
import { TablesNamespace } from "./namespaces/tables.js";
|
|
20
|
+
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
21
|
+
import { UsersNamespace } from "./namespaces/users.js";
|
|
22
|
+
import { WorkflowsNamespace } from "./namespaces/workflows.js";
|
|
17
23
|
export { AuthManager };
|
|
18
24
|
export class LemmaClient {
|
|
19
25
|
_config;
|
|
@@ -37,6 +43,12 @@ export class LemmaClient {
|
|
|
37
43
|
desks;
|
|
38
44
|
integrations;
|
|
39
45
|
resources;
|
|
46
|
+
users;
|
|
47
|
+
icons;
|
|
48
|
+
pods;
|
|
49
|
+
podMembers;
|
|
50
|
+
organizations;
|
|
51
|
+
podSurfaces;
|
|
40
52
|
constructor(overrides = {}) {
|
|
41
53
|
this._config = resolveConfig(overrides);
|
|
42
54
|
this._currentPodId = this._config.podId;
|
|
@@ -52,17 +64,23 @@ export class LemmaClient {
|
|
|
52
64
|
};
|
|
53
65
|
this.datastores = new DatastoresNamespace(this._generated, podIdFn);
|
|
54
66
|
this.tables = new TablesNamespace(this._generated, podIdFn);
|
|
55
|
-
this.records = new RecordsNamespace(this._generated, podIdFn);
|
|
67
|
+
this.records = new RecordsNamespace(this._generated, this._http, podIdFn);
|
|
56
68
|
this.files = new FilesNamespace(this._generated, this._http, podIdFn);
|
|
57
69
|
this.functions = new FunctionsNamespace(this._generated, podIdFn);
|
|
58
70
|
this.agents = new AgentsNamespace(this._generated, podIdFn);
|
|
59
71
|
this.tasks = new TasksNamespace(this._http, podIdFn);
|
|
60
72
|
this.assistants = new AssistantsNamespace(this._http, podIdFn);
|
|
61
73
|
this.conversations = new ConversationsNamespace(this._http, podIdFn);
|
|
62
|
-
this.workflows = new WorkflowsNamespace(this._generated, podIdFn);
|
|
74
|
+
this.workflows = new WorkflowsNamespace(this._generated, this._http, podIdFn);
|
|
63
75
|
this.desks = new DesksNamespace(this._generated, this._http, podIdFn);
|
|
64
76
|
this.integrations = new IntegrationsNamespace(this._generated);
|
|
65
77
|
this.resources = new ResourcesNamespace(this._http);
|
|
78
|
+
this.users = new UsersNamespace(this._generated);
|
|
79
|
+
this.icons = new IconsNamespace(this._generated);
|
|
80
|
+
this.pods = new PodsNamespace(this._generated, this._http);
|
|
81
|
+
this.podMembers = new PodMembersNamespace(this._generated);
|
|
82
|
+
this.organizations = new OrganizationsNamespace(this._generated, this._http);
|
|
83
|
+
this.podSurfaces = new PodSurfacesNamespace(this._generated);
|
|
66
84
|
}
|
|
67
85
|
/** Change the active pod ID for subsequent calls. */
|
|
68
86
|
setPodId(podId) {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,19 +3,25 @@ export type { LemmaConfig } from "./client.js";
|
|
|
3
3
|
export { AuthManager } from "./auth.js";
|
|
4
4
|
export type { AuthState, AuthListener, AuthStatus, UserInfo } from "./auth.js";
|
|
5
5
|
export { ApiError } from "./http.js";
|
|
6
|
-
export type {
|
|
6
|
+
export type { Agent, Assistant, Conversation, ConversationMessage, ConversationModel, CreateAgentInput, CreateAssistantInput, CreateTaskOptions, CursorPage, ListRecordsOptions, Organization, OrganizationInvitation, OrganizationMember, Pod, PodConfig, PodMember, RecordFilter, RecordSort, RunFunctionOptions, StreamOptions, Task, TaskMessage, UpdateAgentInput, UpdateAssistantInput, UploadedIcon, User, WorkflowRunInputs, } from "./types.js";
|
|
7
7
|
export { readSSE, parseSSEJson } from "./streams.js";
|
|
8
8
|
export type { SseRawEvent } from "./streams.js";
|
|
9
9
|
export * from "./openapi_client/index.js";
|
|
10
|
+
export type { AgentsNamespace } from "./namespaces/agents.js";
|
|
11
|
+
export type { AssistantsNamespace, ConversationsNamespace } from "./namespaces/assistants.js";
|
|
10
12
|
export type { DatastoresNamespace } from "./namespaces/datastores.js";
|
|
11
|
-
export type {
|
|
12
|
-
export type { RecordsNamespace } from "./namespaces/records.js";
|
|
13
|
+
export type { DesksNamespace } from "./namespaces/desks.js";
|
|
13
14
|
export type { FilesNamespace } from "./namespaces/files.js";
|
|
14
15
|
export type { FunctionsNamespace } from "./namespaces/functions.js";
|
|
15
|
-
export type {
|
|
16
|
+
export type { IconsNamespace } from "./namespaces/icons.js";
|
|
17
|
+
export type { IntegrationsNamespace } from "./namespaces/integrations.js";
|
|
18
|
+
export type { OrganizationsNamespace } from "./namespaces/organizations.js";
|
|
19
|
+
export type { PodMembersNamespace } from "./namespaces/pod-members.js";
|
|
20
|
+
export type { PodsNamespace } from "./namespaces/pods.js";
|
|
21
|
+
export type { PodSurfacesNamespace } from "./namespaces/pod-surfaces.js";
|
|
22
|
+
export type { RecordsNamespace } from "./namespaces/records.js";
|
|
23
|
+
export type { ResourceType, ResourcesNamespace } from "./namespaces/resources.js";
|
|
24
|
+
export type { TablesNamespace } from "./namespaces/tables.js";
|
|
16
25
|
export type { TasksNamespace } from "./namespaces/tasks.js";
|
|
17
|
-
export type {
|
|
26
|
+
export type { UsersNamespace } from "./namespaces/users.js";
|
|
18
27
|
export type { WorkflowsNamespace } from "./namespaces/workflows.js";
|
|
19
|
-
export type { DesksNamespace } from "./namespaces/desks.js";
|
|
20
|
-
export type { IntegrationsNamespace } from "./namespaces/integrations.js";
|
|
21
|
-
export type { ResourcesNamespace, ResourceType } from "./namespaces/resources.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
2
|
import type { CreateAssistantRequest } from "../openapi_client/models/CreateAssistantRequest.js";
|
|
3
|
-
import type { UpdateAssistantRequest } from "../openapi_client/models/UpdateAssistantRequest.js";
|
|
4
3
|
import type { CreateConversationRequest } from "../openapi_client/models/CreateConversationRequest.js";
|
|
5
4
|
import type { CreateMessageRequest } from "../openapi_client/models/CreateMessageRequest.js";
|
|
5
|
+
import type { UpdateAssistantRequest } from "../openapi_client/models/UpdateAssistantRequest.js";
|
|
6
6
|
export declare class AssistantsNamespace {
|
|
7
7
|
private readonly http;
|
|
8
8
|
private readonly podId;
|
|
@@ -21,6 +21,8 @@ export declare class ConversationsNamespace {
|
|
|
21
21
|
private readonly http;
|
|
22
22
|
private readonly podId;
|
|
23
23
|
constructor(http: HttpClient, podId: () => string);
|
|
24
|
+
private resolvePodId;
|
|
25
|
+
private requirePodId;
|
|
24
26
|
list(options?: {
|
|
25
27
|
assistantId?: string;
|
|
26
28
|
assistantName?: string;
|
|
@@ -50,6 +52,9 @@ export declare class ConversationsNamespace {
|
|
|
50
52
|
update(conversationId: string, payload: Record<string, unknown>, options?: {
|
|
51
53
|
podId?: string;
|
|
52
54
|
}): Promise<unknown>;
|
|
55
|
+
delete(conversationId: string, options?: {
|
|
56
|
+
podId?: string;
|
|
57
|
+
}): Promise<unknown>;
|
|
53
58
|
sendMessageStream(conversationId: string, payload: CreateMessageRequest, options?: {
|
|
54
59
|
podId?: string;
|
|
55
60
|
signal?: AbortSignal;
|
|
@@ -36,11 +36,29 @@ export class ConversationsNamespace {
|
|
|
36
36
|
this.http = http;
|
|
37
37
|
this.podId = podId;
|
|
38
38
|
}
|
|
39
|
+
resolvePodId(explicitPodId) {
|
|
40
|
+
if (typeof explicitPodId === "string") {
|
|
41
|
+
return explicitPodId;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
return this.podId();
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
requirePodId(explicitPodId) {
|
|
51
|
+
const podId = this.resolvePodId(explicitPodId);
|
|
52
|
+
if (!podId) {
|
|
53
|
+
throw new Error("pod_id is required for this conversation operation.");
|
|
54
|
+
}
|
|
55
|
+
return podId;
|
|
56
|
+
}
|
|
39
57
|
list(options = {}) {
|
|
40
58
|
return this.http.request("GET", "/conversations", {
|
|
41
59
|
params: {
|
|
42
60
|
assistant_id: options.assistantName ?? options.assistantId,
|
|
43
|
-
pod_id: options.podId
|
|
61
|
+
pod_id: this.resolvePodId(options.podId),
|
|
44
62
|
organization_id: options.organizationId,
|
|
45
63
|
limit: options.limit ?? 20,
|
|
46
64
|
page_token: options.pageToken ?? options.cursor,
|
|
@@ -56,7 +74,7 @@ export class ConversationsNamespace {
|
|
|
56
74
|
body: {
|
|
57
75
|
...payload,
|
|
58
76
|
assistant_id: payload.assistant_id ?? payload.assistant_name,
|
|
59
|
-
pod_id: payload.pod_id
|
|
77
|
+
pod_id: this.resolvePodId(payload.pod_id),
|
|
60
78
|
},
|
|
61
79
|
});
|
|
62
80
|
}
|
|
@@ -64,29 +82,33 @@ export class ConversationsNamespace {
|
|
|
64
82
|
return this.create({
|
|
65
83
|
...payload,
|
|
66
84
|
assistant_name: assistantName,
|
|
67
|
-
pod_id: payload.pod_id
|
|
85
|
+
pod_id: payload.pod_id,
|
|
68
86
|
});
|
|
69
87
|
}
|
|
70
88
|
get(conversationId, options = {}) {
|
|
71
89
|
return this.http.request("GET", `/conversations/${conversationId}`, {
|
|
72
90
|
params: {
|
|
73
|
-
pod_id: options.podId
|
|
91
|
+
pod_id: this.resolvePodId(options.podId),
|
|
74
92
|
},
|
|
75
93
|
});
|
|
76
94
|
}
|
|
77
95
|
update(conversationId, payload, options = {}) {
|
|
78
96
|
return this.http.request("PATCH", `/conversations/${conversationId}`, {
|
|
79
97
|
params: {
|
|
80
|
-
pod_id: options.podId
|
|
98
|
+
pod_id: this.resolvePodId(options.podId),
|
|
81
99
|
},
|
|
82
100
|
body: payload,
|
|
83
101
|
});
|
|
84
102
|
}
|
|
103
|
+
delete(conversationId, options = {}) {
|
|
104
|
+
const scopedPodId = this.requirePodId(options.podId);
|
|
105
|
+
return this.http.request("DELETE", `/pods/${scopedPodId}/conversations/${conversationId}`);
|
|
106
|
+
}
|
|
85
107
|
sendMessageStream(conversationId, payload, options = {}) {
|
|
86
108
|
return this.http.stream(`/conversations/${conversationId}/messages`, {
|
|
87
109
|
method: "POST",
|
|
88
110
|
params: {
|
|
89
|
-
pod_id: options.podId
|
|
111
|
+
pod_id: this.resolvePodId(options.podId),
|
|
90
112
|
},
|
|
91
113
|
body: payload,
|
|
92
114
|
signal: options.signal,
|
|
@@ -99,7 +121,7 @@ export class ConversationsNamespace {
|
|
|
99
121
|
resumeStream(conversationId, options = {}) {
|
|
100
122
|
return this.http.stream(`/conversations/${conversationId}/stream`, {
|
|
101
123
|
params: {
|
|
102
|
-
pod_id: options.podId
|
|
124
|
+
pod_id: this.resolvePodId(options.podId),
|
|
103
125
|
},
|
|
104
126
|
signal: options.signal,
|
|
105
127
|
headers: {
|
|
@@ -110,7 +132,7 @@ export class ConversationsNamespace {
|
|
|
110
132
|
stopRun(conversationId, options = {}) {
|
|
111
133
|
return this.http.request("PATCH", `/conversations/${conversationId}/stop`, {
|
|
112
134
|
params: {
|
|
113
|
-
pod_id: options.podId
|
|
135
|
+
pod_id: this.resolvePodId(options.podId),
|
|
114
136
|
},
|
|
115
137
|
body: {},
|
|
116
138
|
});
|
|
@@ -118,7 +140,7 @@ export class ConversationsNamespace {
|
|
|
118
140
|
messages = {
|
|
119
141
|
list: (conversationId, options = {}) => this.http.request("GET", `/conversations/${conversationId}/messages`, {
|
|
120
142
|
params: {
|
|
121
|
-
pod_id: options.podId
|
|
143
|
+
pod_id: this.resolvePodId(options.podId),
|
|
122
144
|
limit: options.limit ?? 20,
|
|
123
145
|
page_token: options.pageToken ?? options.cursor,
|
|
124
146
|
cursor: options.cursor,
|
|
@@ -127,7 +149,7 @@ export class ConversationsNamespace {
|
|
|
127
149
|
}),
|
|
128
150
|
send: (conversationId, payload, options = {}) => this.http.request("POST", `/conversations/${conversationId}/messages`, {
|
|
129
151
|
params: {
|
|
130
|
-
pod_id: options.podId
|
|
152
|
+
pod_id: this.resolvePodId(options.podId),
|
|
131
153
|
},
|
|
132
154
|
body: payload,
|
|
133
155
|
}),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
export declare class IconsNamespace {
|
|
3
|
+
private readonly client;
|
|
4
|
+
constructor(client: GeneratedClientAdapter);
|
|
5
|
+
upload(file: Blob): Promise<import("../index.js").IconUploadResponse>;
|
|
6
|
+
getPublic(iconPath: string): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconsService } from "../openapi_client/services/IconsService.js";
|
|
2
|
+
export class IconsNamespace {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
upload(file) {
|
|
8
|
+
return this.client.request(() => IconsService.iconUpload({ file }));
|
|
9
|
+
}
|
|
10
|
+
getPublic(iconPath) {
|
|
11
|
+
return this.client.request(() => IconsService.iconPublicGet(iconPath));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import type { OrganizationCreateRequest } from "../openapi_client/models/OrganizationCreateRequest.js";
|
|
4
|
+
import type { OrganizationInvitationListResponse } from "../openapi_client/models/OrganizationInvitationListResponse.js";
|
|
5
|
+
import type { OrganizationInvitationRequest } from "../openapi_client/models/OrganizationInvitationRequest.js";
|
|
6
|
+
import type { OrganizationInvitationStatus } from "../openapi_client/models/OrganizationInvitationStatus.js";
|
|
7
|
+
import type { OrganizationRole } from "../openapi_client/models/OrganizationRole.js";
|
|
8
|
+
export declare class OrganizationsNamespace {
|
|
9
|
+
private readonly client;
|
|
10
|
+
private readonly http;
|
|
11
|
+
constructor(client: GeneratedClientAdapter, http: HttpClient);
|
|
12
|
+
list(options?: {
|
|
13
|
+
limit?: number;
|
|
14
|
+
pageToken?: string;
|
|
15
|
+
cursor?: string;
|
|
16
|
+
}): Promise<import("../index.js").OrganizationListResponse>;
|
|
17
|
+
get(orgId: string): Promise<import("../index.js").OrganizationResponse>;
|
|
18
|
+
create(payload: OrganizationCreateRequest): Promise<import("../index.js").OrganizationResponse>;
|
|
19
|
+
readonly members: {
|
|
20
|
+
list: (orgId: string, options?: {
|
|
21
|
+
limit?: number;
|
|
22
|
+
pageToken?: string;
|
|
23
|
+
cursor?: string;
|
|
24
|
+
}) => Promise<import("../index.js").OrganizationMemberListResponse>;
|
|
25
|
+
updateRole: (orgId: string, memberId: string, role: OrganizationRole) => Promise<import("../index.js").OrganizationMemberResponse>;
|
|
26
|
+
remove: (orgId: string, memberId: string) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
readonly invitations: {
|
|
29
|
+
listMine: (options?: {
|
|
30
|
+
status?: OrganizationInvitationStatus;
|
|
31
|
+
limit?: number;
|
|
32
|
+
pageToken?: string;
|
|
33
|
+
cursor?: string;
|
|
34
|
+
}) => Promise<OrganizationInvitationListResponse>;
|
|
35
|
+
list: (orgId: string, options?: {
|
|
36
|
+
status?: OrganizationInvitationStatus;
|
|
37
|
+
limit?: number;
|
|
38
|
+
pageToken?: string;
|
|
39
|
+
cursor?: string;
|
|
40
|
+
}) => Promise<OrganizationInvitationListResponse>;
|
|
41
|
+
get: (invitationId: string) => Promise<import("../index.js").OrganizationInvitationResponse>;
|
|
42
|
+
invite: (orgId: string, payload: OrganizationInvitationRequest) => Promise<import("../index.js").OrganizationInvitationResponse>;
|
|
43
|
+
accept: (invitationId: string) => Promise<import("../index.js").OrganizationMessageResponse>;
|
|
44
|
+
revoke: (invitationId: string) => Promise<void>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OrganizationsService } from "../openapi_client/services/OrganizationsService.js";
|
|
2
|
+
export class OrganizationsNamespace {
|
|
3
|
+
client;
|
|
4
|
+
http;
|
|
5
|
+
constructor(client, http) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
list(options = {}) {
|
|
10
|
+
return this.client.request(() => OrganizationsService.orgList(options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
11
|
+
}
|
|
12
|
+
get(orgId) {
|
|
13
|
+
return this.client.request(() => OrganizationsService.orgGet(orgId));
|
|
14
|
+
}
|
|
15
|
+
create(payload) {
|
|
16
|
+
return this.client.request(() => OrganizationsService.orgCreate(payload));
|
|
17
|
+
}
|
|
18
|
+
members = {
|
|
19
|
+
list: (orgId, options = {}) => this.client.request(() => OrganizationsService.orgMemberList(orgId, options.limit ?? 100, options.pageToken ?? options.cursor)),
|
|
20
|
+
updateRole: (orgId, memberId, role) => this.client.request(() => OrganizationsService.orgMemberUpdateRole(orgId, memberId, { role })),
|
|
21
|
+
remove: (orgId, memberId) => this.client.request(() => OrganizationsService.orgMemberRemove(orgId, memberId)),
|
|
22
|
+
};
|
|
23
|
+
invitations = {
|
|
24
|
+
listMine: async (options = {}) => {
|
|
25
|
+
if (options.status) {
|
|
26
|
+
return this.client.request(() => OrganizationsService.orgInvitationListMine(options.status, options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
27
|
+
}
|
|
28
|
+
return this.http.request("GET", "/organizations/invitations", {
|
|
29
|
+
params: {
|
|
30
|
+
limit: options.limit ?? 100,
|
|
31
|
+
page_token: options.pageToken ?? options.cursor,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
list: async (orgId, options = {}) => {
|
|
36
|
+
if (options.status) {
|
|
37
|
+
return this.client.request(() => OrganizationsService.orgInvitationList(orgId, options.status, options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
38
|
+
}
|
|
39
|
+
return this.http.request("GET", `/organizations/${encodeURIComponent(orgId)}/invitations`, {
|
|
40
|
+
params: {
|
|
41
|
+
limit: options.limit ?? 100,
|
|
42
|
+
page_token: options.pageToken ?? options.cursor,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
get: (invitationId) => this.client.request(() => OrganizationsService.orgInvitationGet(invitationId)),
|
|
47
|
+
invite: (orgId, payload) => this.client.request(() => OrganizationsService.orgInvitationInvite(orgId, payload)),
|
|
48
|
+
accept: (invitationId) => this.client.request(() => OrganizationsService.orgInvitationAccept(invitationId)),
|
|
49
|
+
revoke: (invitationId) => this.client.request(() => OrganizationsService.orgInvitationRevoke(invitationId)),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { PodMemberAddRequest } from "../openapi_client/models/PodMemberAddRequest.js";
|
|
3
|
+
import type { PodRole } from "../openapi_client/models/PodRole.js";
|
|
4
|
+
export declare class PodMembersNamespace {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: GeneratedClientAdapter);
|
|
7
|
+
list(podId: string, options?: {
|
|
8
|
+
limit?: number;
|
|
9
|
+
pageToken?: string;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
}): Promise<import("../index.js").PodMemberListResponse>;
|
|
12
|
+
add(podId: string, payload: PodMemberAddRequest): Promise<import("../index.js").PodMemberResponse>;
|
|
13
|
+
updateRole(podId: string, memberId: string, role: PodRole): Promise<import("../index.js").PodMemberResponse>;
|
|
14
|
+
remove(podId: string, memberId: string): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PodMembersService } from "../openapi_client/services/PodMembersService.js";
|
|
2
|
+
export class PodMembersNamespace {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
list(podId, options = {}) {
|
|
8
|
+
return this.client.request(() => PodMembersService.podMemberList(podId, options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
9
|
+
}
|
|
10
|
+
add(podId, payload) {
|
|
11
|
+
return this.client.request(() => PodMembersService.podMemberAdd(podId, payload));
|
|
12
|
+
}
|
|
13
|
+
updateRole(podId, memberId, role) {
|
|
14
|
+
return this.client.request(() => PodMembersService.podMemberUpdateRole(podId, memberId, { role }));
|
|
15
|
+
}
|
|
16
|
+
remove(podId, memberId) {
|
|
17
|
+
return this.client.request(() => PodMembersService.podMemberRemove(podId, memberId));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { CreateSurfaceRequest } from "../openapi_client/models/CreateSurfaceRequest.js";
|
|
3
|
+
import type { UpdateSurfaceRequest } from "../openapi_client/models/UpdateSurfaceRequest.js";
|
|
4
|
+
export declare class PodSurfacesNamespace {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: GeneratedClientAdapter);
|
|
7
|
+
list(podId: string, options?: {
|
|
8
|
+
limit?: number;
|
|
9
|
+
pageToken?: string;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
}): Promise<import("../index.js").AssistantSurfaceListResponse>;
|
|
12
|
+
create(podId: string, payload: CreateSurfaceRequest): Promise<any>;
|
|
13
|
+
get(podId: string, surfaceId: string): Promise<any>;
|
|
14
|
+
updateConfig(podId: string, surfaceId: string, payload: UpdateSurfaceRequest): Promise<any>;
|
|
15
|
+
toggle(podId: string, surfaceId: string, isActive: boolean): Promise<any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AssistantSurfacesService } from "../openapi_client/services/AssistantSurfacesService.js";
|
|
2
|
+
export class PodSurfacesNamespace {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
list(podId, options = {}) {
|
|
8
|
+
return this.client.request(() => AssistantSurfacesService.assistantSurfaceList(podId, options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
9
|
+
}
|
|
10
|
+
create(podId, payload) {
|
|
11
|
+
return this.client.request(() => AssistantSurfacesService.assistantSurfaceCreate(podId, payload));
|
|
12
|
+
}
|
|
13
|
+
get(podId, surfaceId) {
|
|
14
|
+
return this.client.request(() => AssistantSurfacesService.assistantSurfaceGet(podId, surfaceId));
|
|
15
|
+
}
|
|
16
|
+
updateConfig(podId, surfaceId, payload) {
|
|
17
|
+
return this.client.request(() => AssistantSurfacesService.assistantSurfaceUpdateConfig(podId, surfaceId, payload));
|
|
18
|
+
}
|
|
19
|
+
toggle(podId, surfaceId, isActive) {
|
|
20
|
+
return this.client.request(() => AssistantSurfacesService.assistantSurfaceToggle(podId, surfaceId, { is_active: isActive }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import type { PodCreateRequest } from "../openapi_client/models/PodCreateRequest.js";
|
|
4
|
+
import type { PodListResponse } from "../openapi_client/models/PodListResponse.js";
|
|
5
|
+
import type { PodUpdateRequest } from "../openapi_client/models/PodUpdateRequest.js";
|
|
6
|
+
export declare class PodsNamespace {
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(client: GeneratedClientAdapter, http: HttpClient);
|
|
10
|
+
list(options?: {
|
|
11
|
+
organizationId?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
pageToken?: string;
|
|
14
|
+
cursor?: string;
|
|
15
|
+
}): Promise<PodListResponse>;
|
|
16
|
+
listByOrganization(organizationId: string, options?: {
|
|
17
|
+
limit?: number;
|
|
18
|
+
pageToken?: string;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
}): Promise<PodListResponse>;
|
|
21
|
+
get(podId: string): Promise<import("../index.js").PodResponse>;
|
|
22
|
+
create(payload: PodCreateRequest): Promise<import("../index.js").PodResponse>;
|
|
23
|
+
update(podId: string, payload: PodUpdateRequest): Promise<import("../index.js").PodResponse>;
|
|
24
|
+
delete(podId: string): Promise<void>;
|
|
25
|
+
config(podId: string): Promise<import("../index.js").PodConfigResponse>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PodsService } from "../openapi_client/services/PodsService.js";
|
|
2
|
+
export class PodsNamespace {
|
|
3
|
+
client;
|
|
4
|
+
http;
|
|
5
|
+
constructor(client, http) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
list(options = {}) {
|
|
10
|
+
if (options.organizationId) {
|
|
11
|
+
return this.listByOrganization(options.organizationId, {
|
|
12
|
+
limit: options.limit,
|
|
13
|
+
pageToken: options.pageToken ?? options.cursor,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return this.http.request("GET", "/pods", {
|
|
17
|
+
params: {
|
|
18
|
+
limit: options.limit ?? 100,
|
|
19
|
+
page_token: options.pageToken ?? options.cursor,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
listByOrganization(organizationId, options = {}) {
|
|
24
|
+
return this.client.request(() => PodsService.podList(organizationId, options.limit ?? 100, options.pageToken ?? options.cursor));
|
|
25
|
+
}
|
|
26
|
+
get(podId) {
|
|
27
|
+
return this.client.request(() => PodsService.podGet(podId));
|
|
28
|
+
}
|
|
29
|
+
create(payload) {
|
|
30
|
+
return this.client.request(() => PodsService.podCreate(payload));
|
|
31
|
+
}
|
|
32
|
+
update(podId, payload) {
|
|
33
|
+
return this.client.request(() => PodsService.podUpdate(podId, payload));
|
|
34
|
+
}
|
|
35
|
+
delete(podId) {
|
|
36
|
+
return this.client.request(() => PodsService.podDelete(podId));
|
|
37
|
+
}
|
|
38
|
+
config(podId) {
|
|
39
|
+
return this.client.request(() => PodsService.podConfigGet(podId));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import type { RecordListResponse } from "../openapi_client/models/RecordListResponse.js";
|
|
2
4
|
import type { RecordQueryRequest } from "../openapi_client/models/RecordQueryRequest.js";
|
|
3
5
|
import type { ListRecordsOptions } from "../types.js";
|
|
4
6
|
export declare class RecordsNamespace {
|
|
5
7
|
private readonly client;
|
|
8
|
+
private readonly http;
|
|
6
9
|
private readonly podId;
|
|
7
|
-
constructor(client: GeneratedClientAdapter, podId: () => string);
|
|
8
|
-
list(datastore: string, table: string, options?: ListRecordsOptions): Promise<
|
|
10
|
+
constructor(client: GeneratedClientAdapter, http: HttpClient, podId: () => string);
|
|
11
|
+
list(datastore: string, table: string, options?: ListRecordsOptions): Promise<RecordListResponse>;
|
|
12
|
+
listWithParams(datastore: string, table: string, params: Record<string, string | number | boolean | undefined | null>): Promise<RecordListResponse>;
|
|
9
13
|
create(datastore: string, table: string, data: Record<string, unknown>): Promise<import("../index.js").RecordResponse>;
|
|
10
14
|
get(datastore: string, table: string, recordId: string): Promise<import("../index.js").RecordResponse>;
|
|
11
15
|
update(datastore: string, table: string, recordId: string, data: Record<string, unknown>): Promise<import("../index.js").RecordResponse>;
|
|
12
16
|
delete(datastore: string, table: string, recordId: string): Promise<import("../index.js").DatastoreMessageResponse>;
|
|
13
|
-
query(datastore: string, table: string, payload: RecordQueryRequest): Promise<
|
|
17
|
+
query(datastore: string, table: string, payload: RecordQueryRequest): Promise<RecordListResponse>;
|
|
14
18
|
readonly bulk: {
|
|
15
19
|
create: (datastore: string, table: string, records: Record<string, unknown>[]) => Promise<import("../index.js").DatastoreMessageResponse>;
|
|
16
20
|
update: (datastore: string, table: string, records: Record<string, unknown>[]) => Promise<import("../index.js").DatastoreMessageResponse>;
|
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
import { RecordsService } from "../openapi_client/services/RecordsService.js";
|
|
2
|
+
function getRecordsPath(podId, datastore, table) {
|
|
3
|
+
return `/pods/${encodeURIComponent(podId)}/datastores/${encodeURIComponent(datastore)}/tables/${encodeURIComponent(table)}/records`;
|
|
4
|
+
}
|
|
2
5
|
export class RecordsNamespace {
|
|
3
6
|
client;
|
|
7
|
+
http;
|
|
4
8
|
podId;
|
|
5
|
-
constructor(client, podId) {
|
|
9
|
+
constructor(client, http, podId) {
|
|
6
10
|
this.client = client;
|
|
11
|
+
this.http = http;
|
|
7
12
|
this.podId = podId;
|
|
8
13
|
}
|
|
9
14
|
list(datastore, table, options = {}) {
|
|
10
|
-
const { filters, sort, limit, pageToken } = options;
|
|
15
|
+
const { filters, sort, limit, pageToken, offset, sortBy, order, params } = options;
|
|
11
16
|
if (filters || sort) {
|
|
12
|
-
const payload = {
|
|
17
|
+
const payload = {
|
|
18
|
+
filters,
|
|
19
|
+
sort,
|
|
20
|
+
limit,
|
|
21
|
+
page_token: pageToken,
|
|
22
|
+
};
|
|
13
23
|
return this.client.request(() => RecordsService.recordQuery(this.podId(), datastore, table, payload));
|
|
14
24
|
}
|
|
25
|
+
const hasCustomParams = typeof offset === "number" ||
|
|
26
|
+
typeof sortBy === "string" ||
|
|
27
|
+
typeof order === "string" ||
|
|
28
|
+
!!params;
|
|
29
|
+
if (hasCustomParams) {
|
|
30
|
+
return this.http.request("GET", getRecordsPath(this.podId(), datastore, table), {
|
|
31
|
+
params: {
|
|
32
|
+
limit: limit ?? 20,
|
|
33
|
+
page_token: pageToken,
|
|
34
|
+
offset,
|
|
35
|
+
sort_by: sortBy,
|
|
36
|
+
order,
|
|
37
|
+
...(params ?? {}),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
15
41
|
return this.client.request(() => RecordsService.recordList(this.podId(), datastore, table, limit ?? 20, pageToken));
|
|
16
42
|
}
|
|
43
|
+
listWithParams(datastore, table, params) {
|
|
44
|
+
return this.http.request("GET", getRecordsPath(this.podId(), datastore, table), {
|
|
45
|
+
params,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
17
48
|
create(datastore, table, data) {
|
|
18
49
|
return this.client.request(() => RecordsService.recordCreate(this.podId(), datastore, table, { data }));
|
|
19
50
|
}
|