convex 1.47.0 → 1.48.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +28 -4
  2. package/README.md +1 -1
  3. package/dist/browser.bundle.js +1 -1
  4. package/dist/browser.bundle.js.map +1 -1
  5. package/dist/cjs/cli/aiFiles.js +26 -4
  6. package/dist/cjs/cli/aiFiles.js.map +2 -2
  7. package/dist/cjs/cli/env.js +6 -3
  8. package/dist/cjs/cli/env.js.map +2 -2
  9. package/dist/cjs/cli/envDefault.js +5 -2
  10. package/dist/cjs/cli/envDefault.js.map +2 -2
  11. package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js +2 -1
  12. package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
  13. package/dist/cjs/cli/lib/aiFiles/index.js +13 -2
  14. package/dist/cjs/cli/lib/aiFiles/index.js.map +2 -2
  15. package/dist/cjs/cli/lib/aiFiles/skills.js +6 -5
  16. package/dist/cjs/cli/lib/aiFiles/skills.js.map +2 -2
  17. package/dist/cjs/cli/lib/aiFiles/state.js +1 -1
  18. package/dist/cjs/cli/lib/aiFiles/state.js.map +1 -1
  19. package/dist/cjs/cli/lib/components.js +12 -2
  20. package/dist/cjs/cli/lib/components.js.map +2 -2
  21. package/dist/cjs/cli/lib/deployApi/startPush.js +42 -1
  22. package/dist/cjs/cli/lib/deployApi/startPush.js.map +2 -2
  23. package/dist/cjs/cli/lib/env.js +9 -1
  24. package/dist/cjs/cli/lib/env.js.map +2 -2
  25. package/dist/cjs/cli/lib/localDeployment/dashboard.js +11 -1
  26. package/dist/cjs/cli/lib/localDeployment/dashboard.js.map +2 -2
  27. package/dist/cjs/cli/lib/localDeployment/download.js +16 -1
  28. package/dist/cjs/cli/lib/localDeployment/download.js.map +2 -2
  29. package/dist/cjs/cli/lib/localDeployment/utils.js +4 -0
  30. package/dist/cjs/cli/lib/localDeployment/utils.js.map +2 -2
  31. package/dist/cjs/cli/lib/utils/aiAgent.js +32 -0
  32. package/dist/cjs/cli/lib/utils/aiAgent.js.map +7 -0
  33. package/dist/cjs/index.js +1 -1
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/server/authentication.js.map +1 -1
  36. package/dist/cjs/server/components/index.js.map +2 -2
  37. package/dist/cjs/server/impl/authentication_impl.js +15 -1
  38. package/dist/cjs/server/impl/authentication_impl.js.map +2 -2
  39. package/dist/cjs/server/impl/registration_impl.js +1 -1
  40. package/dist/cjs/server/impl/registration_impl.js.map +2 -2
  41. package/dist/cjs/server/index.js.map +2 -2
  42. package/dist/cjs/server/meta.js.map +1 -1
  43. package/dist/cjs/server/registration.js.map +1 -1
  44. package/dist/cjs/server/schema.js +0 -2
  45. package/dist/cjs/server/schema.js.map +2 -2
  46. package/dist/cjs/server/storage.js.map +1 -1
  47. package/dist/cjs-types/cli/aiFiles.d.ts.map +1 -1
  48. package/dist/cjs-types/cli/env.d.ts.map +1 -1
  49. package/dist/cjs-types/cli/envDefault.d.ts.map +1 -1
  50. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -1
  51. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
  52. package/dist/cjs-types/cli/lib/aiFiles/index.d.ts +11 -1
  53. package/dist/cjs-types/cli/lib/aiFiles/index.d.ts.map +1 -1
  54. package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts +4 -1
  55. package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
  56. package/dist/cjs-types/cli/lib/components.d.ts.map +1 -1
  57. package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts +13 -0
  58. package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
  59. package/dist/cjs-types/cli/lib/env.d.ts +1 -0
  60. package/dist/cjs-types/cli/lib/env.d.ts.map +1 -1
  61. package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts +6 -0
  62. package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
  63. package/dist/cjs-types/cli/lib/localDeployment/download.d.ts.map +1 -1
  64. package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts +1 -0
  65. package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
  66. package/dist/cjs-types/cli/lib/utils/aiAgent.d.ts +8 -0
  67. package/dist/cjs-types/cli/lib/utils/aiAgent.d.ts.map +1 -0
  68. package/dist/cjs-types/index.d.ts +1 -1
  69. package/dist/cjs-types/server/authentication.d.ts +65 -0
  70. package/dist/cjs-types/server/authentication.d.ts.map +1 -1
  71. package/dist/cjs-types/server/components/index.d.ts +6 -0
  72. package/dist/cjs-types/server/components/index.d.ts.map +1 -1
  73. package/dist/cjs-types/server/impl/authentication_impl.d.ts +2 -1
  74. package/dist/cjs-types/server/impl/authentication_impl.d.ts.map +1 -1
  75. package/dist/cjs-types/server/index.d.ts +2 -2
  76. package/dist/cjs-types/server/index.d.ts.map +1 -1
  77. package/dist/cjs-types/server/meta.d.ts +8 -0
  78. package/dist/cjs-types/server/meta.d.ts.map +1 -1
  79. package/dist/cjs-types/server/registration.d.ts +5 -3
  80. package/dist/cjs-types/server/registration.d.ts.map +1 -1
  81. package/dist/cjs-types/server/schema.d.ts +0 -2
  82. package/dist/cjs-types/server/schema.d.ts.map +1 -1
  83. package/dist/cjs-types/server/storage.d.ts +28 -25
  84. package/dist/cjs-types/server/storage.d.ts.map +1 -1
  85. package/dist/cli.bundle.cjs +284 -25
  86. package/dist/cli.bundle.cjs.map +4 -4
  87. package/dist/esm/cli/aiFiles.js +26 -4
  88. package/dist/esm/cli/aiFiles.js.map +2 -2
  89. package/dist/esm/cli/env.js +6 -3
  90. package/dist/esm/cli/env.js.map +2 -2
  91. package/dist/esm/cli/envDefault.js +5 -2
  92. package/dist/esm/cli/envDefault.js.map +2 -2
  93. package/dist/esm/cli/lib/aiFiles/guidelinesmd.js +2 -1
  94. package/dist/esm/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
  95. package/dist/esm/cli/lib/aiFiles/index.js +13 -2
  96. package/dist/esm/cli/lib/aiFiles/index.js.map +2 -2
  97. package/dist/esm/cli/lib/aiFiles/skills.js +6 -5
  98. package/dist/esm/cli/lib/aiFiles/skills.js.map +2 -2
  99. package/dist/esm/cli/lib/aiFiles/state.js +1 -1
  100. package/dist/esm/cli/lib/aiFiles/state.js.map +1 -1
  101. package/dist/esm/cli/lib/components.js +15 -2
  102. package/dist/esm/cli/lib/components.js.map +2 -2
  103. package/dist/esm/cli/lib/deployApi/startPush.js +39 -0
  104. package/dist/esm/cli/lib/deployApi/startPush.js.map +2 -2
  105. package/dist/esm/cli/lib/env.js +9 -1
  106. package/dist/esm/cli/lib/env.js.map +2 -2
  107. package/dist/esm/cli/lib/localDeployment/dashboard.js +9 -0
  108. package/dist/esm/cli/lib/localDeployment/dashboard.js.map +2 -2
  109. package/dist/esm/cli/lib/localDeployment/download.js +16 -1
  110. package/dist/esm/cli/lib/localDeployment/download.js.map +2 -2
  111. package/dist/esm/cli/lib/localDeployment/utils.js +3 -0
  112. package/dist/esm/cli/lib/localDeployment/utils.js.map +2 -2
  113. package/dist/esm/cli/lib/utils/aiAgent.js +10 -0
  114. package/dist/esm/cli/lib/utils/aiAgent.js.map +7 -0
  115. package/dist/esm/index.js +1 -1
  116. package/dist/esm/index.js.map +1 -1
  117. package/dist/esm/server/components/index.js.map +2 -2
  118. package/dist/esm/server/impl/authentication_impl.js +13 -0
  119. package/dist/esm/server/impl/authentication_impl.js.map +2 -2
  120. package/dist/esm/server/impl/registration_impl.js +2 -2
  121. package/dist/esm/server/impl/registration_impl.js.map +2 -2
  122. package/dist/esm/server/index.js.map +2 -2
  123. package/dist/esm/server/schema.js +0 -2
  124. package/dist/esm/server/schema.js.map +2 -2
  125. package/dist/esm-types/cli/aiFiles.d.ts.map +1 -1
  126. package/dist/esm-types/cli/env.d.ts.map +1 -1
  127. package/dist/esm-types/cli/envDefault.d.ts.map +1 -1
  128. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -1
  129. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
  130. package/dist/esm-types/cli/lib/aiFiles/index.d.ts +11 -1
  131. package/dist/esm-types/cli/lib/aiFiles/index.d.ts.map +1 -1
  132. package/dist/esm-types/cli/lib/aiFiles/skills.d.ts +4 -1
  133. package/dist/esm-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
  134. package/dist/esm-types/cli/lib/components.d.ts.map +1 -1
  135. package/dist/esm-types/cli/lib/deployApi/startPush.d.ts +13 -0
  136. package/dist/esm-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
  137. package/dist/esm-types/cli/lib/env.d.ts +1 -0
  138. package/dist/esm-types/cli/lib/env.d.ts.map +1 -1
  139. package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts +6 -0
  140. package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
  141. package/dist/esm-types/cli/lib/localDeployment/download.d.ts.map +1 -1
  142. package/dist/esm-types/cli/lib/localDeployment/utils.d.ts +1 -0
  143. package/dist/esm-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
  144. package/dist/esm-types/cli/lib/utils/aiAgent.d.ts +8 -0
  145. package/dist/esm-types/cli/lib/utils/aiAgent.d.ts.map +1 -0
  146. package/dist/esm-types/index.d.ts +1 -1
  147. package/dist/esm-types/server/authentication.d.ts +65 -0
  148. package/dist/esm-types/server/authentication.d.ts.map +1 -1
  149. package/dist/esm-types/server/components/index.d.ts +6 -0
  150. package/dist/esm-types/server/components/index.d.ts.map +1 -1
  151. package/dist/esm-types/server/impl/authentication_impl.d.ts +2 -1
  152. package/dist/esm-types/server/impl/authentication_impl.d.ts.map +1 -1
  153. package/dist/esm-types/server/index.d.ts +2 -2
  154. package/dist/esm-types/server/index.d.ts.map +1 -1
  155. package/dist/esm-types/server/meta.d.ts +8 -0
  156. package/dist/esm-types/server/meta.d.ts.map +1 -1
  157. package/dist/esm-types/server/registration.d.ts +5 -3
  158. package/dist/esm-types/server/registration.d.ts.map +1 -1
  159. package/dist/esm-types/server/schema.d.ts +0 -2
  160. package/dist/esm-types/server/schema.d.ts.map +1 -1
  161. package/dist/esm-types/server/storage.d.ts +28 -25
  162. package/dist/esm-types/server/storage.d.ts.map +1 -1
  163. package/dist/react.bundle.js +1 -1
  164. package/dist/react.bundle.js.map +1 -1
  165. package/package.json +3 -2
  166. package/schemas/convex.schema.json +1 -2
  167. package/src/cli/aiFiles.ts +30 -4
  168. package/src/cli/env.ts +4 -1
  169. package/src/cli/envDefault.ts +4 -1
  170. package/src/cli/lib/aiFiles/guidelinesmd.ts +7 -2
  171. package/src/cli/lib/aiFiles/index.ts +23 -3
  172. package/src/cli/lib/aiFiles/skills.ts +11 -7
  173. package/src/cli/lib/aiFiles/state.ts +1 -1
  174. package/src/cli/lib/components.ts +18 -3
  175. package/src/cli/lib/deployApi/startPush.ts +64 -0
  176. package/src/cli/lib/env.ts +13 -2
  177. package/src/cli/lib/localDeployment/dashboard.ts +19 -0
  178. package/src/cli/lib/localDeployment/download.ts +17 -1
  179. package/src/cli/lib/localDeployment/utils.ts +4 -0
  180. package/src/cli/lib/utils/aiAgent.ts +15 -0
  181. package/src/index.ts +1 -1
  182. package/src/server/authentication.ts +79 -0
  183. package/src/server/components/index.ts +11 -0
  184. package/src/server/impl/authentication_impl.ts +15 -1
  185. package/src/server/impl/registration_impl.ts +2 -2
  186. package/src/server/index.ts +6 -0
  187. package/src/server/meta.ts +0 -8
  188. package/src/server/registration.ts +5 -2
  189. package/src/server/schema.ts +0 -2
  190. package/src/server/storage.ts +29 -42
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/server/schema.ts"],
4
- "sourcesContent": ["/**\n * Utilities for defining the schema of your Convex project.\n *\n * ## Usage\n *\n * Schemas should be placed in a `schema.ts` file in your `convex/` directory.\n *\n * Schema definitions should be built using {@link defineSchema},\n * {@link defineTable}, and {@link values.v}. Make sure to export the schema as the\n * default export.\n *\n * ```ts\n * import { defineSchema, defineTable } from \"convex/server\";\n * import { v } from \"convex/values\";\n *\n * export default defineSchema({\n * messages: defineTable({\n * body: v.string(),\n * user: v.id(\"users\"),\n * }),\n * users: defineTable({\n * name: v.string(),\n * }),\n * });\n * ```\n *\n * To learn more about schemas, see [Defining a Schema](https://docs.convex.dev/using/schemas).\n * @module\n */\nimport {\n AnyDataModel,\n GenericDataModel,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n TableNamesInDataModel,\n} from \"../server/data_model.js\";\nimport {\n IdField,\n IndexTiebreakerField,\n SystemFields,\n SystemIndexes,\n} from \"../server/system_fields.js\";\nimport { Expand } from \"../type_utils.js\";\nimport { GenericId } from \"../values/index.js\";\nimport {\n GenericValidator,\n ObjectType,\n isValidator,\n v,\n} from \"../values/validator.js\";\nimport {\n VFloat64,\n VId,\n VObject,\n VUnion,\n Validator,\n} from \"../values/validators.js\";\n\n/**\n * Extract all of the index field paths within a {@link Validator}.\n *\n * This is used within {@link defineTable}.\n * @public\n */\ntype ExtractFieldPaths<T extends Validator<any, any, any>> =\n // Add in the system fields available in index definitions.\n // This should be everything except for `_id` because thats added to indexes\n // automatically.\n T[\"fieldPaths\"] | keyof SystemFields;\n\n/**\n * Extract the {@link GenericDocument} within a {@link Validator} and\n * add on the system fields.\n *\n * This is used within {@link defineTable}.\n * @public\n */\ntype ExtractDocument<T extends Validator<any, any, any>> =\n // Add the system fields to `Value` (except `_id` because it depends on\n //the table name) and trick TypeScript into expanding them.\n Expand<SystemFields & T[\"type\"]>;\n\nexport interface DbIndexConfig<\n FirstFieldPath extends string,\n RestFieldPaths extends string[],\n> {\n /**\n * The fields to index, in order. Must specify at least one field.\n */\n fields: [FirstFieldPath, ...RestFieldPaths];\n}\n\n/**\n * The configuration for a full text search index.\n *\n * @public\n */\nexport interface SearchIndexConfig<\n SearchField extends string,\n FilterFields extends string,\n> {\n /**\n * The field to index for full text search.\n *\n * This must be a field of type `string`.\n */\n searchField: SearchField;\n\n /**\n * Additional fields to index for fast filtering when running search queries.\n */\n filterFields?: FilterFields[];\n}\n\n/**\n * The configuration for a vector index.\n *\n * @public\n */\nexport interface VectorIndexConfig<\n VectorField extends string,\n FilterFields extends string,\n> {\n /**\n * The field to index for vector search.\n *\n * This must be a field of type `v.array(v.float64())` (or a union)\n */\n vectorField: VectorField;\n /**\n * The length of the vectors indexed. This must be between 2 and 2048 inclusive.\n */\n dimensions: number;\n /**\n * Additional fields to index for fast filtering when running vector searches.\n */\n filterFields?: FilterFields[];\n}\n\n/**\n * @internal\n */\nexport type VectorIndex = {\n indexDescriptor: string;\n vectorField: string;\n dimensions: number;\n filterFields: string[];\n};\n\n/**\n * @internal\n */\nexport type Index = {\n indexDescriptor: string;\n fields: string[];\n};\n\n/**\n * @internal\n */\nexport type SearchIndex = {\n indexDescriptor: string;\n searchField: string;\n filterFields: string[];\n};\n\n/**\n * Options for defining an index.\n *\n * @public\n */\nexport interface IndexOptions {\n /**\n * Whether the index should be staged.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n */\n staged?: boolean;\n}\n\n/**\n * The definition of a table within a schema.\n *\n * This should be produced by using {@link defineTable}.\n * @public\n */\nexport class TableDefinition<\n DocumentType extends Validator<any, any, any> = Validator<any, any, any>,\n Indexes extends GenericTableIndexes = {},\n SearchIndexes extends GenericTableSearchIndexes = {},\n VectorIndexes extends GenericTableVectorIndexes = {},\n> {\n private indexes: Index[];\n private stagedDbIndexes: Index[];\n private searchIndexes: SearchIndex[];\n private stagedSearchIndexes: SearchIndex[];\n private vectorIndexes: VectorIndex[];\n private stagedVectorIndexes: VectorIndex[];\n // The type of documents stored in this table.\n validator: DocumentType;\n // The proposed next validator for this table, validated against existing\n // documents in the background while `validator` remains enforced.\n private stagedValidator: Validator<any, any, any> | undefined;\n\n /**\n * @internal\n */\n constructor(documentType: DocumentType) {\n this.indexes = [];\n this.stagedDbIndexes = [];\n this.searchIndexes = [];\n this.stagedSearchIndexes = [];\n this.vectorIndexes = [];\n this.stagedVectorIndexes = [];\n this.validator = documentType;\n }\n\n /**\n * This API is experimental: it may change or disappear.\n *\n * Returns indexes defined on this table.\n * Intended for the advanced use cases of dynamically deciding which index to use for a query.\n * If you think you need this, please chime in on ths issue in the Convex JS GitHub repo.\n * https://github.com/get-convex/convex-js/issues/49\n */\n \" indexes\"(): { indexDescriptor: string; fields: string[] }[] {\n return this.indexes;\n }\n\n /**\n * Define an index on this table.\n *\n * Indexes speed up queries by allowing efficient lookups on specific fields.\n * Use `.withIndex()` in your queries to leverage them.\n *\n * Index fields must be queried in the same order they are defined. If you\n * need to query by `field2` then `field1`, create a separate index with\n * that field order.\n *\n * @example\n * ```ts\n * defineTable({\n * userId: v.id(\"users\"),\n * status: v.string(),\n * updatedAt: v.number(),\n * })\n * // Name indexes after their fields:\n * .index(\"by_userId\", [\"userId\"])\n * .index(\"by_status_updatedAt\", [\"status\", \"updatedAt\"])\n * ```\n *\n * **Best practice:** Always include all index fields in the index name\n * (e.g., `\"by_field1_and_field2\"`).\n *\n * @param name - The name of the index.\n * @param indexConfig - The index configuration object.\n * @returns A {@link TableDefinition} with this index included.\n *\n * @see https://docs.convex.dev/database/reading-data/indexes\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig: Expand<\n DbIndexConfig<FirstFieldPath, RestFieldPaths> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Expand<\n Indexes &\n Record<\n IndexName,\n [FirstFieldPath, ...RestFieldPaths, IndexTiebreakerField]\n >\n >,\n SearchIndexes,\n VectorIndexes\n >;\n\n /**\n * Define an index on this table.\n *\n * To learn about indexes, see [Defining Indexes](https://docs.convex.dev/database/reading-data/indexes).\n *\n * @param name - The name of the index.\n * @param fields - The fields to index, in order. Must specify at least one\n * field.\n * @returns A {@link TableDefinition} with this index included.\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n fields: [FirstFieldPath, ...RestFieldPaths],\n ): TableDefinition<\n DocumentType,\n Expand<\n Indexes &\n Record<\n IndexName,\n [FirstFieldPath, ...RestFieldPaths, IndexTiebreakerField]\n >\n >,\n SearchIndexes,\n VectorIndexes\n >;\n\n /**\n * Define a staged index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about indexes, see [Defining Indexes](https://docs.convex.dev/using/indexes).\n *\n * @param name - The name of the index.\n * @param indexConfig - The index configuration object.\n * @returns A {@link TableDefinition} with this index included.\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig: Expand<\n DbIndexConfig<FirstFieldPath, RestFieldPaths> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig:\n | Expand<DbIndexConfig<FirstFieldPath, RestFieldPaths> & IndexOptions>\n | [FirstFieldPath, ...RestFieldPaths],\n ) {\n if (Array.isArray(indexConfig)) {\n // indexConfig is [FirstFieldPath, ...RestFieldPaths]\n this.indexes.push({\n indexDescriptor: name,\n fields: indexConfig,\n });\n } else if (indexConfig.staged) {\n // indexConfig is object with fields and staged: true\n this.stagedDbIndexes.push({\n indexDescriptor: name,\n fields: indexConfig.fields,\n });\n } else {\n // indexConfig is object with fields (and maybe staged: false/undefined)\n this.indexes.push({\n indexDescriptor: name,\n fields: indexConfig.fields,\n });\n }\n return this;\n }\n\n /**\n * Define a search index on this table.\n *\n * To learn about search indexes, see [Search](https://docs.convex.dev/text-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The search index configuration object.\n * @returns A {@link TableDefinition} with this search index included.\n */\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Indexes,\n // Update `SearchIndexes` to include the new index and use `Expand` to make\n // the types look pretty in editors.\n Expand<\n SearchIndexes &\n Record<\n IndexName,\n {\n searchField: SearchField;\n filterFields: FilterFields;\n }\n >\n >,\n VectorIndexes\n >;\n\n /**\n * Define a staged search index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about search indexes, see [Search](https://docs.convex.dev/text-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The search index configuration object.\n * @returns A {@link TableDefinition} with this search index included.\n */\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> & IndexOptions\n >,\n ) {\n if (indexConfig.staged) {\n this.stagedSearchIndexes.push({\n indexDescriptor: name,\n searchField: indexConfig.searchField,\n filterFields: indexConfig.filterFields || [],\n });\n } else {\n this.searchIndexes.push({\n indexDescriptor: name,\n searchField: indexConfig.searchField,\n filterFields: indexConfig.filterFields || [],\n });\n }\n return this;\n }\n\n /**\n * Define a vector index on this table.\n *\n * To learn about vector indexes, see [Vector Search](https://docs.convex.dev/vector-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The vector index configuration object.\n * @returns A {@link TableDefinition} with this vector index included.\n */\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Indexes,\n SearchIndexes,\n Expand<\n VectorIndexes &\n Record<\n IndexName,\n {\n vectorField: VectorField;\n dimensions: number;\n filterFields: FilterFields;\n }\n >\n >\n >;\n\n /**\n * Define a staged vector index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about vector indexes, see [Vector Search](https://docs.convex.dev/vector-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The vector index configuration object.\n * @returns A {@link TableDefinition} with this vector index included.\n */\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> & IndexOptions\n >,\n ) {\n if (indexConfig.staged) {\n this.stagedVectorIndexes.push({\n indexDescriptor: name,\n vectorField: indexConfig.vectorField,\n dimensions: indexConfig.dimensions,\n filterFields: indexConfig.filterFields || [],\n });\n } else {\n this.vectorIndexes.push({\n indexDescriptor: name,\n vectorField: indexConfig.vectorField,\n dimensions: indexConfig.dimensions,\n filterFields: indexConfig.filterFields || [],\n });\n }\n return this;\n }\n\n /**\n * Stage changes to this table's document validator.\n *\n * Convex validates the staged validator against the table's existing\n * documents in the background, while the validator passed to\n * {@link defineTable} remains the one enforced on writes. Once\n * the background validation succeeds, apply the staged changes\n * and remove `.staged()`.\n *\n * For an object validator, pass only the fields to add or replace. Fields\n * omitted from the changes keep their enforced validators.\n * Set a field to `undefined` to remove it from the staged validator.\n * For nested objects, you must specify the full object validator.\n *\n * ```ts\n * defineTable({\n * apple: v.string(),\n * banana: v.number(),\n * legacy: v.optional(v.string()),\n * }).staged({\n * banana: v.union(v.string(), v.number()),\n * legacy: undefined,\n * })\n * ```\n *\n * See [Staged validators](https://docs.convex.dev/database/schemas#staged-validators).\n *\n * @param documentSchema - Field changes for a table defined as an object or\n * `v.any()`, or a full schema validator specifying the proposed next document\n * type. Use a full schema validator for a table defined as a union.\n * @returns A {@link TableDefinition} with the staged validator attached.\n */\n staged(\n documentSchema:\n | Validator<Record<string, any>, \"required\", any>\n | Record<string, GenericValidator | undefined>,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes> {\n if (this.stagedValidator !== undefined) {\n throw new Error(\"Table cannot have more than one staged validator.\");\n }\n if (isValidator(documentSchema)) {\n this.stagedValidator = documentSchema;\n } else {\n if (this.validator.kind !== \"object\" && this.validator.kind !== \"any\") {\n throw new Error(\n \"Specifying top-level field changes is only supported for simple table definitions. For a table defined with a union or record validator, you must stage a fully defined object or union validator.\",\n );\n }\n const enforcedFields =\n this.validator.kind === \"object\" ? this.validator.fields : {};\n const fields: Record<string, GenericValidator> = Object.fromEntries(\n Object.entries({ ...enforcedFields, ...documentSchema }).filter(\n (entry): entry is [string, GenericValidator] =>\n entry[1] !== undefined,\n ),\n );\n this.stagedValidator = v.object(fields);\n }\n return this.self();\n }\n\n /**\n * Work around for https://github.com/microsoft/TypeScript/issues/57035\n */\n protected self(): TableDefinition<\n DocumentType,\n Indexes,\n SearchIndexes,\n VectorIndexes\n > {\n return this;\n }\n /**\n * Export the contents of this definition.\n *\n * This is called internally by the Convex framework.\n * @internal\n */\n export() {\n const documentType = this.validator.json;\n if (typeof documentType !== \"object\") {\n throw new Error(\n \"Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)\",\n );\n }\n\n let stagedDocumentType = undefined;\n if (this.stagedValidator !== undefined) {\n stagedDocumentType = this.stagedValidator.json;\n if (typeof stagedDocumentType !== \"object\") {\n throw new Error(\n \"Invalid staged validator: please make sure that the parameter of `.staged()` is valid (see https://docs.convex.dev/database/schemas)\",\n );\n }\n }\n\n return {\n indexes: this.indexes,\n stagedDbIndexes: this.stagedDbIndexes,\n searchIndexes: this.searchIndexes,\n stagedSearchIndexes: this.stagedSearchIndexes,\n vectorIndexes: this.vectorIndexes,\n stagedVectorIndexes: this.stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n };\n }\n}\n\n/**\n * Define a table in a schema.\n *\n * You can either specify the schema of your documents as an object like\n * ```ts\n * defineTable({\n * field: v.string()\n * });\n * ```\n *\n * or as a schema type like\n * ```ts\n * defineTable(\n * v.union(\n * v.object({...}),\n * v.object({...})\n * )\n * );\n * ```\n *\n * @param documentSchema - The type of documents stored in this table.\n * @returns A {@link TableDefinition} for the table.\n *\n * @public\n */\nexport function defineTable<\n DocumentSchema extends Validator<Record<string, any>, \"required\", any>,\n>(documentSchema: DocumentSchema): TableDefinition<DocumentSchema>;\n/**\n * Define a table in a schema.\n *\n * You can either specify the schema of your documents as an object like\n * ```ts\n * defineTable({\n * field: v.string()\n * });\n * ```\n *\n * or as a schema type like\n * ```ts\n * defineTable(\n * v.union(\n * v.object({...}),\n * v.object({...})\n * )\n * );\n * ```\n *\n * @param documentSchema - The type of documents stored in this table.\n * @returns A {@link TableDefinition} for the table.\n *\n * @public\n */\nexport function defineTable<\n DocumentSchema extends Record<string, GenericValidator>,\n>(\n documentSchema: DocumentSchema,\n): TableDefinition<VObject<ObjectType<DocumentSchema>, DocumentSchema>>;\nexport function defineTable<\n DocumentSchema extends\n | Validator<Record<string, any>, \"required\", any>\n | Record<string, GenericValidator>,\n>(documentSchema: DocumentSchema): TableDefinition<any, any, any> {\n if (isValidator(documentSchema)) {\n return new TableDefinition(documentSchema);\n } else {\n return new TableDefinition(v.object(documentSchema));\n }\n}\n\n/**\n * The validators for the system fields Convex adds to every document.\n *\n * @public\n */\nexport type SystemFieldValidators<TableName extends string> = {\n _id: VId<GenericId<TableName>>;\n _creationTime: VFloat64<number>;\n};\n\n/**\n * Add the system field validators to an object validator, leaving any other\n * validator untouched.\n */\ntype WithSystemFieldValidators<\n TableName extends string,\n DocumentType extends Validator<any, any, any>,\n> =\n DocumentType extends VObject<infer Type, infer Fields, any, any>\n ? VObject<\n Expand<IdField<TableName> & SystemFields & Type>,\n Expand<SystemFieldValidators<TableName> & Fields>\n >\n : DocumentType;\n\n/**\n * The validator for whole documents of a table: the table's own validator with\n * the `_id` and `_creationTime` system fields added.\n *\n * For a table defined with a union, the system fields are added to each member\n * of the union.\n *\n * @public\n */\nexport type DocValidator<\n TableName extends string,\n DocumentType extends Validator<any, any, any>,\n> =\n DocumentType extends VUnion<any, infer Members, any, any>\n ? {\n [Index in keyof Members]: WithSystemFieldValidators<\n TableName,\n Members[Index]\n >;\n } extends infer NewMembers extends Validator<any, \"required\", any>[]\n ? VUnion<\n WithSystemFieldValidators<TableName, Members[number]>[\"type\"],\n NewMembers\n >\n : never\n : WithSystemFieldValidators<TableName, DocumentType>;\n\nfunction addSystemFields(\n tableName: string,\n validator: GenericValidator,\n): GenericValidator {\n switch (validator.kind) {\n case \"object\":\n return validator.extend({\n _id: v.id(tableName),\n _creationTime: v.number(),\n });\n case \"union\":\n return v.union(\n ...validator.members.map((member) =>\n addSystemFields(tableName, member),\n ),\n );\n // `v.any()` already permits the system fields.\n case \"any\":\n return validator;\n default:\n throw new Error(\n `Invalid validator for table \"${tableName}\": a table's documents must be objects, or a union of objects (see https://docs.convex.dev/database/schemas)`,\n );\n }\n}\n\n/**\n * Build the validator for whole documents of a table, by adding the `_id` and\n * `_creationTime` system fields to the table's own validator.\n *\n * Prefer {@link SchemaDefinition.doc} when you have the schema in hand: it\n * checks the table name against the schema.\n *\n * @example\n * ```ts\n * const messageDoc = docValidator(\"messages\", schema.tables.messages);\n *\n * export const get = query({\n * args: { id: v.id(\"messages\") },\n * returns: v.union(messageDoc, v.null()),\n * handler: (ctx, args) => ctx.db.get(args.id),\n * });\n * ```\n *\n * @param tableName - The name of the table, used for the `_id` validator.\n * @param table - The {@link TableDefinition} for that table.\n * @returns A validator matching documents of the table.\n *\n * @public\n */\nexport function docValidator<\n TableName extends string,\n Table extends TableDefinition<any, any, any, any>,\n>(\n tableName: TableName,\n table: Table,\n): DocValidator<TableName, Table[\"validator\"]> {\n return addSystemFields(tableName, table.validator) as DocValidator<\n TableName,\n Table[\"validator\"]\n >;\n}\n\n/**\n * A type describing the schema of a Convex project.\n *\n * This should be constructed using {@link defineSchema}, {@link defineTable},\n * and {@link v}.\n * @public\n */\nexport type GenericSchema = Record<string, TableDefinition>;\n\nfunction tableInSchema<\n Schema extends GenericSchema,\n TableName extends keyof Schema & string,\n>(\n schema: SchemaDefinition<Schema, boolean>,\n tableName: TableName,\n): Schema[TableName] {\n const table = schema.tables[tableName];\n if (table === undefined) {\n throw new Error(\n `Table \"${tableName}\" is not in this schema. Tables in this schema: ${Object.keys(\n schema.tables,\n ).join(\", \")}`,\n );\n }\n return table;\n}\n\n/**\n *\n * The definition of a Convex project schema.\n *\n * This should be produced by using {@link defineSchema}.\n * @public\n */\nexport class SchemaDefinition<\n Schema extends GenericSchema,\n StrictTableTypes extends boolean,\n> {\n public tables: Schema;\n public strictTableNameTypes!: StrictTableTypes;\n public readonly schemaValidation: boolean;\n\n /**\n * @internal\n */\n constructor(tables: Schema, options?: DefineSchemaOptions<StrictTableTypes>) {\n this.tables = tables;\n this.schemaValidation =\n options?.schemaValidation === undefined ? true : options.schemaValidation;\n }\n\n /**\n * The validator for whole documents of a table in this schema: the table's\n * own validator with the `_id` and `_creationTime` system fields added.\n *\n * @example\n * ```ts\n * export const get = query({\n * args: { id: schema.id(\"messages\") },\n * returns: v.union(schema.doc(\"messages\"), v.null()),\n * handler: (ctx, args) => ctx.db.get(args.id),\n * });\n * ```\n *\n * @param tableName - The name of a table in this schema.\n * @returns A validator matching documents of that table.\n */\n doc<TableName extends keyof Schema & string>(\n tableName: TableName,\n ): DocValidator<TableName, Schema[TableName][\"validator\"]> {\n return docValidator(tableName, tableInSchema(this, tableName));\n }\n\n /**\n * The validator for IDs of a table in this schema.\n *\n * Same as `v.id(tableName)`, but only accepts tables in this schema.\n *\n * @param tableName - The name of a table in this schema.\n * @returns A validator matching IDs of that table.\n */\n id<TableName extends keyof Schema & string>(\n tableName: TableName,\n ): VId<GenericId<TableName>> {\n tableInSchema(this, tableName);\n return v.id(tableName);\n }\n\n /**\n * Export the contents of this definition.\n *\n * This is called internally by the Convex framework.\n * @internal\n */\n export(): string {\n return JSON.stringify({\n tables: Object.entries(this.tables).map(([tableName, definition]) => {\n const {\n indexes,\n stagedDbIndexes,\n searchIndexes,\n stagedSearchIndexes,\n vectorIndexes,\n stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n } = definition.export();\n return {\n tableName,\n indexes,\n stagedDbIndexes,\n searchIndexes,\n stagedSearchIndexes,\n vectorIndexes,\n stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n };\n }),\n schemaValidation: this.schemaValidation,\n });\n }\n}\n\n/**\n * Options for {@link defineSchema}.\n *\n * @public\n */\nexport interface DefineSchemaOptions<StrictTableNameTypes extends boolean> {\n /**\n * Whether Convex should validate at runtime that all documents match\n * your schema.\n *\n * If `schemaValidation` is `true`, Convex will:\n * 1. Check that all existing documents match your schema when your schema\n * is pushed.\n * 2. Check that all insertions and updates match your schema during mutations.\n *\n * If `schemaValidation` is `false`, Convex will not validate that new or\n * existing documents match your schema. You'll still get schema-specific\n * TypeScript types, but there will be no validation at runtime that your\n * documents match those types.\n *\n * By default, `schemaValidation` is `true`.\n */\n schemaValidation?: boolean;\n\n /**\n * Whether the TypeScript types should allow accessing tables not in the schema.\n *\n * If `strictTableNameTypes` is `true`, using tables not listed in the schema\n * will generate a TypeScript compilation error.\n *\n * If `strictTableNameTypes` is `false`, you'll be able to access tables not\n * listed in the schema and their document type will be `any`.\n *\n * `strictTableNameTypes: false` is useful for rapid prototyping.\n *\n * Regardless of the value of `strictTableNameTypes`, your schema will only\n * validate documents in the tables listed in the schema. You can still create\n * and modify other tables on the dashboard or in JavaScript mutations.\n *\n * By default, `strictTableNameTypes` is `true`.\n */\n strictTableNameTypes?: StrictTableNameTypes;\n}\n\n/**\n * Define the schema of this Convex project.\n *\n * This should be exported as the default export from a `schema.ts` file in\n * your `convex/` directory. The schema enables runtime validation of documents\n * and provides end-to-end TypeScript type safety.\n *\n * Every document in Convex automatically has two system fields:\n * - `_id` - a unique document ID with validator `v.id(\"tableName\")`\n * - `_creationTime` - a creation timestamp with validator `v.number()`\n *\n * You do not need to include these in your schema definition, they are added\n * automatically.\n *\n * @example\n * ```ts\n * // convex/schema.ts\n * import { defineSchema, defineTable } from \"convex/server\";\n * import { v } from \"convex/values\";\n *\n * export default defineSchema({\n * users: defineTable({\n * name: v.string(),\n * email: v.string(),\n * }).index(\"by_email\", [\"email\"]),\n *\n * messages: defineTable({\n * body: v.string(),\n * userId: v.id(\"users\"),\n * channelId: v.id(\"channels\"),\n * }).index(\"by_channel\", [\"channelId\"]),\n *\n * channels: defineTable({\n * name: v.string(),\n * }),\n *\n * // Discriminated union table:\n * results: defineTable(\n * v.union(\n * v.object({ kind: v.literal(\"error\"), message: v.string() }),\n * v.object({ kind: v.literal(\"success\"), value: v.number() }),\n * )\n * ),\n * });\n * ```\n *\n * **Best practice:** Always include all index fields in the index name. For\n * example, an index on `[\"field1\", \"field2\"]` should be named\n * `\"by_field1_field2\"`.\n *\n * @param schema - A map from table name to {@link TableDefinition} for all of\n * the tables in this project.\n * @param options - Optional configuration. See {@link DefineSchemaOptions} for\n * a full description.\n * @returns The schema.\n *\n * @see https://docs.convex.dev/database/schemas\n * @public\n */\nexport function defineSchema<\n Schema extends GenericSchema,\n StrictTableNameTypes extends boolean = true,\n>(\n schema: Schema,\n options?: DefineSchemaOptions<StrictTableNameTypes>,\n): SchemaDefinition<Schema, StrictTableNameTypes> {\n return new SchemaDefinition(schema, options);\n}\n\n/**\n * Internal type used in Convex code generation!\n *\n * Convert a {@link SchemaDefinition} into a {@link server.GenericDataModel}.\n *\n * @public\n */\nexport type DataModelFromSchemaDefinition<\n SchemaDef extends SchemaDefinition<any, boolean>,\n> = MaybeMakeLooseDataModel<\n {\n [TableName in keyof SchemaDef[\"tables\"] &\n string]: SchemaDef[\"tables\"][TableName] extends TableDefinition<\n infer DocumentType,\n infer Indexes,\n infer SearchIndexes,\n infer VectorIndexes\n >\n ? {\n // We've already added all of the system fields except for `_id`.\n // Add that here.\n document: Expand<IdField<TableName> & ExtractDocument<DocumentType>>;\n fieldPaths:\n | keyof IdField<TableName>\n | ExtractFieldPaths<DocumentType>;\n indexes: Expand<Indexes & SystemIndexes>;\n searchIndexes: SearchIndexes;\n vectorIndexes: VectorIndexes;\n }\n : never;\n },\n SchemaDef[\"strictTableNameTypes\"]\n>;\n\ntype MaybeMakeLooseDataModel<\n DataModel extends GenericDataModel,\n StrictTableNameTypes extends boolean,\n> = StrictTableNameTypes extends true\n ? DataModel\n : Expand<DataModel & AnyDataModel>;\n\nconst _systemSchema = defineSchema({\n _scheduled_functions: defineTable({\n name: v.string(),\n args: v.array(v.any()),\n scheduledTime: v.float64(),\n completedTime: v.optional(v.float64()),\n state: v.union(\n v.object({ kind: v.literal(\"pending\") }),\n v.object({ kind: v.literal(\"inProgress\") }),\n v.object({ kind: v.literal(\"success\") }),\n v.object({ kind: v.literal(\"failed\"), error: v.string() }),\n v.object({ kind: v.literal(\"canceled\") }),\n ),\n }),\n _storage: defineTable({\n sha256: v.string(),\n size: v.float64(),\n contentType: v.optional(v.string()),\n }),\n});\n\nexport interface SystemDataModel extends DataModelFromSchemaDefinition<\n typeof _systemSchema\n> {}\n\nexport type SystemTableNames = TableNamesInDataModel<SystemDataModel>;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CA,uBAKO;AA8IA,MAAM,gBAKX;AAAA;AAAA;AAAA;AAAA,EAgBA,YAAY,cAA4B;AAfxC,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AAER;AAAA;AAGA;AAAA;AAAA,wBAAQ;AAMN,SAAK,UAAU,CAAC;AAChB,SAAK,kBAAkB,CAAC;AACxB,SAAK,gBAAgB,CAAC;AACtB,SAAK,sBAAsB,CAAC;AAC5B,SAAK,gBAAgB,CAAC;AACtB,SAAK,sBAAsB,CAAC;AAC5B,SAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,aAA8D;AAC5D,WAAO,KAAK;AAAA,EACd;AAAA,EAkHA,MAKE,MACA,aAGA;AACA,QAAI,MAAM,QAAQ,WAAW,GAAG;AAE9B,WAAK,QAAQ,KAAK;AAAA,QAChB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,MACV,CAAC;AAAA,I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,QAAQ,GAAG,OAAO,mBAAE,OAAO,EAAE,CAAC;AAAA,MACzD,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,UAAU,EAAE,CAAC;AAAA,IAC1C;AAAA,EACF,CAAC;AAAA,EACD,UAAU,YAAY;AAAA,IACpB,QAAQ,mBAAE,OAAO;AAAA,IACjB,MAAM,mBAAE,QAAQ;AAAA,IAChB,aAAa,mBAAE,SAAS,mBAAE,OAAO,CAAC;AAAA,EACpC,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["/**\n * Utilities for defining the schema of your Convex project.\n *\n * ## Usage\n *\n * Schemas should be placed in a `schema.ts` file in your `convex/` directory.\n *\n * Schema definitions should be built using {@link defineSchema},\n * {@link defineTable}, and {@link values.v}. Make sure to export the schema as the\n * default export.\n *\n * ```ts\n * import { defineSchema, defineTable } from \"convex/server\";\n * import { v } from \"convex/values\";\n *\n * export default defineSchema({\n * messages: defineTable({\n * body: v.string(),\n * user: v.id(\"users\"),\n * }),\n * users: defineTable({\n * name: v.string(),\n * }),\n * });\n * ```\n *\n * To learn more about schemas, see [Defining a Schema](https://docs.convex.dev/using/schemas).\n * @module\n */\nimport {\n AnyDataModel,\n GenericDataModel,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n TableNamesInDataModel,\n} from \"../server/data_model.js\";\nimport {\n IdField,\n IndexTiebreakerField,\n SystemFields,\n SystemIndexes,\n} from \"../server/system_fields.js\";\nimport { Expand } from \"../type_utils.js\";\nimport { GenericId } from \"../values/index.js\";\nimport {\n GenericValidator,\n ObjectType,\n isValidator,\n v,\n} from \"../values/validator.js\";\nimport {\n VFloat64,\n VId,\n VObject,\n VUnion,\n Validator,\n} from \"../values/validators.js\";\n\n/**\n * Extract all of the index field paths within a {@link Validator}.\n *\n * This is used within {@link defineTable}.\n * @public\n */\ntype ExtractFieldPaths<T extends Validator<any, any, any>> =\n // Add in the system fields available in index definitions.\n // This should be everything except for `_id` because thats added to indexes\n // automatically.\n T[\"fieldPaths\"] | keyof SystemFields;\n\n/**\n * Extract the {@link GenericDocument} within a {@link Validator} and\n * add on the system fields.\n *\n * This is used within {@link defineTable}.\n * @public\n */\ntype ExtractDocument<T extends Validator<any, any, any>> =\n // Add the system fields to `Value` (except `_id` because it depends on\n //the table name) and trick TypeScript into expanding them.\n Expand<SystemFields & T[\"type\"]>;\n\nexport interface DbIndexConfig<\n FirstFieldPath extends string,\n RestFieldPaths extends string[],\n> {\n /**\n * The fields to index, in order. Must specify at least one field.\n */\n fields: [FirstFieldPath, ...RestFieldPaths];\n}\n\n/**\n * The configuration for a full text search index.\n *\n * @public\n */\nexport interface SearchIndexConfig<\n SearchField extends string,\n FilterFields extends string,\n> {\n /**\n * The field to index for full text search.\n *\n * This must be a field of type `string`.\n */\n searchField: SearchField;\n\n /**\n * Additional fields to index for fast filtering when running search queries.\n */\n filterFields?: FilterFields[];\n}\n\n/**\n * The configuration for a vector index.\n *\n * @public\n */\nexport interface VectorIndexConfig<\n VectorField extends string,\n FilterFields extends string,\n> {\n /**\n * The field to index for vector search.\n *\n * This must be a field of type `v.array(v.float64())` (or a union)\n */\n vectorField: VectorField;\n /**\n * The length of the vectors indexed. This must be between 2 and 2048 inclusive.\n */\n dimensions: number;\n /**\n * Additional fields to index for fast filtering when running vector searches.\n */\n filterFields?: FilterFields[];\n}\n\n/**\n * @internal\n */\nexport type VectorIndex = {\n indexDescriptor: string;\n vectorField: string;\n dimensions: number;\n filterFields: string[];\n};\n\n/**\n * @internal\n */\nexport type Index = {\n indexDescriptor: string;\n fields: string[];\n};\n\n/**\n * @internal\n */\nexport type SearchIndex = {\n indexDescriptor: string;\n searchField: string;\n filterFields: string[];\n};\n\n/**\n * Options for defining an index.\n *\n * @public\n */\nexport interface IndexOptions {\n /**\n * Whether the index should be staged.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n */\n staged?: boolean;\n}\n\n/**\n * The definition of a table within a schema.\n *\n * This should be produced by using {@link defineTable}.\n * @public\n */\nexport class TableDefinition<\n DocumentType extends Validator<any, any, any> = Validator<any, any, any>,\n Indexes extends GenericTableIndexes = {},\n SearchIndexes extends GenericTableSearchIndexes = {},\n VectorIndexes extends GenericTableVectorIndexes = {},\n> {\n private indexes: Index[];\n private stagedDbIndexes: Index[];\n private searchIndexes: SearchIndex[];\n private stagedSearchIndexes: SearchIndex[];\n private vectorIndexes: VectorIndex[];\n private stagedVectorIndexes: VectorIndex[];\n // The type of documents stored in this table.\n validator: DocumentType;\n // The proposed next validator for this table, validated against existing\n // documents in the background while `validator` remains enforced.\n private stagedValidator: Validator<any, any, any> | undefined;\n\n /**\n * @internal\n */\n constructor(documentType: DocumentType) {\n this.indexes = [];\n this.stagedDbIndexes = [];\n this.searchIndexes = [];\n this.stagedSearchIndexes = [];\n this.vectorIndexes = [];\n this.stagedVectorIndexes = [];\n this.validator = documentType;\n }\n\n /**\n * This API is experimental: it may change or disappear.\n *\n * Returns indexes defined on this table.\n * Intended for the advanced use cases of dynamically deciding which index to use for a query.\n */\n \" indexes\"(): { indexDescriptor: string; fields: string[] }[] {\n return this.indexes;\n }\n\n /**\n * Define an index on this table.\n *\n * Indexes speed up queries by allowing efficient lookups on specific fields.\n * Use `.withIndex()` in your queries to leverage them.\n *\n * Index fields must be queried in the same order they are defined. If you\n * need to query by `field2` then `field1`, create a separate index with\n * that field order.\n *\n * @example\n * ```ts\n * defineTable({\n * userId: v.id(\"users\"),\n * status: v.string(),\n * updatedAt: v.number(),\n * })\n * // Name indexes after their fields:\n * .index(\"by_userId\", [\"userId\"])\n * .index(\"by_status_updatedAt\", [\"status\", \"updatedAt\"])\n * ```\n *\n * **Best practice:** Always include all index fields in the index name\n * (e.g., `\"by_field1_and_field2\"`).\n *\n * @param name - The name of the index.\n * @param indexConfig - The index configuration object.\n * @returns A {@link TableDefinition} with this index included.\n *\n * @see https://docs.convex.dev/database/reading-data/indexes\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig: Expand<\n DbIndexConfig<FirstFieldPath, RestFieldPaths> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Expand<\n Indexes &\n Record<\n IndexName,\n [FirstFieldPath, ...RestFieldPaths, IndexTiebreakerField]\n >\n >,\n SearchIndexes,\n VectorIndexes\n >;\n\n /**\n * Define an index on this table.\n *\n * To learn about indexes, see [Defining Indexes](https://docs.convex.dev/database/reading-data/indexes).\n *\n * @param name - The name of the index.\n * @param fields - The fields to index, in order. Must specify at least one\n * field.\n * @returns A {@link TableDefinition} with this index included.\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n fields: [FirstFieldPath, ...RestFieldPaths],\n ): TableDefinition<\n DocumentType,\n Expand<\n Indexes &\n Record<\n IndexName,\n [FirstFieldPath, ...RestFieldPaths, IndexTiebreakerField]\n >\n >,\n SearchIndexes,\n VectorIndexes\n >;\n\n /**\n * Define a staged index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about indexes, see [Defining Indexes](https://docs.convex.dev/using/indexes).\n *\n * @param name - The name of the index.\n * @param indexConfig - The index configuration object.\n * @returns A {@link TableDefinition} with this index included.\n */\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig: Expand<\n DbIndexConfig<FirstFieldPath, RestFieldPaths> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n index<\n IndexName extends string,\n FirstFieldPath extends ExtractFieldPaths<DocumentType>,\n RestFieldPaths extends ExtractFieldPaths<DocumentType>[],\n >(\n name: IndexName,\n indexConfig:\n | Expand<DbIndexConfig<FirstFieldPath, RestFieldPaths> & IndexOptions>\n | [FirstFieldPath, ...RestFieldPaths],\n ) {\n if (Array.isArray(indexConfig)) {\n // indexConfig is [FirstFieldPath, ...RestFieldPaths]\n this.indexes.push({\n indexDescriptor: name,\n fields: indexConfig,\n });\n } else if (indexConfig.staged) {\n // indexConfig is object with fields and staged: true\n this.stagedDbIndexes.push({\n indexDescriptor: name,\n fields: indexConfig.fields,\n });\n } else {\n // indexConfig is object with fields (and maybe staged: false/undefined)\n this.indexes.push({\n indexDescriptor: name,\n fields: indexConfig.fields,\n });\n }\n return this;\n }\n\n /**\n * Define a search index on this table.\n *\n * To learn about search indexes, see [Search](https://docs.convex.dev/text-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The search index configuration object.\n * @returns A {@link TableDefinition} with this search index included.\n */\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Indexes,\n // Update `SearchIndexes` to include the new index and use `Expand` to make\n // the types look pretty in editors.\n Expand<\n SearchIndexes &\n Record<\n IndexName,\n {\n searchField: SearchField;\n filterFields: FilterFields;\n }\n >\n >,\n VectorIndexes\n >;\n\n /**\n * Define a staged search index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about search indexes, see [Search](https://docs.convex.dev/text-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The search index configuration object.\n * @returns A {@link TableDefinition} with this search index included.\n */\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n searchIndex<\n IndexName extends string,\n SearchField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n SearchIndexConfig<SearchField, FilterFields> & IndexOptions\n >,\n ) {\n if (indexConfig.staged) {\n this.stagedSearchIndexes.push({\n indexDescriptor: name,\n searchField: indexConfig.searchField,\n filterFields: indexConfig.filterFields || [],\n });\n } else {\n this.searchIndexes.push({\n indexDescriptor: name,\n searchField: indexConfig.searchField,\n filterFields: indexConfig.filterFields || [],\n });\n }\n return this;\n }\n\n /**\n * Define a vector index on this table.\n *\n * To learn about vector indexes, see [Vector Search](https://docs.convex.dev/vector-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The vector index configuration object.\n * @returns A {@link TableDefinition} with this vector index included.\n */\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> &\n IndexOptions & { staged?: false }\n >,\n ): TableDefinition<\n DocumentType,\n Indexes,\n SearchIndexes,\n Expand<\n VectorIndexes &\n Record<\n IndexName,\n {\n vectorField: VectorField;\n dimensions: number;\n filterFields: FilterFields;\n }\n >\n >\n >;\n\n /**\n * Define a staged vector index on this table.\n *\n * For large tables, index backfill can be slow. Staging an index allows you\n * to push the schema and enable the index later.\n *\n * If `staged` is `true`, the index will be staged and will not be enabled\n * until the staged flag is removed. Staged indexes do not block push\n * completion. Staged indexes cannot be used in queries.\n *\n * To learn about vector indexes, see [Vector Search](https://docs.convex.dev/vector-search).\n *\n * @param name - The name of the index.\n * @param indexConfig - The vector index configuration object.\n * @returns A {@link TableDefinition} with this vector index included.\n */\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> &\n IndexOptions & { staged: true }\n >,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes>;\n\n vectorIndex<\n IndexName extends string,\n VectorField extends ExtractFieldPaths<DocumentType>,\n FilterFields extends ExtractFieldPaths<DocumentType> = never,\n >(\n name: IndexName,\n indexConfig: Expand<\n VectorIndexConfig<VectorField, FilterFields> & IndexOptions\n >,\n ) {\n if (indexConfig.staged) {\n this.stagedVectorIndexes.push({\n indexDescriptor: name,\n vectorField: indexConfig.vectorField,\n dimensions: indexConfig.dimensions,\n filterFields: indexConfig.filterFields || [],\n });\n } else {\n this.vectorIndexes.push({\n indexDescriptor: name,\n vectorField: indexConfig.vectorField,\n dimensions: indexConfig.dimensions,\n filterFields: indexConfig.filterFields || [],\n });\n }\n return this;\n }\n\n /**\n * Stage changes to this table's document validator.\n *\n * Convex validates the staged validator against the table's existing\n * documents in the background, while the validator passed to\n * {@link defineTable} remains the one enforced on writes. Once\n * the background validation succeeds, apply the staged changes\n * and remove `.staged()`.\n *\n * For an object validator, pass only the fields to add or replace. Fields\n * omitted from the changes keep their enforced validators.\n * Set a field to `undefined` to remove it from the staged validator.\n * For nested objects, you must specify the full object validator.\n *\n * ```ts\n * defineTable({\n * apple: v.string(),\n * banana: v.number(),\n * legacy: v.optional(v.string()),\n * }).staged({\n * banana: v.union(v.string(), v.number()),\n * legacy: undefined,\n * })\n * ```\n *\n * See [Staged validators](https://docs.convex.dev/database/schemas#staged-validators).\n *\n * @param documentSchema - Field changes for a table defined as an object or\n * `v.any()`, or a full schema validator specifying the proposed next document\n * type. Use a full schema validator for a table defined as a union.\n * @returns A {@link TableDefinition} with the staged validator attached.\n */\n staged(\n documentSchema:\n | Validator<Record<string, any>, \"required\", any>\n | Record<string, GenericValidator | undefined>,\n ): TableDefinition<DocumentType, Indexes, SearchIndexes, VectorIndexes> {\n if (this.stagedValidator !== undefined) {\n throw new Error(\"Table cannot have more than one staged validator.\");\n }\n if (isValidator(documentSchema)) {\n this.stagedValidator = documentSchema;\n } else {\n if (this.validator.kind !== \"object\" && this.validator.kind !== \"any\") {\n throw new Error(\n \"Specifying top-level field changes is only supported for simple table definitions. For a table defined with a union or record validator, you must stage a fully defined object or union validator.\",\n );\n }\n const enforcedFields =\n this.validator.kind === \"object\" ? this.validator.fields : {};\n const fields: Record<string, GenericValidator> = Object.fromEntries(\n Object.entries({ ...enforcedFields, ...documentSchema }).filter(\n (entry): entry is [string, GenericValidator] =>\n entry[1] !== undefined,\n ),\n );\n this.stagedValidator = v.object(fields);\n }\n return this.self();\n }\n\n /**\n * Work around for https://github.com/microsoft/TypeScript/issues/57035\n */\n protected self(): TableDefinition<\n DocumentType,\n Indexes,\n SearchIndexes,\n VectorIndexes\n > {\n return this;\n }\n /**\n * Export the contents of this definition.\n *\n * This is called internally by the Convex framework.\n * @internal\n */\n export() {\n const documentType = this.validator.json;\n if (typeof documentType !== \"object\") {\n throw new Error(\n \"Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)\",\n );\n }\n\n let stagedDocumentType = undefined;\n if (this.stagedValidator !== undefined) {\n stagedDocumentType = this.stagedValidator.json;\n if (typeof stagedDocumentType !== \"object\") {\n throw new Error(\n \"Invalid staged validator: please make sure that the parameter of `.staged()` is valid (see https://docs.convex.dev/database/schemas)\",\n );\n }\n }\n\n return {\n indexes: this.indexes,\n stagedDbIndexes: this.stagedDbIndexes,\n searchIndexes: this.searchIndexes,\n stagedSearchIndexes: this.stagedSearchIndexes,\n vectorIndexes: this.vectorIndexes,\n stagedVectorIndexes: this.stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n };\n }\n}\n\n/**\n * Define a table in a schema.\n *\n * You can either specify the schema of your documents as an object like\n * ```ts\n * defineTable({\n * field: v.string()\n * });\n * ```\n *\n * or as a schema type like\n * ```ts\n * defineTable(\n * v.union(\n * v.object({...}),\n * v.object({...})\n * )\n * );\n * ```\n *\n * @param documentSchema - The type of documents stored in this table.\n * @returns A {@link TableDefinition} for the table.\n *\n * @public\n */\nexport function defineTable<\n DocumentSchema extends Validator<Record<string, any>, \"required\", any>,\n>(documentSchema: DocumentSchema): TableDefinition<DocumentSchema>;\n/**\n * Define a table in a schema.\n *\n * You can either specify the schema of your documents as an object like\n * ```ts\n * defineTable({\n * field: v.string()\n * });\n * ```\n *\n * or as a schema type like\n * ```ts\n * defineTable(\n * v.union(\n * v.object({...}),\n * v.object({...})\n * )\n * );\n * ```\n *\n * @param documentSchema - The type of documents stored in this table.\n * @returns A {@link TableDefinition} for the table.\n *\n * @public\n */\nexport function defineTable<\n DocumentSchema extends Record<string, GenericValidator>,\n>(\n documentSchema: DocumentSchema,\n): TableDefinition<VObject<ObjectType<DocumentSchema>, DocumentSchema>>;\nexport function defineTable<\n DocumentSchema extends\n | Validator<Record<string, any>, \"required\", any>\n | Record<string, GenericValidator>,\n>(documentSchema: DocumentSchema): TableDefinition<any, any, any> {\n if (isValidator(documentSchema)) {\n return new TableDefinition(documentSchema);\n } else {\n return new TableDefinition(v.object(documentSchema));\n }\n}\n\n/**\n * The validators for the system fields Convex adds to every document.\n *\n * @public\n */\nexport type SystemFieldValidators<TableName extends string> = {\n _id: VId<GenericId<TableName>>;\n _creationTime: VFloat64<number>;\n};\n\n/**\n * Add the system field validators to an object validator, leaving any other\n * validator untouched.\n */\ntype WithSystemFieldValidators<\n TableName extends string,\n DocumentType extends Validator<any, any, any>,\n> =\n DocumentType extends VObject<infer Type, infer Fields, any, any>\n ? VObject<\n Expand<IdField<TableName> & SystemFields & Type>,\n Expand<SystemFieldValidators<TableName> & Fields>\n >\n : DocumentType;\n\n/**\n * The validator for whole documents of a table: the table's own validator with\n * the `_id` and `_creationTime` system fields added.\n *\n * For a table defined with a union, the system fields are added to each member\n * of the union.\n *\n * @public\n */\nexport type DocValidator<\n TableName extends string,\n DocumentType extends Validator<any, any, any>,\n> =\n DocumentType extends VUnion<any, infer Members, any, any>\n ? {\n [Index in keyof Members]: WithSystemFieldValidators<\n TableName,\n Members[Index]\n >;\n } extends infer NewMembers extends Validator<any, \"required\", any>[]\n ? VUnion<\n WithSystemFieldValidators<TableName, Members[number]>[\"type\"],\n NewMembers\n >\n : never\n : WithSystemFieldValidators<TableName, DocumentType>;\n\nfunction addSystemFields(\n tableName: string,\n validator: GenericValidator,\n): GenericValidator {\n switch (validator.kind) {\n case \"object\":\n return validator.extend({\n _id: v.id(tableName),\n _creationTime: v.number(),\n });\n case \"union\":\n return v.union(\n ...validator.members.map((member) =>\n addSystemFields(tableName, member),\n ),\n );\n // `v.any()` already permits the system fields.\n case \"any\":\n return validator;\n default:\n throw new Error(\n `Invalid validator for table \"${tableName}\": a table's documents must be objects, or a union of objects (see https://docs.convex.dev/database/schemas)`,\n );\n }\n}\n\n/**\n * Build the validator for whole documents of a table, by adding the `_id` and\n * `_creationTime` system fields to the table's own validator.\n *\n * Prefer {@link SchemaDefinition.doc} when you have the schema in hand: it\n * checks the table name against the schema.\n *\n * @example\n * ```ts\n * const messageDoc = docValidator(\"messages\", schema.tables.messages);\n *\n * export const get = query({\n * args: { id: v.id(\"messages\") },\n * returns: v.union(messageDoc, v.null()),\n * handler: (ctx, args) => ctx.db.get(args.id),\n * });\n * ```\n *\n * @param tableName - The name of the table, used for the `_id` validator.\n * @param table - The {@link TableDefinition} for that table.\n * @returns A validator matching documents of the table.\n *\n * @public\n */\nexport function docValidator<\n TableName extends string,\n Table extends TableDefinition<any, any, any, any>,\n>(\n tableName: TableName,\n table: Table,\n): DocValidator<TableName, Table[\"validator\"]> {\n return addSystemFields(tableName, table.validator) as DocValidator<\n TableName,\n Table[\"validator\"]\n >;\n}\n\n/**\n * A type describing the schema of a Convex project.\n *\n * This should be constructed using {@link defineSchema}, {@link defineTable},\n * and {@link v}.\n * @public\n */\nexport type GenericSchema = Record<string, TableDefinition>;\n\nfunction tableInSchema<\n Schema extends GenericSchema,\n TableName extends keyof Schema & string,\n>(\n schema: SchemaDefinition<Schema, boolean>,\n tableName: TableName,\n): Schema[TableName] {\n const table = schema.tables[tableName];\n if (table === undefined) {\n throw new Error(\n `Table \"${tableName}\" is not in this schema. Tables in this schema: ${Object.keys(\n schema.tables,\n ).join(\", \")}`,\n );\n }\n return table;\n}\n\n/**\n *\n * The definition of a Convex project schema.\n *\n * This should be produced by using {@link defineSchema}.\n * @public\n */\nexport class SchemaDefinition<\n Schema extends GenericSchema,\n StrictTableTypes extends boolean,\n> {\n public tables: Schema;\n public strictTableNameTypes!: StrictTableTypes;\n public readonly schemaValidation: boolean;\n\n /**\n * @internal\n */\n constructor(tables: Schema, options?: DefineSchemaOptions<StrictTableTypes>) {\n this.tables = tables;\n this.schemaValidation =\n options?.schemaValidation === undefined ? true : options.schemaValidation;\n }\n\n /**\n * The validator for whole documents of a table in this schema: the table's\n * own validator with the `_id` and `_creationTime` system fields added.\n *\n * @example\n * ```ts\n * export const get = query({\n * args: { id: schema.id(\"messages\") },\n * returns: v.union(schema.doc(\"messages\"), v.null()),\n * handler: (ctx, args) => ctx.db.get(args.id),\n * });\n * ```\n *\n * @param tableName - The name of a table in this schema.\n * @returns A validator matching documents of that table.\n */\n doc<TableName extends keyof Schema & string>(\n tableName: TableName,\n ): DocValidator<TableName, Schema[TableName][\"validator\"]> {\n return docValidator(tableName, tableInSchema(this, tableName));\n }\n\n /**\n * The validator for IDs of a table in this schema.\n *\n * Same as `v.id(tableName)`, but only accepts tables in this schema.\n *\n * @param tableName - The name of a table in this schema.\n * @returns A validator matching IDs of that table.\n */\n id<TableName extends keyof Schema & string>(\n tableName: TableName,\n ): VId<GenericId<TableName>> {\n tableInSchema(this, tableName);\n return v.id(tableName);\n }\n\n /**\n * Export the contents of this definition.\n *\n * This is called internally by the Convex framework.\n * @internal\n */\n export(): string {\n return JSON.stringify({\n tables: Object.entries(this.tables).map(([tableName, definition]) => {\n const {\n indexes,\n stagedDbIndexes,\n searchIndexes,\n stagedSearchIndexes,\n vectorIndexes,\n stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n } = definition.export();\n return {\n tableName,\n indexes,\n stagedDbIndexes,\n searchIndexes,\n stagedSearchIndexes,\n vectorIndexes,\n stagedVectorIndexes,\n documentType,\n stagedDocumentType,\n };\n }),\n schemaValidation: this.schemaValidation,\n });\n }\n}\n\n/**\n * Options for {@link defineSchema}.\n *\n * @public\n */\nexport interface DefineSchemaOptions<StrictTableNameTypes extends boolean> {\n /**\n * Whether Convex should validate at runtime that all documents match\n * your schema.\n *\n * If `schemaValidation` is `true`, Convex will:\n * 1. Check that all existing documents match your schema when your schema\n * is pushed.\n * 2. Check that all insertions and updates match your schema during mutations.\n *\n * If `schemaValidation` is `false`, Convex will not validate that new or\n * existing documents match your schema. You'll still get schema-specific\n * TypeScript types, but there will be no validation at runtime that your\n * documents match those types.\n *\n * By default, `schemaValidation` is `true`.\n */\n schemaValidation?: boolean;\n\n /**\n * Whether the TypeScript types should allow accessing tables not in the schema.\n *\n * If `strictTableNameTypes` is `true`, using tables not listed in the schema\n * will generate a TypeScript compilation error.\n *\n * If `strictTableNameTypes` is `false`, you'll be able to access tables not\n * listed in the schema and their document type will be `any`.\n *\n * `strictTableNameTypes: false` is useful for rapid prototyping.\n *\n * Regardless of the value of `strictTableNameTypes`, your schema will only\n * validate documents in the tables listed in the schema. You can still create\n * and modify other tables on the dashboard or in JavaScript mutations.\n *\n * By default, `strictTableNameTypes` is `true`.\n */\n strictTableNameTypes?: StrictTableNameTypes;\n}\n\n/**\n * Define the schema of this Convex project.\n *\n * This should be exported as the default export from a `schema.ts` file in\n * your `convex/` directory. The schema enables runtime validation of documents\n * and provides end-to-end TypeScript type safety.\n *\n * Every document in Convex automatically has two system fields:\n * - `_id` - a unique document ID with validator `v.id(\"tableName\")`\n * - `_creationTime` - a creation timestamp with validator `v.number()`\n *\n * You do not need to include these in your schema definition, they are added\n * automatically.\n *\n * @example\n * ```ts\n * // convex/schema.ts\n * import { defineSchema, defineTable } from \"convex/server\";\n * import { v } from \"convex/values\";\n *\n * export default defineSchema({\n * users: defineTable({\n * name: v.string(),\n * email: v.string(),\n * }).index(\"by_email\", [\"email\"]),\n *\n * messages: defineTable({\n * body: v.string(),\n * userId: v.id(\"users\"),\n * channelId: v.id(\"channels\"),\n * }).index(\"by_channel\", [\"channelId\"]),\n *\n * channels: defineTable({\n * name: v.string(),\n * }),\n *\n * // Discriminated union table:\n * results: defineTable(\n * v.union(\n * v.object({ kind: v.literal(\"error\"), message: v.string() }),\n * v.object({ kind: v.literal(\"success\"), value: v.number() }),\n * )\n * ),\n * });\n * ```\n *\n * **Best practice:** Always include all index fields in the index name. For\n * example, an index on `[\"field1\", \"field2\"]` should be named\n * `\"by_field1_field2\"`.\n *\n * @param schema - A map from table name to {@link TableDefinition} for all of\n * the tables in this project.\n * @param options - Optional configuration. See {@link DefineSchemaOptions} for\n * a full description.\n * @returns The schema.\n *\n * @see https://docs.convex.dev/database/schemas\n * @public\n */\nexport function defineSchema<\n Schema extends GenericSchema,\n StrictTableNameTypes extends boolean = true,\n>(\n schema: Schema,\n options?: DefineSchemaOptions<StrictTableNameTypes>,\n): SchemaDefinition<Schema, StrictTableNameTypes> {\n return new SchemaDefinition(schema, options);\n}\n\n/**\n * Internal type used in Convex code generation!\n *\n * Convert a {@link SchemaDefinition} into a {@link server.GenericDataModel}.\n *\n * @public\n */\nexport type DataModelFromSchemaDefinition<\n SchemaDef extends SchemaDefinition<any, boolean>,\n> = MaybeMakeLooseDataModel<\n {\n [TableName in keyof SchemaDef[\"tables\"] &\n string]: SchemaDef[\"tables\"][TableName] extends TableDefinition<\n infer DocumentType,\n infer Indexes,\n infer SearchIndexes,\n infer VectorIndexes\n >\n ? {\n // We've already added all of the system fields except for `_id`.\n // Add that here.\n document: Expand<IdField<TableName> & ExtractDocument<DocumentType>>;\n fieldPaths:\n | keyof IdField<TableName>\n | ExtractFieldPaths<DocumentType>;\n indexes: Expand<Indexes & SystemIndexes>;\n searchIndexes: SearchIndexes;\n vectorIndexes: VectorIndexes;\n }\n : never;\n },\n SchemaDef[\"strictTableNameTypes\"]\n>;\n\ntype MaybeMakeLooseDataModel<\n DataModel extends GenericDataModel,\n StrictTableNameTypes extends boolean,\n> = StrictTableNameTypes extends true\n ? DataModel\n : Expand<DataModel & AnyDataModel>;\n\nconst _systemSchema = defineSchema({\n _scheduled_functions: defineTable({\n name: v.string(),\n args: v.array(v.any()),\n scheduledTime: v.float64(),\n completedTime: v.optional(v.float64()),\n state: v.union(\n v.object({ kind: v.literal(\"pending\") }),\n v.object({ kind: v.literal(\"inProgress\") }),\n v.object({ kind: v.literal(\"success\") }),\n v.object({ kind: v.literal(\"failed\"), error: v.string() }),\n v.object({ kind: v.literal(\"canceled\") }),\n ),\n }),\n _storage: defineTable({\n sha256: v.string(),\n size: v.float64(),\n contentType: v.optional(v.string()),\n }),\n});\n\nexport interface SystemDataModel extends DataModelFromSchemaDefinition<\n typeof _systemSchema\n> {}\n\nexport type SystemTableNames = TableNamesInDataModel<SystemDataModel>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CA,uBAKO;AA8IA,MAAM,gBAKX;AAAA;AAAA;AAAA;AAAA,EAgBA,YAAY,cAA4B;AAfxC,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AACR,wBAAQ;AAER;AAAA;AAGA;AAAA;AAAA,wBAAQ;AAMN,SAAK,UAAU,CAAC;AAChB,SAAK,kBAAkB,CAAC;AACxB,SAA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C;AAAA,IACrB,eAAe,mBAAE,QAAQ;AAAA,IACzB,eAAe,mBAAE,SAAS,mBAAE,QAAQ,CAAC;AAAA,IACrC,OAAO,mBAAE;AAAA,MACP,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,SAAS,EAAE,CAAC;AAAA,MACvC,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,YAAY,EAAE,CAAC;AAAA,MAC1C,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,SAAS,EAAE,CAAC;AAAA,MACvC,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,QAAQ,GAAG,OAAO,mBAAE,OAAO,EAAE,CAAC;AAAA,MACzD,mBAAE,OAAO,EAAE,MAAM,mBAAE,QAAQ,UAAU,EAAE,CAAC;AAAA,IAC1C;AAAA,EACF,CAAC;AAAA,EACD,UAAU,YAAY;AAAA,IACpB,QAAQ,mBAAE,OAAO;AAAA,IACjB,MAAM,mBAAE,QAAQ;AAAA,IAChB,aAAa,mBAAE,SAAS,mBAAE,OAAO,CAAC;AAAA,EACpC,CAAC;AACH,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/server/storage.ts"],
4
- "sourcesContent": ["import { GenericId } from \"../values/index.js\";\n\n/**\n * @deprecated This ID format is no longer returned by stable file storage APIs. Use `Id<\"_storage\">` instead.\n *\n * The old ID format used by Convex file storage.\n *\n * \u26A0\uFE0F Security warning: Anyone that has knows to this ID can download the underlying file\n * from `https://<deployment>.convex.cloud/api/storage/<storageId>`.\n * (Note that it\u2019s safe to share the new ID format, `Id<\"_storage\">`, to anyone).\n *\n * @public\n */\nexport type StorageId = string;\n\n/**\n * @deprecated This type is only necessary for backwards compatibility with Convex versions that\n * pre-date `convex@1.6.0`. Use `Id<\"_storage\">` instead.\n */\nexport type FileStorageId = GenericId<\"_storage\"> | StorageId;\n\n/**\n * @deprecated This type is only returned by {@link StorageReader.getUrl | storage.getUrl}.\n * To get the details of a document, use `ctx.db.system.get(\"_storage\", storageId)` instead.\n *\n * Metadata for a single file as returned by {@link StorageReader.getMetadata | storage.getMetadata}.\n *\n * @public\n */\nexport type FileMetadata = {\n /**\n * ID for referencing the file (eg. via {@link StorageReader.getUrl | storage.getUrl})\n *\n * This is an older ID format that is no longer returned by stable file storage APIs.\n * Consider using `Id<\"_storage\">` instead.\n *\n * \u26A0\uFE0F Security warning: Anyone that has knows to this ID can download the underlying file\n * from `https://<deployment>.convex.cloud/api/storage/<storageId>`.\n * (Note that it\u2019s safe to share the new ID format, `Id<\"_storage\">`, to anyone).\n */\n storageId: StorageId;\n /**\n * Hex encoded sha256 checksum of file contents\n */\n sha256: string;\n /**\n * Size of the file in bytes\n */\n size: number;\n /**\n * ContentType of the file if it was provided on upload\n */\n contentType: string | null;\n};\n\n/**\n * An interface to read files from storage within Convex query functions.\n *\n * Available as `ctx.storage` in queries (read-only), mutations, and actions.\n *\n * @example\n * ```typescript\n * // Get a URL for a stored file:\n * const url = await ctx.storage.getUrl(storageId);\n * if (url) {\n * // Use the URL (e.g., return it to the client)\n * }\n *\n * // Get file metadata via the system table (preferred over deprecated getMetadata):\n * const metadata = await ctx.db.system.get(\"_storage\", storageId);\n * // metadata: { _id, _creationTime, sha256, size, contentType? }\n * ```\n *\n * @see https://docs.convex.dev/file-storage\n * @public\n */\nexport interface StorageReader {\n /**\n * Get the URL for a file in storage by its `Id<\"_storage\">`.\n *\n * The GET response includes a standard HTTP Digest header with a sha256 checksum.\n *\n * @example\n * ```typescript\n * const url = await ctx.storage.getUrl(storageId);\n * ```\n *\n * @param storageId - The `Id<\"_storage\">` of the file to fetch from Convex storage.\n * @returns - A URL which fetches the file via an HTTP GET, or `null` if the file no longer exists.\n */\n getUrl(storageId: GenericId<\"_storage\">): Promise<string | null>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.getUrl(Id<\"_storage\">)` instead.\n *\n * Get the URL for a file in storage by its {@link StorageId}.\n *\n * The GET response includes a standard HTTP Digest header with a sha256 checksum.\n *\n * @param storageId - The {@link StorageId} of the file to fetch from Convex storage.\n * @returns - A url which fetches the file via an HTTP GET, or `null` if it no longer exists.\n */\n getUrl<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<string | null>;\n\n /**\n * @deprecated Use `ctx.db.system.get(\"_storage\", storageId)` instead, which returns\n * equivalent metadata from the `_storage` system table (with a slightly different shape):\n * ```typescript\n * const metadata = await ctx.db.system.get(\"_storage\", storageId);\n * // { _id, _creationTime, sha256, size, contentType? }\n * ```\n *\n * Get metadata for a file.\n *\n * @param storageId - The `Id<\"_storage\">` of the file.\n * @returns - A {@link FileMetadata} object if found or `null` if not found.\n */\n getMetadata(storageId: GenericId<\"_storage\">): Promise<FileMetadata | null>;\n\n /**\n * @deprecated Use `ctx.db.system.get(\"_storage\", storageId)` instead.\n *\n * Get metadata for a file.\n *\n * @param storageId - The {@link StorageId} of the file.\n * @returns - A {@link FileMetadata} object if found or `null` if not found.\n */\n getMetadata<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<FileMetadata | null>;\n}\n\n/**\n * An interface to write files to storage within Convex mutation functions.\n *\n * Available as `ctx.storage` in mutations.\n *\n * @see https://docs.convex.dev/file-storage\n * @public\n */\nexport interface StorageWriter extends StorageReader {\n /**\n * Generate a short-lived URL for uploading a file into storage.\n *\n * The client should make a POST request to this URL with the file as the\n * body. The response will be a JSON object containing a newly allocated\n * `Id<\"_storage\">` (`{ storageId: \"...\" }`).\n *\n * @example\n * ```typescript\n * // In a mutation, generate the upload URL:\n * export const generateUploadUrl = mutation({\n * args: {},\n * returns: v.string(),\n * handler: async (ctx) => {\n * return await ctx.storage.generateUploadUrl();\n * },\n * });\n *\n * // On the client, upload the file:\n * // const uploadUrl = await generateUploadUrl();\n * // const result = await fetch(uploadUrl, { method: \"POST\", body: file });\n * // const { storageId } = await result.json();\n * ```\n *\n * @returns - A short-lived URL for uploading a file via HTTP POST.\n */\n generateUploadUrl(): Promise<string>;\n /**\n * Delete a file from Convex storage.\n *\n * Once a file is deleted, any URLs previously generated by {@link StorageReader.getUrl} will return 404s.\n *\n * @example\n * ```typescript\n * await ctx.storage.delete(storageId);\n * ```\n *\n * @param storageId - The `Id<\"_storage\">` of the file to delete from Convex storage.\n */\n delete(storageId: GenericId<\"_storage\">): Promise<void>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.delete(Id<\"_storage\">)` instead.\n *\n * Delete a file from Convex storage.\n *\n * Once a file is deleted, any URLs previously generated by {@link StorageReader.getUrl} will return 404s.\n *\n * @param storageId - The {@link StorageId} of the file to delete from Convex storage.\n */\n delete<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<void>;\n\n /**\n * @internal\n */\n // TODO: move `store` from StorageActionWriter to StorageWriter when mutation\n // file storage access is ready for release\n store(\n blob: Blob,\n options?: { sha256?: string },\n ): Promise<GenericId<\"_storage\">>;\n\n /**\n * @internal\n */\n // TODO: move `get` from StorageActionWriter to StorageWriter when mutation\n // file storage access is ready for release\n get(storageId: GenericId<\"_storage\">): Promise<Blob | null>;\n}\n\n/**\n * An interface to read and write files to storage within Convex actions and HTTP actions.\n *\n * In actions, `ctx.storage` has additional methods not available in mutations:\n * `get()` to download a file as a Blob, and `store()` to upload a Blob directly.\n *\n * @example\n * ```typescript\n * // In an action, download and re-upload a file:\n * const blob = await ctx.storage.get(storageId);\n * if (blob) {\n * const newStorageId = await ctx.storage.store(blob);\n * }\n * ```\n *\n * @public\n */\nexport interface StorageActionWriter extends StorageWriter {\n /**\n * Download a file from storage as a Blob.\n *\n * Only available in actions and HTTP actions (not in mutations or queries).\n *\n * @param storageId - The `Id<\"_storage\">` of the file.\n * @returns A Blob containing the file contents, or `null` if the file doesn't exist.\n */\n get(storageId: GenericId<\"_storage\">): Promise<Blob | null>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.get(Id<\"_storage\">)` instead.\n *\n * Get a Blob containing the file associated with the provided {@link StorageId}, or `null` if there is no file.\n */\n get<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<Blob | null>;\n /**\n * Upload a Blob directly to storage.\n *\n * Only available in actions and HTTP actions. For client-side uploads from\n * mutations, use `generateUploadUrl()` instead.\n *\n * @example\n * ```typescript\n * const storageId = await ctx.storage.store(blob);\n * // Save storageId to the database via ctx.runMutation\n * ```\n *\n * @param blob - The Blob to store.\n * @param options - Optional settings. Pass `sha256` to verify the file integrity.\n * @returns The `Id<\"_storage\">` of the newly stored file.\n */\n store(\n blob: Blob,\n options?: { sha256?: string },\n ): Promise<GenericId<\"_storage\">>;\n}\n"],
4
+ "sourcesContent": ["import { GenericId } from \"../values/index.js\";\n\n/**\n * @deprecated This ID format is no longer returned by stable file storage APIs. Use `Id<\"_storage\">` instead.\n *\n * The old ID format used by Convex file storage.\n *\n * \u26A0\uFE0F Security warning: Anyone that has knows to this ID can download the underlying file\n * from `https://<deployment>.convex.cloud/api/storage/<storageId>`.\n * (Note that it\u2019s safe to share the new ID format, `Id<\"_storage\">`, to anyone).\n *\n * @public\n */\nexport type StorageId = string;\n\n/**\n * @deprecated This type is only necessary for backwards compatibility with Convex versions that\n * pre-date `convex@1.6.0`. Use `Id<\"_storage\">` instead.\n */\nexport type FileStorageId = GenericId<\"_storage\"> | StorageId;\n\n/**\n * @deprecated This type is only returned by {@link StorageReader.getUrl | storage.getUrl}.\n * To get the details of a document, use `ctx.db.system.get(\"_storage\", storageId)` instead.\n *\n * Metadata for a single file as returned by {@link StorageReader.getMetadata | storage.getMetadata}.\n *\n * @public\n */\nexport type FileMetadata = {\n /**\n * ID for referencing the file (eg. via {@link StorageReader.getUrl | storage.getUrl})\n *\n * This is an older ID format that is no longer returned by stable file storage APIs.\n * Consider using `Id<\"_storage\">` instead.\n *\n * \u26A0\uFE0F Security warning: Anyone that has knows to this ID can download the underlying file\n * from `https://<deployment>.convex.cloud/api/storage/<storageId>`.\n * (Note that it\u2019s safe to share the new ID format, `Id<\"_storage\">`, to anyone).\n */\n storageId: StorageId;\n /**\n * Hex encoded sha256 checksum of file contents\n */\n sha256: string;\n /**\n * Size of the file in bytes\n */\n size: number;\n /**\n * ContentType of the file if it was provided on upload\n */\n contentType: string | null;\n};\n\n/**\n * An interface to read files from storage within Convex query functions.\n *\n * Available as `ctx.storage` in queries (read-only), mutations, and actions.\n *\n * @example\n * ```typescript\n * // Get a URL for a stored file:\n * const url = await ctx.storage.getUrl(storageId);\n * if (url) {\n * // Use the URL (e.g., return it to the client)\n * }\n *\n * // Get file metadata via the system table (preferred over deprecated getMetadata):\n * const metadata = await ctx.db.system.get(\"_storage\", storageId);\n * // metadata: { _id, _creationTime, sha256, size, contentType? }\n * ```\n *\n * @see https://docs.convex.dev/file-storage\n * @public\n */\nexport interface StorageReader {\n /**\n * Get the URL for a file in storage by its `Id<\"_storage\">`.\n *\n * The GET response includes a standard HTTP Digest header with a sha256 checksum.\n *\n * @example\n * ```typescript\n * const url = await ctx.storage.getUrl(storageId);\n * ```\n *\n * @param storageId - The `Id<\"_storage\">` of the file to fetch from Convex storage.\n * @returns - A URL which fetches the file via an HTTP GET, or `null` if the file no longer exists.\n */\n getUrl(storageId: GenericId<\"_storage\">): Promise<string | null>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.getUrl(Id<\"_storage\">)` instead.\n *\n * Get the URL for a file in storage by its {@link StorageId}.\n *\n * The GET response includes a standard HTTP Digest header with a sha256 checksum.\n *\n * @param storageId - The {@link StorageId} of the file to fetch from Convex storage.\n * @returns - A url which fetches the file via an HTTP GET, or `null` if it no longer exists.\n */\n getUrl<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<string | null>;\n\n /**\n * @deprecated Use `ctx.db.system.get(\"_storage\", storageId)` instead, which returns\n * equivalent metadata from the `_storage` system table (with a slightly different shape):\n * ```typescript\n * const metadata = await ctx.db.system.get(\"_storage\", storageId);\n * // { _id, _creationTime, sha256, size, contentType? }\n * ```\n *\n * Get metadata for a file.\n *\n * @param storageId - The `Id<\"_storage\">` of the file.\n * @returns - A {@link FileMetadata} object if found or `null` if not found.\n */\n getMetadata(storageId: GenericId<\"_storage\">): Promise<FileMetadata | null>;\n\n /**\n * @deprecated Use `ctx.db.system.get(\"_storage\", storageId)` instead.\n *\n * Get metadata for a file.\n *\n * @param storageId - The {@link StorageId} of the file.\n * @returns - A {@link FileMetadata} object if found or `null` if not found.\n */\n getMetadata<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<FileMetadata | null>;\n}\n\n/**\n * An interface to read and write files to storage within Convex mutation functions.\n *\n * Available as `ctx.storage` in mutations, actions, and HTTP actions.\n *\n * @see https://docs.convex.dev/file-storage\n * @public\n */\nexport interface StorageWriter extends StorageReader {\n /**\n * Generate a short-lived URL for uploading a file into storage.\n *\n * The client should make a POST request to this URL with the file as the\n * body. The response will be a JSON object containing a newly allocated\n * `Id<\"_storage\">` (`{ storageId: \"...\" }`).\n *\n * @example\n * ```typescript\n * // In a mutation, generate the upload URL:\n * export const generateUploadUrl = mutation({\n * args: {},\n * returns: v.string(),\n * handler: async (ctx) => {\n * return await ctx.storage.generateUploadUrl();\n * },\n * });\n *\n * // On the client, upload the file:\n * // const uploadUrl = await generateUploadUrl();\n * // const result = await fetch(uploadUrl, { method: \"POST\", body: file });\n * // const { storageId } = await result.json();\n * ```\n *\n * @returns - A short-lived URL for uploading a file via HTTP POST.\n */\n generateUploadUrl(): Promise<string>;\n /**\n * Delete a file from Convex storage.\n *\n * Once a file is deleted, any URLs previously generated by {@link StorageReader.getUrl} will return 404s.\n *\n * @example\n * ```typescript\n * await ctx.storage.delete(storageId);\n * ```\n *\n * @param storageId - The `Id<\"_storage\">` of the file to delete from Convex storage.\n */\n delete(storageId: GenericId<\"_storage\">): Promise<void>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.delete(Id<\"_storage\">)` instead.\n *\n * Delete a file from Convex storage.\n *\n * Once a file is deleted, any URLs previously generated by {@link StorageReader.getUrl} will return 404s.\n *\n * @param storageId - The {@link StorageId} of the file to delete from Convex storage.\n */\n delete<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<void>;\n\n /**\n * Download a file from storage as a Blob.\n *\n * In mutations, files read count toward the transaction's `filesRead` and\n * `fileReadBytes` limits. Use\n * `ctx.meta.getTransactionMetrics()` to check the remaining headroom.\n *\n * @param storageId - The `Id<\"_storage\">` of the file.\n * @returns A Blob containing the file contents, or `null` if the file doesn't exist.\n */\n get(storageId: GenericId<\"_storage\">): Promise<Blob | null>;\n\n /**\n * @deprecated Passing a string is deprecated, use `storage.get(Id<\"_storage\">)` instead.\n *\n * Get a Blob containing the file associated with the provided {@link StorageId}, or `null` if there is no file.\n */\n get<T extends StorageId>(\n storageId: T extends { __tableName: any } ? never : T,\n ): Promise<Blob | null>;\n\n /**\n * Upload a Blob directly to storage.\n *\n * To upload files from a client, use {@link StorageWriter.generateUploadUrl}\n * instead.\n *\n * In mutations, files stored count toward the transaction's `filesWritten`\n * and `fileWriteBytes` limits. Use\n * `ctx.meta.getTransactionMetrics()` to check the remaining headroom.\n *\n * @example\n * ```typescript\n * const storageId = await ctx.storage.store(blob);\n * // If in an action, save storageId to the database via ctx.runMutation\n * ```\n *\n * @param blob - The Blob to store.\n * @param options - Optional settings. Pass `sha256` to verify the file integrity.\n * @returns The `Id<\"_storage\">` of the newly stored file.\n */\n store(\n blob: Blob,\n options?: { sha256?: string },\n ): Promise<GenericId<\"_storage\">>;\n}\n\n/**\n * An interface to read and write files to storage within Convex actions and HTTP actions.\n *\n * @example\n * ```typescript\n * // In an action, download and re-upload a file:\n * const blob = await ctx.storage.get(storageId);\n * if (blob) {\n * const newStorageId = await ctx.storage.store(blob);\n * }\n * ```\n *\n * @public\n */\nexport interface StorageActionWriter extends StorageWriter {}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aiFiles.d.ts","sourceRoot":"","sources":["../../../src/cli/aiFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuJtD,eAAO,MAAM,OAAO,qBAaI,CAAC"}
1
+ {"version":3,"file":"aiFiles.d.ts","sourceRoot":"","sources":["../../../src/cli/aiFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAiLtD,eAAO,MAAM,OAAO,qBAaI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/cli/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAE9B,MAAM,cAAc,CAAC;AA4EtB,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC;IACT,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE;QACV,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,6BAA6B,CAAC,kBAAkB,CAAC,CAAC;KACrE,CAAC;CACH,CAAC,CAyBD;AAuFD,eAAO,MAAM,GAAG;;;;;;;;MA2Bb,CAAC"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/cli/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAE9B,MAAM,cAAc,CAAC;AA4EtB,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC;IACT,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE;QACV,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,6BAA6B,CAAC,kBAAkB,CAAC,CAAC;KACrE,CAAC;CACH,CAAC,CAyBD;AA0FD,eAAO,MAAM,GAAG;;;;;;;;MA2Bb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"envDefault.d.ts","sourceRoot":"","sources":["../../../src/cli/envDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAKL,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,mBAAmB,EAEnB,cAAc,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AA8J/D,eAAO,MAAM,UAAU,qBAmBF,CAAC;AAqGtB,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,OAAO,EACZ,gBAAgB,EAAE;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;CAChC,GAAG,IAAI,EACR,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAwBxB"}
1
+ {"version":3,"file":"envDefault.d.ts","sourceRoot":"","sources":["../../../src/cli/envDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAKL,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,mBAAmB,EAEnB,cAAc,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAiK/D,eAAO,MAAM,UAAU,qBAmBF,CAAC;AAqGtB,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,OAAO,EACZ,gBAAgB,EAAE;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;CAChC,GAAG,IAAI,EACR,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAwBxB"}
@@ -4,9 +4,11 @@ export declare function hasGuidelinesInstalled(convexDir: string): Promise<boole
4
4
  * Download and write the guidelines file.
5
5
  * Guidelines live in `_generated/` so local edits are not expected and are
6
6
  * not preserved.
7
+ *
8
+ * Returns false if the guidelines could not be downloaded.
7
9
  */
8
10
  export declare function installGuidelinesFile({ convexDir, state, }: {
9
11
  convexDir: string;
10
12
  state: AiFilesState;
11
- }): Promise<void>;
13
+ }): Promise<boolean>;
12
14
  //# sourceMappingURL=guidelinesmd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guidelinesmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/guidelinesmd.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB"}
1
+ {"version":3,"file":"guidelinesmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/guidelinesmd.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBnB"}
@@ -1,15 +1,24 @@
1
1
  import { Context } from "../../../bundler/context.js";
2
2
  import { type AiFilesPaths } from "./paths.js";
3
3
  import { type AiFilesProjectConfig } from "../config.js";
4
+ type InstallAiFilesResult = {
5
+ kind: "success";
6
+ } | {
7
+ kind: "error";
8
+ message: string;
9
+ };
4
10
  /**
5
11
  * Install or refresh all Convex AI files.
6
12
  *
7
13
  * Reads the existing state if present, or starts from a blank one for a
8
14
  * fresh install.
15
+ *
16
+ * Writes everything it can even when the guidelines download or the skills
17
+ * install fails, and returns an error if either of them failed.
9
18
  */
10
19
  export declare function installAiFiles({ projectDir, convexDir, aiFilesConfig, }: AiFilesPaths & {
11
20
  aiFilesConfig?: AiFilesProjectConfig | undefined;
12
- }): Promise<void>;
21
+ }): Promise<InstallAiFilesResult>;
13
22
  export declare function isAiFilesDisabled(aiFilesConfig: AiFilesProjectConfig | undefined): boolean;
