@madewithremy/admin 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ What changed in `@madewithremy/admin`, newest first, each version under its own
4
4
 
5
5
  Versions before 0.1.44 aren't recorded here.
6
6
 
7
+ ## 0.1.57
8
+
9
+ ### New
10
+
11
+ - `datasources list` (`admin.dataSources.list`) gives each source's `documentLimit`: the most documents it may hold, the app's limit, or `null` when unlimited. A source nearing it shows before an add is refused.
12
+
13
+ ### Changed behavior
14
+
15
+ - A document added past the limit is refused with `document_limit_reached` (422), where it was `entitlement_required:unlimited_data_source_documents`. Support raises the limit per app or workspace. Code that branched on the old code should check for the new one.
16
+
7
17
  ## 0.1.56
8
18
 
9
19
  ### New
package/dist/index.d.ts CHANGED
@@ -2757,6 +2757,11 @@ interface DataSourcesListEntry {
2757
2757
  name: string | null;
2758
2758
  /** Total document count (active pipeline). */
2759
2759
  documentCount: number;
2760
+ /**
2761
+ * The most documents the source may hold, the app's limit; null when
2762
+ * unlimited. An add past it is refused with `document_limit_reached`.
2763
+ */
2764
+ documentLimit: number | null;
2760
2765
  counts: DataSourcesBuildProgress;
2761
2766
  /** Source-document bytes (does not include vector storage). */
2762
2767
  storageBytes: number;
@@ -3123,6 +3128,8 @@ interface AddDocumentResult {
3123
3128
  *
3124
3129
  * @throws AdminApiError `invalid_content_hash` (400) — malformed hash
3125
3130
  * (internal; `addDocument` computes this from `content`).
3131
+ * @throws AdminApiError `document_limit_reached` (422) — the source holds the
3132
+ * app's limit of documents (`documentLimit` in `list`); support raises it.
3126
3133
  * @example
3127
3134
  * const result = await admin.dataSources.addDocument({
3128
3135
  * slug: 'policies',
@@ -3241,7 +3248,8 @@ declare function documents(ctx: AdminContext, params: DocumentsParams): Promise<
3241
3248
  */
3242
3249
  declare function allDocuments(ctx: AdminContext, params: Omit<DocumentsParams, 'cursor' | 'limit'>): Promise<DataSourcesDocumentStatus[]>;
3243
3250
  /**
3244
- * List all data sources with document counts, build progress, and active
3251
+ * List all data sources with document counts, the most documents each may
3252
+ * hold (`documentLimit`, null when unlimited), build progress, and active
3245
3253
  * version metadata.
3246
3254
  *
3247
3255
  * @example