@madewithremy/admin 0.1.63 → 0.1.64

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.
@@ -530,7 +530,7 @@ export interface PromoteParams {
530
530
  *
531
531
  * Atomically swaps the candidate for the active version and retires the old
532
532
  * one. Without `force`, promotion is blocked when any candidate document
533
- * failed. The retired version is kept; discard it with `drop` once rollback
533
+ * failed. The retired version is kept; discard it with `dropPipelineVersion` once rollback
534
534
  * is no longer wanted.
535
535
  *
536
536
  * @throws AdminApiError `data_source_not_found` (404).
@@ -556,7 +556,7 @@ export interface DropParams {
556
556
  * @example
557
557
  * await admin.dataSources.drop({ slug: 'policies' }); // drops the candidate
558
558
  */
559
- export declare function drop(ctx: AdminContext, params: DropParams): Promise<DataSourcesDropResult>;
559
+ export declare function dropPipelineVersion(ctx: AdminContext, params: DropParams): Promise<DataSourcesDropResult>;
560
560
  export interface RmParams {
561
561
  /** Data source slug. */
562
562
  slug: string;
@@ -574,7 +574,7 @@ export interface RmParams {
574
574
  * @example
575
575
  * await admin.dataSources.rm({ slug: 'policies', documentId });
576
576
  */
577
- export declare function rm(ctx: AdminContext, params: RmParams): Promise<DataSourcesDocumentDeleteResult>;
577
+ export declare function deleteDocument(ctx: AdminContext, params: RmParams): Promise<DataSourcesDocumentDeleteResult>;
578
578
  export interface RmWhereParams {
579
579
  /** Data source slug. */
580
580
  slug: string;
@@ -583,7 +583,7 @@ export interface RmWhereParams {
583
583
  /**
584
584
  * Remove one page (up to 1,000) of the documents matching a selector, across
585
585
  * every pipeline version, and report how many still match. Loop while
586
- * `remaining > 0`; `rmWhereAll` does that.
586
+ * `remaining > 0`; `deleteAllDocumentsWhere` does that.
587
587
  *
588
588
  * @throws AdminApiError `data_source_not_found` (404), `invalid_filter` (400),
589
589
  * `data_source_busy` (422) while a job is in flight, `data_source_migrating`
@@ -591,9 +591,9 @@ export interface RmWhereParams {
591
591
  * @example
592
592
  * await admin.dataSources.rmWhere({ slug: 'archive', filter: { metadata: { year: 2019 } } });
593
593
  */
594
- export declare function rmWhere(ctx: AdminContext, params: RmWhereParams): Promise<DataSourcesDocumentDeleteManyResult>;
595
- /** `rmWhere` until nothing matches. Reports each page through `onProgress`. */
596
- export declare function rmWhereAll(ctx: AdminContext, params: RmWhereParams & {
594
+ export declare function deleteDocumentsWhere(ctx: AdminContext, params: RmWhereParams): Promise<DataSourcesDocumentDeleteManyResult>;
595
+ /** `deleteDocumentsWhere` until nothing matches. Reports each page through `onProgress`. */
596
+ export declare function deleteAllDocumentsWhere(ctx: AdminContext, params: RmWhereParams & {
597
597
  onProgress?: (message: string) => void;
598
598
  }): Promise<{
599
599
  deleted: number;
@@ -652,3 +652,11 @@ export declare function link(ctx: AdminContext, params: {
652
652
  slug: string;
653
653
  text: string;
654
654
  }): Promise<DataSourcesLinkResult>;
655
+ /** @deprecated Renamed `deleteDocument` in 0.1.64; use that. */
656
+ export declare const rm: typeof deleteDocument;
657
+ /** @deprecated Renamed `deleteDocumentsWhere` in 0.1.64; use that. */
658
+ export declare const rmWhere: typeof deleteDocumentsWhere;
659
+ /** @deprecated Renamed `deleteAllDocumentsWhere` in 0.1.64; use that. */
660
+ export declare const rmWhereAll: typeof deleteAllDocumentsWhere;
661
+ /** @deprecated Renamed `dropPipelineVersion` in 0.1.64; use that. */
662
+ export declare const drop: typeof dropPipelineVersion;
@@ -146,7 +146,7 @@ export interface BuyParams {
146
146
  * renews yearly at its renewal price while auto-renew is on. Only call this
147
147
  * after the user has explicitly confirmed the name, the price and the renewal
148
148
  * price. The domain is usually `active` on return; a `pending` one settles
149
- * within minutes (poll `owned`). It connects to nothing by itself.
149
+ * within minutes (poll `listOwned`). It connects to nothing by itself.
150
150
  *
151
151
  * @throws AdminApiError `registrant_contact_required` (400) — set the contact
152
152
  * first; `price_changed` (409) — the message has the new price, to confirm
@@ -170,7 +170,7 @@ export declare function buy(ctx: AdminContext, params: BuyParams): Promise<Regis
170
170
  * @example
171
171
  * const { domains } = await admin.domains.owned();
172
172
  */
173
- export declare function owned(ctx: AdminContext): Promise<RegisteredDomainsListResult>;
173
+ export declare function listOwned(ctx: AdminContext): Promise<RegisteredDomainsListResult>;
174
174
  /**
175
175
  * Resolve one of the workspace's domains by name (lists and matches).
176
176
  *
@@ -248,3 +248,5 @@ export declare function zoneUpdate(ctx: AdminContext, name: string, recordId: nu
248
248
  * await admin.domains.zoneDelete('acmebakery.com', 123);
249
249
  */
250
250
  export declare function zoneDelete(ctx: AdminContext, name: string, recordId: number): Promise<RegisteredDomainsRecordDeleteResult>;
251
+ /** @deprecated Renamed `listOwned` in 0.1.64; use that. */
252
+ export declare const owned: typeof listOwned;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Provisioned-infrastructure operations: lease, park, resume and delete
3
- * dedicated resources (first kind: retrieval capacity for data sources).
3
+ * dedicated resources (retrieval capacity for data sources, and database
4
+ * servers for databases past the shared pool's limit).
4
5
  *
5
6
  * Ops are pure (ctx, params) → typed result. The CLI skin in
6
7
  * commands/infra.ts owns flag parsing, progress printing and exit codes.
@@ -49,7 +50,7 @@ export interface LogsParams {
49
50
  */
50
51
  export declare function logs(ctx: AdminContext, params: LogsParams): Promise<InfraLogsResult>;
51
52
  export interface ProvisionParams {
52
- /** Offering id from `list().offerings`, e.g. `retrieval.small`. */
53
+ /** Offering id from `list().offerings`, e.g. `retrieval.small` or `database.xs`. */
53
54
  offeringId: string;
54
55
  /** Display name; defaults to the offering label. */
55
56
  name?: string;
@@ -73,9 +74,11 @@ export interface ResourceIdParams {
73
74
  id: string;
74
75
  }
75
76
  /**
76
- * Park an active resource. Data is kept; searches on its data sources return
77
- * `capacity_hibernating` while it parks and `capacity_hibernated` once parked,
78
- * until it resumes; billing drops to the retained-storage rate.
77
+ * Park an active resource. Data is kept and billing stops until it resumes.
78
+ * Retrieval: searches on its data sources return `capacity_hibernating` while
79
+ * it parks and `capacity_hibernated` once parked. A database server: every
80
+ * database is backed up first, and its queries answer `database_lease_parked`
81
+ * until it resumes.
79
82
  *
80
83
  * @throws AdminApiError `resource_not_found` (404), `invalid_transition` (422).
81
84
  */
@@ -87,32 +90,37 @@ export declare function hibernate(ctx: AdminContext, params: ResourceIdParams):
87
90
  */
88
91
  export declare function resume(ctx: AdminContext, params: ResourceIdParams): Promise<InfraResourceResult>;
89
92
  /**
90
- * Delete a resource. Refused while any data source is placed on it — move
91
- * those to shared capacity (`admin.dataSources.move({ placement: 'shared' })`,
92
- * data intact) or delete them first. Billing stops when the phase reaches
93
- * `destroyed`.
93
+ * Delete a resource. Billing stops when the phase reaches `destroyed`.
94
+ * Retrieval: refused while any data source is placed on it; move those to
95
+ * shared capacity (`admin.dataSources.move({ placement: 'shared' })`, data
96
+ * intact) or delete them first. A database server: its databases go back to
97
+ * the shared pool, so it's refused while any is too large for the pool to
98
+ * take back.
94
99
  *
95
100
  * @throws AdminApiError `resource_not_found` (404),
96
- * `resource_has_attachments` (422), `invalid_transition` (422).
101
+ * `resource_has_attachments` (422), `resource_holds_large_databases` (422),
102
+ * `invalid_transition` (422).
97
103
  */
98
104
  export declare function destroy(ctx: AdminContext, params: ResourceIdParams): Promise<InfraResourceResult>;
99
105
  export interface ResizeParams {
100
106
  id: string;
101
- /** Offering id from `list().offerings`, e.g. `retrieval.medium`. */
107
+ /** Offering id from `list().offerings` of the same kind, e.g. `retrieval.medium`. */
102
108
  offeringId: string;
103
109
  }
104
110
  /**
105
- * Change a resource's size, keeping its documents.
111
+ * Change a resource's size, keeping its data. Either kind passes through
112
+ * `hibernated`: the platform parks the resource, swaps its spec and brings it
113
+ * back up. A resource that is already hibernated swaps in place and stays
114
+ * parked. Growing is gated on a month of credits at the new rate like a
115
+ * provision; shrinking is refused below what the resource holds. The response
116
+ * carries `resizingTo` until the swap has happened; `waitForPhase` with
117
+ * `until: (r) => r.resizingTo === null` blocks on the whole thing.
106
118
  *
107
- * The platform parks the resource, swaps its spec, and brings it back up with
108
- * its sources' indexes rebuilt from durable storage in the background, so a
109
- * resize passes through `hibernated` and searches on those sources answer
110
- * `index_warming` with the rebuild's progress until it lands. A resource that
111
- * is already hibernated swaps in place and stays parked. Growing is gated on a
112
- * month of credits at the new rate like a provision; shrinking is refused
113
- * below what the resource holds. The response carries `resizingTo` until the
114
- * swap has happened; `waitForPhase` with `until: (r) => r.resizingTo === null`
115
- * blocks on the whole thing.
119
+ * Retrieval: its sources' indexes are rebuilt from durable storage in the
120
+ * background, and searches on them answer `index_warming` with the rebuild's
121
+ * progress until it lands. A database server: every database is backed up as
122
+ * it parks and downloaded again as it's next used, and shrinking is refused
123
+ * below its largest database's file.
116
124
  *
117
125
  * @throws AdminApiError `resource_not_found` (404), `offering_not_found`
118
126
  * (400), `offering_retired` (422), `same_offering` (400),
@@ -42,7 +42,7 @@ export declare function list(ctx: AdminContext, params?: IssuesListParams): Prom
42
42
  * @example
43
43
  * const { issues } = await admin.issues.filed({ status: 'open' });
44
44
  */
45
- export declare function filed(ctx: AdminContext, params?: Omit<IssuesListParams, 'originAppId'>): Promise<IssuesListResult>;
45
+ export declare function listFiled(ctx: AdminContext, params?: Omit<IssuesListParams, 'originAppId'>): Promise<IssuesListResult>;
46
46
  /**
47
47
  * Get one issue with its full comment thread.
48
48
  *
@@ -158,3 +158,5 @@ export declare function edit(ctx: AdminContext, number: string, params: IssuesEd
158
158
  * await admin.issues.del('42');
159
159
  */
160
160
  export declare function del(ctx: AdminContext, number: string): Promise<IssuesDeleteResult>;
161
+ /** @deprecated Renamed `listFiled` in 0.1.64; use that. */
162
+ export declare const filed: typeof listFiled;
@@ -47,10 +47,10 @@ export declare function get(ctx: AdminContext, releaseId: string): Promise<Relea
47
47
  * `release_not_found` (404) when the commit has no release yet.
48
48
  *
49
49
  * @example
50
- * const r = await admin.releases.byCommit('91ca67a');
50
+ * const r = await admin.releases.getByCommit('91ca67a');
51
51
  * if (r.ok) console.log(r.body.status);
52
52
  */
53
- export declare function byCommit(ctx: AdminContext, commitSha: string): Promise<{
53
+ export declare function getByCommit(ctx: AdminContext, commitSha: string): Promise<{
54
54
  ok: boolean;
55
55
  status: number;
56
56
  body: ReleasesByCommitResult;
@@ -191,3 +191,5 @@ export interface WaitForCommitParams {
191
191
  * }
192
192
  */
193
193
  export declare function waitForCommit(ctx: AdminContext, params: WaitForCommitParams): Promise<WaitForCommitResult>;
194
+ /** @deprecated Renamed `getByCommit` in 0.1.64; use that. */
195
+ export declare const byCommit: typeof getByCommit;
package/dist/output.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * while a person watching a long poll still sees something happen.
7
7
  */
8
8
  import type { OperationProgress } from './types/progress.js';
9
- export declare function out(data: unknown): void;
9
+ export declare function printJson(data: unknown): void;
10
10
  /** Progress to stderr so stdout stays a clean stream of JSON values. */
11
11
  export declare function progress(message: string): void;
12
12
  /** "about 12 min left" or "about 2.5 h left"; null without an ETA. */
@@ -33,7 +33,7 @@ export type ParseResult<T> = {
33
33
  error: string;
34
34
  notFound: boolean;
35
35
  };
36
- export declare function msg(err: unknown): string;
36
+ export declare function errorMessage(err: unknown): string;
37
37
  /**
38
38
  * Parse a config string. Pure — no I/O, no repair. Use this when the caller
39
39
  * already holds the file contents, or must not write (e.g. the CLI).
package/dist/poll.d.ts CHANGED
@@ -35,4 +35,4 @@ export type PollOutcome<T> = {
35
35
  export declare function pollUntil<T>(read: () => Promise<T>, isSettled: (value: T) => boolean, options: PollOptions<T>): Promise<PollOutcome<T>>;
36
36
  export declare function elapsedSeconds(start: number): number;
37
37
  /** The standard timeout line: how long, and where the thing still is. */
38
- export declare function timedOut(timeoutMs: number, still: string): string;
38
+ export declare function timeoutMessage(timeoutMs: number, still: string): string;