14
23
  /**
15
24
  * Check whether the Convex AI files are out of date and log a nag message
@@ -45,4 +54,5 @@ export declare function attemptSetupAiFiles({ ctx, convexDir, projectDir, aiFile
45
54
  ctx: Context;
46
55
  aiFilesConfig?: AiFilesProjectConfig | undefined;
47
56
  } & AiFilesPaths): Promise<void>;
57
+ export {};
48
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAOtD,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,YAAY,CAAC;AAWlE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA0BzD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,EACnC,UAAU,EACV,SAAS,E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AAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC;;;GAGG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,SAAS,GACV,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0B7C;AAoCD,wBAAsB,mBAAmB,CAAC,EACxC,GAAG,EACH,SAAS,EACT,UAAU,EACV,aAAa,GACd,EAAE;IACD,GAAG,EAAE,OAAO,CAAC;IACb,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB/B"}
@@ -3,12 +3,15 @@ import { type AiFilesProjectConfig } from "../config.js";
3
3
  /**
4
4
  * Install Convex agent skills and record the SHA into the state.
5
5
  * Handles the kill-switch check and all logging internally.
6
+ *
7
+ * Returns false if the skills CLI failed. Skipping skills because no agents
8
+ * are configured or the kill switch is on counts as success.
6
9
  */
