@iqlabs-official/git-sdk 0.1.3 → 0.1.4

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.
@@ -1,3 +1,3 @@
1
- export { Commit, FileTree, GitClient, GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, RegistryEntry, Repository, WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint } from '../shared/index.js';
1
+ export { Commit, FileTree, GitClient, GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, RegistryEntry, Repository, WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit } from '../shared/index.js';
2
2
  export { SignerInput } from '@iqlabs-official/solana-sdk/utils';
3
3
  import '@solana/web3.js';
@@ -2,7 +2,7 @@ import { SystemProgram, Transaction, Keypair } from '@solana/web3.js';
2
2
  import { getDbRootPda, createInstructionBuilder, initializeDbRootInstruction, getTablePda } from '@iqlabs-official/solana-sdk/contract';
3
3
  import { readCodeIn, readTableRows } from '@iqlabs-official/solana-sdk/reader';
4
4
  import { toSeedBytes } from '@iqlabs-official/solana-sdk/utils';
5
- import { createTable, writeRow, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
5
+ import { writeRow, createTable, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
6
6
 
7
7
  // src/core/hash.ts
8
8
  var impl;
@@ -384,6 +384,6 @@ var GitClient = class {
384
384
  // src/browser.ts
385
385
  setSha256(hashBrowser);
386
386
 
387
- export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint };
387
+ export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit };
388
388
  //# sourceMappingURL=index.js.map
389
389
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export { Commit, FileTree, GitClient, GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, RegistryEntry, Repository, WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint } from '../shared/index.js';
1
+ export { Commit, FileTree, GitClient, GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, RegistryEntry, Repository, WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit } from '../shared/index.js';
2
2
  export { SignerInput } from '@iqlabs-official/solana-sdk/utils';
3
3
  import '@solana/web3.js';
@@ -3,7 +3,7 @@ import { SystemProgram, Transaction, Keypair } from '@solana/web3.js';
3
3
  import { getDbRootPda, createInstructionBuilder, initializeDbRootInstruction, getTablePda } from '@iqlabs-official/solana-sdk/contract';
4
4
  import { readCodeIn, readTableRows } from '@iqlabs-official/solana-sdk/reader';
5
5
  import { toSeedBytes } from '@iqlabs-official/solana-sdk/utils';
6
- import { createTable, writeRow, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
6
+ import { writeRow, createTable, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
7
7
 
8
8
  // src/core/hash.ts
9
9
  var impl;
@@ -376,6 +376,6 @@ var GitClient = class {
376
376
  // src/node.ts
377
377
  setSha256(hashNode);
378
378
 
379
- export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint };
379
+ export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit };
380
380
  //# sourceMappingURL=index.js.map
381
381
  //# sourceMappingURL=index.js.map
@@ -134,6 +134,11 @@ declare function readRegistryPage(_connection: Connection, options?: {
134
134
  */
135
135
  declare function bootstrapRegistry(connection: Connection, signer: SignerInput): Promise<string | null>;
136
136
 
137
+ /**
138
+ * Append one commit row. Callers (workflow-level code) are responsible for
139
+ * setting parentCommitId — the SDK does not auto-chain.
140
+ */
141
+ declare function writeCommit(connection: Connection, signer: SignerInput, repo: string, commit: Commit): Promise<string>;
137
142
  /** Latest commit. Single-row, O(1) RPC path. */
138
143
  declare function readLatestCommit(_connection: Connection, owner: string, repo: string): Promise<Commit | null>;
139
144
  /** Full commit history, newest first. */
@@ -142,6 +147,20 @@ declare function readCommitHistory(_connection: Connection, owner: string, repo:
142
147
  before?: string;
143
148
  }): Promise<Commit[]>;
144
149
 
150
+ /**
151
+ * Upload one file unless an identical hash is already in `reuse` (blob dedup).
152
+ *
153
+ * input: connection, signer, relativePath, base64 content, reuse map, optional onProgress
154
+ * output: { txId, hash } — either reused or freshly uploaded
155
+ */
156
+ declare function uploadBlob(connection: Connection, signer: SignerInput, relativePath: string, base64Content: string, reuse: FileTree, onProgress?: (percent: number) => void): Promise<{
157
+ txId: string;
158
+ hash: string;
159
+ }>;
160
+ /**
161
+ * Serialize a FileTree and upload it as one `tree.json` blob.
162
+ */
163
+ declare function uploadTree(connection: Connection, signer: SignerInput, tree: FileTree): Promise<string>;
145
164
  /**
146
165
  * Fetch and parse a `tree.json` blob by its tx signature.
147
166
  */
@@ -152,4 +171,4 @@ declare function loadTree(treeTxId: string): Promise<FileTree>;
152
171
  */
153
172
  declare function loadBlob(txId: string): Promise<string>;
154
173
 
155
- export { type Commit, type FileTree, GitClient, type GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, type RegistryEntry, type Repository, type WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint };
174
+ export { type Commit, type FileTree, GitClient, type GitClientConfig, IQGIT_ROOT_ID, REGISTRY_HINT, type RegistryEntry, type Repository, type WriteEvent, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit };
@@ -2,7 +2,7 @@ import { SystemProgram, Transaction, Keypair } from '@solana/web3.js';
2
2
  import { getDbRootPda, createInstructionBuilder, initializeDbRootInstruction, getTablePda } from '@iqlabs-official/solana-sdk/contract';
3
3
  import { readCodeIn, readTableRows } from '@iqlabs-official/solana-sdk/reader';
4
4
  import { toSeedBytes } from '@iqlabs-official/solana-sdk/utils';
5
- import { createTable, writeRow, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
5
+ import { writeRow, createTable, codeIn as codeIn$1 } from '@iqlabs-official/solana-sdk/writer';
6
6
 
7
7
  // src/core/seed.ts
8
8
  var IQGIT_ROOT_ID = "iq-git-v1";
@@ -359,6 +359,6 @@ var GitClient = class {
359
359
  }
360
360
  };
361
361
 
362
- export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint };
362
+ export { GitClient, IQGIT_ROOT_ID, REGISTRY_HINT, bootstrapRegistry, commitTableHint, loadBlob, loadTree, readCommitHistory, readLatestCommit, readOwnerRepos, readRegistryPage, repoListHint, uploadBlob, uploadTree, writeCommit };
363
363
  //# sourceMappingURL=index.js.map
364
364
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqlabs-official/git-sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Embed on-chain Git into your Solana dApp. Browser SDK for letting users browse, create, and commit to repositories from your website, with a Node entry for tooling.",
5
5
  "keywords": [
6
6
  "solana",