promigence 0.1.0-beta.12 → 0.1.0-beta.14

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.
@@ -16,9 +16,19 @@ export function callerToken(name, version) {
16
16
  return n;
17
17
  return `${n}/${v}`;
18
18
  }
19
+ let callerLastRaw;
20
+ let callerLast;
19
21
  export function parseCallerToken(raw) {
20
22
  if (typeof raw !== "string")
21
23
  return undefined;
24
+ if (raw === callerLastRaw)
25
+ return callerLast;
26
+ const parsed = parseCallerTokenOf(raw);
27
+ callerLastRaw = raw;
28
+ callerLast = parsed;
29
+ return parsed;
30
+ }
31
+ function parseCallerTokenOf(raw) {
22
32
  const t = raw.trim();
23
33
  if (!t)
24
34
  return undefined;
@@ -5,6 +5,7 @@ import { type Bundle } from "./bundle.js";
5
5
  import { type PtyExit, type PtySession } from "./pty.js";
6
6
  import { type SshTunnel } from "./ssh.js";
7
7
  import type * as M from "./models.gen.js";
8
+ import { isKeyedCreate } from "./keyed.js";
8
9
  import { type ConnectRequest, type ConnectTicket, type GithubConnect, type GithubDisconnected, type GithubRepos, type GithubStatus, type GithubUntracked } from "./github.js";
9
10
  import { type GitlabConnect, type GitlabDisconnected, type GitlabRepos, type GitlabStatus, type GitlabUntracked } from "./gitlab.js";
10
11
  export type FetchLike = typeof globalThis.fetch;
@@ -1882,12 +1883,7 @@ export declare function errorFor(code: string, message: string, fix: string, ext
1882
1883
  category?: string;
1883
1884
  retryable?: boolean;
1884
1885
  }): PromigenceError;
1885
- /**
1886
- * Is `method path` a create that takes an `Idempotency-Key`? `path` is relative to `/v1` and may
1887
- * carry a query string. The list is the API reference's (generated from the operations that
1888
- * document the header), so a create the API keys is never sent unkeyed by this client.
1889
- */
1890
- export declare function isKeyedCreate(method: string, path: string): boolean;
1886
+ export { isKeyedCreate };
1891
1887
  /** A sandbox id as a request names it: a non-empty string, or refused before anything is sent. */
1892
1888
  export declare function checkSandboxId(sandboxId: unknown, call: string): asserts sandboxId is string;
1893
1889
  /** A spend cap in USD: a finite number, 0 or more. A negative one used to be sent and echoed back as "$-1.00". */
@@ -2006,6 +2002,7 @@ export declare class PromigenceClient {
2006
2002
  private readExtras;
2007
2003
  private guardDispatcher;
2008
2004
  private dispatcherFor;
2005
+ private againKeyed;
2009
2006
  request<T>(opts: RequestOpts): Promise<T>;
2010
2007
  /**
2011
2008
  * A request whose body — in either direction — is **bytes, not JSON** (`files get|put`).
@@ -2066,6 +2063,7 @@ export declare class PromigenceClient {
2066
2063
  signal?: AbortSignal;
2067
2064
  }) => Promise<M.TemplateDetail>;
2068
2065
  };
2066
+ private group_templates;
2069
2067
  me(opts?: {
2070
2068
  signal?: AbortSignal;
2071
2069
  }): Promise<MeResponse>;
@@ -2114,6 +2112,7 @@ export declare class PromigenceClient {
2114
2112
  /** `POST /referrals/apply` — apply a referral code (an owner's key, before the first paid invoice). */
2115
2113
  applyReferral: (code: string) => Promise<ReferralApplied>;
2116
2114
  };
2115
+ private group_billing;
2117
2116
  /**
2118
2117
  * This key's API keys. With an API key the list is the key's own project's; `all` includes
2119
2118
  * revoked ones.
@@ -2137,6 +2136,7 @@ export declare class PromigenceClient {
2137
2136
  */
2138
2137
  revoke: (keyId: string) => Promise<KeyRecord>;
2139
2138
  };
2139
+ private group_keys;
2140
2140
  /** The organization this key belongs to, its projects, members and pending invites. */