7
10
  export declare function installSkills({ projectDir, state, aiFilesConfig, }: {
8
11
  projectDir: string;
9
12
  state: AiFilesState;
10
13
  aiFilesConfig?: AiFilesProjectConfig | undefined;
11
- }): Promise<void>;
14
+ }): Promise<boolean>;
12
15
  export type RemoveInstalledSkillsStatus = "unchanged" | "removed" | "failed";
13
16
  /**
14
17
  * Remove Convex-managed agent skills and clean up the lock file if empty.
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/skills.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAyGzD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB;AAED,MAAM,MAAM,2BAA2B,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7E;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAwBvC"}
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/skills.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAyGzD;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBnB;AAED,MAAM,MAAM,2BAA2B,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7E;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAwBvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BA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B,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAC1C;IACD,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;IAC1C,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAiBA;AAwcD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,aAAa,iBAoE7B"}
@@ -2271,6 +2271,19 @@ export declare const startPushResponse: z.ZodObject<{
2271
2271
  };
2272
2272
  }>;
2273
2273
  export type StartPushResponse = z.infer<typeof startPushResponse>;
2274
+ /**
2275
+ * Replaces every occurrence of an environment variable's value in `node`'s
2276
+ * strings with `<redacted>`. Values reappear in push responses wherever the
2277
+ * code read them, such as auth providers built from `process.env` in
2278
+ * `auth.config.ts`.
2279
+ */
2280
+ export declare function redactEnvironmentVariableValues<T>(node: T, environmentVariables: Record<string, string>): T;
2281
+ /**
2282
+ * A copy of the response that is safe to print. `environmentVariables` holds
2283
+ * every value on the deployment so `finish_push` can detect concurrent changes,
2284
+ * and those values are often secrets.
2285
+ */
2286
+ export declare function startPushResponseForLogging(response: StartPushResponse): StartPushResponse;
2274
2287
  export declare const evaluatePushResponse: z.ZodObject<{
2275
2288
  schemaChange: z.ZodObject<{
2276
2289
  allocatedComponentIds: z.ZodAny;
@@ -1 +1 @@
1
- {"version":3,"file":"startPush.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/deployApi/startPush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -27,5 +27,6 @@ export declare function envGet(ctx: Context, backend: EnvVarBackend, name: strin
27
27
  export declare function envRemove(ctx: Context, backend: EnvVarBackend, name: string): Promise<void>;
28
28
  export declare function envList(ctx: Context, backend: EnvVarBackend, options?: {
29
29
  namesOnly?: boolean;
30
+ includeValues?: boolean;
30
31
  }): Promise<void>;
31
32
  //# sourceMappingURL=env.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/env.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AA+BnD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1B,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE;IACV,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAC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AC;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE;IACV,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACA,aAAa,CAgCf;AAED,wBAAsB,MAAM,CAC1B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,oBA+CF;AAED,wBAAsB,MAAM,CAC1B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,iBAQb;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,iBAMb;AAED,wBAAsB,OAAO,CAC3B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,iBA4B3D"}
@@ -17,5 +17,11 @@ export declare function handleDashboard(ctx: Context, deployment: {
17
17
  dashboardPort: number;
18
18
  cleanupHandle: string;
19
19
  }>;
20
+ /**
21
+ * The dashboard is only meant to be opened at the URL the CLI prints, so
22
+ * requests addressed to any other hostname are not served, even if that
23
+ * hostname resolves to 127.0.0.1.
24
+ */
25
+ export declare function isLoopbackHost(host: string | undefined, port: number): boolean;
20
26
  export declare function dashboardUrl(ctx: Context, deploymentName: string): string | null;
21
27
  //# sourceMappingURL=dashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAiBtD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjE,OAAO,EAAE;IACP,iHAAiH;IACjH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;;;GAiEF;AAiCD,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAOhE"}
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAiBtD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjE,OAAO,EAAE;IACP,iHAAiH;IACjH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;;;GAuEF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,WAMpE;AAiCD,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAOhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/download.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAqCtD,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,OAAO,EACZ,OAAO,EACH;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBlD;AAqBD;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAC/C,cAAc,SAAS,OAAO,EAE9B,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,cAAc,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAS/D;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,cAAc,SAAS,OAAO,EAE9B,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,cAAc,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CA4D/D;AAqJD,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAU5E"}
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/download.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAsCtD,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,OAAO,EACZ,OAAO,EACH;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBlD;AAmCD;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAC/C,cAAc,SAAS,OAAO,EAE9B,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,cAAc,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAS/D;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,cAAc,SAAS,OAAO,EAE9B,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,cAAc,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CA4D/D;AAqJD,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAW5E"}
@@ -23,4 +23,5 @@ export declare function chooseLocalBackendPorts(ctx: Context, options?: {
23
23
  export declare function printLocalDeploymentWelcomeMessage(): void;
24
24
  export declare const LOCAL_BACKEND_INSTANCE_SECRET = "4361726e697461732c206c69746572616c6c79206d65616e696e6720226c6974";
25
25
  export declare function releaseDate(version: string): string | null;
26
+ export declare function isValidBackendVersion(version: string): boolean;
26
27
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAKtD,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,EACE,KAAK,EACL,cAAc,EACd,cAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC,m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;CACnB,GACA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CA+BxB;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EACX;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACzD,SAAS,CAAC;IACd,cAAc,CAAC,EACX;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACzD,SAAS,CAAC;CACf,GACA,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBlD;AAED,wBAAgB,kCAAkC,SASjD;AAED,eAAO,MAAM,6BAA6B,qEAC0B,CAAC;AAIrE,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9D"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns the name of the AI agent running this process, or null if none is
3
+ * detected. `@vercel/detect-agent` recognizes the environment variables that
4
+ * agents like Claude Code, Codex and Cursor set; `CONVEX_AGENT_MODE` is
5
+ * Convex's own.
6
+ */
7
+ export declare function detectAiAgent(): Promise<string | null>;
8
+ //# sourceMappingURL=aiAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiAgent.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/utils/aiAgent.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM5D"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.47.0";
1
+ export declare const version = "1.48.0";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -197,4 +197,69 @@ export interface Auth {
197
197
  */
198
198
  getUserIdentity(): Promise<UserIdentity | null>;
199
199
  }
200
+ /**
201
+ * {@link Auth} for mutations, which can also sign JWTs with this deployment's
202
+ * key.
203
+ *
204
+ * @public
205
+ */
206
+ export interface MutationAuth extends Auth {
207
+ /**
208
+ * Sign an ES256 JWT with this deployment's key.
209
+ *
210
+ * Pass the `claims` and `expiresInSeconds` values that match your use case.
211
+ *
212
+ * Convex populates the header and sets the `iss`, `iat` and `exp` claims.
213
+ *
214
+ * The `iss` is `process.env.CONVEX_CLOUD_URL` for the app and
215
+ * `${process.env.CONVEX_CLOUD_URL}/components/<name>` for a component.
216
+ *
217
+ * Anyone can verify these tokens against the public keys at
218
+ * `${process.env.CONVEX_CLOUD_URL}/.well-known/jwks.json`.
219
+ *
220
+ * Claims are signed but not encrypted, so anyone holding the token can read
221
+ * them.
222
+ *
223
+ * Prefer short token lifetimes: a token can't be revoked individually, and a
224
+ * mutation can always sign a fresh one to reassert the claims. This API
225
+ * allows a token to have a max expiration of 1 hour from issuance.
226
+ *
227
+ * Claims that start with `convex` or `cvx` (case insensitive) and the `nbf`
228
+ * claim are reserved and may not be set.
229
+ */
230
+ signJwt(options: SignJwtOptions): Promise<string>;
231
+ }
232
+ /**
233
+ * Claims that callers may not set on JWTs with {@link MutationAuth.signJwt}.
234
+ */
235
+ export type ReservedJwtClaim = "iss" | "iat" | "exp" | "nbf";
236
+ /**
237
+ * Every ASCII casing of `S`: `AnyCase<"cvx">` is `"cvx" | "cvX" | "cVx" | ...`.
238
+ */
239
+ type AnyCase<S extends string> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First> | Uppercase<First>}${AnyCase<Rest>}` : S;
240
+ /**
241
+ * Claim names starting with `convex` or `cvx`, in any casing, are reserved
242
+ * for Convex. They may not be set on JWTs with {@link MutationAuth.signJwt}.
243
+ */
244
+ export type ReservedJwtClaimPrefix = AnyCase<"convex" | "cvx">;
245
+ /**
246
+ * Rejects claim names starting with a {@link ReservedJwtClaimPrefix}.
247
+ */
248
+ type ReservedPrefixJwtClaims = {
249
+ [K: `${ReservedJwtClaimPrefix}${string}`]: never;
250
+ };
251
+ /**
252
+ * The claims a caller passes to {@link MutationAuth.signJwt}: any JSON value,
253
+ * except for the {@link ReservedJwtClaim}s and names starting with a
254
+ * {@link ReservedJwtClaimPrefix}.
255
+ */
256
+ export type SignJwtClaims = Record<string, JSONValue> & {
257
+ [K in ReservedJwtClaim]?: never;
258
+ } & ReservedPrefixJwtClaims;
259
+ export type SignJwtOptions = {
260
+ claims?: SignJwtClaims;
261
+ /** How long the token stays valid, at least 1 second and at most 1 hour. */
262
+ expiresInSeconds: number;
263
+ };
264
+ export {};
200
265
  //# sourceMappingURL=authentication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/server/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAEpB;IACE;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,GAED;IACE,IAAI,EAAE,WAAW,CAAC;IAElB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC;CAC9B,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE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