@madewithremy/admin 0.1.28 → 0.1.30

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.js CHANGED
@@ -196,6 +196,27 @@ function threadsGet(ctx, threadId) {
196
196
  );
197
197
  }
198
198
 
199
+ // src/ops/tasks.ts
200
+ var tasks_exports = {};
201
+ __export(tasks_exports, {
202
+ get: () => get,
203
+ list: () => list
204
+ });
205
+ function list(ctx, params = {}) {
206
+ return call(
207
+ ctx,
208
+ "GET",
209
+ `/_internal/v2/apps/${ctx.appId}/task-traces${qs(params)}`
210
+ );
211
+ }
212
+ function get(ctx, traceId) {
213
+ return call(
214
+ ctx,
215
+ "GET",
216
+ `/_internal/v2/apps/${ctx.appId}/task-traces/${seg(traceId)}`
217
+ );
218
+ }
219
+
199
220
  // src/ops/analytics.ts
200
221
  var analytics_exports = {};
201
222
  __export(analytics_exports, {
@@ -285,12 +306,12 @@ function publish(ctx, params) {
285
306
  // src/ops/crashes.ts
286
307
  var crashes_exports = {};
287
308
  __export(crashes_exports, {
288
- get: () => get,
289
- list: () => list,
309
+ get: () => get2,
310
+ list: () => list2,
290
311
  occurrences: () => occurrences,
291
312
  stats: () => stats
292
313
  });
293
- function list(ctx, params = {}) {
314
+ function list2(ctx, params = {}) {
294
315
  return call(
295
316
  ctx,
296
317
  "GET",
@@ -304,7 +325,7 @@ function occurrences(ctx, fingerprint, params = {}) {
304
325
  `/_internal/v2/apps/${ctx.appId}/frontend-errors/${seg(fingerprint)}/events${qs(params)}`
305
326
  );
306
327
  }
307
- function get(ctx, eventId) {
328
+ function get2(ctx, eventId) {
308
329
  return call(
309
330
  ctx,
310
331
  "GET",
@@ -322,10 +343,10 @@ function stats(ctx, params = {}) {
322
343
  // src/ops/cron.ts
323
344
  var cron_exports = {};
324
345
  __export(cron_exports, {
325
- list: () => list2,
346
+ list: () => list3,
326
347
  run: () => run
327
348
  });
328
- function list2(ctx, params = {}) {
349
+ function list3(ctx, params = {}) {
329
350
  return call(
330
351
  ctx,
331
352
  "GET",
@@ -385,7 +406,7 @@ __export(dataSources_exports, {
385
406
  deleteSource: () => deleteSource,
386
407
  documents: () => documents,
387
408
  drop: () => drop,
388
- list: () => list3,
409
+ list: () => list4,
389
410
  move: () => move,
390
411
  promote: () => promote,
391
412
  revectorize: () => revectorize,
@@ -616,7 +637,7 @@ async function waitForCandidate(ctx, params) {
616
637
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
617
638
  const outcome = await pollUntil(
618
639
  async () => {
619
- const { dataSources } = await list3(ctx);
640
+ const { dataSources } = await list4(ctx);
620
641
  const source = dataSources.find((s) => s.slug === params.slug);
621
642
  if (!source) {
622
643
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -698,7 +719,7 @@ async function allDocuments(ctx, params) {
698
719
  }
699
720
  return out;
700
721
  }
701
- function list3(ctx) {
722
+ function list4(ctx) {
702
723
  return call(ctx, "GET", base(ctx.appId));
703
724
  }
704
725
  function search(ctx, params) {
@@ -788,7 +809,7 @@ async function waitForMove(ctx, params) {
788
809
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
789
810
  const outcome = await pollUntil(
790
811
  async () => {
791
- const { dataSources } = await list3(ctx);
812
+ const { dataSources } = await list4(ctx);
792
813
  const source2 = dataSources.find((s) => s.slug === params.slug);
793
814
  if (!source2) {
794
815
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -907,8 +928,8 @@ __export(dataSourceJobs_exports, {
907
928
  approve: () => approve,
908
929
  cancel: () => cancel,
909
930
  describeProgress: () => describeProgress,
910
- get: () => get2,
911
- list: () => list4,
931
+ get: () => get3,
932
+ list: () => list5,
912
933
  pause: () => pause,
913
934
  resume: () => resume,
914
935
  retry: () => retry,
@@ -944,14 +965,14 @@ async function uploadManifest(ctx, params) {
944
965
  await uploadDirect(token.upload, params.content, "manifest.jsonl");
945
966
  return { key: token.key };
946
967
  }
947
- function list4(ctx, params) {
968
+ function list5(ctx, params) {
948
969
  return call(
949
970
  ctx,
950
971
  "GET",
951
972
  `${base2(ctx.appId)}${qs({ slug: params?.slug })}`
952
973
  );
953
974
  }
954
- function get2(ctx, params) {
975
+ function get3(ctx, params) {
955
976
  return call(
956
977
  ctx,
957
978
  "GET",
@@ -1015,7 +1036,7 @@ function waitForJob(ctx, params) {
1015
1036
  async function settle(ctx, params, isSettled) {
1016
1037
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS2;
1017
1038
  const outcome = await pollUntil(
1018
- async () => (await get2(ctx, { id: params.id })).job,
1039
+ async () => (await get3(ctx, { id: params.id })).job,
1019
1040
  isSettled,
1020
1041
  {
1021
1042
  timeoutMs,
@@ -1075,7 +1096,7 @@ var dataSourceConnectors_exports = {};
1075
1096
  __export(dataSourceConnectors_exports, {
1076
1097
  connect: () => connect,
1077
1098
  disconnect: () => disconnect,
1078
- get: () => get3,
1099
+ get: () => get4,
1079
1100
  sync: () => sync
1080
1101
  });
1081
1102
  function base3(appId) {
@@ -1110,7 +1131,7 @@ function connect(ctx, params) {
1110
1131
  }
1111
1132
  );
1112
1133
  }
1113
- function get3(ctx, params) {
1134
+ function get4(ctx, params) {
1114
1135
  return call(
1115
1136
  ctx,
1116
1137
  "GET",
@@ -1182,7 +1203,7 @@ async function waitForHydration(ctx, params) {
1182
1203
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
1183
1204
  const outcome = await pollUntil(
1184
1205
  async () => {
1185
- const { dataSources } = await list3(ctx);
1206
+ const { dataSources } = await list4(ctx);
1186
1207
  const source2 = dataSources.find((s) => s.slug === params.slug);
1187
1208
  if (!source2) {
1188
1209
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -1496,18 +1517,18 @@ var releases_exports = {};
1496
1517
  __export(releases_exports, {
1497
1518
  byCommit: () => byCommit,
1498
1519
  dashboardLive: () => dashboardLive,
1499
- get: () => get4,
1500
- list: () => list5,
1520
+ get: () => get5,
1521
+ list: () => list6,
1501
1522
  waitForCommit: () => waitForCommit
1502
1523
  });
1503
- function list5(ctx, params = {}) {
1524
+ function list6(ctx, params = {}) {
1504
1525
  return call(
1505
1526
  ctx,
1506
1527
  "GET",
1507
1528
  `/_internal/v2/apps/${ctx.appId}/releases${qs({ limit: params.limit })}`
1508
1529
  );
1509
1530
  }
1510
- function get4(ctx, releaseId) {
1531
+ function get5(ctx, releaseId) {
1511
1532
  return call(
1512
1533
  ctx,
1513
1534
  "GET",
@@ -1658,10 +1679,10 @@ __export(domains_exports, {
1658
1679
  customRemove: () => customRemove,
1659
1680
  customRetry: () => customRetry,
1660
1681
  findHostname: () => findHostname,
1661
- get: () => get5,
1682
+ get: () => get6,
1662
1683
  set: () => set
1663
1684
  });
1664
- function get5(ctx) {
1685
+ function get6(ctx) {
1665
1686
  return call(
1666
1687
  ctx,
1667
1688
  "GET",
@@ -1742,9 +1763,9 @@ __export(email_exports, {
1742
1763
  batch: () => batch2,
1743
1764
  batches: () => batches,
1744
1765
  checkDomain: () => checkDomain,
1745
- get: () => get6,
1766
+ get: () => get7,
1746
1767
  inbox: () => inbox,
1747
- list: () => list6,
1768
+ list: () => list7,
1748
1769
  listDomains: () => listDomains,
1749
1770
  removeDomain: () => removeDomain,
1750
1771
  stats: () => stats2,
@@ -1779,14 +1800,14 @@ async function resolveDomainId(ctx, direction, domain) {
1779
1800
  }
1780
1801
  return match.id;
1781
1802
  }
1782
- function list6(ctx, params = {}) {
1803
+ function list7(ctx, params = {}) {
1783
1804
  return call(
1784
1805
  ctx,
1785
1806
  "GET",
1786
1807
  `/_internal/v2/apps/${ctx.appId}/outbound-email/messages${qs(params)}`
1787
1808
  );
1788
1809
  }
1789
- function get6(ctx, messageId) {
1810
+ function get7(ctx, messageId) {
1790
1811
  return call(
1791
1812
  ctx,
1792
1813
  "GET",
@@ -1978,9 +1999,9 @@ var infra_exports = {};
1978
1999
  __export(infra_exports, {
1979
2000
  DEFAULT_WAIT_TIMEOUT_MS: () => DEFAULT_WAIT_TIMEOUT_MS4,
1980
2001
  destroy: () => destroy,
1981
- get: () => get7,
2002
+ get: () => get8,
1982
2003
  hibernate: () => hibernate,
1983
- list: () => list7,
2004
+ list: () => list8,
1984
2005
  logs: () => logs,
1985
2006
  provision: () => provision,
1986
2007
  rename: () => rename,
@@ -1993,14 +2014,14 @@ var POLL_MS5 = 3e3;
1993
2014
  function base6(appId) {
1994
2015
  return `/_internal/v2/apps/${appId}/infra`;
1995
2016
  }
1996
- function list7(ctx, params) {
2017
+ function list8(ctx, params) {
1997
2018
  return call(
1998
2019
  ctx,
1999
2020
  "GET",
2000
2021
  `${base6(ctx.appId)}${params?.includeDestroyed ? "?includeDestroyed=true" : ""}`
2001
2022
  );
2002
2023
  }
2003
- function get7(ctx, params) {
2024
+ function get8(ctx, params) {
2004
2025
  return call(
2005
2026
  ctx,
2006
2027
  "GET",
@@ -2070,7 +2091,7 @@ async function waitForPhase(ctx, params) {
2070
2091
  const wanted = new Set(params.phases);
2071
2092
  const arrived = (resource2) => wanted.has(resource2.phase) && (params.until?.(resource2) ?? true);
2072
2093
  const outcome = await pollUntil(
2073
- async () => (await get7(ctx, { id: params.id })).resource,
2094
+ async () => (await get8(ctx, { id: params.id })).resource,
2074
2095
  (resource2) => arrived(resource2) || resource2.phase === "failed",
2075
2096
  {
2076
2097
  timeoutMs,
@@ -2113,8 +2134,8 @@ __export(issues_exports, {
2113
2134
  del: () => del,
2114
2135
  edit: () => edit,
2115
2136
  filed: () => filed,
2116
- get: () => get8,
2117
- list: () => list8,
2137
+ get: () => get9,
2138
+ list: () => list9,
2118
2139
  reopen: () => reopen
2119
2140
  });
2120
2141
  function authorship(ctx) {
@@ -2129,7 +2150,7 @@ function listQuery(params) {
2129
2150
  cursor: params.cursor
2130
2151
  });
2131
2152
  }
2132
- function list8(ctx, params = {}) {
2153
+ function list9(ctx, params = {}) {
2133
2154
  return call(
2134
2155
  ctx,
2135
2156
  "GET",
@@ -2143,7 +2164,7 @@ function filed(ctx, params = {}) {
2143
2164
  `/_internal/v2/apps/${ctx.appId}/issues/filed${listQuery(params)}`
2144
2165
  );
2145
2166
  }
2146
- function get8(ctx, number) {
2167
+ function get9(ctx, number) {
2147
2168
  return call(
2148
2169
  ctx,
2149
2170
  "GET",
@@ -2360,9 +2381,9 @@ function grade(ctx, runId) {
2360
2381
  var methods_exports = {};
2361
2382
  __export(methods_exports, {
2362
2383
  invoke: () => invoke,
2363
- list: () => list9
2384
+ list: () => list10
2364
2385
  });
2365
- async function list9(ctx) {
2386
+ async function list10(ctx) {
2366
2387
  const dashboard = await call(
2367
2388
  ctx,
2368
2389
  "GET",
@@ -2525,19 +2546,19 @@ async function exportVideo(_ctx, params) {
2525
2546
  // src/ops/requests.ts
2526
2547
  var requests_exports = {};
2527
2548
  __export(requests_exports, {
2528
- get: () => get9,
2529
- list: () => list10,
2549
+ get: () => get10,
2550
+ list: () => list11,
2530
2551
  statsForMethod: () => statsForMethod,
2531
2552
  statsSummary: () => statsSummary
2532
2553
  });
2533
- function list10(ctx, params = {}) {
2554
+ function list11(ctx, params = {}) {
2534
2555
  return call(
2535
2556
  ctx,
2536
2557
  "GET",
2537
2558
  `/_internal/v2/apps/${ctx.appId}/requests${qs(params)}`
2538
2559
  );
2539
2560
  }
2540
- function get9(ctx, requestId) {
2561
+ function get10(ctx, requestId) {
2541
2562
  return call(
2542
2563
  ctx,
2543
2564
  "GET",
@@ -2563,18 +2584,18 @@ function statsForMethod(ctx, methodId, params = {}) {
2563
2584
  var secrets_exports = {};
2564
2585
  __export(secrets_exports, {
2565
2586
  del: () => del2,
2566
- get: () => get10,
2567
- list: () => list11,
2587
+ get: () => get11,
2588
+ list: () => list12,
2568
2589
  set: () => set2
2569
2590
  });
2570
- function list11(ctx) {
2591
+ function list12(ctx) {
2571
2592
  return call(
2572
2593
  ctx,
2573
2594
  "GET",
2574
2595
  `/_internal/v2/apps/${ctx.appId}/secrets`
2575
2596
  );
2576
2597
  }
2577
- function get10(ctx, key) {
2598
+ function get11(ctx, key) {
2578
2599
  return call(
2579
2600
  ctx,
2580
2601
  "GET",
@@ -2630,11 +2651,11 @@ function updateSettings(ctx, partial) {
2630
2651
  var users_exports = {};
2631
2652
  __export(users_exports, {
2632
2653
  createApiKey: () => createApiKey,
2633
- list: () => list12,
2654
+ list: () => list13,
2634
2655
  revokeApiKey: () => revokeApiKey,
2635
2656
  setRole: () => setRole
2636
2657
  });
2637
- function list12(ctx, params = {}) {
2658
+ function list13(ctx, params = {}) {
2638
2659
  return call(
2639
2660
  ctx,
2640
2661
  "GET",
@@ -2802,7 +2823,7 @@ function resolveOptions(options) {
2802
2823
  // loadWorkspaceAppId throws its own precise message if there's no
2803
2824
  // mindstudio.json to fall back to.
2804
2825
  appId: options.appId ?? loadWorkspaceAppId(),
2805
- baseUrl: options.baseUrl ?? process.env["API_BASE_URL"] ?? DEFAULT_BASE_URL
2826
+ baseUrl: options.baseUrl ?? process.env["MINDSTUDIO_BASE_URL"] ?? DEFAULT_BASE_URL
2806
2827
  };
2807
2828
  }
2808
2829
  function buildClient(ctx) {
@@ -2825,6 +2846,7 @@ function buildClient(ctx) {
2825
2846
  });
2826
2847
  },
2827
2848
  agent: bindOps(agent_exports, ctx),
2849
+ tasks: bindOps(tasks_exports, ctx),
2828
2850
  analytics: bindOps(analytics_exports, ctx),
2829
2851
  events: bindOps(events_exports, ctx),
2830
2852
  crashes: bindOps(crashes_exports, ctx),
@@ -2871,7 +2893,7 @@ function createAdminClient(options = {}) {
2871
2893
  // src/index.ts
2872
2894
  var _default;
2873
2895
  var admin = new Proxy({}, {
2874
- get(_, prop, receiver) {
2896
+ get(_, prop) {
2875
2897
  _default ??= createAdminClient();
2876
2898
  const value = Reflect.get(_default, prop, _default);
2877
2899
  return typeof value === "function" ? value.bind(_default) : value;