@daytonaio/sdk 0.21.1 → 0.21.2
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/package.json +2 -9
- package/src/Git.d.ts +36 -0
- package/src/Git.js +54 -0
- package/src/Git.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daytonaio/sdk",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "TypeScript SDK for Daytona",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -25,24 +25,17 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-sdk/client-s3": "^3.445.0",
|
|
27
27
|
"@aws-sdk/lib-storage": "^3.798.0",
|
|
28
|
-
"@babel/preset-env": "7.27.2",
|
|
29
|
-
"@babel/preset-typescript": "7.27.1",
|
|
30
28
|
"@dotenvx/dotenvx": "^1.25.1",
|
|
31
29
|
"@iarna/toml": "^2.2.5",
|
|
32
|
-
"@types/shell-quote": "1.7.5",
|
|
33
|
-
"@types/tar": "6.1.13",
|
|
34
30
|
"axios": "^1.6.1",
|
|
35
31
|
"dotenv": "16.5.0",
|
|
36
32
|
"fast-glob": "^3.3.0",
|
|
37
33
|
"form-data": "^4.0.0",
|
|
38
34
|
"shell-quote": "^1.8.2",
|
|
39
35
|
"tar": "^6.2.0",
|
|
40
|
-
"typedoc": "0.27.9",
|
|
41
|
-
"typedoc-plugin-markdown": "4.4.2",
|
|
42
|
-
"typedoc-plugin-merge-modules": "6.1.0",
|
|
43
36
|
"untildify": "^5.0.0",
|
|
44
37
|
"uuid": "^11.0.3",
|
|
45
|
-
"@daytonaio/api-client": "
|
|
38
|
+
"@daytonaio/api-client": "0.0.0-dev"
|
|
46
39
|
},
|
|
47
40
|
"packageManager": "yarn@4.6.0",
|
|
48
41
|
"type": "commonjs"
|
package/src/Git.d.ts
CHANGED
|
@@ -48,6 +48,42 @@ export declare class Git {
|
|
|
48
48
|
* console.log(`Branches: ${response.branches}`);
|
|
49
49
|
*/
|
|
50
50
|
branches(path: string): Promise<ListBranchResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Create branche in the repository.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
55
|
+
* root directory.
|
|
56
|
+
* @param {string} name - Name of the new branch to create
|
|
57
|
+
* @returns {Promise<void>}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await git.createBranch('workspace/repo', 'new-feature');
|
|
61
|
+
*/
|
|
62
|
+
createBranch(path: string, name: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete branche in the repository.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
67
|
+
* root directory.
|
|
68
|
+
* @param {string} name - Name of the branch to delete
|
|
69
|
+
* @returns {Promise<void>}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await git.deleteBranch('workspace/repo', 'new-feature');
|
|
73
|
+
*/
|
|
74
|
+
deleteBranch(path: string, name: string): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Checkout branche in the repository.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
79
|
+
* root directory.
|
|
80
|
+
* @param {string} branch - Name of the branch to checkout
|
|
81
|
+
* @returns {Promise<void>}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await git.checkoutBranch('workspace/repo', 'new-feature');
|
|
85
|
+
*/
|
|
86
|
+
checkoutBranch(path: string, branch: string): Promise<void>;
|
|
51
87
|
/**
|
|
52
88
|
* Clones a Git repository into the specified path. It supports
|
|
53
89
|
* cloning specific branches or commits, and can authenticate with the remote
|
package/src/Git.js
CHANGED
|
@@ -58,6 +58,60 @@ class Git {
|
|
|
58
58
|
const response = await this.toolboxApi.gitListBranches(this.sandboxId, (0, Path_1.prefixRelativePath)(await this.getRootDir(), path));
|
|
59
59
|
return response.data;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Create branche in the repository.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
65
|
+
* root directory.
|
|
66
|
+
* @param {string} name - Name of the new branch to create
|
|
67
|
+
* @returns {Promise<void>}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await git.createBranch('workspace/repo', 'new-feature');
|
|
71
|
+
*/
|
|
72
|
+
async createBranch(path, name) {
|
|
73
|
+
await this.toolboxApi.gitCreateBranch(this.sandboxId, {
|
|
74
|
+
path: (0, Path_1.prefixRelativePath)(await this.getRootDir(), path),
|
|
75
|
+
name,
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Delete branche in the repository.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
83
|
+
* root directory.
|
|
84
|
+
* @param {string} name - Name of the branch to delete
|
|
85
|
+
* @returns {Promise<void>}
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await git.deleteBranch('workspace/repo', 'new-feature');
|
|
89
|
+
*/
|
|
90
|
+
async deleteBranch(path, name) {
|
|
91
|
+
await this.toolboxApi.gitDeleteBranch(this.sandboxId, {
|
|
92
|
+
path: (0, Path_1.prefixRelativePath)(await this.getRootDir(), path),
|
|
93
|
+
name,
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Checkout branche in the repository.
|
|
99
|
+
*
|
|
100
|
+
* @param {string} path - Path to the Git repository root. Relative paths are resolved based on the user's
|
|
101
|
+
* root directory.
|
|
102
|
+
* @param {string} branch - Name of the branch to checkout
|
|
103
|
+
* @returns {Promise<void>}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* await git.checkoutBranch('workspace/repo', 'new-feature');
|
|
107
|
+
*/
|
|
108
|
+
async checkoutBranch(path, branch) {
|
|
109
|
+
await this.toolboxApi.gitCheckoutBranch(this.sandboxId, {
|
|
110
|
+
path: (0, Path_1.prefixRelativePath)(await this.getRootDir(), path),
|
|
111
|
+
branch,
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
61
115
|
/**
|
|
62
116
|
* Clones a Git repository into the specified path. It supports
|
|
63
117
|
* cloning specific branches or commits, and can authenticate with the remote
|
package/src/Git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Git.js","sourceRoot":"","sources":["../../../../libs/sdk-typescript/src/Git.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uCAAiD;AAYjD;;;;GAIG;AACH,MAAa,GAAG;IAEK;IACA;IACA;IAHnB,YACmB,SAAiB,EACjB,UAAsB,EACtB,UAAiC;QAFjC,cAAS,GAAT,SAAS,CAAQ;QACjB,eAAU,GAAV,UAAU,CAAY;QACtB,eAAU,GAAV,UAAU,CAAuB;IACjD,CAAC;IAEJ;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAAe;QAC5C,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE;YAChD,IAAI,EAAE,IAAA,yBAAkB,EAAC,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC;YACvD,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,QAAQ,CAAC,IAAY;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,eAAe,CACpD,IAAI,CAAC,SAAS,EACd,IAAA,yBAAkB,EAAC,MAAM,IAAI,CAAC,UAAU,EA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