@myjsblock/sdk
Advanced tools
Comparing version 0.2.0-beta.3 to 0.2.0-beta.4
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -93,3 +93,3 @@ | ||
arguments: args, | ||
version: packageVersion | ||
version: "0.2.0-beta.4", | ||
}); | ||
@@ -257,10 +257,26 @@ }); | ||
(function (PickImageErrors) { | ||
PickImageErrors["PERMISSION_ERROR"] = "PERMISSION_ERROR"; | ||
PickImageErrors["OPERATION_CANCELLED"] = "OPERATION_CANCELLED"; | ||
})(PickImageErrors || (PickImageErrors = {})); | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
const pickImage = () => callRemoteFunction(BridgeFunction$1.pickImage); | ||
const pickImage = (imageOptions = { | ||
quality: 100, | ||
}, showCameraOption = true, showGalleryOption = true) => callRemoteFunction(BridgeFunction$1.pickImage, { | ||
maxWidth: imageOptions.maxWidth, | ||
maxHeight: imageOptions.maxHeight, | ||
quality: imageOptions.quality, | ||
showCameraOption, | ||
showGalleryOption, | ||
}); | ||
@@ -267,0 +283,0 @@ /** |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -89,3 +89,3 @@ | ||
arguments: args, | ||
version: packageVersion | ||
version: "0.2.0-beta.4", | ||
}); | ||
@@ -253,10 +253,26 @@ }); | ||
(function (PickImageErrors) { | ||
PickImageErrors["PERMISSION_ERROR"] = "PERMISSION_ERROR"; | ||
PickImageErrors["OPERATION_CANCELLED"] = "OPERATION_CANCELLED"; | ||
})(PickImageErrors || (PickImageErrors = {})); | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
const pickImage = () => callRemoteFunction(BridgeFunction$1.pickImage); | ||
const pickImage = (imageOptions = { | ||
quality: 100, | ||
}, showCameraOption = true, showGalleryOption = true) => callRemoteFunction(BridgeFunction$1.pickImage, { | ||
maxWidth: imageOptions.maxWidth, | ||
maxHeight: imageOptions.maxHeight, | ||
quality: imageOptions.quality, | ||
showCameraOption, | ||
showGalleryOption, | ||
}); | ||
@@ -263,0 +279,0 @@ /** |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
declare type PickImageResult = string; | ||
interface ImageOptions { | ||
/** | ||
* Maximum height of the image | ||
*/ | ||
maxHeight?: number; | ||
/** | ||
* Maximum width of the image | ||
*/ | ||
maxWidth?: number; | ||
/** | ||
* Quality of the image | ||
* 100 being original quality and 1 the maximum amount of compression depending on the file type | ||
*/ | ||
quality?: number; | ||
} | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
declare const pickImage: () => Promise<PickImageResult>; | ||
declare const pickImage: (imageOptions?: ImageOptions, showCameraOption?: boolean, showGalleryOption?: boolean) => Promise<PickImageResult>; | ||
export default pickImage; |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -12,12 +12,28 @@ | ||
(function (PickImageErrors) { | ||
PickImageErrors["PERMISSION_ERROR"] = "PERMISSION_ERROR"; | ||
PickImageErrors["OPERATION_CANCELLED"] = "OPERATION_CANCELLED"; | ||
})(PickImageErrors || (PickImageErrors = {})); | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
const pickImage = () => callRemoteFunction(BridgeFunction.pickImage); | ||
const pickImage = (imageOptions = { | ||
quality: 100, | ||
}, showCameraOption = true, showGalleryOption = true) => callRemoteFunction(BridgeFunction.pickImage, { | ||
maxWidth: imageOptions.maxWidth, | ||
maxHeight: imageOptions.maxHeight, | ||
quality: imageOptions.quality, | ||
showCameraOption, | ||
showGalleryOption, | ||
}); | ||
export { pickImage as default }; | ||
//# sourceMappingURL=pickImage.js.map |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
import { Message } from './postMessage'; | ||
import BridgeFunction from '../types/BridgeFunction'; | ||
declare global { | ||
var packageVersion: string; | ||
const __packageVersion: string; | ||
} | ||
declare const callRemoteFunction: <Response_1, FunctionErrorCodes>(functionName: BridgeFunction, args?: Message['arguments']) => Promise<Response_1>; | ||
export default callRemoteFunction; |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -36,3 +36,3 @@ | ||
arguments: args, | ||
version: packageVersion | ||
version: "0.2.0-beta.4", | ||
}); | ||
@@ -39,0 +39,0 @@ }); |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -4,0 +4,0 @@ |
@@ -128,8 +128,31 @@ interface GetBlockNameResult { | ||
declare type PickImageResult = string; | ||
interface ImageOptions { | ||
/** | ||
* Maximum height of the image | ||
*/ | ||
maxHeight?: number; | ||
/** | ||
* Maximum width of the image | ||
*/ | ||
maxWidth?: number; | ||
/** | ||
* Quality of the image | ||
* 100 being original quality and 1 the maximum amount of compression depending on the file type | ||
*/ | ||
quality?: number; | ||
} | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
declare const pickImage: () => Promise<PickImageResult>; | ||
declare const pickImage: (imageOptions?: ImageOptions, showCameraOption?: boolean, showGalleryOption?: boolean) => Promise<PickImageResult>; | ||
@@ -136,0 +159,0 @@ interface GetUserInfoResult { |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
@@ -95,3 +95,3 @@ | ||
arguments: args, | ||
version: packageVersion | ||
version: "0.2.0-beta.4", | ||
}); | ||
@@ -259,10 +259,26 @@ }); | ||
(function (PickImageErrors) { | ||
PickImageErrors["PERMISSION_ERROR"] = "PERMISSION_ERROR"; | ||
PickImageErrors["OPERATION_CANCELLED"] = "OPERATION_CANCELLED"; | ||
})(PickImageErrors || (PickImageErrors = {})); | ||
/** | ||
* Open native media picker for images. | ||
* Open native media picker or camera app for images | ||
* | ||
* If only one option is enabled either the gallery or the camera app will be opened immediately | ||
* | ||
* Note that an exception will be thrown when there is no camera available or if the user denied access. | ||
* | ||
* @public | ||
* @param {String} imageOptions Options related to the resulting image | ||
* @param {Boolean} showCameraOption Enable "Take photo" option | ||
* @param {Boolean} showGalleryOption Enable "Select from library" option | ||
* @returns {Promise<string>} Promise with string of base46 image. | ||
*/ | ||
const pickImage = () => callRemoteFunction(BridgeFunction$1.pickImage); | ||
const pickImage = (imageOptions = { | ||
quality: 100, | ||
}, showCameraOption = true, showGalleryOption = true) => callRemoteFunction(BridgeFunction$1.pickImage, { | ||
maxWidth: imageOptions.maxWidth, | ||
maxHeight: imageOptions.maxHeight, | ||
quality: imageOptions.quality, | ||
showCameraOption, | ||
showGalleryOption, | ||
}); | ||
@@ -269,0 +285,0 @@ /** |
/** | ||
* @myjsblock/sdk v0.2.0-beta.3 - MIT | ||
* @myjsblock/sdk v0.2.0-beta.4 - MIT | ||
*/ | ||
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["myjsblock-sdk"]={})}(this,(function(e){let t="object"==typeof window.flutter_inappwebview,o=t?window.myjsblock:window;var r,s;console.debug("Messaging API:",""+(t?"in app":"iframe")),(s=r||(r={})).TIMEOUT_EXCEEDED="TIMEOUT_EXCEEDED",s.NO_VALUE_RETURNED="NO_VALUE_RETURNED",s.UNKNOWN_FUNCTION="UNKNOWN_FUNCTION";let a=(e,s)=>new Promise(((a,n)=>{const g=Date.now().toString(36)+Math.random().toString(36).substring(2);((e,t,s=1e4)=>{let a;const n=r=>{r.source!==window&&(r=JSON.parse(r.data)).requestId===e&&(t(r),o.removeEventListener("message",n),a&&clearTimeout(a))};a=setTimeout((()=>{t({requestId:e,error:r.TIMEOUT_EXCEEDED,message:"Timeout exceeded, no response from the App"}),o.removeEventListener("message",n)}),s),o.addEventListener("message",n)})(g,(e=>{if(console.debug("Received:",e),"error"in e){const t=Error(e.message);t.name=String(e.error).toUpperCase(),"traceId"in e&&(t.message=`${t.message}, traceId: ${e.traceId}`),n(t)}else"value"in e?a(e.value):((e=Error("No response value returned.")).name=r.NO_VALUE_RETURNED,n(e))})),(e=>{console.debug("POST:",e),e=JSON.stringify(e),t?o.postMessage(e):window.parent.postMessage(e,"*")})({id:g,functionName:e,arguments:s,version:packageVersion})}));var n;!function(e){e.getBlockName="getBlockName",e.getProperty="getProperty",e.getImageUrl="getImageUrl",e.showLoader="showLoader",e.hideLoader="hideLoader",e.getRecords="getRecords",e.getCurrentRecord="getCurrentRecord",e.showAlert="showAlert",e.goBack="goBack",e.navigate="navigate",e.pickImage="pickImage",e.getUserInfo="getUserInfo"}(n||(n={}));var g,i,d,c=n;(g||(g={})).OPERATION_NOT_ALLOWED="OPERATION_NOT_ALLOWED",(i||(i={})).WEBSERVICE_ERRORS="WEBSERVICE_ERRORS",(d||(d={})).PERMISSION_ERROR="PERMISSION_ERROR",e.getBlockName=()=>a(c.getProperty,{name:"caption"}),e.getCurrentRecord=()=>a(c.getCurrentRecord),e.getImageUrl=(e,{width:t=null,height:o=null})=>a(c.getImageUrl,{imageId:e,width:t,height:o}),e.getProperty=e=>a(c.getProperty,{name:e}),e.getRecords=()=>a(c.getRecords),e.getUserInfo=()=>a(c.getUserInfo),e.goBack=()=>a(c.goBack),e.hideLoader=()=>a(c.hideLoader),e.navigate=(e,t)=>a(c.navigate,{variableName:e,properties:t}),e.pickImage=()=>a(c.pickImage),e.showAlert=(e,t="",o=["OK"])=>a(c.showAlert,{title:e,message:t,buttons:o}),e.showLoader=()=>a(c.showLoader),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["myjsblock-sdk"]={})}(this,(function(e){let t="object"==typeof window.flutter_inappwebview,o=t?window.myjsblock:window;var r,a;console.debug("Messaging API:",""+(t?"in app":"iframe")),(a=r||(r={})).TIMEOUT_EXCEEDED="TIMEOUT_EXCEEDED",a.NO_VALUE_RETURNED="NO_VALUE_RETURNED",a.UNKNOWN_FUNCTION="UNKNOWN_FUNCTION";let s=(e,a)=>new Promise(((s,n)=>{const i=Date.now().toString(36)+Math.random().toString(36).substring(2);((e,t,a=1e4)=>{let s;const n=r=>{r.source!==window&&(r=JSON.parse(r.data)).requestId===e&&(t(r),o.removeEventListener("message",n),s&&clearTimeout(s))};s=setTimeout((()=>{t({requestId:e,error:r.TIMEOUT_EXCEEDED,message:"Timeout exceeded, no response from the App"}),o.removeEventListener("message",n)}),a),o.addEventListener("message",n)})(i,(e=>{if(console.debug("Received:",e),"error"in e){const t=Error(e.message);t.name=String(e.error).toUpperCase(),"traceId"in e&&(t.message=`${t.message}, traceId: ${e.traceId}`),n(t)}else"value"in e?s(e.value):((e=Error("No response value returned.")).name=r.NO_VALUE_RETURNED,n(e))})),(e=>{console.debug("POST:",e),e=JSON.stringify(e),t?o.postMessage(e):window.parent.postMessage(e,"*")})({id:i,functionName:e,arguments:a,version:"0.2.0-beta.4"})}));var n;!function(e){e.getBlockName="getBlockName",e.getProperty="getProperty",e.getImageUrl="getImageUrl",e.showLoader="showLoader",e.hideLoader="hideLoader",e.getRecords="getRecords",e.getCurrentRecord="getCurrentRecord",e.showAlert="showAlert",e.goBack="goBack",e.navigate="navigate",e.pickImage="pickImage",e.getUserInfo="getUserInfo"}(n||(n={}));var i,g,d,E=n;(i||(i={})).OPERATION_NOT_ALLOWED="OPERATION_NOT_ALLOWED",(g||(g={})).WEBSERVICE_ERRORS="WEBSERVICE_ERRORS",(d||(d={})).OPERATION_CANCELLED="OPERATION_CANCELLED",e.getBlockName=()=>s(E.getProperty,{name:"caption"}),e.getCurrentRecord=()=>s(E.getCurrentRecord),e.getImageUrl=(e,{width:t=null,height:o=null})=>s(E.getImageUrl,{imageId:e,width:t,height:o}),e.getProperty=e=>s(E.getProperty,{name:e}),e.getRecords=()=>s(E.getRecords),e.getUserInfo=()=>s(E.getUserInfo),e.goBack=()=>s(E.goBack),e.hideLoader=()=>s(E.hideLoader),e.navigate=(e,t)=>s(E.navigate,{variableName:e,properties:t}),e.pickImage=(e={quality:100},t=!0,o=!0)=>s(E.pickImage,{maxWidth:e.maxWidth,maxHeight:e.maxHeight,quality:e.quality,showCameraOption:t,showGalleryOption:o}),e.showAlert=(e,t="",o=["OK"])=>s(E.showAlert,{title:e,message:t,buttons:o}),e.showLoader=()=>s(E.showLoader),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=myjsblock-sdk.min.js.map |
{ | ||
"name": "@myjsblock/sdk", | ||
"version": "0.2.0-beta.3", | ||
"version": "0.2.0-beta.4", | ||
"description": "Javascript SDK that will allow you to build your own AppMachine block", | ||
@@ -49,2 +49,3 @@ "type": "module", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@rollup/plugin-typescript": "^8.3.1", | ||
@@ -61,6 +62,6 @@ "@types/jest": "^27.4.1", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-config-airbnb-typescript": "^17.0.0", | ||
"eslint-import-resolver-alias": "^1.1.2", | ||
"eslint-import-resolver-typescript": "^2.7.1", | ||
"eslint-plugin-import": "^2.26.0", | ||
"jest": "^27.4.7", | ||
@@ -67,0 +68,0 @@ "react": "17.0.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
95978
1832
0
35