@madewithremy/admin 0.1.33 → 0.1.35

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
@@ -2080,14 +2080,19 @@ interface DataSourceReader {
2080
2080
  */
2081
2081
  interface DataSourceReaderDeliveries {
2082
2082
  pending: number;
2083
+ /** Sent to frames that are reading them now, up to a frame's worth for each of the reader's frames. */
2083
2084
  inFlight: number;
2084
2085
  retrying: number;
2085
2086
  parked: number;
2086
- /** The newest failures, the document null for a `cleared`. */
2087
+ /**
2088
+ * The newest failures, the document null for a `cleared`: when each failed
2089
+ * (null if unknown) and when it is tried again (null once parked).
2090
+ */
2087
2091
  recentErrors: {
2088
2092
  documentId: string | null;
2089
2093
  error: string;
2090
- at: string;
2094
+ failedAt: string | null;
2095
+ retryAt: string | null;
2091
2096
  }[];
2092
2097
  }
2093
2098
  /** POST /datasources/reader/status */
@@ -4100,8 +4105,8 @@ declare namespace dataSourceMappers {
4100
4105
  * Response types for the db command group.
4101
4106
  *
4102
4107
  * Sources in youai-api:
4103
- * POST /db/query → src/http/routes/V2Apps/manage/dbQuery.ts
4104
- * AppDataDatabasesDao.executeSqlBatch returns
4108
+ * POST /db/query → apps/api/src/roles/http/routes/Apps/manage/dbQuery.ts
4109
+ * AppDatabasesDao.executeSqlBatch returns
4105
4110
  * Array<{ rows: any[]; changes: number }>
4106
4111
  */
4107
4112
  /**
@@ -4116,6 +4121,16 @@ interface DbQueryResult {
4116
4121
  /** Rows modified by a DML statement; 0 for SELECT. */
4117
4122
  changes: number;
4118
4123
  }>;
4124
+ /**
4125
+ * Display info for the people the rows reference (user-typed columns hold
4126
+ * `@@user@@<id>`), keyed by user id. Only people the workspace may see.
4127
+ */
4128
+ resolvedUsers: Record<string, {
4129
+ id: string;
4130
+ username: string;
4131
+ displayName: string | null;
4132
+ profilePictureUrl: string | null;
4133
+ }>;
4119
4134
  }
4120
4135
 
4121
4136
  /**
@@ -4134,16 +4149,15 @@ interface DbQueryResult {
4134
4149
  * accepted. The `results` array always has exactly one element for a single
4135
4150
  * statement; `changes` is 0 for SELECT.
4136
4151
  *
4137
- * SQL errors (syntax, constraint violations, etc.) surface as HTTP 400
4138
- * responses with a `code` field rather than throwing — check `error.code`
4139
- * in the response when the call fails.
4152
+ * A statement the database refuses (a syntax error, a constraint, a result
4153
+ * too large) throws with `errorString: 'sql_error'`, and the body's
4154
+ * `errorMessage` is the database's own message.
4140
4155
  *
4141
4156
  * @param sql The SQL statement to execute.
4142
4157
  * @throws AdminApiError `no_live_release` (404) — the app has not been
4143
4158
  * deployed; `no_database` (404) — the live release has no database;
4144
4159
  * `invalid_request` (400) — `queries[]` missing or malformed;
4145
- * `query_error` (400) — the SQL failed at the database layer;
4146
- * `unique_constraint_violated` (400) — a UNIQUE constraint was violated.
4160
+ * `sql_error` (400) — the database refused the statement.
4147
4161
  * @example
4148
4162
  * const { results } = await admin.db.query('SELECT * FROM users LIMIT 10');
4149
4163
  */
@@ -6840,6 +6854,14 @@ interface MethodsInvokeResult {
6840
6854
  * and user-facing error messages.
6841
6855
  */
6842
6856
 
6857
+ /**
6858
+ * How long an invoke waits for the method's answer: as long as the API's load
6859
+ * balancer holds an idle connection (600 s), since a method can run for many
6860
+ * minutes and a request can't outwait that. A method still running past it
6861
+ * carries on; `requests list --method <id>` shows how it ended.
6862
+ * @internal Consumed by the CLI skin; not part of the documented surface.
6863
+ */
6864
+ declare const METHOD_RUN_TIMEOUT_MS = 600000;
6843
6865
  interface MethodsInvokeParams {
6844
6866
  /** The method's compiled id (e.g. `mth_abc123`), as shown by `methods.list`. */
6845
6867
  methodId: string;
@@ -6882,10 +6904,11 @@ declare function list$4(ctx: AdminContext): Promise<DashboardReleaseMethod[]>;
6882
6904
  */
6883
6905
  declare function invoke(ctx: AdminContext, params: MethodsInvokeParams): Promise<MethodsInvokeResult>;
6884
6906
 
6907
+ declare const methods_METHOD_RUN_TIMEOUT_MS: typeof METHOD_RUN_TIMEOUT_MS;
6885
6908
  type methods_MethodsInvokeParams = MethodsInvokeParams;
6886
6909
  declare const methods_invoke: typeof invoke;
6887
6910
  declare namespace methods {
6888
- export { type methods_MethodsInvokeParams as MethodsInvokeParams, methods_invoke as invoke, list$4 as list };
6911
+ export { methods_METHOD_RUN_TIMEOUT_MS as METHOD_RUN_TIMEOUT_MS, type methods_MethodsInvokeParams as MethodsInvokeParams, methods_invoke as invoke, list$4 as list };
6889
6912
  }
6890
6913
 
6891
6914
  /**
package/dist/index.js CHANGED
@@ -2487,9 +2487,11 @@ function grade(ctx, runId) {
2487
2487
  // src/ops/methods.ts
2488
2488
  var methods_exports = {};
2489
2489
  __export(methods_exports, {
2490
+ METHOD_RUN_TIMEOUT_MS: () => METHOD_RUN_TIMEOUT_MS,
2490
2491
  invoke: () => invoke,
2491
2492
  list: () => list10
2492
2493
  });
2494
+ var METHOD_RUN_TIMEOUT_MS = 6e5;
2493
2495
  async function list10(ctx) {
2494
2496
  const dashboard = await call(
2495
2497
  ctx,
@@ -2507,7 +2509,13 @@ function invoke(ctx, params) {
2507
2509
  const useImpersonate = impersonate !== void 0 && (impersonate.roles !== void 0 || impersonate.userId !== void 0);
2508
2510
  const apiPath = useImpersonate ? `/_internal/v2/apps/${ctx.appId}/methods/${seg(methodId)}/invoke-as` : `/_internal/v2/apps/${ctx.appId}/methods/${seg(methodId)}/invoke`;
2509
2511
  const body = useImpersonate ? { input, impersonate } : { input };
2510
- return call(ctx, "POST", apiPath, body);
2512
+ return call(
2513
+ ctx,
2514
+ "POST",
2515
+ apiPath,
2516
+ body,
2517
+ METHOD_RUN_TIMEOUT_MS
2518
+ );
2511
2519
  }
2512
2520
 
2513
2521
  // src/ops/prerender.ts