Socket
Socket
Sign inDemoInstall

@tinacms/git-client

Package Overview
Dependencies
Maintainers
10
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinacms/git-client - npm Package Compare versions

Comparing version 0.1.1-alpha.0 to 0.1.1-canary.163

LICENSE

46

build/git-client.d.ts

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export declare class GitClient {

@@ -5,3 +22,3 @@ private baseUrl;

/**
* An alias to `commitAndPush`
* An alias to `commit`
*

@@ -38,3 +55,3 @@ * @deprecated

*/
commitAndPush(data: {
commit(data: {
files: string[];

@@ -50,2 +67,8 @@ message?: string;

*/
push(): Promise<any>;
/**
*
* TODO: Add return type.
* TODO: Remove `catch`
*/
writeToDisk(data: {

@@ -71,2 +94,21 @@ fileRelativePath: string;

}): Promise<any>;
/**
* Resets the given files.
*/
reset(data: {
files: string[];
}): Promise<Response>;
/**
* Get the contents of a file for the most recent commit.
*/
show(fileRelativePath: string): Promise<any>;
/**
* Get information about a local branch by name, or the current branch if no
* name is specified.
*/
branch(name?: string): Promise<any>;
/**
* Get a list of the names of all local branches.
*/
branches(): Promise<any>;
}

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * from './git-client';

2

build/index.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@tinacms/git-client"]={})}(this,function(t){"use strict";var e=(o.prototype.onSubmit=function(t){return this.commitAndPush(t)},o.prototype.onChange=function(t){return this.writeToDisk(t)},o.prototype.onUploadMedia=function(t){return this.writeMediaToDisk(t)},o.prototype.onDelete=function(t){return this.deleteFromDisk(t)},o.prototype.isAuthenticated=function(){return!0},o.prototype.commitAndPush=function(t){return fetch(this.baseUrl+"/commit",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},o.prototype.writeToDisk=function(t){return fetch(this.baseUrl+"/"+encodeURIComponent(t.fileRelativePath),{method:"PUT",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},o.prototype.writeMediaToDisk=function(t){var e=new FormData;return e.append("file",t.content),e.append("directory",t.directory),fetch(this.baseUrl+"/upload",{method:"POST",body:e}).catch(function(t){console.error(t)})},o.prototype.deleteFromDisk=function(t){return fetch(this.baseUrl+"/"+encodeURIComponent(t.relPath),{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},o);function o(t){this.baseUrl=t}t.GitClient=e,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@tinacms/git-client"]={})}(this,function(t){"use strict";var e=(n.prototype.onSubmit=function(t){return this.commit(t)},n.prototype.onChange=function(t){return this.writeToDisk(t)},n.prototype.onUploadMedia=function(t){return this.writeMediaToDisk(t)},n.prototype.onDelete=function(t){return this.deleteFromDisk(t)},n.prototype.isAuthenticated=function(){return!0},n.prototype.commit=function(t){return fetch(this.baseUrl+"/commit",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},n.prototype.push=function(){return fetch(this.baseUrl+"/push",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"}}).catch(function(t){console.error(t)})},n.prototype.writeToDisk=function(t){return fetch(this.baseUrl+"/"+encodeURIComponent(t.fileRelativePath),{method:"PUT",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},n.prototype.writeMediaToDisk=function(t){var e=new FormData;return e.append("file",t.content),e.append("directory",t.directory),fetch(this.baseUrl+"/upload",{method:"POST",body:e}).catch(function(t){console.error(t)})},n.prototype.deleteFromDisk=function(t){return fetch(this.baseUrl+"/"+encodeURIComponent(t.relPath),{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)}).catch(function(t){console.error(t)})},n.prototype.reset=function(t){return fetch(this.baseUrl+"/reset",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)})},n.prototype.show=function(t){return fetch(this.baseUrl+"/show/"+encodeURIComponent(t),{headers:{"Content-Type":"application/json; charset=utf-8"}}).then(function(t){return t.json()})},n.prototype.branch=function(t){return fetch(this.baseUrl+"/"+(t?"branches/"+t:"branch"),{headers:{"Content-Type":"application/json; charset=utf-8"}}).then(function(t){return t.json()})},n.prototype.branches=function(){return fetch(this.baseUrl+"/branches",{headers:{"Content-Type":"application/json; charset=utf-8"}}).then(function(t){return t.json()})},n);function n(t){this.baseUrl=t}t.GitClient=e,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -6,20 +6,4 @@ # Change Log

# [0.1.0](https://github.com/tinacms/tinacms/compare/@tinacms/git-client@0.1.0-alpha.2...@tinacms/git-client@0.1.0) (2019-10-02)
## [0.1.6](https://github.com/tinacms/tinacms/compare/@tinacms/git-client@0.1.6-alpha.0...@tinacms/git-client@0.1.6) (2019-10-28)
**Note:** Version bump only for package @tinacms/git-client
# [0.1.0-alpha.2](https://github.com/tinacms/tinacms/compare/@tinacms/git-client@0.1.0-alpha.1...@tinacms/git-client@0.1.0-alpha.2) (2019-10-02)
**Note:** Version bump only for package @tinacms/git-client
# 0.1.0-alpha.1 (2019-09-25)
**Note:** Version bump only for package @tinacms/git-client
{
"name": "@tinacms/git-client",
"version": "0.1.1-alpha.0",
"version": "0.1.1-canary.163+48901656",
"main": "build/index.js",
"types": "build/index.d.ts",
"license": "MIT",
"license": "Apache-2.0",
"files": [

@@ -25,14 +25,14 @@ "build"

"scripts": {
"watch": "cms-scripts watch",
"build": "cms-scripts build",
"dev": "cms-scripts dev",
"watch": "tinacms-scripts watch",
"build": "tinacms-scripts build",
"dev": "tinacms-scripts dev",
"test": "jest --passWithNoTests"
},
"devDependencies": {
"@tinacms/scripts": "^0.1.7-canary.1620+48901656",
"@types/jest": "^24.0.15",
"cms-scripts": "^0.1.0",
"jest": "^24.8.0",
"ts-jest": "^24.0.2"
},
"gitHead": "91f24ee16f904f22e9047704ab2fe0f3c66c9506"
"gitHead": "48901656e9e9c067b04232f621887bdca350845d"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc