@offworld/backend-api 0.1.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/__tests__/push-validation.test.d.ts +1 -0
- package/dist/__tests__/references.test.d.ts +1 -0
- package/dist/_generated/api.d.ts +65 -0
- package/dist/_generated/api.js +23 -0
- package/dist/_generated/dataModel.d.ts +60 -0
- package/dist/_generated/server.d.ts +143 -0
- package/dist/_generated/server.js +93 -0
- package/dist/admin.d.ts +26 -0
- package/dist/auth.config.d.ts +16 -0
- package/dist/auth.d.ts +39 -0
- package/dist/convex.config.d.ts +3 -0
- package/dist/github.d.ts +36 -0
- package/dist/healthCheck.d.ts +2 -0
- package/dist/http.d.ts +2 -0
- package/dist/references.d.ts +154 -0
- package/dist/repository.d.ts +93 -0
- package/dist/schema.d.ts +94 -0
- package/dist/validation/github.d.ts +19 -0
- package/dist/validation/push.d.ts +36 -0
- package/dist/validation/referenceContent.d.ts +7 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type * as admin from "../admin.js";
|
|
12
|
+
import type * as auth from "../auth.js";
|
|
13
|
+
import type * as github from "../github.js";
|
|
14
|
+
import type * as http from "../http.js";
|
|
15
|
+
import type * as references from "../references.js";
|
|
16
|
+
import type * as repository from "../repository.js";
|
|
17
|
+
import type * as validation_github from "../validation/github.js";
|
|
18
|
+
import type * as validation_push from "../validation/push.js";
|
|
19
|
+
import type * as validation_referenceContent from "../validation/referenceContent.js";
|
|
20
|
+
|
|
21
|
+
import type {
|
|
22
|
+
ApiFromModules,
|
|
23
|
+
FilterApi,
|
|
24
|
+
FunctionReference,
|
|
25
|
+
} from "convex/server";
|
|
26
|
+
|
|
27
|
+
declare const fullApi: ApiFromModules<{
|
|
28
|
+
admin: typeof admin;
|
|
29
|
+
auth: typeof auth;
|
|
30
|
+
github: typeof github;
|
|
31
|
+
http: typeof http;
|
|
32
|
+
references: typeof references;
|
|
33
|
+
repository: typeof repository;
|
|
34
|
+
"validation/github": typeof validation_github;
|
|
35
|
+
"validation/push": typeof validation_push;
|
|
36
|
+
"validation/referenceContent": typeof validation_referenceContent;
|
|
37
|
+
}>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
41
|
+
*
|
|
42
|
+
* Usage:
|
|
43
|
+
* ```js
|
|
44
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const api: FilterApi<
|
|
48
|
+
typeof fullApi,
|
|
49
|
+
FunctionReference<any, "public">
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
54
|
+
*
|
|
55
|
+
* Usage:
|
|
56
|
+
* ```js
|
|
57
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const internal: FilterApi<
|
|
61
|
+
typeof fullApi,
|
|
62
|
+
FunctionReference<any, "internal">
|
|
63
|
+
>;
|
|
64
|
+
|
|
65
|
+
export declare const components: {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing Convex functions in your app's API.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```js
|
|
18
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const api = anyApi;
|
|
22
|
+
export const internal = anyApi;
|
|
23
|
+
export const components = componentsGeneric();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated data model types.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
DataModelFromSchemaDefinition,
|
|
13
|
+
DocumentByName,
|
|
14
|
+
TableNamesInDataModel,
|
|
15
|
+
SystemTableNames,
|
|
16
|
+
} from "convex/server";
|
|
17
|
+
import type { GenericId } from "convex/values";
|
|
18
|
+
import schema from "../schema.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The names of all of your Convex tables.
|
|
22
|
+
*/
|
|
23
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The type of a document stored in Convex.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
29
|
+
*/
|
|
30
|
+
export type Doc<TableName extends TableNames> = DocumentByName<
|
|
31
|
+
DataModel,
|
|
32
|
+
TableName
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An identifier for a document in Convex.
|
|
37
|
+
*
|
|
38
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
39
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
40
|
+
*
|
|
41
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
42
|
+
*
|
|
43
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
44
|
+
* strings when type checking.
|
|
45
|
+
*
|
|
46
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
47
|
+
*/
|
|
48
|
+
export type Id<TableName extends TableNames | SystemTableNames> =
|
|
49
|
+
GenericId<TableName>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A type describing your Convex data model.
|
|
53
|
+
*
|
|
54
|
+
* This type includes information about what tables you have, the type of
|
|
55
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
56
|
+
*
|
|
57
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
58
|
+
* `mutationGeneric` to make them type-safe.
|
|
59
|
+
*/
|
|
60
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
ActionBuilder,
|
|
13
|
+
HttpActionBuilder,
|
|
14
|
+
MutationBuilder,
|
|
15
|
+
QueryBuilder,
|
|
16
|
+
GenericActionCtx,
|
|
17
|
+
GenericMutationCtx,
|
|
18
|
+
GenericQueryCtx,
|
|
19
|
+
GenericDatabaseReader,
|
|
20
|
+
GenericDatabaseWriter,
|
|
21
|
+
} from "convex/server";
|
|
22
|
+
import type { DataModel } from "./dataModel.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Define a query in this Convex app's public API.
|
|
26
|
+
*
|
|
27
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
28
|
+
*
|
|
29
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
30
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
31
|
+
*/
|
|
32
|
+
export declare const query: QueryBuilder<DataModel, "public">;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
36
|
+
*
|
|
37
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
38
|
+
*
|
|
39
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
40
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
41
|
+
*/
|
|
42
|
+
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Define a mutation in this Convex app's public API.
|
|
46
|
+
*
|
|
47
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
48
|
+
*
|
|
49
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
50
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
51
|
+
*/
|
|
52
|
+
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
56
|
+
*
|
|
57
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
58
|
+
*
|
|
59
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
60
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
61
|
+
*/
|
|
62
|
+
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Define an action in this Convex app's public API.
|
|
66
|
+
*
|
|
67
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
68
|
+
* code and code with side-effects, like calling third-party services.
|
|
69
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
70
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
71
|
+
*
|
|
72
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
73
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
74
|
+
*/
|
|
75
|
+
export declare const action: ActionBuilder<DataModel, "public">;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
79
|
+
*
|
|
80
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
81
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
82
|
+
*/
|
|
83
|
+
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Define an HTTP action.
|
|
87
|
+
*
|
|
88
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
89
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
90
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
91
|
+
*
|
|
92
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
93
|
+
* and a Fetch API `Request` object as its second.
|
|
94
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
95
|
+
*/
|
|
96
|
+
export declare const httpAction: HttpActionBuilder;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A set of services for use within Convex query functions.
|
|
100
|
+
*
|
|
101
|
+
* The query context is passed as the first argument to any Convex query
|
|
102
|
+
* function run on the server.
|
|
103
|
+
*
|
|
104
|
+
* This differs from the {@link MutationCtx} because all of the services are
|
|
105
|
+
* read-only.
|
|
106
|
+
*/
|
|
107
|
+
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A set of services for use within Convex mutation functions.
|
|
111
|
+
*
|
|
112
|
+
* The mutation context is passed as the first argument to any Convex mutation
|
|
113
|
+
* function run on the server.
|
|
114
|
+
*/
|
|
115
|
+
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* A set of services for use within Convex action functions.
|
|
119
|
+
*
|
|
120
|
+
* The action context is passed as the first argument to any Convex action
|
|
121
|
+
* function run on the server.
|
|
122
|
+
*/
|
|
123
|
+
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* An interface to read from the database within Convex query functions.
|
|
127
|
+
*
|
|
128
|
+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
129
|
+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
130
|
+
* building a query.
|
|
131
|
+
*/
|
|
132
|
+
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* An interface to read from and write to the database within Convex mutation
|
|
136
|
+
* functions.
|
|
137
|
+
*
|
|
138
|
+
* Convex guarantees that all writes within a single mutation are
|
|
139
|
+
* executed atomically, so you never have to worry about partial writes leaving
|
|
140
|
+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
141
|
+
* for the guarantees Convex provides your functions.
|
|
142
|
+
*/
|
|
143
|
+
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
actionGeneric,
|
|
13
|
+
httpActionGeneric,
|
|
14
|
+
queryGeneric,
|
|
15
|
+
mutationGeneric,
|
|
16
|
+
internalActionGeneric,
|
|
17
|
+
internalMutationGeneric,
|
|
18
|
+
internalQueryGeneric,
|
|
19
|
+
} from "convex/server";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Define a query in this Convex app's public API.
|
|
23
|
+
*
|
|
24
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
25
|
+
*
|
|
26
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
27
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
28
|
+
*/
|
|
29
|
+
export const query = queryGeneric;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
33
|
+
*
|
|
34
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
35
|
+
*
|
|
36
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
37
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
38
|
+
*/
|
|
39
|
+
export const internalQuery = internalQueryGeneric;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Define a mutation in this Convex app's public API.
|
|
43
|
+
*
|
|
44
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
45
|
+
*
|
|
46
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
47
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
48
|
+
*/
|
|
49
|
+
export const mutation = mutationGeneric;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
53
|
+
*
|
|
54
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
55
|
+
*
|
|
56
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
57
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
58
|
+
*/
|
|
59
|
+
export const internalMutation = internalMutationGeneric;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Define an action in this Convex app's public API.
|
|
63
|
+
*
|
|
64
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
65
|
+
* code and code with side-effects, like calling third-party services.
|
|
66
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
67
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
68
|
+
*
|
|
69
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
70
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
71
|
+
*/
|
|
72
|
+
export const action = actionGeneric;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
76
|
+
*
|
|
77
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
78
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
79
|
+
*/
|
|
80
|
+
export const internalAction = internalActionGeneric;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Define an HTTP action.
|
|
84
|
+
*
|
|
85
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
86
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
87
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
88
|
+
*
|
|
89
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
90
|
+
* and a Fetch API `Request` object as its second.
|
|
91
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
92
|
+
*/
|
|
93
|
+
export const httpAction = httpActionGeneric;
|
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const listAllReferences: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
2
|
+
_id: import("convex/values").GenericId<"reference">;
|
|
3
|
+
fullName: string;
|
|
4
|
+
pullCount: number;
|
|
5
|
+
generatedAt: string;
|
|
6
|
+
commitSha: string;
|
|
7
|
+
isVerified: boolean;
|
|
8
|
+
}[]>>;
|
|
9
|
+
export declare const listAllUsers: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
10
|
+
_id: import("convex/values").GenericId<"user">;
|
|
11
|
+
email: string;
|
|
12
|
+
name: string | undefined;
|
|
13
|
+
image: string | undefined;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
}[]>>;
|
|
16
|
+
export declare const deleteReference: import("convex/server").RegisteredMutation<"public", {
|
|
17
|
+
fullName: string;
|
|
18
|
+
}, Promise<{
|
|
19
|
+
success: boolean;
|
|
20
|
+
}>>;
|
|
21
|
+
export declare const toggleVerified: import("convex/server").RegisteredMutation<"public", {
|
|
22
|
+
fullName: string;
|
|
23
|
+
}, Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
isVerified: boolean;
|
|
26
|
+
}>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
providers: ({
|
|
3
|
+
type: "customJwt";
|
|
4
|
+
issuer: string;
|
|
5
|
+
algorithm: "RS256";
|
|
6
|
+
jwks: string;
|
|
7
|
+
applicationID: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: "customJwt";
|
|
10
|
+
issuer: string;
|
|
11
|
+
algorithm: "RS256";
|
|
12
|
+
jwks: string;
|
|
13
|
+
applicationID?: undefined;
|
|
14
|
+
})[];
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type QueryCtx, type MutationCtx } from "./_generated/server";
|
|
2
|
+
export declare function getAuthUser(ctx: QueryCtx | MutationCtx): Promise<{
|
|
3
|
+
_id: import("convex/values").GenericId<"user">;
|
|
4
|
+
_creationTime: number;
|
|
5
|
+
name?: string | undefined;
|
|
6
|
+
image?: string | undefined;
|
|
7
|
+
workosId: string;
|
|
8
|
+
email: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
} | null>;
|
|
11
|
+
export declare const ensureUser: import("convex/server").RegisteredMutation<"public", {}, Promise<import("convex/values").GenericId<"user">>>;
|
|
12
|
+
export declare const getCurrentUser: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
13
|
+
_id: import("convex/values").GenericId<"user">;
|
|
14
|
+
_creationTime: number;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
image?: string | undefined;
|
|
17
|
+
workosId: string;
|
|
18
|
+
email: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
} | null>>;
|
|
21
|
+
export declare const getCurrentUserSafe: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
22
|
+
_id: import("convex/values").GenericId<"user">;
|
|
23
|
+
_creationTime: number;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
image?: string | undefined;
|
|
26
|
+
workosId: string;
|
|
27
|
+
email: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
} | null>>;
|
|
30
|
+
export declare function requireAdmin(ctx: QueryCtx | MutationCtx): Promise<{
|
|
31
|
+
_id: import("convex/values").GenericId<"user">;
|
|
32
|
+
_creationTime: number;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
image?: string | undefined;
|
|
35
|
+
workosId: string;
|
|
36
|
+
email: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const isAdmin: import("convex/server").RegisteredQuery<"public", {}, Promise<boolean>>;
|
package/dist/github.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const fetchRepoMetadata: import("convex/server").RegisteredAction<"public", {
|
|
2
|
+
owner: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}, Promise<{
|
|
5
|
+
owner: string;
|
|
6
|
+
name: string;
|
|
7
|
+
fullName: string;
|
|
8
|
+
description: string | undefined;
|
|
9
|
+
stars: number;
|
|
10
|
+
language: string | undefined;
|
|
11
|
+
githubUrl: string;
|
|
12
|
+
defaultBranch: string;
|
|
13
|
+
} | null>>;
|
|
14
|
+
export declare const fetchOwnerInfo: import("convex/server").RegisteredAction<"public", {
|
|
15
|
+
owner: string;
|
|
16
|
+
}, Promise<{
|
|
17
|
+
login: string;
|
|
18
|
+
name: string;
|
|
19
|
+
avatarUrl: string;
|
|
20
|
+
bio: string | undefined;
|
|
21
|
+
type: "user" | "organization";
|
|
22
|
+
publicRepos: number;
|
|
23
|
+
followers: number;
|
|
24
|
+
htmlUrl: string;
|
|
25
|
+
} | null>>;
|
|
26
|
+
export declare const fetchOwnerRepos: import("convex/server").RegisteredAction<"public", {
|
|
27
|
+
perPage?: number | undefined;
|
|
28
|
+
owner: string;
|
|
29
|
+
}, Promise<{
|
|
30
|
+
owner: string;
|
|
31
|
+
name: string;
|
|
32
|
+
fullName: string;
|
|
33
|
+
description: string | undefined;
|
|
34
|
+
stars: number;
|
|
35
|
+
language: string | undefined;
|
|
36
|
+
}[] | null>>;
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference Convex Functions
|
|
3
|
+
* Public queries/mutations for CLI and web app
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get reference by repository fullName (public)
|
|
7
|
+
* Display reference on web
|
|
8
|
+
*/
|
|
9
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
10
|
+
fullName: string;
|
|
11
|
+
}, Promise<{
|
|
12
|
+
_id: import("convex/values").GenericId<"reference">;
|
|
13
|
+
_creationTime: number;
|
|
14
|
+
workosId?: string | undefined;
|
|
15
|
+
repositoryId: import("convex/values").GenericId<"repository">;
|
|
16
|
+
referenceName: string;
|
|
17
|
+
referenceDescription: string;
|
|
18
|
+
referenceContent: string;
|
|
19
|
+
commitSha: string;
|
|
20
|
+
generatedAt: string;
|
|
21
|
+
pullCount: number;
|
|
22
|
+
isVerified: boolean;
|
|
23
|
+
} | null>>;
|
|
24
|
+
/**
|
|
25
|
+
* Get reference by repository fullName + referenceName (public)
|
|
26
|
+
* Display specific reference on web
|
|
27
|
+
*/
|
|
28
|
+
export declare const getByName: import("convex/server").RegisteredQuery<"public", {
|
|
29
|
+
fullName: string;
|
|
30
|
+
referenceName: string;
|
|
31
|
+
}, Promise<{
|
|
32
|
+
_id: import("convex/values").GenericId<"reference">;
|
|
33
|
+
_creationTime: number;
|
|
34
|
+
workosId?: string | undefined;
|
|
35
|
+
repositoryId: import("convex/values").GenericId<"repository">;
|
|
36
|
+
referenceName: string;
|
|
37
|
+
referenceDescription: string;
|
|
38
|
+
referenceContent: string;
|
|
39
|
+
commitSha: string;
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
pullCount: number;
|
|
42
|
+
isVerified: boolean;
|
|
43
|
+
} | null>>;
|
|
44
|
+
/**
|
|
45
|
+
* List all references for a repository (public)
|
|
46
|
+
*/
|
|
47
|
+
export declare const listByRepo: import("convex/server").RegisteredQuery<"public", {
|
|
48
|
+
fullName: string;
|
|
49
|
+
}, Promise<{
|
|
50
|
+
referenceName: string;
|
|
51
|
+
referenceDescription: string;
|
|
52
|
+
generatedAt: string;
|
|
53
|
+
commitSha: string;
|
|
54
|
+
pullCount: number;
|
|
55
|
+
isVerified: boolean;
|
|
56
|
+
}[]>>;
|
|
57
|
+
/**
|
|
58
|
+
* List all references sorted by pull count (public)
|
|
59
|
+
* Repo directory/explore page
|
|
60
|
+
*/
|
|
61
|
+
export declare const list: import("convex/server").RegisteredQuery<"public", {
|
|
62
|
+
limit?: number | undefined;
|
|
63
|
+
cursor?: string | undefined;
|
|
64
|
+
}, Promise<{
|
|
65
|
+
fullName: string;
|
|
66
|
+
pullCount: number;
|
|
67
|
+
generatedAt: string;
|
|
68
|
+
commitSha: string;
|
|
69
|
+
isVerified: boolean;
|
|
70
|
+
}[]>>;
|
|
71
|
+
/**
|
|
72
|
+
* List references pushed by the current user
|
|
73
|
+
*/
|
|
74
|
+
export declare const listByCurrentUser: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
75
|
+
fullName: string;
|
|
76
|
+
owner: string;
|
|
77
|
+
name: string;
|
|
78
|
+
referenceName: string;
|
|
79
|
+
referenceDescription: string;
|
|
80
|
+
pullCount: number;
|
|
81
|
+
generatedAt: string;
|
|
82
|
+
commitSha: string;
|
|
83
|
+
isVerified: boolean;
|
|
84
|
+
}[]>>;
|
|
85
|
+
/**
|
|
86
|
+
* Fetch reference for CLI pull (no pull count tracking)
|
|
87
|
+
*/
|
|
88
|
+
export declare const pull: import("convex/server").RegisteredQuery<"public", {
|
|
89
|
+
referenceName?: string | undefined;
|
|
90
|
+
fullName: string;
|
|
91
|
+
}, Promise<{
|
|
92
|
+
fullName: string;
|
|
93
|
+
referenceName: string;
|
|
94
|
+
referenceDescription: string;
|
|
95
|
+
referenceContent: string;
|
|
96
|
+
commitSha: string;
|
|
97
|
+
generatedAt: string;
|
|
98
|
+
} | null>>;
|
|
99
|
+
/**
|
|
100
|
+
* Lightweight existence check for CLI
|
|
101
|
+
*/
|
|
102
|
+
export declare const check: import("convex/server").RegisteredQuery<"public", {
|
|
103
|
+
referenceName?: string | undefined;
|
|
104
|
+
fullName: string;
|
|
105
|
+
}, Promise<{
|
|
106
|
+
exists: false;
|
|
107
|
+
commitSha?: undefined;
|
|
108
|
+
generatedAt?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
exists: true;
|
|
111
|
+
commitSha: string;
|
|
112
|
+
generatedAt: string;
|
|
113
|
+
}>>;
|
|
114
|
+
export type PushError = "auth_required" | "invalid_input" | "invalid_reference" | "repo_not_found" | "low_stars" | "private_repo" | "commit_not_found" | "commit_already_exists" | "rate_limit" | "github_error";
|
|
115
|
+
export type PushResult = {
|
|
116
|
+
success: true;
|
|
117
|
+
} | {
|
|
118
|
+
success: false;
|
|
119
|
+
error: PushError;
|
|
120
|
+
message?: string;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Push reference - public action with full validation
|
|
124
|
+
*/
|
|
125
|
+
export declare const push: import("convex/server").RegisteredAction<"public", {
|
|
126
|
+
fullName: string;
|
|
127
|
+
referenceName: string;
|
|
128
|
+
referenceDescription: string;
|
|
129
|
+
referenceContent: string;
|
|
130
|
+
commitSha: string;
|
|
131
|
+
generatedAt: string;
|
|
132
|
+
}, Promise<PushResult>>;
|
|
133
|
+
/**
|
|
134
|
+
* Internal mutation - DB operations only, not directly callable
|
|
135
|
+
*/
|
|
136
|
+
export declare const pushInternal: import("convex/server").RegisteredMutation<"internal", {
|
|
137
|
+
canonicalFullName?: string | undefined;
|
|
138
|
+
repoStars?: number | undefined;
|
|
139
|
+
repoDescription?: string | undefined;
|
|
140
|
+
fullName: string;
|
|
141
|
+
referenceName: string;
|
|
142
|
+
referenceDescription: string;
|
|
143
|
+
referenceContent: string;
|
|
144
|
+
commitSha: string;
|
|
145
|
+
generatedAt: string;
|
|
146
|
+
workosId: string;
|
|
147
|
+
}, Promise<PushResult>>;
|
|
148
|
+
/**
|
|
149
|
+
* Record a pull event - increments pullCount for display on repo pages
|
|
150
|
+
*/
|
|
151
|
+
export declare const recordPull: import("convex/server").RegisteredMutation<"public", {
|
|
152
|
+
referenceName?: string | undefined;
|
|
153
|
+
fullName: string;
|
|
154
|
+
}, Promise<void>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository Convex Functions
|
|
3
|
+
* Queries for GitHub repository metadata
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get repository by fullName
|
|
7
|
+
*/
|
|
8
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
9
|
+
fullName: string;
|
|
10
|
+
}, Promise<{
|
|
11
|
+
_id: import("convex/values").GenericId<"repository">;
|
|
12
|
+
_creationTime: number;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
language?: string | undefined;
|
|
15
|
+
fullName: string;
|
|
16
|
+
fullNameLower: string;
|
|
17
|
+
owner: string;
|
|
18
|
+
name: string;
|
|
19
|
+
stars: number;
|
|
20
|
+
defaultBranch: string;
|
|
21
|
+
githubUrl: string;
|
|
22
|
+
fetchedAt: string;
|
|
23
|
+
} | null>>;
|
|
24
|
+
/**
|
|
25
|
+
* List repositories by owner
|
|
26
|
+
*/
|
|
27
|
+
export declare const listByOwner: import("convex/server").RegisteredQuery<"public", {
|
|
28
|
+
owner: string;
|
|
29
|
+
}, Promise<{
|
|
30
|
+
_id: import("convex/values").GenericId<"repository">;
|
|
31
|
+
_creationTime: number;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
language?: string | undefined;
|
|
34
|
+
fullName: string;
|
|
35
|
+
fullNameLower: string;
|
|
36
|
+
owner: string;
|
|
37
|
+
name: string;
|
|
38
|
+
stars: number;
|
|
39
|
+
defaultBranch: string;
|
|
40
|
+
githubUrl: string;
|
|
41
|
+
fetchedAt: string;
|
|
42
|
+
}[]>>;
|
|
43
|
+
/**
|
|
44
|
+
* List repositories sorted by stars (for explore page)
|
|
45
|
+
*/
|
|
46
|
+
export declare const list: import("convex/server").RegisteredQuery<"public", {
|
|
47
|
+
limit?: number | undefined;
|
|
48
|
+
}, Promise<{
|
|
49
|
+
_id: import("convex/values").GenericId<"repository">;
|
|
50
|
+
_creationTime: number;
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
language?: string | undefined;
|
|
53
|
+
fullName: string;
|
|
54
|
+
fullNameLower: string;
|
|
55
|
+
owner: string;
|
|
56
|
+
name: string;
|
|
57
|
+
stars: number;
|
|
58
|
+
defaultBranch: string;
|
|
59
|
+
githubUrl: string;
|
|
60
|
+
fetchedAt: string;
|
|
61
|
+
}[]>>;
|
|
62
|
+
/**
|
|
63
|
+
* List recently indexed repositories (for homepage carousel)
|
|
64
|
+
*/
|
|
65
|
+
export declare const listRecent: import("convex/server").RegisteredQuery<"public", {
|
|
66
|
+
limit?: number | undefined;
|
|
67
|
+
}, Promise<{
|
|
68
|
+
_id: import("convex/values").GenericId<"repository">;
|
|
69
|
+
_creationTime: number;
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
language?: string | undefined;
|
|
72
|
+
fullName: string;
|
|
73
|
+
fullNameLower: string;
|
|
74
|
+
owner: string;
|
|
75
|
+
name: string;
|
|
76
|
+
stars: number;
|
|
77
|
+
defaultBranch: string;
|
|
78
|
+
githubUrl: string;
|
|
79
|
+
fetchedAt: string;
|
|
80
|
+
}[]>>;
|
|
81
|
+
/**
|
|
82
|
+
* Upsert repository (internal - called after fetching from GitHub)
|
|
83
|
+
*/
|
|
84
|
+
export declare const upsert: import("convex/server").RegisteredMutation<"internal", {
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
language?: string | undefined;
|
|
87
|
+
fullName: string;
|
|
88
|
+
owner: string;
|
|
89
|
+
name: string;
|
|
90
|
+
stars: number;
|
|
91
|
+
defaultBranch: string;
|
|
92
|
+
githubUrl: string;
|
|
93
|
+
}, Promise<import("convex/values").GenericId<"repository">>>;
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offworld Backend Schema
|
|
3
|
+
* Convex schema for reference storage
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: import("convex/server").SchemaDefinition<{
|
|
6
|
+
repository: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
language?: string | undefined;
|
|
9
|
+
fullName: string;
|
|
10
|
+
fullNameLower: string;
|
|
11
|
+
owner: string;
|
|
12
|
+
name: string;
|
|
13
|
+
stars: number;
|
|
14
|
+
defaultBranch: string;
|
|
15
|
+
githubUrl: string;
|
|
16
|
+
fetchedAt: string;
|
|
17
|
+
}, {
|
|
18
|
+
fullName: import("convex/values").VString<string, "required">;
|
|
19
|
+
fullNameLower: import("convex/values").VString<string, "required">;
|
|
20
|
+
owner: import("convex/values").VString<string, "required">;
|
|
21
|
+
name: import("convex/values").VString<string, "required">;
|
|
22
|
+
description: import("convex/values").VString<string | undefined, "optional">;
|
|
23
|
+
stars: import("convex/values").VFloat64<number, "required">;
|
|
24
|
+
language: import("convex/values").VString<string | undefined, "optional">;
|
|
25
|
+
defaultBranch: import("convex/values").VString<string, "required">;
|
|
26
|
+
githubUrl: import("convex/values").VString<string, "required">;
|
|
27
|
+
fetchedAt: import("convex/values").VString<string, "required">;
|
|
28
|
+
}, "required", "fullName" | "fullNameLower" | "owner" | "name" | "description" | "stars" | "language" | "defaultBranch" | "githubUrl" | "fetchedAt">, {
|
|
29
|
+
by_fullName: ["fullName", "_creationTime"];
|
|
30
|
+
by_fullNameLower: ["fullNameLower", "_creationTime"];
|
|
31
|
+
by_owner: ["owner", "_creationTime"];
|
|
32
|
+
by_stars: ["stars", "_creationTime"];
|
|
33
|
+
by_fetchedAt: ["fetchedAt", "_creationTime"];
|
|
34
|
+
}, {}, {}>;
|
|
35
|
+
reference: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
36
|
+
workosId?: string | undefined;
|
|
37
|
+
repositoryId: import("convex/values").GenericId<"repository">;
|
|
38
|
+
referenceName: string;
|
|
39
|
+
referenceDescription: string;
|
|
40
|
+
referenceContent: string;
|
|
41
|
+
commitSha: string;
|
|
42
|
+
generatedAt: string;
|
|
43
|
+
pullCount: number;
|
|
44
|
+
isVerified: boolean;
|
|
45
|
+
}, {
|
|
46
|
+
repositoryId: import("convex/values").VId<import("convex/values").GenericId<"repository">, "required">;
|
|
47
|
+
referenceName: import("convex/values").VString<string, "required">;
|
|
48
|
+
referenceDescription: import("convex/values").VString<string, "required">;
|
|
49
|
+
referenceContent: import("convex/values").VString<string, "required">;
|
|
50
|
+
commitSha: import("convex/values").VString<string, "required">;
|
|
51
|
+
generatedAt: import("convex/values").VString<string, "required">;
|
|
52
|
+
pullCount: import("convex/values").VFloat64<number, "required">;
|
|
53
|
+
isVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
54
|
+
workosId: import("convex/values").VString<string | undefined, "optional">;
|
|
55
|
+
}, "required", "repositoryId" | "referenceName" | "referenceDescription" | "referenceContent" | "commitSha" | "generatedAt" | "pullCount" | "isVerified" | "workosId">, {
|
|
56
|
+
by_repositoryId: ["repositoryId", "_creationTime"];
|
|
57
|
+
by_repositoryId_referenceName: ["repositoryId", "referenceName", "_creationTime"];
|
|
58
|
+
by_repositoryId_commitSha: ["repositoryId", "commitSha", "_creationTime"];
|
|
59
|
+
by_pullCount: ["pullCount", "_creationTime"];
|
|
60
|
+
by_generatedAt: ["generatedAt", "_creationTime"];
|
|
61
|
+
by_workosId: ["workosId", "_creationTime"];
|
|
62
|
+
}, {}, {}>;
|
|
63
|
+
pushLog: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
64
|
+
fullName: string;
|
|
65
|
+
commitSha: string;
|
|
66
|
+
workosId: string;
|
|
67
|
+
pushedAt: string;
|
|
68
|
+
}, {
|
|
69
|
+
fullName: import("convex/values").VString<string, "required">;
|
|
70
|
+
workosId: import("convex/values").VString<string, "required">;
|
|
71
|
+
pushedAt: import("convex/values").VString<string, "required">;
|
|
72
|
+
commitSha: import("convex/values").VString<string, "required">;
|
|
73
|
+
}, "required", "fullName" | "commitSha" | "workosId" | "pushedAt">, {
|
|
74
|
+
by_repo_date: ["fullName", "pushedAt", "_creationTime"];
|
|
75
|
+
by_workos_date: ["workosId", "pushedAt", "_creationTime"];
|
|
76
|
+
}, {}, {}>;
|
|
77
|
+
user: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
78
|
+
name?: string | undefined;
|
|
79
|
+
image?: string | undefined;
|
|
80
|
+
workosId: string;
|
|
81
|
+
email: string;
|
|
82
|
+
createdAt: string;
|
|
83
|
+
}, {
|
|
84
|
+
workosId: import("convex/values").VString<string, "required">;
|
|
85
|
+
email: import("convex/values").VString<string, "required">;
|
|
86
|
+
name: import("convex/values").VString<string | undefined, "optional">;
|
|
87
|
+
image: import("convex/values").VString<string | undefined, "optional">;
|
|
88
|
+
createdAt: import("convex/values").VString<string, "required">;
|
|
89
|
+
}, "required", "name" | "workosId" | "email" | "image" | "createdAt">, {
|
|
90
|
+
by_email: ["email", "_creationTime"];
|
|
91
|
+
by_workosId: ["workosId", "_creationTime"];
|
|
92
|
+
}, {}, {}>;
|
|
93
|
+
}, true>;
|
|
94
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface RepoValidationResult {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
error?: string;
|
|
4
|
+
stars?: number;
|
|
5
|
+
description?: string;
|
|
6
|
+
canonicalFullName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CommitValidationResult {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Verify repo exists and has minimum stars
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateRepo(fullName: string): Promise<RepoValidationResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Verify commit exists in repo
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateCommit(fullName: string, commitSha: string): Promise<CommitValidationResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const FULLNAME_MIN = 3;
|
|
2
|
+
export declare const FULLNAME_MAX = 200;
|
|
3
|
+
export declare const SKILLNAME_MIN = 2;
|
|
4
|
+
export declare const SKILLNAME_MAX = 80;
|
|
5
|
+
export declare const DESCRIPTION_MAX = 200;
|
|
6
|
+
export declare const CONTENT_MIN = 500;
|
|
7
|
+
export declare const CONTENT_MAX = 200000;
|
|
8
|
+
export declare const COMMIT_SHA_LENGTH = 40;
|
|
9
|
+
export declare const FULLNAME_PATTERN: RegExp;
|
|
10
|
+
export declare const SKILLNAME_PATTERN: RegExp;
|
|
11
|
+
export declare const COMMIT_SHA_PATTERN: RegExp;
|
|
12
|
+
export declare const pushArgs: {
|
|
13
|
+
fullName: import("convex/values").VString<string, "required">;
|
|
14
|
+
referenceName: import("convex/values").VString<string, "required">;
|
|
15
|
+
referenceDescription: import("convex/values").VString<string, "required">;
|
|
16
|
+
referenceContent: import("convex/values").VString<string, "required">;
|
|
17
|
+
commitSha: import("convex/values").VString<string, "required">;
|
|
18
|
+
generatedAt: import("convex/values").VString<string, "required">;
|
|
19
|
+
};
|
|
20
|
+
export interface ValidationResult {
|
|
21
|
+
valid: boolean;
|
|
22
|
+
error?: string;
|
|
23
|
+
field?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Validates push arguments at runtime
|
|
27
|
+
* Returns first validation error or { valid: true }
|
|
28
|
+
*/
|
|
29
|
+
export declare function validatePushArgs(args: {
|
|
30
|
+
fullName: string;
|
|
31
|
+
referenceName: string;
|
|
32
|
+
referenceDescription: string;
|
|
33
|
+
referenceContent: string;
|
|
34
|
+
commitSha: string;
|
|
35
|
+
generatedAt: string;
|
|
36
|
+
}): ValidationResult;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@offworld/backend-api",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Generated Convex API types for Offworld",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
"./api": {
|
|
12
|
+
"types": "./dist/_generated/api.d.ts",
|
|
13
|
+
"import": "./dist/_generated/api.js"
|
|
14
|
+
},
|
|
15
|
+
"./server": {
|
|
16
|
+
"types": "./dist/_generated/server.d.ts",
|
|
17
|
+
"import": "./dist/_generated/server.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json && bun run ./scripts/copy-generated.ts",
|
|
25
|
+
"prepublishOnly": "bun run build"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"convex": "catalog:"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "catalog:"
|
|
32
|
+
}
|
|
33
|
+
}
|