Socket
Socket
Sign inDemoInstall

@tinacms/git-client

Package Overview
Dependencies
Maintainers
14
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.26.0 to 0.28.0-alpha.0

1

build/git-media-store.d.ts

@@ -25,2 +25,3 @@ /**

persist(files: MediaUploadOptions[]): Promise<Media[]>;
previewSrc(src: string): Promise<string>;
}

2

build/index.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("@tinacms/react-core")):"function"==typeof define&&define.amd?define(["exports","react","@tinacms/react-core"],e):e((t=t||self)["@tinacms/git-client"]={},t.react,t.reactCore)}(this,function(t,o,i){"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)})},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}var c=(Object.defineProperty(r.prototype,"git",{get:function(){return this.cms.api.git},enumerable:!0,configurable:!0}),r);function r(t,e,n,r){var o=this;this.cms=t,this.relativePath=e,this.format=n,this.parse=r,this.show=function(){return o.git.show(o.relativePath).then(function(t){return o.parse(t.content)})},this.commit=function(){return o.git.commit({files:[o.relativePath]}).then(function(t){return o.cms.events.dispatch({type:"git:commit",response:t})})},this.reset=function(){o.cms.api.git.reset({files:[o.relativePath]})},this.write=function(t){o.git.writeToDisk({fileRelativePath:o.relativePath,content:o.format(t)})}}function u(n,r){var o,i,c,t,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(c=2&e[0]?i.return:e[0]?i.throw||((c=i.return)&&c.call(i),0):i.next)&&!(c=c.call(i,e[1])).done)return c;switch(i=0,c&&(e=[2&e[0],c.value]),e[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(n,a)}catch(t){e=[6,t],i=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var a=(s.prototype.persist=function(s){return function(i,c,a,s){return new(a=a||Promise)(function(t,e){function n(t){try{o(s.next(t))}catch(t){e(t)}}function r(t){try{o(s.throw(t))}catch(t){e(t)}}function o(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(n,r)}o((s=s.apply(i,c||[])).next())})}(this,void 0,void 0,function(){var e,n,r,o,i,c,a;return u(this,function(t){switch(t.label){case 0:e=[],n=0,r=s,t.label=1;case 1:return n<r.length?(o=r[n],i=o.file,c=o.directory,[4,this.client.writeMediaToDisk({directory:c,content:i})]):[3,5];case 2:return[4,t.sent().json()];case 3:a=t.sent().filename,e.push({directory:c,filename:a}),t.label=4;case 4:return n++,[3,1];case 5:return[2,e]}})})},s);function s(t){this.client=t,this.accept="*"}t.GitClient=e,t.GitFile=c,t.GitMediaStore=a,t.useGitFile=function(t,e,n){var r=i.useCMS();return o.useMemo(function(){return new c(r,t,e,n)},[r,t,e,n])},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("@tinacms/react-core")):"function"==typeof define&&define.amd?define(["exports","react","@tinacms/react-core"],e):e((t=t||self)["@tinacms/git-client"]={},t.react,t.reactCore)}(this,function(t,o,i){"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)})},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}var c=(Object.defineProperty(r.prototype,"git",{get:function(){return this.cms.api.git},enumerable:!0,configurable:!0}),r);function r(t,e,n,r){var o=this;this.cms=t,this.relativePath=e,this.format=n,this.parse=r,this.show=function(){return o.git.show(o.relativePath).then(function(t){return o.parse(t.content)})},this.commit=function(){return o.git.commit({files:[o.relativePath]}).then(function(t){return o.cms.events.dispatch({type:"git:commit",response:t})})},this.reset=function(){o.cms.api.git.reset({files:[o.relativePath]})},this.write=function(t){o.git.writeToDisk({fileRelativePath:o.relativePath,content:o.format(t)})}}function s(i,c,s,a){return new(s=s||Promise)(function(t,e){function n(t){try{o(a.next(t))}catch(t){e(t)}}function r(t){try{o(a.throw(t))}catch(t){e(t)}}function o(e){e.done?t(e.value):new s(function(t){t(e.value)}).then(n,r)}o((a=a.apply(i,c||[])).next())})}function u(n,r){var o,i,c,t,s={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(c=2&e[0]?i.return:e[0]?i.throw||((c=i.return)&&c.call(i),0):i.next)&&!(c=c.call(i,e[1])).done)return c;switch(i=0,c&&(e=[2&e[0],c.value]),e[0]){case 0:case 1:c=e;break;case 4:return s.label++,{value:e[1],done:!1};case 5:s.label++,i=e[1],e=[0];continue;case 7:e=s.ops.pop(),s.trys.pop();continue;default:if(!(c=0<(c=s.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){s.label=e[1];break}if(6===e[0]&&s.label<c[1]){s.label=c[1],c=e;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(e);break}c[2]&&s.ops.pop(),s.trys.pop();continue}e=r.call(n,s)}catch(t){e=[6,t],i=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var a=(h.prototype.persist=function(a){return s(this,void 0,void 0,function(){var e,n,r,o,i,c,s;return u(this,function(t){switch(t.label){case 0:e=[],n=0,r=a,t.label=1;case 1:return n<r.length?(o=r[n],i=o.file,c=o.directory,[4,this.client.writeMediaToDisk({directory:c,content:i})]):[3,5];case 2:return[4,t.sent().json()];case 3:s=t.sent().filename,e.push({directory:c,filename:s}),t.label=4;case 4:return n++,[3,1];case 5:return[2,e]}})})},h.prototype.previewSrc=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){return[2,e]})})},h);function h(t){this.client=t,this.accept="*"}t.GitClient=e,t.GitFile=c,t.GitMediaStore=a,t.useGitFile=function(t,e,n){var r=i.useCMS();return o.useMemo(function(){return new c(r,t,e,n)},[r,t,e,n])},Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "@tinacms/git-client",
"version": "0.26.0",
"version": "0.28.0-alpha.0",
"main": "build/index.js",

@@ -32,8 +32,8 @@ "types": "build/index.d.ts",

"devDependencies": {
"@tinacms/core": "^0.26.0",
"@tinacms/media": "^0.26.0",
"@tinacms/react-core": "^0.26.0",
"@tinacms/core": "^0.28.0-alpha.0",
"@tinacms/media": "^0.28.0-alpha.0",
"@tinacms/react-core": "^0.28.0-alpha.0",
"@tinacms/scripts": "^0.26.0"
},
"gitHead": "c6dfaa406a2ce3b5a3e1eaebe9d51c180ab2b282"
"gitHead": "08295a1caf859dd48bed2929f15468fa1a768648"
}
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