@madewithremy/admin 0.1.0 → 0.1.2

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/prod.js CHANGED
@@ -36,11 +36,11 @@ function fatal(message) {
36
36
  throw new CliError(message);
37
37
  }
38
38
  var AdminApiError = class extends Error {
39
- constructor(method, path5, status, body) {
40
- super(`API ${method} ${path5} returned ${status}: ${JSON.stringify(body)}`);
39
+ constructor(method, path5, status2, body) {
40
+ super(`API ${method} ${path5} returned ${status2}: ${JSON.stringify(body)}`);
41
41
  this.method = method;
42
42
  this.path = path5;
43
- this.status = status;
43
+ this.status = status2;
44
44
  this.body = body;
45
45
  this.name = "AdminApiError";
46
46
  }
@@ -2988,6 +2988,7 @@ var CONFIG_FLAGS = {
2988
2988
  "min-chars": { type: "number", min: 0 },
2989
2989
  "drop-blocks": { type: "string" },
2990
2990
  contextual: { type: "string" },
2991
+ "contextual-model": { type: "string" },
2991
2992
  "describe-images": { type: "string" },
2992
2993
  "embedding-model": { type: "string" },
2993
2994
  "image-model": { type: "string" },
@@ -3253,7 +3254,10 @@ function configFromFlags(a) {
3253
3254
  if (dropBlocks !== void 0) {
3254
3255
  chunking.dropBlockTypes = dropBlocks.split(",").map((s) => s.trim()).filter(Boolean);
3255
3256
  }
3256
- const contextual = triState(a, "contextual", "enabled");
3257
+ const contextual = {
3258
+ ...triState(a, "contextual", "enabled"),
3259
+ ...a.str("contextual-model") ? { modelId: a.str("contextual-model") } : {}
3260
+ };
3257
3261
  const images = {
3258
3262
  ...triState(a, "describe-images", "describe"),
3259
3263
  ...a.str("image-model") ? { modelId: a.str("image-model") } : {}
@@ -3426,7 +3430,10 @@ Search options:
3426
3430
  coerce: true/false and numbers become typed.
3427
3431
  Pass a JSON object for the full grammar:
3428
3432
  metadata, filename, documentIds, pages, contains,
3429
- phrase \u2014 e.g. --filter '{"pages":{"max":3}}'
3433
+ phrase \u2014 e.g. --filter '{"pages":{"max":3}}'.
3434
+ Metadata takes numeric ranges via {gte,lte}: store
3435
+ dates as integers (YYYYMMDD or epoch seconds), then
3436
+ --filter '{"metadata":{"date":{"gte":20250101}}}'
3430
3437
  --phrase <text> Chunk must contain this exact word sequence
3431
3438
  --contains <words> Chunk must contain ALL these words, any order
3432
3439
  --max-per-document <n> Cap hits per document; backfills from others
@@ -3456,6 +3463,8 @@ Tuning a corpus:
3456
3463
  --contextual <true|false> LLM context blurb per chunk. Improves retrieval
3457
3464
  on long documents; costs a model call per chunk
3458
3465
  at ingest. Off by default \u2014 measure on your data.
3466
+ --contextual-model <id> Which chat model writes the blurbs. Optional:
3467
+ enabling without it uses the platform default.
3459
3468
  --describe-images <true|false> Vision pass over images inside documents,
3460
3469
  substituting a description into the searchable
3461
3470
  text. ON by default: a document with no images
@@ -4606,6 +4615,13 @@ function stats2(ctx, params = {}) {
4606
4615
  `/_internal/v2/apps/${ctx.appId}/outbound-email/summary${qs(params)}`
4607
4616
  );
4608
4617
  }
4618
+ function status(ctx) {
4619
+ return call(
4620
+ ctx,
4621
+ "GET",
4622
+ `/_internal/v2/apps/${ctx.appId}/outbound-email/status`
4623
+ );
4624
+ }
4609
4625
  function batches(ctx, params = {}) {
4610
4626
  return call(
4611
4627
  ctx,
@@ -4702,6 +4718,9 @@ var emailSpecs = {
4702
4718
  usage: "Usage: remy-admin email stats [--start <ISO date>] [--end <ISO date>]",
4703
4719
  flags: { ...WINDOW }
4704
4720
  },
4721
+ "email status": {
4722
+ usage: "Usage: remy-admin email status"
4723
+ },
4705
4724
  "email batches": {
4706
4725
  usage: "Usage: remy-admin email batches [--start <ISO date>] [--end <ISO date>] [--limit 50]",
4707
4726
  flags: { ...WINDOW, ...PAGINATION }
@@ -4793,6 +4812,9 @@ async function emailGet(ctx, a) {
4793
4812
  async function emailStats(ctx, a) {
4794
4813
  out(await stats2(ctx, { start: a.str("start"), end: a.str("end") }));
4795
4814
  }
4815
+ async function emailStatus(ctx) {
4816
+ out(await status(ctx));
4817
+ }
4796
4818
  async function emailBatches(ctx, a) {
4797
4819
  out(
4798
4820
  await batches(ctx, {
@@ -4829,7 +4851,12 @@ async function emailUnsuppress(ctx, a) {
4829
4851
  const { reason, at } = result.platformSuppression;
4830
4852
  console.error(
4831
4853
  `
4832
- Note: removed from this app's list, but ${a.req("email")} is still on the platform suppression list (${reason}${at ? ` since ${at}` : ""}). Mail to it will still be blocked \u2014 that list is account-wide and is not cleared.`
4854
+ Note: removed from this app's list, but ${a.req("email")} is still on the ACCOUNT-wide suppression list (${reason}${at ? ` since ${at}` : ""}). Mail to it will still be blocked \u2014 that list is shared by every app and is not cleared.`
4855
+ );
4856
+ } else if (result?.tenantEntryRemoved) {
4857
+ console.error(
4858
+ `
4859
+ Note: also cleared this app's provider-side bounce/complaint record for ${a.req("email")}. Mail will be attempted again \u2014 another hard bounce re-suppresses it automatically.`
4833
4860
  );
4834
4861
  }
4835
4862
  }
@@ -4868,6 +4895,7 @@ var emailHandlers = {
4868
4895
  "email list": emailList,
4869
4896
  "email get": emailGet,
4870
4897
  "email stats": emailStats,
4898
+ "email status": emailStatus,
4871
4899
  "email batches": emailBatches,
4872
4900
  "email batch": emailBatch,
4873
4901
  "email suppressions": emailSuppressions,
@@ -4891,7 +4919,8 @@ Subcommands:
4891
4919
  list List sent messages (includes mail that never reached the provider)
4892
4920
  get Full detail for one message, including bounce diagnostics
4893
4921
  stats Counts and rates over a window
4894
- batches One row per blast, with per-status counts
4922
+ status Can this app send right now? Pause/throttle state + daily quota
4923
+ batches One row per blast, with per-status counts and delivery progress
4895
4924
  batch Stats for a single blast
4896
4925
  suppressions This app's unsubscribe list
4897
4926
  suppress Add an address to the unsubscribe list
@@ -4903,15 +4932,26 @@ Subcommands:
4903
4932
 
4904
4933
  Notes:
4905
4934
  Statuses: suppressed, failed, sent, delivered, blocked, bounced, complained,
4906
- delayed, rejected. "blocked" means the platform-wide suppression list dropped
4907
- it \u2014 usually another tenant's hard bounce \u2014 not that this address is bad.
4935
+ delayed, rejected. "blocked" means an SES suppression list dropped it before
4936
+ delivery \u2014 usually this app's OWN list, after an earlier hard bounce or spam
4937
+ report from that address ('unsuppress' clears it and says which list it was).
4938
+
4939
+ 'status' is the first check when sends are failing or a send returns
4940
+ 409 sending_paused. sending.source 'ses' = Amazon paused the tenant (clears
4941
+ when the finding clears; nothing lifts it directly); 'platform' = our
4942
+ bounce/complaint enforcement \u2014 enforcement.origin 'platform' steps down on
4943
+ its own as rates recover, 'operator' is a human hold and will not. A reduced
4944
+ quota.limit with an expiresAt is an automatic throttle.
4908
4945
 
4909
4946
  --recipient is an exact match and is index-backed; use --search for partials
4910
4947
  (bounded, and not paginated).
4911
4948
 
4912
4949
  A marketing send delivers one message per recipient, so a campaign is many
4913
4950
  rows sharing a batch id. Pass batchId to sendEmail to group them under your own
4914
- campaign id.
4951
+ campaign id. Large and marketing sends are QUEUED: accepted immediately,
4952
+ delivered in chunks \u2014 a batch's status (accepted|sending|completed|partial|
4953
+ failed), chunksDone/chunksTotal and pending report the progress. status null
4954
+ is a normal send that delivered inline, not an error.
4915
4955
 
4916
4956
  An inbox row's id is its request-log id: open the full detail (parsed message,
4917
4957
  method run, errors) with 'requests get <id>'.
@@ -4934,6 +4974,8 @@ Custom domains \u2014 two independent directions:
4934
4974
  the records and 'verify' again).
4935
4975
 
4936
4976
  Examples:
4977
+ remy-admin email status
4978
+ remy-admin email list --status bounced,blocked --limit 50
4937
4979
  remy-admin email domains add mail.acme.com
4938
4980
  remy-admin email domains verify mail.acme.com
4939
4981
  remy-admin email inbound-domains check acme.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",