2141
2141
  readonly orgs: {
2142
2142
  /** `GET /orgs` — with an API key, the key's own organization. */
@@ -2175,10 +2175,12 @@ export declare class PromigenceClient {
2175
2175
  rename: (org: string, project: string, name: string) => Promise<ProjectRecord>;
2176
2176
  };
2177
2177
  };
2178
+ private group_orgs;
2178
2179
  readonly credits: {
2179
2180
  /** `GET /credits/offer` — claimable (how much, until when), claimed, being checked, or none. */
2180
2181
  offer: () => Promise<CreditOffer>;
2181
2182
  };
2183
+ private group_credits;
2182
2184
  /**
2183
2185
  * The GitHub connection: install the platform's GitHub App once, then build snapshots from the
2184
2186
  * repositories it can read (`snapshots.create({ repo: "github:owner/name", ref })`).
@@ -2206,6 +2208,7 @@ export declare class PromigenceClient {
2206
2208
  /** `DELETE /integrations/github/tracks/:id` — the snapshot stays; pushes stop rebuilding it. */
2207
2209
  untrack: (trackId: string) => Promise<GithubUntracked>;
2208
2210
  };
2211
+ private group_github;
2209
2212
  /**
2210
2213
  * The GitLab connection: authorize the platform's GitLab application once (read-only), have an
2211
2214
  * owner confirm it, then build snapshots from the projects it can read
@@ -2235,6 +2238,7 @@ export declare class PromigenceClient {
2235
2238
  /** `DELETE /integrations/gitlab/tracks/:id` — the snapshot stays; new commits stop rebuilding it. */
2236
2239
  untrack: (trackId: string) => Promise<GitlabUntracked>;
2237
2240
  };
2241
+ private group_gitlab;
2238
2242
  readonly runs: {
2239
2243
  /** `POST /runs` — returns immediately; sandboxes start `queued`. */
2240
2244
  start: (opts: RunStartOpts) => Promise<RunStartResponse>;
@@ -2328,6 +2332,7 @@ export declare class PromigenceClient {
2328
2332
  */
2329
2333
  waitDone: (runId: string, opts?: WaitOpts) => Promise<WaitRunResult>;
2330
2334
  };
2335
+ private group_runs;
2331
2336
  /**
2332
2337
  * The loop behind `waitReady` / `waitDone`.
2333
2338
  *
@@ -2805,6 +2810,7 @@ export declare class PromigenceClient {
2805
2810
  };
2806
2811
  }) => Promise<ExecOutput>;
2807
2812
  };
2813
+ private group_sandboxes;
2808
2814
  /** Bound helpers for one sandbox (kept from the 0.0.0 shape). */
2809
2815
  sandbox(id: string): {
2810
2816
  id: string;
@@ -2874,6 +2880,7 @@ export declare class PromigenceClient {
2874
2880
  deleted: boolean;
2875
2881
  }>;
2876
2882
  };
2883
+ private group_secrets;
2877
2884
  /**
2878
2885
  * Container images, as far as we need to know about them: what digest does this tag name?
2879
2886
  */
@@ -2901,6 +2908,7 @@ export declare class PromigenceClient {
2901
2908
  registrySecret?: string;
2902
2909
  }) => Promise<ResolvedImage>;
2903
2910
  };
2911
+ private group_images;
2904
2912
  readonly captures: {
2905
2913
  /**
2906
2914
  * `DELETE /captures/:snapshot_id` — destroy a preserved failure now, before it expires.
@@ -2916,6 +2924,7 @@ export declare class PromigenceClient {
2916
2924
  deleted_at: string;
2917
2925
  }>;
2918
2926
  };
2927
+ private group_captures;
2919
2928
  readonly snapshots: {
2920
2929
  /**
2921
2930
  * `POST /snapshots` — 202 with a `build_id`, or 200 with the existing snapshot when an
@@ -3011,5 +3020,6 @@ export declare class PromigenceClient {
3011
3020
  record?: SnapshotRecord;
3012
3021
  }>;
3013
3022
  };
3023
+ private group_snapshots;
3014
3024
  }
3015
3025
  export declare function toCommandResult(r: ExecResponse): CommandResult;