weave-typescript 0.51.3 → 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 +1 -1
- 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
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const createAuthorizationOutboxEntryQuery = "-- name: CreateAuthorizationOutboxEntry :one\nINSERT INTO weave.authorization_outbox (\n organization_id,\n operation,\n tuple_user,\n tuple_relation,\n tuple_object\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5\n)\nRETURNING id, organization_id, operation, tuple_user, tuple_relation, tuple_object, status, attempt_count, next_attempt_at, last_error, processed_at, created_at, updated_at";
|
|
6
|
+
export interface CreateAuthorizationOutboxEntryArgs {
|
|
7
|
+
organizationId: string;
|
|
8
|
+
operation: string;
|
|
9
|
+
tupleUser: string;
|
|
10
|
+
tupleRelation: string;
|
|
11
|
+
tupleObject: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateAuthorizationOutboxEntryRow {
|
|
14
|
+
id: string;
|
|
15
|
+
organizationId: string;
|
|
16
|
+
operation: string;
|
|
17
|
+
tupleUser: string;
|
|
18
|
+
tupleRelation: string;
|
|
19
|
+
tupleObject: string;
|
|
20
|
+
status: string;
|
|
21
|
+
attemptCount: number;
|
|
22
|
+
nextAttemptAt: Date;
|
|
23
|
+
lastError: string;
|
|
24
|
+
processedAt: Date | null;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
}
|
|
28
|
+
export declare function createAuthorizationOutboxEntry(client: Client, args: CreateAuthorizationOutboxEntryArgs): Promise<CreateAuthorizationOutboxEntryRow | null>;
|
|
29
|
+
export declare const claimAuthorizationOutboxEntriesQuery = "-- name: ClaimAuthorizationOutboxEntries :many\nWITH claimable AS (\n SELECT id\n FROM weave.authorization_outbox\n WHERE status IN ('pending', 'failed')\n AND next_attempt_at <= now()\n ORDER BY next_attempt_at ASC, created_at ASC, id ASC\n LIMIT $1\n FOR UPDATE SKIP LOCKED\n)\nUPDATE weave.authorization_outbox ao\nSET status = 'processing',\n attempt_count = ao.attempt_count + 1,\n last_error = ''\nFROM claimable\nWHERE ao.id = claimable.id\nRETURNING ao.id, ao.organization_id, ao.operation, ao.tuple_user, ao.tuple_relation, ao.tuple_object, ao.status, ao.attempt_count, ao.next_attempt_at, ao.last_error, ao.processed_at, ao.created_at, ao.updated_at";
|
|
30
|
+
export interface ClaimAuthorizationOutboxEntriesArgs {
|
|
31
|
+
limitCount: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ClaimAuthorizationOutboxEntriesRow {
|
|
34
|
+
id: string;
|
|
35
|
+
organizationId: string;
|
|
36
|
+
operation: string;
|
|
37
|
+
tupleUser: string;
|
|
38
|
+
tupleRelation: string;
|
|
39
|
+
tupleObject: string;
|
|
40
|
+
status: string;
|
|
41
|
+
attemptCount: number;
|
|
42
|
+
nextAttemptAt: Date;
|
|
43
|
+
lastError: string;
|
|
44
|
+
processedAt: Date | null;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
updatedAt: Date;
|
|
47
|
+
}
|
|
48
|
+
export declare function claimAuthorizationOutboxEntries(client: Client, args: ClaimAuthorizationOutboxEntriesArgs): Promise<ClaimAuthorizationOutboxEntriesRow[]>;
|
|
49
|
+
export declare const claimAuthorizationOutboxEntriesByIDQuery = "-- name: ClaimAuthorizationOutboxEntriesByID :many\nWITH claimable AS (\n SELECT id\n FROM weave.authorization_outbox\n WHERE id = ANY($1::uuid[])\n AND status IN ('pending', 'failed')\n AND next_attempt_at <= now()\n ORDER BY created_at ASC, id ASC\n FOR UPDATE SKIP LOCKED\n)\nUPDATE weave.authorization_outbox ao\nSET status = 'processing',\n attempt_count = ao.attempt_count + 1,\n last_error = ''\nFROM claimable\nWHERE ao.id = claimable.id\nRETURNING ao.id, ao.organization_id, ao.operation, ao.tuple_user, ao.tuple_relation, ao.tuple_object, ao.status, ao.attempt_count, ao.next_attempt_at, ao.last_error, ao.processed_at, ao.created_at, ao.updated_at";
|
|
50
|
+
export interface ClaimAuthorizationOutboxEntriesByIDArgs {
|
|
51
|
+
authorizationOutboxIds: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface ClaimAuthorizationOutboxEntriesByIDRow {
|
|
54
|
+
id: string;
|
|
55
|
+
organizationId: string;
|
|
56
|
+
operation: string;
|
|
57
|
+
tupleUser: string;
|
|
58
|
+
tupleRelation: string;
|
|
59
|
+
tupleObject: string;
|
|
60
|
+
status: string;
|
|
61
|
+
attemptCount: number;
|
|
62
|
+
nextAttemptAt: Date;
|
|
63
|
+
lastError: string;
|
|
64
|
+
processedAt: Date | null;
|
|
65
|
+
createdAt: Date;
|
|
66
|
+
updatedAt: Date;
|
|
67
|
+
}
|
|
68
|
+
export declare function claimAuthorizationOutboxEntriesByID(client: Client, args: ClaimAuthorizationOutboxEntriesByIDArgs): Promise<ClaimAuthorizationOutboxEntriesByIDRow[]>;
|
|
69
|
+
export declare const completeAuthorizationOutboxEntryQuery = "-- name: CompleteAuthorizationOutboxEntry :one\nUPDATE weave.authorization_outbox\nSET status = 'completed',\n last_error = '',\n processed_at = now()\nWHERE id = $1\n AND status = 'processing'\nRETURNING id, organization_id, operation, tuple_user, tuple_relation, tuple_object, status, attempt_count, next_attempt_at, last_error, processed_at, created_at, updated_at";
|
|
70
|
+
export interface CompleteAuthorizationOutboxEntryArgs {
|
|
71
|
+
authorizationOutboxId: string;
|
|
72
|
+
}
|
|
73
|
+
export interface CompleteAuthorizationOutboxEntryRow {
|
|
74
|
+
id: string;
|
|
75
|
+
organizationId: string;
|
|
76
|
+
operation: string;
|
|
77
|
+
tupleUser: string;
|
|
78
|
+
tupleRelation: string;
|
|
79
|
+
tupleObject: string;
|
|
80
|
+
status: string;
|
|
81
|
+
attemptCount: number;
|
|
82
|
+
nextAttemptAt: Date;
|
|
83
|
+
lastError: string;
|
|
84
|
+
processedAt: Date | null;
|
|
85
|
+
createdAt: Date;
|
|
86
|
+
updatedAt: Date;
|
|
87
|
+
}
|
|
88
|
+
export declare function completeAuthorizationOutboxEntry(client: Client, args: CompleteAuthorizationOutboxEntryArgs): Promise<CompleteAuthorizationOutboxEntryRow | null>;
|
|
89
|
+
export declare const failAuthorizationOutboxEntryQuery = "-- name: FailAuthorizationOutboxEntry :one\nUPDATE weave.authorization_outbox\nSET status = 'failed',\n last_error = $1,\n next_attempt_at = $2,\n processed_at = NULL\nWHERE id = $3\n AND status = 'processing'\nRETURNING id, organization_id, operation, tuple_user, tuple_relation, tuple_object, status, attempt_count, next_attempt_at, last_error, processed_at, created_at, updated_at";
|
|
90
|
+
export interface FailAuthorizationOutboxEntryArgs {
|
|
91
|
+
lastError: string;
|
|
92
|
+
nextAttemptAt: Date;
|
|
93
|
+
authorizationOutboxId: string;
|
|
94
|
+
}
|
|
95
|
+
export interface FailAuthorizationOutboxEntryRow {
|
|
96
|
+
id: string;
|
|
97
|
+
organizationId: string;
|
|
98
|
+
operation: string;
|
|
99
|
+
tupleUser: string;
|
|
100
|
+
tupleRelation: string;
|
|
101
|
+
tupleObject: string;
|
|
102
|
+
status: string;
|
|
103
|
+
attemptCount: number;
|
|
104
|
+
nextAttemptAt: Date;
|
|
105
|
+
lastError: string;
|
|
106
|
+
processedAt: Date | null;
|
|
107
|
+
createdAt: Date;
|
|
108
|
+
updatedAt: Date;
|
|
109
|
+
}
|
|
110
|
+
export declare function failAuthorizationOutboxEntry(client: Client, args: FailAuthorizationOutboxEntryArgs): Promise<FailAuthorizationOutboxEntryRow | null>;
|
|
111
|
+
export declare const requeueStaleAuthorizationOutboxEntriesQuery = "-- name: RequeueStaleAuthorizationOutboxEntries :many\nUPDATE weave.authorization_outbox\nSET status = 'failed',\n last_error = COALESCE($1::text, last_error),\n next_attempt_at = now(),\n processed_at = NULL\nWHERE status = 'processing'\n AND updated_at < $2\nRETURNING id, organization_id, operation, tuple_user, tuple_relation, tuple_object, status, attempt_count, next_attempt_at, last_error, processed_at, created_at, updated_at";
|
|
112
|
+
export interface RequeueStaleAuthorizationOutboxEntriesArgs {
|
|
113
|
+
lastError: string | null;
|
|
114
|
+
processingBefore: Date;
|
|
115
|
+
}
|
|
116
|
+
export interface RequeueStaleAuthorizationOutboxEntriesRow {
|
|
117
|
+
id: string;
|
|
118
|
+
organizationId: string;
|
|
119
|
+
operation: string;
|
|
120
|
+
tupleUser: string;
|
|
121
|
+
tupleRelation: string;
|
|
122
|
+
tupleObject: string;
|
|
123
|
+
status: string;
|
|
124
|
+
attemptCount: number;
|
|
125
|
+
nextAttemptAt: Date;
|
|
126
|
+
lastError: string;
|
|
127
|
+
processedAt: Date | null;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
}
|
|
131
|
+
export declare function requeueStaleAuthorizationOutboxEntries(client: Client, args: RequeueStaleAuthorizationOutboxEntriesArgs): Promise<RequeueStaleAuthorizationOutboxEntriesRow[]>;
|
|
132
|
+
export declare const createAuthorizationGrantQuery = "-- name: CreateAuthorizationGrant :one\nINSERT INTO weave.authorization_grant (\n organization_id,\n subject_kind,\n subject_id,\n object_kind,\n object_id,\n relation,\n created_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7\n)\nON CONFLICT (organization_id, subject_kind, subject_id, object_kind, object_id, relation, revoked_at)\n DO UPDATE SET\n updated_at = now()\nRETURNING id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at";
|
|
133
|
+
export interface CreateAuthorizationGrantArgs {
|
|
134
|
+
organizationId: string;
|
|
135
|
+
subjectKind: string;
|
|
136
|
+
subjectId: string;
|
|
137
|
+
objectKind: string;
|
|
138
|
+
objectId: string;
|
|
139
|
+
relation: string;
|
|
140
|
+
createdByUserId: string;
|
|
141
|
+
}
|
|
142
|
+
export interface CreateAuthorizationGrantRow {
|
|
143
|
+
id: string;
|
|
144
|
+
organizationId: string;
|
|
145
|
+
subjectKind: string;
|
|
146
|
+
subjectId: string;
|
|
147
|
+
objectKind: string;
|
|
148
|
+
objectId: string;
|
|
149
|
+
relation: string;
|
|
150
|
+
createdByUserId: string;
|
|
151
|
+
revokedAt: Date | null;
|
|
152
|
+
createdAt: Date;
|
|
153
|
+
updatedAt: Date;
|
|
154
|
+
}
|
|
155
|
+
export declare function createAuthorizationGrant(client: Client, args: CreateAuthorizationGrantArgs): Promise<CreateAuthorizationGrantRow | null>;
|
|
156
|
+
export declare const getAuthorizationGrantQuery = "-- name: GetAuthorizationGrant :one\nSELECT id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at\nFROM weave.authorization_grant\nWHERE id = $1\n AND organization_id = $2";
|
|
157
|
+
export interface GetAuthorizationGrantArgs {
|
|
158
|
+
authorizationGrantId: string;
|
|
159
|
+
organizationId: string;
|
|
160
|
+
}
|
|
161
|
+
export interface GetAuthorizationGrantRow {
|
|
162
|
+
id: string;
|
|
163
|
+
organizationId: string;
|
|
164
|
+
subjectKind: string;
|
|
165
|
+
subjectId: string;
|
|
166
|
+
objectKind: string;
|
|
167
|
+
objectId: string;
|
|
168
|
+
relation: string;
|
|
169
|
+
createdByUserId: string;
|
|
170
|
+
revokedAt: Date | null;
|
|
171
|
+
createdAt: Date;
|
|
172
|
+
updatedAt: Date;
|
|
173
|
+
}
|
|
174
|
+
export declare function getAuthorizationGrant(client: Client, args: GetAuthorizationGrantArgs): Promise<GetAuthorizationGrantRow | null>;
|
|
175
|
+
export declare const listAuthorizationGrantsForSubjectQuery = "-- name: ListAuthorizationGrantsForSubject :many\nSELECT id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at\nFROM weave.authorization_grant\nWHERE organization_id = $1\n AND subject_kind = $2\n AND subject_id = $3\n AND revoked_at IS NULL\nORDER BY created_at DESC, id DESC\nLIMIT $5\nOFFSET $4";
|
|
176
|
+
export interface ListAuthorizationGrantsForSubjectArgs {
|
|
177
|
+
organizationId: string;
|
|
178
|
+
subjectKind: string;
|
|
179
|
+
subjectId: string;
|
|
180
|
+
offsetCount: string;
|
|
181
|
+
limitCount: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ListAuthorizationGrantsForSubjectRow {
|
|
184
|
+
id: string;
|
|
185
|
+
organizationId: string;
|
|
186
|
+
subjectKind: string;
|
|
187
|
+
subjectId: string;
|
|
188
|
+
objectKind: string;
|
|
189
|
+
objectId: string;
|
|
190
|
+
relation: string;
|
|
191
|
+
createdByUserId: string;
|
|
192
|
+
revokedAt: Date | null;
|
|
193
|
+
createdAt: Date;
|
|
194
|
+
updatedAt: Date;
|
|
195
|
+
}
|
|
196
|
+
export declare function listAuthorizationGrantsForSubject(client: Client, args: ListAuthorizationGrantsForSubjectArgs): Promise<ListAuthorizationGrantsForSubjectRow[]>;
|
|
197
|
+
export declare const listAuthorizationGrantsForObjectQuery = "-- name: ListAuthorizationGrantsForObject :many\nSELECT id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at\nFROM weave.authorization_grant\nWHERE organization_id = $1\n AND object_kind = $2\n AND object_id = $3\n AND revoked_at IS NULL\nORDER BY created_at DESC, id DESC\nLIMIT $5\nOFFSET $4";
|
|
198
|
+
export interface ListAuthorizationGrantsForObjectArgs {
|
|
199
|
+
organizationId: string;
|
|
200
|
+
objectKind: string;
|
|
201
|
+
objectId: string;
|
|
202
|
+
offsetCount: string;
|
|
203
|
+
limitCount: string;
|
|
204
|
+
}
|
|
205
|
+
export interface ListAuthorizationGrantsForObjectRow {
|
|
206
|
+
id: string;
|
|
207
|
+
organizationId: string;
|
|
208
|
+
subjectKind: string;
|
|
209
|
+
subjectId: string;
|
|
210
|
+
objectKind: string;
|
|
211
|
+
objectId: string;
|
|
212
|
+
relation: string;
|
|
213
|
+
createdByUserId: string;
|
|
214
|
+
revokedAt: Date | null;
|
|
215
|
+
createdAt: Date;
|
|
216
|
+
updatedAt: Date;
|
|
217
|
+
}
|
|
218
|
+
export declare function listAuthorizationGrantsForObject(client: Client, args: ListAuthorizationGrantsForObjectArgs): Promise<ListAuthorizationGrantsForObjectRow[]>;
|
|
219
|
+
export declare const revokeAuthorizationGrantQuery = "-- name: RevokeAuthorizationGrant :one\nUPDATE weave.authorization_grant\nSET revoked_at = now()\nWHERE id = $1\n AND organization_id = $2\n AND revoked_at IS NULL\nRETURNING id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at";
|
|
220
|
+
export interface RevokeAuthorizationGrantArgs {
|
|
221
|
+
authorizationGrantId: string;
|
|
222
|
+
organizationId: string;
|
|
223
|
+
}
|
|
224
|
+
export interface RevokeAuthorizationGrantRow {
|
|
225
|
+
id: string;
|
|
226
|
+
organizationId: string;
|
|
227
|
+
subjectKind: string;
|
|
228
|
+
subjectId: string;
|
|
229
|
+
objectKind: string;
|
|
230
|
+
objectId: string;
|
|
231
|
+
relation: string;
|
|
232
|
+
createdByUserId: string;
|
|
233
|
+
revokedAt: Date | null;
|
|
234
|
+
createdAt: Date;
|
|
235
|
+
updatedAt: Date;
|
|
236
|
+
}
|
|
237
|
+
export declare function revokeAuthorizationGrant(client: Client, args: RevokeAuthorizationGrantArgs): Promise<RevokeAuthorizationGrantRow | null>;
|
|
238
|
+
export declare const revokeAuthorizationGrantByTupleQuery = "-- name: RevokeAuthorizationGrantByTuple :one\nUPDATE weave.authorization_grant\nSET revoked_at = now()\nWHERE organization_id = $1\n AND subject_kind = $2\n AND subject_id = $3\n AND object_kind = $4\n AND object_id = $5\n AND relation = $6\n AND revoked_at IS NULL\nRETURNING id, organization_id, subject_kind, subject_id, object_kind, object_id, relation, created_by_user_id, revoked_at, created_at, updated_at";
|
|
239
|
+
export interface RevokeAuthorizationGrantByTupleArgs {
|
|
240
|
+
organizationId: string;
|
|
241
|
+
subjectKind: string;
|
|
242
|
+
subjectId: string;
|
|
243
|
+
objectKind: string;
|
|
244
|
+
objectId: string;
|
|
245
|
+
relation: string;
|
|
246
|
+
}
|
|
247
|
+
export interface RevokeAuthorizationGrantByTupleRow {
|
|
248
|
+
id: string;
|
|
249
|
+
organizationId: string;
|
|
250
|
+
subjectKind: string;
|
|
251
|
+
subjectId: string;
|
|
252
|
+
objectKind: string;
|
|
253
|
+
objectId: string;
|
|
254
|
+
relation: string;
|
|
255
|
+
createdByUserId: string;
|
|
256
|
+
revokedAt: Date | null;
|
|
257
|
+
createdAt: Date;
|
|
258
|
+
updatedAt: Date;
|
|
259
|
+
}
|
|
260
|
+
export declare function revokeAuthorizationGrantByTuple(client: Client, args: RevokeAuthorizationGrantByTupleArgs): Promise<RevokeAuthorizationGrantByTupleRow | null>;
|
|
261
|
+
export {};
|