@lizard-build/sdk 0.1.75 → 0.1.77

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/README.md CHANGED
@@ -121,7 +121,7 @@ try {
121
121
 
122
122
  The SDK reads `LIZARD_API_KEY` and, optionally, `LIZARD_API_URL` (default: `https://lizard.build`). You can also pass `apiKey` and `apiUrl` to the constructor or static sandbox methods.
123
123
 
124
- Lizard Git (`lizard.git`: repositories, pull requests, CI and the rest) reads `LIZARD_GIT_URL` (default `https://git.lizard.build`) and needs a key with no scopes. See the [Lizard Git guide](https://github.com/lizard-build/lizard-sdk/blob/main/docs/platform.md#lizard-git).
124
+ Lizard Git (`lizard.git`: repositories, pull requests, CI and the rest) reads `LIZARD_GIT_URL` (default `https://lizard.build/git`) and needs a key with no scopes. See the [Lizard Git guide](https://github.com/lizard-build/lizard-sdk/blob/main/docs/platform.md#lizard-git).
125
125
 
126
126
  Pass `timeoutMs` to `create()` to set the sandbox lifetime. The default is five minutes. `timeoutMs` on `process.exec()` or `runCode()` controls that call, not the sandbox lifetime.
127
127
 
package/dist/index.d.mts CHANGED
@@ -461,7 +461,7 @@ declare class GitHubAPI {
461
461
  }
462
462
 
463
463
  /**
464
- * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, Actions-style
464
+ * Lizard Git (lizard.build/git): repositories, issues, pull requests, reviews, Actions-style
465
465
  * CI, releases, webhooks, branch protection and the rest, with the same API key as the rest
466
466
  * of the SDK. The key must be a whole account's (no scopes): Lizard Git refuses scoped keys.
467
467
  *
@@ -475,7 +475,7 @@ declare class GitHubAPI {
475
475
  * const pr = await lizard.git.pulls.create('me/app', { title: 'Feature', head: 'feature', base: 'main' })
476
476
  * ```
477
477
  */
478
- declare const DEFAULT_GIT_URL = "https://git.lizard.build";
478
+ declare const DEFAULT_GIT_URL = "https://lizard.build/git";
479
479
  type RepoRef = string;
480
480
  type Role = 'read' | 'write' | 'admin';
481
481
  interface Repo {
@@ -895,11 +895,13 @@ declare class GitReposAPI {
895
895
  name: string;
896
896
  }>;
897
897
  get(repo: RepoRef): Promise<RepoMeta>;
898
+ /** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
898
899
  update(repo: RepoRef, opts: {
899
900
  name?: string;
900
901
  description?: string;
901
902
  private?: boolean;
902
903
  defaultBranch?: string;
904
+ apiCommits?: boolean;
903
905
  }): Promise<{
904
906
  ok: boolean;
905
907
  }>;
@@ -949,7 +951,11 @@ declare class GitReposAPI {
949
951
  diff: unknown;
950
952
  }>;
951
953
  compare(repo: RepoRef, base: string, head: string): Promise<unknown>;
952
- /** Commit files on the server: no clone, no push. Answers 409 when `expect` no longer matches. */
954
+ /**
955
+ * Commit files on the server: no clone, no push. Only on a repository whose admin allowed
956
+ * it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
957
+ * (403 otherwise). Answers 409 when `expect` no longer matches.
958
+ */
953
959
  commitFiles(repo: RepoRef, opts: CommitFilesOpts): Promise<{
954
960
  sha: string;
955
961
  branch: string;
@@ -2946,7 +2952,7 @@ interface LizardOpts extends ConnectionOpts {
2946
2952
  * management (projects, services, addons, etc.).
2947
2953
  */
2948
2954
  project?: string;
2949
- /** Lizard Git's address. Defaults to `LIZARD_GIT_URL`, then https://git.lizard.build. */
2955
+ /** Lizard Git's address. Defaults to `LIZARD_GIT_URL`, then https://lizard.build/git. */
2950
2956
  gitUrl?: string;
2951
2957
  }
2952
2958
  /**
@@ -3005,7 +3011,7 @@ declare class Lizard {
3005
3011
  readonly storage: StorageAPI;
3006
3012
  readonly github: GitHubAPI;
3007
3013
  /**
3008
- * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, CI runs,
3014
+ * Lizard Git (lizard.build/git): repositories, issues, pull requests, reviews, CI runs,
3009
3015
  * releases, webhooks, branch rules. Needs a key with no scopes.
3010
3016
  */
3011
3017
  readonly git: GitAPI;
package/dist/index.d.ts CHANGED
@@ -461,7 +461,7 @@ declare class GitHubAPI {
461
461
  }
462
462
 
463
463
  /**
464
- * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, Actions-style
464
+ * Lizard Git (lizard.build/git): repositories, issues, pull requests, reviews, Actions-style
465
465
  * CI, releases, webhooks, branch protection and the rest, with the same API key as the rest
466
466
  * of the SDK. The key must be a whole account's (no scopes): Lizard Git refuses scoped keys.
467
467
  *
@@ -475,7 +475,7 @@ declare class GitHubAPI {
475
475
  * const pr = await lizard.git.pulls.create('me/app', { title: 'Feature', head: 'feature', base: 'main' })
476
476
  * ```
477
477
  */
478
- declare const DEFAULT_GIT_URL = "https://git.lizard.build";
478
+ declare const DEFAULT_GIT_URL = "https://lizard.build/git";
479
479
  type RepoRef = string;
480
480
  type Role = 'read' | 'write' | 'admin';
481
481
  interface Repo {
@@ -895,11 +895,13 @@ declare class GitReposAPI {
895
895
  name: string;
896
896
  }>;
897
897
  get(repo: RepoRef): Promise<RepoMeta>;
898
+ /** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
898
899
  update(repo: RepoRef, opts: {
899
900
  name?: string;
900
901
  description?: string;
901
902
  private?: boolean;
902
903
  defaultBranch?: string;
904
+ apiCommits?: boolean;
903
905
  }): Promise<{
904
906
  ok: boolean;
905
907
  }>;
@@ -949,7 +951,11 @@ declare class GitReposAPI {
949
951
  diff: unknown;
950
952
  }>;
951
953
  compare(repo: RepoRef, base: string, head: string): Promise<unknown>;
952
- /** Commit files on the server: no clone, no push. Answers 409 when `expect` no longer matches. */
954
+ /**
955
+ * Commit files on the server: no clone, no push. Only on a repository whose admin allowed
956
+ * it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
957
+ * (403 otherwise). Answers 409 when `expect` no longer matches.
958
+ */
953
959
  commitFiles(repo: RepoRef, opts: CommitFilesOpts): Promise<{
954
960
  sha: string;
955
961
  branch: string;
@@ -2946,7 +2952,7 @@ interface LizardOpts extends ConnectionOpts {
2946
2952
  * management (projects, services, addons, etc.).
2947
2953
  */
2948
2954
  project?: string;
2949
- /** Lizard Git's address. Defaults to `LIZARD_GIT_URL`, then https://git.lizard.build. */
2955
+ /** Lizard Git's address. Defaults to `LIZARD_GIT_URL`, then https://lizard.build/git. */
2950
2956
  gitUrl?: string;
2951
2957
  }
2952
2958
  /**
@@ -3005,7 +3011,7 @@ declare class Lizard {
3005
3011
  readonly storage: StorageAPI;
3006
3012
  readonly github: GitHubAPI;
3007
3013
  /**
3008
- * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, CI runs,
3014
+ * Lizard Git (lizard.build/git): repositories, issues, pull requests, reviews, CI runs,
3009
3015
  * releases, webhooks, branch rules. Needs a key with no scopes.
3010
3016
  */
3011
3017
  readonly git: GitAPI;
package/dist/index.js CHANGED
@@ -554,7 +554,7 @@ var GitHubAPI = class {
554
554
  };
555
555
 
556
556
  // src/platform/git.ts
557
- var DEFAULT_GIT_URL = "https://git.lizard.build";
557
+ var DEFAULT_GIT_URL = "https://lizard.build/git";
558
558
  var seg = encodeURIComponent;
559
559
  function qs(path, values) {
560
560
  const q = new URLSearchParams();
@@ -632,6 +632,7 @@ var GitReposAPI = class {
632
632
  get(repo) {
633
633
  return this.c.get(repoPath(repo));
634
634
  }
635
+ /** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
635
636
  update(repo, opts) {
636
637
  return this.c.patch(repoPath(repo), opts);
637
638
  }
@@ -690,7 +691,11 @@ var GitReposAPI = class {
690
691
  compare(repo, base, head) {
691
692
  return this.c.get(qs(`${repoPath(repo)}/compare`, { base, head }));
692
693
  }
693
- /** Commit files on the server: no clone, no push. Answers 409 when `expect` no longer matches. */
694
+ /**
695
+ * Commit files on the server: no clone, no push. Only on a repository whose admin allowed
696
+ * it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
697
+ * (403 otherwise). Answers 409 when `expect` no longer matches.
698
+ */
694
699
  commitFiles(repo, opts) {
695
700
  const { idempotencyKey, ...body } = opts;
696
701
  return this.c.request("POST", `${repoPath(repo)}/commits`, body, idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {});
package/dist/index.mjs CHANGED
@@ -482,7 +482,7 @@ var GitHubAPI = class {
482
482
  };
483
483
 
484
484
  // src/platform/git.ts
485
- var DEFAULT_GIT_URL = "https://git.lizard.build";
485
+ var DEFAULT_GIT_URL = "https://lizard.build/git";
486
486
  var seg = encodeURIComponent;
487
487
  function qs(path, values) {
488
488
  const q = new URLSearchParams();
@@ -560,6 +560,7 @@ var GitReposAPI = class {
560
560
  get(repo) {
561
561
  return this.c.get(repoPath(repo));
562
562
  }
563
+ /** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
563
564
  update(repo, opts) {
564
565
  return this.c.patch(repoPath(repo), opts);
565
566
  }
@@ -618,7 +619,11 @@ var GitReposAPI = class {
618
619
  compare(repo, base, head) {
619
620
  return this.c.get(qs(`${repoPath(repo)}/compare`, { base, head }));
620
621
  }
621
- /** Commit files on the server: no clone, no push. Answers 409 when `expect` no longer matches. */
622
+ /**
623
+ * Commit files on the server: no clone, no push. Only on a repository whose admin allowed
624
+ * it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
625
+ * (403 otherwise). Answers 409 when `expect` no longer matches.
626
+ */
622
627
  commitFiles(repo, opts) {
623
628
  const { idempotencyKey, ...body } = opts;
624
629
  return this.c.request("POST", `${repoPath(repo)}/commits`, body, idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/sdk",
3
- "version": "0.1.75",
3
+ "version": "0.1.77",
4
4
  "description": "TypeScript SDK for Lizard: Firecracker microVM sandboxes, code execution and cloud apps.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",