@townco/apiclient 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +98 -0
- package/dist/index.js +27 -0
- package/dist/library-types.d.ts +68 -0
- package/dist/library-types.js +1 -0
- package/dist/server.d.ts +132 -0
- package/dist/server.js +1 -0
- package/package.json +2 -1
- package/src/index.ts +0 -45
- package/src/library-types.ts +0 -74
- package/src/server.ts +0 -165
- package/tsconfig.json +0 -6
- package/turbo.json +0 -18
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export declare const createClient: ({ shedUrl, accessToken, debug, }: {
|
|
2
|
+
shedUrl: string;
|
|
3
|
+
accessToken: string;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
}) => import("@trpc/client").TRPCClient<import("@trpc/server").TRPCBuiltRouter<{
|
|
6
|
+
ctx: {
|
|
7
|
+
user: null;
|
|
8
|
+
token?: never;
|
|
9
|
+
} | {
|
|
10
|
+
user: import("@supabase/supabase-js").User | null;
|
|
11
|
+
token: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
meta: object;
|
|
14
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
15
|
+
transformer: true;
|
|
16
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
17
|
+
greet: import("@trpc/server").TRPCQueryProcedure<{
|
|
18
|
+
input: void;
|
|
19
|
+
output: string;
|
|
20
|
+
meta: object;
|
|
21
|
+
}>;
|
|
22
|
+
listArtifacts: import("@trpc/server").TRPCQueryProcedure<{
|
|
23
|
+
input: {
|
|
24
|
+
key: string;
|
|
25
|
+
recursive?: boolean | undefined;
|
|
26
|
+
kind: "agent" | "user";
|
|
27
|
+
};
|
|
28
|
+
output: import("@supabase/storage-js").FileObject[];
|
|
29
|
+
meta: object;
|
|
30
|
+
}>;
|
|
31
|
+
getArtifactUrl: import("@trpc/server").TRPCQueryProcedure<{
|
|
32
|
+
input: {
|
|
33
|
+
key: string;
|
|
34
|
+
upload?: boolean | undefined;
|
|
35
|
+
kind: "agent" | "user";
|
|
36
|
+
};
|
|
37
|
+
output: string;
|
|
38
|
+
meta: object;
|
|
39
|
+
}>;
|
|
40
|
+
deleteArtifact: import("@trpc/server").TRPCMutationProcedure<{
|
|
41
|
+
input: {
|
|
42
|
+
kind: "agent" | "user";
|
|
43
|
+
key: string;
|
|
44
|
+
};
|
|
45
|
+
output: {
|
|
46
|
+
success: boolean;
|
|
47
|
+
};
|
|
48
|
+
meta: object;
|
|
49
|
+
}>;
|
|
50
|
+
uploadArchive: import("@trpc/server").TRPCMutationProcedure<{
|
|
51
|
+
input: import("@trpc/server/unstable-core-do-not-import").OctetInput;
|
|
52
|
+
output: {
|
|
53
|
+
sha256: string;
|
|
54
|
+
cached: boolean;
|
|
55
|
+
};
|
|
56
|
+
meta: object;
|
|
57
|
+
}>;
|
|
58
|
+
deploy: import("@trpc/server").TRPCSubscriptionProcedure<{
|
|
59
|
+
input: {
|
|
60
|
+
sha256: string;
|
|
61
|
+
agent: string;
|
|
62
|
+
shedUrl: string;
|
|
63
|
+
};
|
|
64
|
+
output: AsyncIterable<{
|
|
65
|
+
status: string;
|
|
66
|
+
error?: never;
|
|
67
|
+
} | {
|
|
68
|
+
status?: never;
|
|
69
|
+
error: unknown;
|
|
70
|
+
}, void>;
|
|
71
|
+
meta: object;
|
|
72
|
+
}>;
|
|
73
|
+
"library.create": import("@trpc/server").TRPCMutationProcedure<{
|
|
74
|
+
input: {
|
|
75
|
+
name: string;
|
|
76
|
+
};
|
|
77
|
+
output: {
|
|
78
|
+
collectionId: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
meta: object;
|
|
81
|
+
}>;
|
|
82
|
+
"library.list": import("@trpc/server").TRPCQueryProcedure<{
|
|
83
|
+
input: void;
|
|
84
|
+
output: {
|
|
85
|
+
collections: import("./library-types").CollectionListItem[] | undefined;
|
|
86
|
+
};
|
|
87
|
+
meta: object;
|
|
88
|
+
}>;
|
|
89
|
+
"library.delete": import("@trpc/server").TRPCMutationProcedure<{
|
|
90
|
+
input: {
|
|
91
|
+
id: string;
|
|
92
|
+
};
|
|
93
|
+
output: {
|
|
94
|
+
success: boolean;
|
|
95
|
+
};
|
|
96
|
+
meta: object;
|
|
97
|
+
}>;
|
|
98
|
+
}>>>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createTRPCClient, httpLink, httpSubscriptionLink, loggerLink, splitLink, } from "@trpc/client";
|
|
2
|
+
import { EventSource } from "eventsource";
|
|
3
|
+
import superjson from "superjson";
|
|
4
|
+
export const createClient = ({ shedUrl, accessToken, debug = true, }) => {
|
|
5
|
+
const authHeader = { Authorization: `Bearer ${accessToken}` };
|
|
6
|
+
const url = `${shedUrl}/api/trpc`;
|
|
7
|
+
const baseLinkOpts = { url, transformer: superjson };
|
|
8
|
+
return createTRPCClient({
|
|
9
|
+
links: [
|
|
10
|
+
loggerLink({ enabled: (_) => debug }),
|
|
11
|
+
splitLink({
|
|
12
|
+
condition: (op) => op.type === "subscription",
|
|
13
|
+
true: httpSubscriptionLink({
|
|
14
|
+
...baseLinkOpts,
|
|
15
|
+
EventSource,
|
|
16
|
+
eventSourceOptions: {
|
|
17
|
+
fetch: async (url, init) => fetch(url, {
|
|
18
|
+
...init,
|
|
19
|
+
headers: { ...init.headers, ...authHeader },
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
false: httpLink({ ...baseLinkOpts, headers: authHeader }),
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface OrganizationCreateRequest {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface OrganizationResponse {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
external_agent_url: string | null;
|
|
10
|
+
user_count: number;
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UserCreateRequest {
|
|
15
|
+
email: string;
|
|
16
|
+
role: "ADMIN" | "MEMBER";
|
|
17
|
+
organization_id: number;
|
|
18
|
+
}
|
|
19
|
+
export interface UserResponse {
|
|
20
|
+
id: number;
|
|
21
|
+
email: string;
|
|
22
|
+
role: "ADMIN" | "MEMBER";
|
|
23
|
+
organization_id: number;
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ApiKeyCreateRequest {
|
|
28
|
+
user_id: number;
|
|
29
|
+
expires_at?: string | null;
|
|
30
|
+
description?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface ApiKeyCreateResponse {
|
|
33
|
+
id: number;
|
|
34
|
+
key: string;
|
|
35
|
+
key_prefix: string;
|
|
36
|
+
user_id: number;
|
|
37
|
+
organization_id: number;
|
|
38
|
+
expires_at: string | null;
|
|
39
|
+
description: string | null;
|
|
40
|
+
created_at: string;
|
|
41
|
+
updated_at: string;
|
|
42
|
+
}
|
|
43
|
+
export type CreateCollectionResult = {
|
|
44
|
+
collectionId: string;
|
|
45
|
+
error?: never;
|
|
46
|
+
} | {
|
|
47
|
+
collectionId?: never;
|
|
48
|
+
error: string;
|
|
49
|
+
};
|
|
50
|
+
export interface CollectionListItem {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
created_at: string;
|
|
54
|
+
}
|
|
55
|
+
export type ListCollectionsResult = {
|
|
56
|
+
collections: CollectionListItem[];
|
|
57
|
+
error?: never;
|
|
58
|
+
} | {
|
|
59
|
+
collections?: never;
|
|
60
|
+
error: string;
|
|
61
|
+
};
|
|
62
|
+
export type DeleteCollectionResult = {
|
|
63
|
+
success: true;
|
|
64
|
+
error?: never;
|
|
65
|
+
} | {
|
|
66
|
+
success?: never;
|
|
67
|
+
error: string;
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { FileObject } from "@supabase/storage-js";
|
|
2
|
+
export declare const createContext: ({ req }: {
|
|
3
|
+
req: Request;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
user: null;
|
|
6
|
+
token?: never;
|
|
7
|
+
} | {
|
|
8
|
+
user: import("@supabase/supabase-js").User | null;
|
|
9
|
+
token: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export type Context = Awaited<ReturnType<typeof createContext>>;
|
|
12
|
+
export declare const publicProcedure: import("@trpc/server").TRPCProcedureBuilder<{
|
|
13
|
+
user: null;
|
|
14
|
+
token?: never;
|
|
15
|
+
} | {
|
|
16
|
+
user: import("@supabase/supabase-js").User | null;
|
|
17
|
+
token: string | undefined;
|
|
18
|
+
}, object, object, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
19
|
+
export declare const authedProcedure: import("@trpc/server").TRPCProcedureBuilder<{
|
|
20
|
+
user: null;
|
|
21
|
+
token?: never;
|
|
22
|
+
} | {
|
|
23
|
+
user: import("@supabase/supabase-js").User | null;
|
|
24
|
+
token: string | undefined;
|
|
25
|
+
}, object, {}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
26
|
+
export declare const routerBuilder: import("@trpc/server").TRPCRouterBuilder<{
|
|
27
|
+
ctx: {
|
|
28
|
+
user: null;
|
|
29
|
+
token?: never;
|
|
30
|
+
} | {
|
|
31
|
+
user: import("@supabase/supabase-js").User | null;
|
|
32
|
+
token: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
meta: object;
|
|
35
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
36
|
+
transformer: true;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
39
|
+
ctx: {
|
|
40
|
+
user: null;
|
|
41
|
+
token?: never;
|
|
42
|
+
} | {
|
|
43
|
+
user: import("@supabase/supabase-js").User | null;
|
|
44
|
+
token: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
meta: object;
|
|
47
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
48
|
+
transformer: true;
|
|
49
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
50
|
+
greet: import("@trpc/server").TRPCQueryProcedure<{
|
|
51
|
+
input: void;
|
|
52
|
+
output: string;
|
|
53
|
+
meta: object;
|
|
54
|
+
}>;
|
|
55
|
+
listArtifacts: import("@trpc/server").TRPCQueryProcedure<{
|
|
56
|
+
input: {
|
|
57
|
+
key: string;
|
|
58
|
+
recursive?: boolean | undefined;
|
|
59
|
+
kind: "agent" | "user";
|
|
60
|
+
};
|
|
61
|
+
output: FileObject[];
|
|
62
|
+
meta: object;
|
|
63
|
+
}>;
|
|
64
|
+
getArtifactUrl: import("@trpc/server").TRPCQueryProcedure<{
|
|
65
|
+
input: {
|
|
66
|
+
key: string;
|
|
67
|
+
upload?: boolean | undefined;
|
|
68
|
+
kind: "agent" | "user";
|
|
69
|
+
};
|
|
70
|
+
output: string;
|
|
71
|
+
meta: object;
|
|
72
|
+
}>;
|
|
73
|
+
deleteArtifact: import("@trpc/server").TRPCMutationProcedure<{
|
|
74
|
+
input: {
|
|
75
|
+
kind: "agent" | "user";
|
|
76
|
+
key: string;
|
|
77
|
+
};
|
|
78
|
+
output: {
|
|
79
|
+
success: boolean;
|
|
80
|
+
};
|
|
81
|
+
meta: object;
|
|
82
|
+
}>;
|
|
83
|
+
uploadArchive: import("@trpc/server").TRPCMutationProcedure<{
|
|
84
|
+
input: import("@trpc/server/http").OctetInput;
|
|
85
|
+
output: {
|
|
86
|
+
sha256: string;
|
|
87
|
+
cached: boolean;
|
|
88
|
+
};
|
|
89
|
+
meta: object;
|
|
90
|
+
}>;
|
|
91
|
+
deploy: import("@trpc/server").TRPCSubscriptionProcedure<{
|
|
92
|
+
input: {
|
|
93
|
+
sha256: string;
|
|
94
|
+
agent: string;
|
|
95
|
+
shedUrl: string;
|
|
96
|
+
};
|
|
97
|
+
output: AsyncIterable<{
|
|
98
|
+
status: string;
|
|
99
|
+
error?: never;
|
|
100
|
+
} | {
|
|
101
|
+
status?: never;
|
|
102
|
+
error: unknown;
|
|
103
|
+
}, void, any>;
|
|
104
|
+
meta: object;
|
|
105
|
+
}>;
|
|
106
|
+
"library.create": import("@trpc/server").TRPCMutationProcedure<{
|
|
107
|
+
input: {
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
output: {
|
|
111
|
+
collectionId: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
meta: object;
|
|
114
|
+
}>;
|
|
115
|
+
"library.list": import("@trpc/server").TRPCQueryProcedure<{
|
|
116
|
+
input: void;
|
|
117
|
+
output: {
|
|
118
|
+
collections: import("./library-types").CollectionListItem[] | undefined;
|
|
119
|
+
};
|
|
120
|
+
meta: object;
|
|
121
|
+
}>;
|
|
122
|
+
"library.delete": import("@trpc/server").TRPCMutationProcedure<{
|
|
123
|
+
input: {
|
|
124
|
+
id: string;
|
|
125
|
+
};
|
|
126
|
+
output: {
|
|
127
|
+
success: boolean;
|
|
128
|
+
};
|
|
129
|
+
meta: object;
|
|
130
|
+
}>;
|
|
131
|
+
}>>;
|
|
132
|
+
export type AppRouter = typeof router;
|
package/dist/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/apiclient",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"description": "apiclient",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"repository": "github:townco/town",
|
|
10
|
+
"files": ["dist/**/*"],
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"import": "./dist/index.js",
|
package/src/index.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTRPCClient,
|
|
3
|
-
httpLink,
|
|
4
|
-
httpSubscriptionLink,
|
|
5
|
-
loggerLink,
|
|
6
|
-
splitLink,
|
|
7
|
-
} from "@trpc/client";
|
|
8
|
-
import { EventSource } from "eventsource";
|
|
9
|
-
import superjson from "superjson";
|
|
10
|
-
import type { AppRouter } from "./server";
|
|
11
|
-
|
|
12
|
-
export const createClient = ({
|
|
13
|
-
shedUrl,
|
|
14
|
-
accessToken,
|
|
15
|
-
debug = true,
|
|
16
|
-
}: {
|
|
17
|
-
shedUrl: string;
|
|
18
|
-
accessToken: string;
|
|
19
|
-
debug?: boolean;
|
|
20
|
-
}) => {
|
|
21
|
-
const authHeader = { Authorization: `Bearer ${accessToken}` };
|
|
22
|
-
const url = `${shedUrl}/api/trpc`;
|
|
23
|
-
const baseLinkOpts = { url, transformer: superjson };
|
|
24
|
-
|
|
25
|
-
return createTRPCClient<AppRouter>({
|
|
26
|
-
links: [
|
|
27
|
-
loggerLink({ enabled: (_) => debug }),
|
|
28
|
-
splitLink({
|
|
29
|
-
condition: (op) => op.type === "subscription",
|
|
30
|
-
true: httpSubscriptionLink({
|
|
31
|
-
...baseLinkOpts,
|
|
32
|
-
EventSource,
|
|
33
|
-
eventSourceOptions: {
|
|
34
|
-
fetch: async (url, init) =>
|
|
35
|
-
fetch(url, {
|
|
36
|
-
...init,
|
|
37
|
-
headers: { ...init.headers, ...authHeader },
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
false: httpLink({ ...baseLinkOpts, headers: authHeader }),
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
44
|
-
});
|
|
45
|
-
};
|
package/src/library-types.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export interface OrganizationCreateRequest {
|
|
2
|
-
name: string;
|
|
3
|
-
description?: string | null;
|
|
4
|
-
}
|
|
5
|
-
export interface OrganizationResponse {
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
description: string | null;
|
|
9
|
-
external_agent_url: string | null;
|
|
10
|
-
user_count: number;
|
|
11
|
-
created_at: string;
|
|
12
|
-
updated_at: string;
|
|
13
|
-
}
|
|
14
|
-
export interface UserCreateRequest {
|
|
15
|
-
email: string;
|
|
16
|
-
role: "ADMIN" | "MEMBER";
|
|
17
|
-
organization_id: number;
|
|
18
|
-
}
|
|
19
|
-
export interface UserResponse {
|
|
20
|
-
id: number;
|
|
21
|
-
email: string;
|
|
22
|
-
role: "ADMIN" | "MEMBER";
|
|
23
|
-
organization_id: number;
|
|
24
|
-
created_at: string;
|
|
25
|
-
updated_at: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ApiKeyCreateRequest {
|
|
28
|
-
user_id: number;
|
|
29
|
-
expires_at?: string | null;
|
|
30
|
-
description?: string | null;
|
|
31
|
-
}
|
|
32
|
-
export interface ApiKeyCreateResponse {
|
|
33
|
-
id: number;
|
|
34
|
-
key: string;
|
|
35
|
-
key_prefix: string;
|
|
36
|
-
user_id: number;
|
|
37
|
-
organization_id: number;
|
|
38
|
-
expires_at: string | null;
|
|
39
|
-
description: string | null;
|
|
40
|
-
created_at: string;
|
|
41
|
-
updated_at: string;
|
|
42
|
-
}
|
|
43
|
-
export type CreateCollectionResult =
|
|
44
|
-
| {
|
|
45
|
-
collectionId: string;
|
|
46
|
-
error?: never;
|
|
47
|
-
}
|
|
48
|
-
| {
|
|
49
|
-
collectionId?: never;
|
|
50
|
-
error: string;
|
|
51
|
-
};
|
|
52
|
-
export interface CollectionListItem {
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
created_at: string;
|
|
56
|
-
}
|
|
57
|
-
export type ListCollectionsResult =
|
|
58
|
-
| {
|
|
59
|
-
collections: CollectionListItem[];
|
|
60
|
-
error?: never;
|
|
61
|
-
}
|
|
62
|
-
| {
|
|
63
|
-
collections?: never;
|
|
64
|
-
error: string;
|
|
65
|
-
};
|
|
66
|
-
export type DeleteCollectionResult =
|
|
67
|
-
| {
|
|
68
|
-
success: true;
|
|
69
|
-
error?: never;
|
|
70
|
-
}
|
|
71
|
-
| {
|
|
72
|
-
success?: never;
|
|
73
|
-
error: string;
|
|
74
|
-
};
|
package/src/server.ts
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import type { FileObject } from "@supabase/storage-js";
|
|
2
|
-
export declare const createContext: ({ req }: { req: Request }) => Promise<
|
|
3
|
-
| {
|
|
4
|
-
user: null;
|
|
5
|
-
token?: never;
|
|
6
|
-
}
|
|
7
|
-
| {
|
|
8
|
-
user: import("@supabase/supabase-js").User | null;
|
|
9
|
-
token: string | undefined;
|
|
10
|
-
}
|
|
11
|
-
>;
|
|
12
|
-
export type Context = Awaited<ReturnType<typeof createContext>>;
|
|
13
|
-
export declare const publicProcedure: import("@trpc/server").TRPCProcedureBuilder<
|
|
14
|
-
| {
|
|
15
|
-
user: null;
|
|
16
|
-
token?: never;
|
|
17
|
-
}
|
|
18
|
-
| {
|
|
19
|
-
user: import("@supabase/supabase-js").User | null;
|
|
20
|
-
token: string | undefined;
|
|
21
|
-
},
|
|
22
|
-
object,
|
|
23
|
-
object,
|
|
24
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
25
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
26
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
27
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
28
|
-
false
|
|
29
|
-
>;
|
|
30
|
-
export declare const authedProcedure: import("@trpc/server").TRPCProcedureBuilder<
|
|
31
|
-
| {
|
|
32
|
-
user: null;
|
|
33
|
-
token?: never;
|
|
34
|
-
}
|
|
35
|
-
| {
|
|
36
|
-
user: import("@supabase/supabase-js").User | null;
|
|
37
|
-
token: string | undefined;
|
|
38
|
-
},
|
|
39
|
-
object,
|
|
40
|
-
{},
|
|
41
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
42
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
43
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
44
|
-
import("@trpc/server").TRPCUnsetMarker,
|
|
45
|
-
false
|
|
46
|
-
>;
|
|
47
|
-
export declare const routerBuilder: import("@trpc/server").TRPCRouterBuilder<{
|
|
48
|
-
ctx:
|
|
49
|
-
| {
|
|
50
|
-
user: null;
|
|
51
|
-
token?: never;
|
|
52
|
-
}
|
|
53
|
-
| {
|
|
54
|
-
user: import("@supabase/supabase-js").User | null;
|
|
55
|
-
token: string | undefined;
|
|
56
|
-
};
|
|
57
|
-
meta: object;
|
|
58
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
59
|
-
transformer: true;
|
|
60
|
-
}>;
|
|
61
|
-
export declare const router: import("@trpc/server").TRPCBuiltRouter<
|
|
62
|
-
{
|
|
63
|
-
ctx:
|
|
64
|
-
| {
|
|
65
|
-
user: null;
|
|
66
|
-
token?: never;
|
|
67
|
-
}
|
|
68
|
-
| {
|
|
69
|
-
user: import("@supabase/supabase-js").User | null;
|
|
70
|
-
token: string | undefined;
|
|
71
|
-
};
|
|
72
|
-
meta: object;
|
|
73
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
74
|
-
transformer: true;
|
|
75
|
-
},
|
|
76
|
-
import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
77
|
-
greet: import("@trpc/server").TRPCQueryProcedure<{
|
|
78
|
-
input: void;
|
|
79
|
-
output: string;
|
|
80
|
-
meta: object;
|
|
81
|
-
}>;
|
|
82
|
-
listArtifacts: import("@trpc/server").TRPCQueryProcedure<{
|
|
83
|
-
input: {
|
|
84
|
-
key: string;
|
|
85
|
-
recursive?: boolean | undefined;
|
|
86
|
-
kind: "agent" | "user";
|
|
87
|
-
};
|
|
88
|
-
output: FileObject[];
|
|
89
|
-
meta: object;
|
|
90
|
-
}>;
|
|
91
|
-
getArtifactUrl: import("@trpc/server").TRPCQueryProcedure<{
|
|
92
|
-
input: {
|
|
93
|
-
key: string;
|
|
94
|
-
upload?: boolean | undefined;
|
|
95
|
-
kind: "agent" | "user";
|
|
96
|
-
};
|
|
97
|
-
output: string;
|
|
98
|
-
meta: object;
|
|
99
|
-
}>;
|
|
100
|
-
deleteArtifact: import("@trpc/server").TRPCMutationProcedure<{
|
|
101
|
-
input: {
|
|
102
|
-
kind: "agent" | "user";
|
|
103
|
-
key: string;
|
|
104
|
-
};
|
|
105
|
-
output: {
|
|
106
|
-
success: boolean;
|
|
107
|
-
};
|
|
108
|
-
meta: object;
|
|
109
|
-
}>;
|
|
110
|
-
uploadArchive: import("@trpc/server").TRPCMutationProcedure<{
|
|
111
|
-
input: import("@trpc/server/http").OctetInput;
|
|
112
|
-
output: {
|
|
113
|
-
sha256: string;
|
|
114
|
-
cached: boolean;
|
|
115
|
-
};
|
|
116
|
-
meta: object;
|
|
117
|
-
}>;
|
|
118
|
-
deploy: import("@trpc/server").TRPCSubscriptionProcedure<{
|
|
119
|
-
input: {
|
|
120
|
-
sha256: string;
|
|
121
|
-
agent: string;
|
|
122
|
-
shedUrl: string;
|
|
123
|
-
};
|
|
124
|
-
output: AsyncIterable<
|
|
125
|
-
| {
|
|
126
|
-
status: string;
|
|
127
|
-
error?: never;
|
|
128
|
-
}
|
|
129
|
-
| {
|
|
130
|
-
status?: never;
|
|
131
|
-
error: unknown;
|
|
132
|
-
},
|
|
133
|
-
void,
|
|
134
|
-
any
|
|
135
|
-
>;
|
|
136
|
-
meta: object;
|
|
137
|
-
}>;
|
|
138
|
-
"library.create": import("@trpc/server").TRPCMutationProcedure<{
|
|
139
|
-
input: {
|
|
140
|
-
name: string;
|
|
141
|
-
};
|
|
142
|
-
output: {
|
|
143
|
-
collectionId: string | undefined;
|
|
144
|
-
};
|
|
145
|
-
meta: object;
|
|
146
|
-
}>;
|
|
147
|
-
"library.list": import("@trpc/server").TRPCQueryProcedure<{
|
|
148
|
-
input: void;
|
|
149
|
-
output: {
|
|
150
|
-
collections: import("./library-types").CollectionListItem[] | undefined;
|
|
151
|
-
};
|
|
152
|
-
meta: object;
|
|
153
|
-
}>;
|
|
154
|
-
"library.delete": import("@trpc/server").TRPCMutationProcedure<{
|
|
155
|
-
input: {
|
|
156
|
-
id: string;
|
|
157
|
-
};
|
|
158
|
-
output: {
|
|
159
|
-
success: boolean;
|
|
160
|
-
};
|
|
161
|
-
meta: object;
|
|
162
|
-
}>;
|
|
163
|
-
}>
|
|
164
|
-
>;
|
|
165
|
-
export type AppRouter = typeof router;
|
package/tsconfig.json
DELETED
package/turbo.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://turbo.build/schema.json",
|
|
3
|
-
"extends": ["//"],
|
|
4
|
-
"tasks": {
|
|
5
|
-
"build": {
|
|
6
|
-
"dependsOn": ["//#shed:texport"],
|
|
7
|
-
"inputs": [
|
|
8
|
-
"src/**",
|
|
9
|
-
"!src/server.ts",
|
|
10
|
-
"!src/library-types.ts",
|
|
11
|
-
"package.json",
|
|
12
|
-
"tsconfig.json"
|
|
13
|
-
],
|
|
14
|
-
"outputs": ["dist/**"]
|
|
15
|
-
},
|
|
16
|
-
"check": { "dependsOn": ["//#shed:texport"] }
|
|
17
|
-
}
|
|
18
|
-
}
|