weave-typescript 0.51.2 → 0.52.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/dist/google/protobuf/duration.pb.d.ts +99 -0
- package/dist/google/protobuf/duration.pb.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/weave/authz/v1/index.d.ts +1 -0
- package/dist/weave/authz/v1/index.js +38 -0
- package/dist/weave/authz/v1/options.pb.d.ts +52 -0
- package/dist/weave/authz/v1/options.pb.js +403 -0
- package/dist/weave/filter/v1/index.d.ts +1 -0
- package/dist/weave/filter/v1/index.js +38 -0
- package/dist/{weaveapi/atc/v1/message.pb.d.ts → weave/filter/v1/options.pb.d.ts} +33 -21
- package/dist/weave/filter/v1/options.pb.js +417 -0
- package/dist/weave/index.d.ts +2 -0
- package/dist/weave/index.js +39 -0
- package/dist/weaveapi/agent/v1/agent.pb.d.ts +137 -188
- package/dist/weaveapi/agent/v1/agent.pb.js +891 -2151
- package/dist/weaveapi/agent/v1/index.d.ts +1 -1
- package/dist/weaveapi/agent/v1/index.js +2 -2
- package/dist/weaveapi/agent/v1/run.pb.d.ts +289 -0
- package/dist/weaveapi/agent/v1/run.pb.js +2763 -0
- package/dist/weaveapi/auth/v1/auth.pb.d.ts +67 -14
- package/dist/weaveapi/auth/v1/auth.pb.js +829 -89
- package/dist/weaveapi/auth/v1/index.d.ts +4 -1
- package/dist/weaveapi/auth/v1/index.js +5 -2
- package/dist/weaveapi/auth/v1/{service.pb.d.ts → organization_admin.pb.d.ts} +39 -530
- package/dist/weaveapi/auth/v1/{service.pb.js → organization_admin.pb.js} +2978 -5812
- package/dist/weaveapi/auth/v1/personal_access_token.pb.d.ts +114 -0
- package/dist/weaveapi/auth/v1/personal_access_token.pb.js +750 -0
- package/dist/weaveapi/auth/v1/profile.pb.d.ts +161 -0
- package/dist/weaveapi/auth/v1/profile.pb.js +1007 -0
- package/dist/weaveapi/auth/v1/session.pb.d.ts +460 -0
- package/dist/weaveapi/auth/v1/session.pb.js +3544 -0
- package/dist/weaveapi/chat/v1/chat.pb.d.ts +377 -149
- package/dist/weaveapi/chat/v1/chat.pb.js +3492 -1614
- package/dist/weaveapi/chat/v1/index.d.ts +0 -1
- package/dist/weaveapi/chat/v1/index.js +1 -2
- package/dist/weaveapi/consolidation/v1/consolidation.pb.d.ts +95 -0
- package/dist/weaveapi/consolidation/v1/consolidation.pb.js +770 -1
- package/dist/weaveapi/consolidation/v1/index.d.ts +0 -1
- package/dist/weaveapi/consolidation/v1/index.js +1 -2
- package/dist/weaveapi/content/v1/content.pb.d.ts +63 -0
- package/dist/weaveapi/content/v1/content.pb.js +470 -0
- package/dist/weaveapi/content/v1/index.d.ts +1 -0
- package/dist/weaveapi/content/v1/index.js +38 -0
- package/dist/weaveapi/gateway/v1/gateway.pb.d.ts +247 -523
- package/dist/weaveapi/gateway/v1/gateway.pb.js +1648 -5783
- package/dist/weaveapi/gateway/v1/index.d.ts +0 -1
- package/dist/weaveapi/gateway/v1/index.js +1 -2
- package/dist/weaveapi/index.d.ts +5 -5
- package/dist/weaveapi/index.js +6 -6
- package/dist/weaveapi/inference/v1/generate.pb.d.ts +120 -0
- package/dist/weaveapi/inference/v1/generate.pb.js +1159 -0
- package/dist/weaveapi/inference/v1/index.d.ts +4 -0
- package/dist/weaveapi/{provider → inference}/v1/index.js +4 -2
- package/dist/weaveapi/{model → inference}/v1/model.pb.d.ts +52 -15
- package/dist/weaveapi/{model → inference}/v1/model.pb.js +529 -116
- package/dist/weaveapi/{model/v1/service.pb.d.ts → inference/v1/model_route.pb.d.ts} +182 -110
- package/dist/weaveapi/{model/v1/service.pb.js → inference/v1/model_route.pb.js} +2197 -1061
- package/dist/weaveapi/inference/v1/provider.pb.d.ts +264 -0
- package/dist/weaveapi/inference/v1/provider.pb.js +2590 -0
- package/dist/weaveapi/ingestion/v1/index.d.ts +0 -2
- package/dist/weaveapi/ingestion/v1/index.js +1 -3
- package/dist/weaveapi/ingestion/v1/ingestion.pb.d.ts +543 -0
- package/dist/weaveapi/ingestion/v1/ingestion.pb.js +5550 -16
- package/dist/weaveapi/initialization/v1/index.d.ts +1 -0
- package/dist/weaveapi/initialization/v1/index.js +38 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.d.ts +99 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.js +510 -0
- package/dist/weaveapi/organization/v1/index.d.ts +0 -1
- package/dist/weaveapi/organization/v1/index.js +1 -2
- package/dist/weaveapi/organization/v1/organization.pb.d.ts +241 -0
- package/dist/weaveapi/organization/v1/organization.pb.js +1838 -1
- package/dist/weaveapi/reporting/index.d.ts +1 -0
- package/dist/weaveapi/reporting/index.js +38 -0
- package/dist/weaveapi/{task → reporting}/v1/index.d.ts +1 -1
- package/dist/weaveapi/{model → reporting}/v1/index.js +2 -2
- package/dist/weaveapi/reporting/v1/service.pb.d.ts +38 -0
- package/dist/weaveapi/reporting/v1/service.pb.js +167 -0
- package/dist/weaveapi/reporting/v1/usage.pb.d.ts +150 -0
- package/dist/weaveapi/reporting/v1/usage.pb.js +1837 -0
- package/dist/weaveapi/retrieval/v1/index.d.ts +0 -1
- package/dist/weaveapi/retrieval/v1/index.js +1 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.d.ts +96 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.js +690 -10
- package/dist/weaveapi/tool/index.d.ts +1 -0
- package/dist/weaveapi/tool/index.js +38 -0
- package/dist/weaveapi/tool/v1/index.d.ts +1 -0
- package/dist/weaveapi/tool/v1/index.js +38 -0
- package/dist/weaveapi/tool/v1/tool.pb.d.ts +370 -0
- package/dist/weaveapi/tool/v1/tool.pb.js +2717 -0
- package/dist/weaveapi/workflow/v1/index.d.ts +1 -1
- package/dist/weaveapi/workflow/v1/index.js +2 -2
- package/dist/weaveapi/workflow/v1/run.pb.d.ts +244 -0
- package/dist/weaveapi/workflow/v1/run.pb.js +2084 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +122 -275
- package/dist/weaveapi/workflow/v1/workflow.pb.js +790 -3261
- package/dist/weavesql/weavedb/agent_sql.d.ts +173 -477
- package/dist/weavesql/weavedb/agent_sql.js +281 -758
- package/dist/weavesql/weavedb/authorization_outbox_sql.d.ts +261 -0
- package/dist/weavesql/weavedb/authorization_outbox_sql.js +445 -0
- package/dist/weavesql/weavedb/chat_sql.d.ts +103 -345
- package/dist/weavesql/weavedb/chat_sql.js +312 -597
- package/dist/weavesql/weavedb/document_consolidation_sql.d.ts +217 -0
- package/dist/weavesql/weavedb/document_consolidation_sql.js +486 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.d.ts +1433 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.js +3488 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.d.ts +314 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.js +965 -0
- package/dist/weavesql/weavedb/document_table_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/document_table_sql.js +12 -12
- package/dist/weavesql/weavedb/identity_sql.d.ts +1014 -0
- package/dist/weavesql/weavedb/identity_sql.js +1811 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.d.ts +161 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.js +408 -0
- package/dist/weavesql/weavedb/inference_provider_sql.d.ts +125 -0
- package/dist/weavesql/weavedb/inference_provider_sql.js +228 -0
- package/dist/weavesql/weavedb/initialization_sql.d.ts +15 -0
- package/dist/weavesql/weavedb/initialization_sql.js +33 -0
- package/dist/weavesql/weavedb/model_catalog_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/model_catalog_sql.js +6 -6
- package/dist/weavesql/weavedb/organization_sql.d.ts +22 -102
- package/dist/weavesql/weavedb/organization_sql.js +54 -262
- package/dist/weavesql/weavedb/tool_sql.d.ts +209 -0
- package/dist/weavesql/weavedb/tool_sql.js +407 -0
- package/dist/weavesql/weavedb/usage_sql.d.ts +356 -0
- package/dist/weavesql/weavedb/usage_sql.js +568 -0
- package/dist/weavesql/weavedb/workflow_sql.d.ts +159 -546
- package/dist/weavesql/weavedb/workflow_sql.js +281 -909
- package/package.json +2 -2
- package/dist/weaveapi/agent/v1/service.pb.d.ts +0 -397
- package/dist/weaveapi/agent/v1/service.pb.js +0 -3152
- package/dist/weaveapi/atc/v1/event.pb.d.ts +0 -134
- package/dist/weaveapi/atc/v1/event.pb.js +0 -1124
- package/dist/weaveapi/atc/v1/index.d.ts +0 -5
- package/dist/weaveapi/atc/v1/index.js +0 -42
- package/dist/weaveapi/atc/v1/message.pb.js +0 -287
- package/dist/weaveapi/atc/v1/process.pb.d.ts +0 -91
- package/dist/weaveapi/atc/v1/process.pb.js +0 -658
- package/dist/weaveapi/atc/v1/run.pb.d.ts +0 -71
- package/dist/weaveapi/atc/v1/run.pb.js +0 -525
- package/dist/weaveapi/atc/v1/service.pb.d.ts +0 -472
- package/dist/weaveapi/atc/v1/service.pb.js +0 -3093
- package/dist/weaveapi/chat/v1/service.pb.d.ts +0 -345
- package/dist/weaveapi/chat/v1/service.pb.js +0 -2545
- package/dist/weaveapi/consolidation/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/consolidation/v1/service.pb.js +0 -427
- package/dist/weaveapi/gateway/v1/service.pb.d.ts +0 -235
- package/dist/weaveapi/gateway/v1/service.pb.js +0 -651
- package/dist/weaveapi/ingestion/v1/service.pb.d.ts +0 -420
- package/dist/weaveapi/ingestion/v1/service.pb.js +0 -2311
- package/dist/weaveapi/ingestion/v1/table.pb.d.ts +0 -121
- package/dist/weaveapi/ingestion/v1/table.pb.js +0 -1478
- package/dist/weaveapi/model/v1/index.d.ts +0 -2
- package/dist/weaveapi/organization/v1/service.pb.d.ts +0 -261
- package/dist/weaveapi/organization/v1/service.pb.js +0 -1561
- package/dist/weaveapi/project/v1/index.d.ts +0 -2
- package/dist/weaveapi/project/v1/index.js +0 -39
- package/dist/weaveapi/project/v1/project.pb.d.ts +0 -105
- package/dist/weaveapi/project/v1/project.pb.js +0 -1004
- package/dist/weaveapi/project/v1/service.pb.d.ts +0 -247
- package/dist/weaveapi/project/v1/service.pb.js +0 -1994
- package/dist/weaveapi/provider/v1/index.d.ts +0 -2
- package/dist/weaveapi/provider/v1/provider.pb.d.ts +0 -137
- package/dist/weaveapi/provider/v1/provider.pb.js +0 -1000
- package/dist/weaveapi/provider/v1/service.pb.d.ts +0 -223
- package/dist/weaveapi/provider/v1/service.pb.js +0 -1888
- package/dist/weaveapi/retrieval/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/retrieval/v1/service.pb.js +0 -385
- package/dist/weaveapi/task/v1/index.js +0 -39
- package/dist/weaveapi/task/v1/service.pb.d.ts +0 -172
- package/dist/weaveapi/task/v1/service.pb.js +0 -1436
- package/dist/weaveapi/task/v1/task.pb.d.ts +0 -85
- package/dist/weaveapi/task/v1/task.pb.js +0 -802
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -392
- package/dist/weaveapi/workflow/v1/service.pb.js +0 -3146
- /package/dist/{weaveapi/atc → weave/authz}/index.d.ts +0 -0
- /package/dist/{weaveapi/atc → weave/authz}/index.js +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.d.ts +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.js +0 -0
- /package/dist/weaveapi/{project → content}/index.d.ts +0 -0
- /package/dist/weaveapi/{project → content}/index.js +0 -0
- /package/dist/weaveapi/{provider → inference}/index.d.ts +0 -0
- /package/dist/weaveapi/{provider → inference}/index.js +0 -0
- /package/dist/weaveapi/{task → initialization}/index.d.ts +0 -0
- /package/dist/weaveapi/{task → initialization}/index.js +0 -0
|
@@ -2,32 +2,12 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
|
2
2
|
interface Client {
|
|
3
3
|
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
4
|
}
|
|
5
|
-
export declare const
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
description: string;
|
|
10
|
-
primaryColor: string;
|
|
11
|
-
logo: Buffer | null;
|
|
12
|
-
logoContentType: string | null;
|
|
13
|
-
timezone: string;
|
|
14
|
-
location: string;
|
|
15
|
-
}
|
|
16
|
-
export interface CreateOrganizationRow {
|
|
17
|
-
id: string;
|
|
18
|
-
slug: string;
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
primaryColor: string;
|
|
22
|
-
hasLogo: string | null;
|
|
23
|
-
timezone: string;
|
|
24
|
-
location: string;
|
|
25
|
-
createdAt: Date;
|
|
26
|
-
updatedAt: Date;
|
|
5
|
+
export declare const updateOrganizationDefaultChatAgentQuery = "-- name: UpdateOrganizationDefaultChatAgent :one\nWITH valid_agent AS (\n SELECT a.id\n FROM weave.agent a\n WHERE a.organization_id = $1\n AND a.id = $2\n)\nUPDATE weave.organization o\nSET default_chat_agent_id = valid_agent.id\nFROM valid_agent\nWHERE o.id = $1\nRETURNING o.id, o.slug, o.name, o.description, o.primary_color, o.logo, o.logo_content_type, o.timezone, o.location, o.status, o.default_chat_agent_id, o.default_chat_model_route_id, o.created_at, o.updated_at";
|
|
6
|
+
export interface UpdateOrganizationDefaultChatAgentArgs {
|
|
7
|
+
organizationId: string;
|
|
8
|
+
agentId: string;
|
|
27
9
|
}
|
|
28
|
-
export
|
|
29
|
-
export declare const createOrganizationWithIDQuery = "-- name: CreateOrganizationWithID :one\nINSERT INTO weave.organizations (\n id,\n slug,\n name,\n description,\n primary_color,\n logo,\n logo_content_type,\n timezone,\n location\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9\n)\nON CONFLICT (slug) DO NOTHING\nRETURNING\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at";
|
|
30
|
-
export interface CreateOrganizationWithIDArgs {
|
|
10
|
+
export interface UpdateOrganizationDefaultChatAgentRow {
|
|
31
11
|
id: string;
|
|
32
12
|
slug: string;
|
|
33
13
|
name: string;
|
|
@@ -37,69 +17,14 @@ export interface CreateOrganizationWithIDArgs {
|
|
|
37
17
|
logoContentType: string | null;
|
|
38
18
|
timezone: string;
|
|
39
19
|
location: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
slug: string;
|
|
44
|
-
name: string;
|
|
45
|
-
description: string;
|
|
46
|
-
primaryColor: string;
|
|
47
|
-
hasLogo: string | null;
|
|
48
|
-
timezone: string;
|
|
49
|
-
location: string;
|
|
20
|
+
status: string;
|
|
21
|
+
defaultChatAgentId: string | null;
|
|
22
|
+
defaultChatModelRouteId: string | null;
|
|
50
23
|
createdAt: Date;
|
|
51
24
|
updatedAt: Date;
|
|
52
25
|
}
|
|
53
|
-
export declare function
|
|
54
|
-
export declare const
|
|
55
|
-
export interface GetOrganizationBySlugArgs {
|
|
56
|
-
slug: string;
|
|
57
|
-
}
|
|
58
|
-
export interface GetOrganizationBySlugRow {
|
|
59
|
-
id: string;
|
|
60
|
-
slug: string;
|
|
61
|
-
name: string;
|
|
62
|
-
description: string;
|
|
63
|
-
primaryColor: string;
|
|
64
|
-
hasLogo: string | null;
|
|
65
|
-
timezone: string;
|
|
66
|
-
location: string;
|
|
67
|
-
createdAt: Date;
|
|
68
|
-
updatedAt: Date;
|
|
69
|
-
}
|
|
70
|
-
export declare function getOrganizationBySlug(client: Client, args: GetOrganizationBySlugArgs): Promise<GetOrganizationBySlugRow | null>;
|
|
71
|
-
export declare const getOrganizationByIDQuery = "-- name: GetOrganizationByID :one\nSELECT\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at\nFROM weave.organizations\nWHERE id = $1";
|
|
72
|
-
export interface GetOrganizationByIDArgs {
|
|
73
|
-
id: string;
|
|
74
|
-
}
|
|
75
|
-
export interface GetOrganizationByIDRow {
|
|
76
|
-
id: string;
|
|
77
|
-
slug: string;
|
|
78
|
-
name: string;
|
|
79
|
-
description: string;
|
|
80
|
-
primaryColor: string;
|
|
81
|
-
hasLogo: string | null;
|
|
82
|
-
timezone: string;
|
|
83
|
-
location: string;
|
|
84
|
-
createdAt: Date;
|
|
85
|
-
updatedAt: Date;
|
|
86
|
-
}
|
|
87
|
-
export declare function getOrganizationByID(client: Client, args: GetOrganizationByIDArgs): Promise<GetOrganizationByIDRow | null>;
|
|
88
|
-
export declare const listOrganizationsQuery = "-- name: ListOrganizations :many\nSELECT\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at\nFROM weave.organizations\nORDER BY created_at DESC";
|
|
89
|
-
export interface ListOrganizationsRow {
|
|
90
|
-
id: string;
|
|
91
|
-
slug: string;
|
|
92
|
-
name: string;
|
|
93
|
-
description: string;
|
|
94
|
-
primaryColor: string;
|
|
95
|
-
hasLogo: string | null;
|
|
96
|
-
timezone: string;
|
|
97
|
-
location: string;
|
|
98
|
-
createdAt: Date;
|
|
99
|
-
updatedAt: Date;
|
|
100
|
-
}
|
|
101
|
-
export declare function listOrganizations(client: Client): Promise<ListOrganizationsRow[]>;
|
|
102
|
-
export declare const updateOrganizationQuery = "-- name: UpdateOrganization :one\nUPDATE weave.organizations\nSET\n slug = COALESCE($1, slug),\n name = COALESCE($2, name),\n description = COALESCE($3, description),\n primary_color = COALESCE($4, primary_color),\n timezone = COALESCE($5, timezone),\n location = COALESCE($6, location)\nWHERE id = $7\nRETURNING\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at";
|
|
26
|
+
export declare function updateOrganizationDefaultChatAgent(client: Client, args: UpdateOrganizationDefaultChatAgentArgs): Promise<UpdateOrganizationDefaultChatAgentRow | null>;
|
|
27
|
+
export declare const updateOrganizationQuery = "-- name: UpdateOrganization :one\nUPDATE weave.organization\nSET\n slug = COALESCE($1::text, slug),\n name = COALESCE($2::text, name),\n description = COALESCE($3::text, description),\n primary_color = COALESCE($4::text, primary_color),\n timezone = COALESCE($5::text, timezone),\n location = COALESCE($6::text, location)\nWHERE id = $7\nRETURNING id, slug, name, description, primary_color, logo, logo_content_type, timezone, location, status, default_chat_agent_id, default_chat_model_route_id, created_at, updated_at";
|
|
103
28
|
export interface UpdateOrganizationArgs {
|
|
104
29
|
slug: string | null;
|
|
105
30
|
name: string | null;
|
|
@@ -107,7 +32,7 @@ export interface UpdateOrganizationArgs {
|
|
|
107
32
|
primaryColor: string | null;
|
|
108
33
|
timezone: string | null;
|
|
109
34
|
location: string | null;
|
|
110
|
-
|
|
35
|
+
organizationId: string;
|
|
111
36
|
}
|
|
112
37
|
export interface UpdateOrganizationRow {
|
|
113
38
|
id: string;
|
|
@@ -115,34 +40,29 @@ export interface UpdateOrganizationRow {
|
|
|
115
40
|
name: string;
|
|
116
41
|
description: string;
|
|
117
42
|
primaryColor: string;
|
|
118
|
-
|
|
43
|
+
logo: Buffer | null;
|
|
44
|
+
logoContentType: string | null;
|
|
119
45
|
timezone: string;
|
|
120
46
|
location: string;
|
|
47
|
+
status: string;
|
|
48
|
+
defaultChatAgentId: string | null;
|
|
49
|
+
defaultChatModelRouteId: string | null;
|
|
121
50
|
createdAt: Date;
|
|
122
51
|
updatedAt: Date;
|
|
123
52
|
}
|
|
124
53
|
export declare function updateOrganization(client: Client, args: UpdateOrganizationArgs): Promise<UpdateOrganizationRow | null>;
|
|
125
|
-
export declare const deleteOrganizationQuery = "-- name: DeleteOrganization :execrows\nDELETE FROM weave.
|
|
54
|
+
export declare const deleteOrganizationQuery = "-- name: DeleteOrganization :execrows\nDELETE FROM weave.organization\nWHERE id = $1";
|
|
126
55
|
export interface DeleteOrganizationArgs {
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
export declare const getOrganizationLogoQuery = "-- name: GetOrganizationLogo :one\nSELECT logo, logo_content_type\nFROM weave.organizations\nWHERE slug = $1";
|
|
130
|
-
export interface GetOrganizationLogoArgs {
|
|
131
|
-
slug: string;
|
|
132
|
-
}
|
|
133
|
-
export interface GetOrganizationLogoRow {
|
|
134
|
-
logo: Buffer | null;
|
|
135
|
-
logoContentType: string | null;
|
|
56
|
+
organizationId: string;
|
|
136
57
|
}
|
|
137
|
-
export declare
|
|
138
|
-
export declare const setOrganizationLogoQuery = "-- name: SetOrganizationLogo :execrows\nUPDATE weave.organizations\nSET logo = $1, logo_content_type = $2\nWHERE slug = $3";
|
|
58
|
+
export declare const setOrganizationLogoQuery = "-- name: SetOrganizationLogo :execrows\nUPDATE weave.organization\nSET\n logo = $1,\n logo_content_type = $2\nWHERE id = $3";
|
|
139
59
|
export interface SetOrganizationLogoArgs {
|
|
140
60
|
logo: Buffer | null;
|
|
141
61
|
logoContentType: string | null;
|
|
142
|
-
|
|
62
|
+
organizationId: string;
|
|
143
63
|
}
|
|
144
|
-
export declare const clearOrganizationLogoQuery = "-- name: ClearOrganizationLogo :execrows\nUPDATE weave.
|
|
64
|
+
export declare const clearOrganizationLogoQuery = "-- name: ClearOrganizationLogo :execrows\nUPDATE weave.organization\nSET\n logo = NULL,\n logo_content_type = NULL\nWHERE id = $1";
|
|
145
65
|
export interface ClearOrganizationLogoArgs {
|
|
146
|
-
|
|
66
|
+
organizationId: string;
|
|
147
67
|
}
|
|
148
68
|
export {};
|
|
@@ -1,49 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clearOrganizationLogoQuery = exports.setOrganizationLogoQuery = exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.createOrganizationWithID = createOrganizationWithID;
|
|
6
|
-
exports.getOrganizationBySlug = getOrganizationBySlug;
|
|
7
|
-
exports.getOrganizationByID = getOrganizationByID;
|
|
8
|
-
exports.listOrganizations = listOrganizations;
|
|
3
|
+
exports.clearOrganizationLogoQuery = exports.setOrganizationLogoQuery = exports.deleteOrganizationQuery = exports.updateOrganizationQuery = exports.updateOrganizationDefaultChatAgentQuery = void 0;
|
|
4
|
+
exports.updateOrganizationDefaultChatAgent = updateOrganizationDefaultChatAgent;
|
|
9
5
|
exports.updateOrganization = updateOrganization;
|
|
10
|
-
exports.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
primary_color,
|
|
17
|
-
logo,
|
|
18
|
-
logo_content_type,
|
|
19
|
-
timezone,
|
|
20
|
-
location
|
|
21
|
-
) VALUES (
|
|
22
|
-
$1,
|
|
23
|
-
$2,
|
|
24
|
-
$3,
|
|
25
|
-
$4,
|
|
26
|
-
$5,
|
|
27
|
-
$6,
|
|
28
|
-
$7,
|
|
29
|
-
$8
|
|
6
|
+
exports.updateOrganizationDefaultChatAgentQuery = `-- name: UpdateOrganizationDefaultChatAgent :one
|
|
7
|
+
WITH valid_agent AS (
|
|
8
|
+
SELECT a.id
|
|
9
|
+
FROM weave.agent a
|
|
10
|
+
WHERE a.organization_id = $1
|
|
11
|
+
AND a.id = $2
|
|
30
12
|
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
primary_color,
|
|
38
|
-
(logo IS NOT NULL) AS has_logo,
|
|
39
|
-
timezone,
|
|
40
|
-
location,
|
|
41
|
-
created_at,
|
|
42
|
-
updated_at`;
|
|
43
|
-
async function createOrganization(client, args) {
|
|
13
|
+
UPDATE weave.organization o
|
|
14
|
+
SET default_chat_agent_id = valid_agent.id
|
|
15
|
+
FROM valid_agent
|
|
16
|
+
WHERE o.id = $1
|
|
17
|
+
RETURNING o.id, o.slug, o.name, o.description, o.primary_color, o.logo, o.logo_content_type, o.timezone, o.location, o.status, o.default_chat_agent_id, o.default_chat_model_route_id, o.created_at, o.updated_at`;
|
|
18
|
+
async function updateOrganizationDefaultChatAgent(client, args) {
|
|
44
19
|
const result = await client.query({
|
|
45
|
-
text: exports.
|
|
46
|
-
values: [args.
|
|
20
|
+
text: exports.updateOrganizationDefaultChatAgentQuery,
|
|
21
|
+
values: [args.organizationId, args.agentId],
|
|
47
22
|
rowMode: "array"
|
|
48
23
|
});
|
|
49
24
|
if (result.rows.length !== 1) {
|
|
@@ -56,204 +31,32 @@ async function createOrganization(client, args) {
|
|
|
56
31
|
name: row[2],
|
|
57
32
|
description: row[3],
|
|
58
33
|
primaryColor: row[4],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
34
|
+
logo: row[5],
|
|
35
|
+
logoContentType: row[6],
|
|
36
|
+
timezone: row[7],
|
|
37
|
+
location: row[8],
|
|
38
|
+
status: row[9],
|
|
39
|
+
defaultChatAgentId: row[10],
|
|
40
|
+
defaultChatModelRouteId: row[11],
|
|
41
|
+
createdAt: row[12],
|
|
42
|
+
updatedAt: row[13]
|
|
64
43
|
};
|
|
65
44
|
}
|
|
66
|
-
exports.createOrganizationWithIDQuery = `-- name: CreateOrganizationWithID :one
|
|
67
|
-
INSERT INTO weave.organizations (
|
|
68
|
-
id,
|
|
69
|
-
slug,
|
|
70
|
-
name,
|
|
71
|
-
description,
|
|
72
|
-
primary_color,
|
|
73
|
-
logo,
|
|
74
|
-
logo_content_type,
|
|
75
|
-
timezone,
|
|
76
|
-
location
|
|
77
|
-
) VALUES (
|
|
78
|
-
$1,
|
|
79
|
-
$2,
|
|
80
|
-
$3,
|
|
81
|
-
$4,
|
|
82
|
-
$5,
|
|
83
|
-
$6,
|
|
84
|
-
$7,
|
|
85
|
-
$8,
|
|
86
|
-
$9
|
|
87
|
-
)
|
|
88
|
-
ON CONFLICT (slug) DO NOTHING
|
|
89
|
-
RETURNING
|
|
90
|
-
id,
|
|
91
|
-
slug,
|
|
92
|
-
name,
|
|
93
|
-
description,
|
|
94
|
-
primary_color,
|
|
95
|
-
(logo IS NOT NULL) AS has_logo,
|
|
96
|
-
timezone,
|
|
97
|
-
location,
|
|
98
|
-
created_at,
|
|
99
|
-
updated_at`;
|
|
100
|
-
async function createOrganizationWithID(client, args) {
|
|
101
|
-
const result = await client.query({
|
|
102
|
-
text: exports.createOrganizationWithIDQuery,
|
|
103
|
-
values: [args.id, args.slug, args.name, args.description, args.primaryColor, args.logo, args.logoContentType, args.timezone, args.location],
|
|
104
|
-
rowMode: "array"
|
|
105
|
-
});
|
|
106
|
-
if (result.rows.length !== 1) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
const row = result.rows[0];
|
|
110
|
-
return {
|
|
111
|
-
id: row[0],
|
|
112
|
-
slug: row[1],
|
|
113
|
-
name: row[2],
|
|
114
|
-
description: row[3],
|
|
115
|
-
primaryColor: row[4],
|
|
116
|
-
hasLogo: row[5],
|
|
117
|
-
timezone: row[6],
|
|
118
|
-
location: row[7],
|
|
119
|
-
createdAt: row[8],
|
|
120
|
-
updatedAt: row[9]
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
exports.getOrganizationBySlugQuery = `-- name: GetOrganizationBySlug :one
|
|
124
|
-
SELECT
|
|
125
|
-
id,
|
|
126
|
-
slug,
|
|
127
|
-
name,
|
|
128
|
-
description,
|
|
129
|
-
primary_color,
|
|
130
|
-
(logo IS NOT NULL) AS has_logo,
|
|
131
|
-
timezone,
|
|
132
|
-
location,
|
|
133
|
-
created_at,
|
|
134
|
-
updated_at
|
|
135
|
-
FROM weave.organizations
|
|
136
|
-
WHERE slug = $1`;
|
|
137
|
-
async function getOrganizationBySlug(client, args) {
|
|
138
|
-
const result = await client.query({
|
|
139
|
-
text: exports.getOrganizationBySlugQuery,
|
|
140
|
-
values: [args.slug],
|
|
141
|
-
rowMode: "array"
|
|
142
|
-
});
|
|
143
|
-
if (result.rows.length !== 1) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
const row = result.rows[0];
|
|
147
|
-
return {
|
|
148
|
-
id: row[0],
|
|
149
|
-
slug: row[1],
|
|
150
|
-
name: row[2],
|
|
151
|
-
description: row[3],
|
|
152
|
-
primaryColor: row[4],
|
|
153
|
-
hasLogo: row[5],
|
|
154
|
-
timezone: row[6],
|
|
155
|
-
location: row[7],
|
|
156
|
-
createdAt: row[8],
|
|
157
|
-
updatedAt: row[9]
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
exports.getOrganizationByIDQuery = `-- name: GetOrganizationByID :one
|
|
161
|
-
SELECT
|
|
162
|
-
id,
|
|
163
|
-
slug,
|
|
164
|
-
name,
|
|
165
|
-
description,
|
|
166
|
-
primary_color,
|
|
167
|
-
(logo IS NOT NULL) AS has_logo,
|
|
168
|
-
timezone,
|
|
169
|
-
location,
|
|
170
|
-
created_at,
|
|
171
|
-
updated_at
|
|
172
|
-
FROM weave.organizations
|
|
173
|
-
WHERE id = $1`;
|
|
174
|
-
async function getOrganizationByID(client, args) {
|
|
175
|
-
const result = await client.query({
|
|
176
|
-
text: exports.getOrganizationByIDQuery,
|
|
177
|
-
values: [args.id],
|
|
178
|
-
rowMode: "array"
|
|
179
|
-
});
|
|
180
|
-
if (result.rows.length !== 1) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
const row = result.rows[0];
|
|
184
|
-
return {
|
|
185
|
-
id: row[0],
|
|
186
|
-
slug: row[1],
|
|
187
|
-
name: row[2],
|
|
188
|
-
description: row[3],
|
|
189
|
-
primaryColor: row[4],
|
|
190
|
-
hasLogo: row[5],
|
|
191
|
-
timezone: row[6],
|
|
192
|
-
location: row[7],
|
|
193
|
-
createdAt: row[8],
|
|
194
|
-
updatedAt: row[9]
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
exports.listOrganizationsQuery = `-- name: ListOrganizations :many
|
|
198
|
-
SELECT
|
|
199
|
-
id,
|
|
200
|
-
slug,
|
|
201
|
-
name,
|
|
202
|
-
description,
|
|
203
|
-
primary_color,
|
|
204
|
-
(logo IS NOT NULL) AS has_logo,
|
|
205
|
-
timezone,
|
|
206
|
-
location,
|
|
207
|
-
created_at,
|
|
208
|
-
updated_at
|
|
209
|
-
FROM weave.organizations
|
|
210
|
-
ORDER BY created_at DESC`;
|
|
211
|
-
async function listOrganizations(client) {
|
|
212
|
-
const result = await client.query({
|
|
213
|
-
text: exports.listOrganizationsQuery,
|
|
214
|
-
values: [],
|
|
215
|
-
rowMode: "array"
|
|
216
|
-
});
|
|
217
|
-
return result.rows.map(row => {
|
|
218
|
-
return {
|
|
219
|
-
id: row[0],
|
|
220
|
-
slug: row[1],
|
|
221
|
-
name: row[2],
|
|
222
|
-
description: row[3],
|
|
223
|
-
primaryColor: row[4],
|
|
224
|
-
hasLogo: row[5],
|
|
225
|
-
timezone: row[6],
|
|
226
|
-
location: row[7],
|
|
227
|
-
createdAt: row[8],
|
|
228
|
-
updatedAt: row[9]
|
|
229
|
-
};
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
45
|
exports.updateOrganizationQuery = `-- name: UpdateOrganization :one
|
|
233
|
-
UPDATE weave.
|
|
46
|
+
UPDATE weave.organization
|
|
234
47
|
SET
|
|
235
|
-
slug = COALESCE($1, slug),
|
|
236
|
-
name = COALESCE($2, name),
|
|
237
|
-
description = COALESCE($3, description),
|
|
238
|
-
primary_color = COALESCE($4, primary_color),
|
|
239
|
-
timezone = COALESCE($5, timezone),
|
|
240
|
-
location = COALESCE($6, location)
|
|
48
|
+
slug = COALESCE($1::text, slug),
|
|
49
|
+
name = COALESCE($2::text, name),
|
|
50
|
+
description = COALESCE($3::text, description),
|
|
51
|
+
primary_color = COALESCE($4::text, primary_color),
|
|
52
|
+
timezone = COALESCE($5::text, timezone),
|
|
53
|
+
location = COALESCE($6::text, location)
|
|
241
54
|
WHERE id = $7
|
|
242
|
-
RETURNING
|
|
243
|
-
id,
|
|
244
|
-
slug,
|
|
245
|
-
name,
|
|
246
|
-
description,
|
|
247
|
-
primary_color,
|
|
248
|
-
(logo IS NOT NULL) AS has_logo,
|
|
249
|
-
timezone,
|
|
250
|
-
location,
|
|
251
|
-
created_at,
|
|
252
|
-
updated_at`;
|
|
55
|
+
RETURNING id, slug, name, description, primary_color, logo, logo_content_type, timezone, location, status, default_chat_agent_id, default_chat_model_route_id, created_at, updated_at`;
|
|
253
56
|
async function updateOrganization(client, args) {
|
|
254
57
|
const result = await client.query({
|
|
255
58
|
text: exports.updateOrganizationQuery,
|
|
256
|
-
values: [args.slug, args.name, args.description, args.primaryColor, args.timezone, args.location, args.
|
|
59
|
+
values: [args.slug, args.name, args.description, args.primaryColor, args.timezone, args.location, args.organizationId],
|
|
257
60
|
rowMode: "array"
|
|
258
61
|
});
|
|
259
62
|
if (result.rows.length !== 1) {
|
|
@@ -266,40 +69,29 @@ async function updateOrganization(client, args) {
|
|
|
266
69
|
name: row[2],
|
|
267
70
|
description: row[3],
|
|
268
71
|
primaryColor: row[4],
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
72
|
+
logo: row[5],
|
|
73
|
+
logoContentType: row[6],
|
|
74
|
+
timezone: row[7],
|
|
75
|
+
location: row[8],
|
|
76
|
+
status: row[9],
|
|
77
|
+
defaultChatAgentId: row[10],
|
|
78
|
+
defaultChatModelRouteId: row[11],
|
|
79
|
+
createdAt: row[12],
|
|
80
|
+
updatedAt: row[13]
|
|
274
81
|
};
|
|
275
82
|
}
|
|
276
83
|
exports.deleteOrganizationQuery = `-- name: DeleteOrganization :execrows
|
|
277
|
-
DELETE FROM weave.
|
|
84
|
+
DELETE FROM weave.organization
|
|
278
85
|
WHERE id = $1`;
|
|
279
|
-
exports.getOrganizationLogoQuery = `-- name: GetOrganizationLogo :one
|
|
280
|
-
SELECT logo, logo_content_type
|
|
281
|
-
FROM weave.organizations
|
|
282
|
-
WHERE slug = $1`;
|
|
283
|
-
async function getOrganizationLogo(client, args) {
|
|
284
|
-
const result = await client.query({
|
|
285
|
-
text: exports.getOrganizationLogoQuery,
|
|
286
|
-
values: [args.slug],
|
|
287
|
-
rowMode: "array"
|
|
288
|
-
});
|
|
289
|
-
if (result.rows.length !== 1) {
|
|
290
|
-
return null;
|
|
291
|
-
}
|
|
292
|
-
const row = result.rows[0];
|
|
293
|
-
return {
|
|
294
|
-
logo: row[0],
|
|
295
|
-
logoContentType: row[1]
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
86
|
exports.setOrganizationLogoQuery = `-- name: SetOrganizationLogo :execrows
|
|
299
|
-
UPDATE weave.
|
|
300
|
-
SET
|
|
301
|
-
|
|
87
|
+
UPDATE weave.organization
|
|
88
|
+
SET
|
|
89
|
+
logo = $1,
|
|
90
|
+
logo_content_type = $2
|
|
91
|
+
WHERE id = $3`;
|
|
302
92
|
exports.clearOrganizationLogoQuery = `-- name: ClearOrganizationLogo :execrows
|
|
303
|
-
UPDATE weave.
|
|
304
|
-
SET
|
|
305
|
-
|
|
93
|
+
UPDATE weave.organization
|
|
94
|
+
SET
|
|
95
|
+
logo = NULL,
|
|
96
|
+
logo_content_type = NULL
|
|
97
|
+
WHERE id = $1`;
|