@madewithremy/admin 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1181,6 +1181,8 @@ interface DataSourceJob {
1181
1181
  budgetCredits: number | null;
1182
1182
  budgetDollars: number | null;
1183
1183
  maxInflightBatches: number;
1184
+ /** Embedding at the provider's priority tier (1.5x the embedding price). */
1185
+ priority: boolean;
1184
1186
  limitObjects: number | null;
1185
1187
  enumerationDone: boolean;
1186
1188
  counts: {
@@ -2720,6 +2722,11 @@ interface StartParams {
2720
2722
  budgetDollars?: number;
2721
2723
  /** Batches in flight at once (default 64, max 128). */
2722
2724
  concurrency?: number;
2725
+ /**
2726
+ * Embed at the provider's priority tier: calls are admitted ahead of the
2727
+ * provider's queue at 1.5x the embedding price. Off by default.
2728
+ */
2729
+ priority?: boolean;
2723
2730
  /** Process only the first N objects — a sample of the corpus. */
2724
2731
  limit?: number;
2725
2732
  }
@@ -2771,6 +2778,8 @@ declare function get$7(ctx: AdminContext, params: JobIdParams): Promise<DataSour
2771
2778
  declare function approve(ctx: AdminContext, params: JobIdParams & {
2772
2779
  /** Batches in flight from here on (max 128); the plan was made at the job's current value. */
2773
2780
  concurrency?: number;
2781
+ /** Embed at the provider's priority tier from here on (1.5x the embedding price). */
2782
+ priority?: boolean;
2774
2783
  }): Promise<DataSourceJobResult>;
2775
2784
  /** Stop dispatching batches; the ones in flight finish. */
2776
2785
  declare function pause(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
@@ -2778,6 +2787,8 @@ declare function pause(ctx: AdminContext, params: JobIdParams): Promise<DataSour
2778
2787
  declare function resume$1(ctx: AdminContext, params: JobIdParams & {
2779
2788
  /** Batches in flight from here on (max 128). */
2780
2789
  concurrency?: number;
2790
+ /** Embed at the provider's priority tier from here on (1.5x the embedding price). */
2791
+ priority?: boolean;
2781
2792
  }): Promise<DataSourceJobResult>;
2782
2793
  /** End the job. Documents already indexed stay. */
2783
2794
  declare function cancel(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
@@ -2905,6 +2916,8 @@ interface SyncParams {
2905
2916
  limit?: number;
2906
2917
  /** Batches in flight (default 64, max 128). */
2907
2918
  concurrency?: number;
2919
+ /** Embed at the provider's priority tier (1.5x the embedding price). Off by default. */
2920
+ priority?: boolean;
2908
2921
  }
2909
2922
  /**
2910
2923
  * Start a sync: list the bucket, diff by ETag, run a job over what changed.
package/dist/index.js CHANGED
@@ -818,13 +818,14 @@ function base2(appId) {
818
818
  return `/_internal/v2/apps/${appId}/datasources/jobs`;
819
819
  }
820
820
  function start(ctx, params) {
821
- const { slug, source, approve: approve2, budgetDollars, concurrency, limit } = params;
821
+ const { slug, source, approve: approve2, budgetDollars, concurrency, priority, limit } = params;
822
822
  return call(ctx, "POST", base2(ctx.appId), {
823
823
  slug,
824
824
  source,
825
825
  ...approve2 ? { approve: true } : {},
826
826
  ...budgetDollars !== void 0 ? { budgetDollars } : {},
827
827
  ...concurrency !== void 0 ? { concurrency } : {},
828
+ ...priority ? { priority: true } : {},
828
829
  ...limit !== void 0 ? { limit } : {}
829
830
  });
830
831
  }
@@ -857,9 +858,16 @@ function approve(ctx, params) {
857
858
  ctx,
858
859
  "POST",
859
860
  `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/approve`,
860
- params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
861
+ controlBody(params)
861
862
  );
862
863
  }
864
+ function controlBody(params) {
865
+ const body = {
866
+ ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {},
867
+ ...params.priority !== void 0 ? { priority: params.priority } : {}
868
+ };
869
+ return Object.keys(body).length > 0 ? body : void 0;
870
+ }
863
871
  function pause(ctx, params) {
864
872
  return call(
865
873
  ctx,
@@ -872,7 +880,7 @@ function resume(ctx, params) {
872
880
  ctx,
873
881
  "POST",
874
882
  `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/resume`,
875
- params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
883
+ controlBody(params)
876
884
  );
877
885
  }
878
886
  function cancel(ctx, params) {
@@ -1006,7 +1014,8 @@ function sync(ctx, params) {
1006
1014
  slug: params.slug,
1007
1015
  ...params.budgetDollars !== void 0 ? { budgetDollars: params.budgetDollars } : {},
1008
1016
  ...params.limit !== void 0 ? { limit: params.limit } : {},
1009
- ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {}
1017
+ ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {},
1018
+ ...params.priority ? { priority: true } : {}
1010
1019
  });
1011
1020
  }
1012
1021