This commit is contained in:
metacryst
2026-01-09 11:14:27 -06:00
parent cf03c95664
commit 637c9e4674
2149 changed files with 527743 additions and 0 deletions

21
node_modules/@capacitor/synapse/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Ionic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

52
node_modules/@capacitor/synapse/README.md generated vendored Normal file
View File

@@ -0,0 +1,52 @@
# Synapse
### Example
You have plugins that exist for both Capacitor and Cordova. They share the same API for the most part; as in they both expose a `ping` method that takes a string and returns that string with the word "_pong" appeneded to it. You can use synapse to create a single call in ODC that will use which ever plugin is available to the built app. Adding this to your plugins does not alter their ability to be used in the normal fashion they would be directly in a Capacitor or Cordova app.
#### Capacitor Usage of MyPlugin
```javascript
import { MyPlugin } from 'capacitor-my-plugin';
...
async function buttonClick() {
try {
const resp = await MyPlugin.ping({text: "Hello World"});
console.log(resp); // "Hello World_pong"
} catch (error) {
console.error(error);
}
}
```
#### Cordova Usage of MyPlugin
```javascript
function buttonClick() {
window.cordova.plugins.MyPlugin.ping(
{text: "Hello World"},
function(response) {
console.log(response); // "Hello World_pong"
},
function(error) {
console.error(error);
}
)
}
```
#### Synapse Usage of MyPlugin
```javascript
function buttonClick() {
window.CapacitorUtils.Synapse.MyPlugin.ping(
{text: "Hello World"},
function(response) {
console.log(response); // "Hello World_pong"
},
function(error) {
console.error(error);
}
)
}
```
While similar to the way you call cordova plugins, the synapse call will use the appropriate plugin for the platform it is running on. If the app is built with Capacitor, it will use the Capacitor plugin. If the app is built with Cordova, it will use the Cordova plugin.

14
node_modules/@capacitor/synapse/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
/**
* Expose CapacitorUtils.Synapse.<pluginName>
*
* By default it decides to use capacitor if is defined.
* If you want to instead use a cordova plugin in a capacitor shell, set overrideCapacitorWithCordova to true.
*
* Example use:
* window.CapacitorUtils.Synapse.DemoPlugin.ping(
* {value: "hello"},
* (val) => {console.log(val)},
* (err) => {console.error(err)}
* );
*/
export declare function exposeSynapse(overrideCapacitorWithCordova?: boolean): void;

1
node_modules/@capacitor/synapse/dist/synapse.cjs generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(t){t.CapacitorUtils.Synapse=new Proxy({},{get(a,o){return new Proxy({},{get(d,n){return(c,p,r)=>{const e=t.Capacitor.Plugins[o];if(e===void 0){r(new Error(`Capacitor plugin ${o} not found`));return}if(typeof e[n]!="function"){r(new Error(`Method ${n} not found in Capacitor plugin ${o}`));return}(async()=>{try{const i=await e[n](c);p(i)}catch(i){r(i)}})()}}})}})}function u(t){t.CapacitorUtils.Synapse=new Proxy({},{get(a,o){return t.cordova.plugins[o]}})}function y(t=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!t?s(window):window.cordova!==void 0&&u(window))}exports.exposeSynapse=y;

1
node_modules/@capacitor/synapse/dist/synapse.js generated vendored Normal file
View File

@@ -0,0 +1 @@
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.outsystemsSynapse={}))})(this,function(t){"use strict";function n(e){e.CapacitorUtils.Synapse=new Proxy({},{get(f,o){return new Proxy({},{get(y,i){return(u,d,r)=>{const a=e.Capacitor.Plugins[o];if(a===void 0){r(new Error(`Capacitor plugin ${o} not found`));return}if(typeof a[i]!="function"){r(new Error(`Method ${i} not found in Capacitor plugin ${o}`));return}(async()=>{try{const s=await a[i](u);d(s)}catch(s){r(s)}})()}}})}})}function p(e){e.CapacitorUtils.Synapse=new Proxy({},{get(f,o){return e.cordova.plugins[o]}})}function c(e=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?n(window):window.cordova!==void 0&&p(window))}t.exposeSynapse=c,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});

48
node_modules/@capacitor/synapse/dist/synapse.mjs generated vendored Normal file
View File

@@ -0,0 +1,48 @@
function s(t) {
t.CapacitorUtils.Synapse = new Proxy(
{},
{
get(e, n) {
return new Proxy({}, {
get(w, o) {
return (c, p, r) => {
const i = t.Capacitor.Plugins[n];
if (i === void 0) {
r(new Error(`Capacitor plugin ${n} not found`));
return;
}
if (typeof i[o] != "function") {
r(new Error(`Method ${o} not found in Capacitor plugin ${n}`));
return;
}
(async () => {
try {
const a = await i[o](c);
p(a);
} catch (a) {
r(a);
}
})();
};
}
});
}
}
);
}
function u(t) {
t.CapacitorUtils.Synapse = new Proxy(
{},
{
get(e, n) {
return t.cordova.plugins[n];
}
}
);
}
function f(t = !1) {
typeof window > "u" || (window.CapacitorUtils = window.CapacitorUtils || {}, window.Capacitor !== void 0 && !t ? s(window) : window.cordova !== void 0 && u(window));
}
export {
f as exposeSynapse
};

42
node_modules/@capacitor/synapse/package.json generated vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "@capacitor/synapse",
"version": "1.0.4",
"main": "./dist/synapse.cjs",
"module": "./dist/synapse.mjs",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/synapse.mjs",
"require": "./dist/synapse.cjs"
}
},
"files": [
"dist"
],
"scripts": {
"lint": "npm run eslint && npm run prettier -- --check",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write",
"eslint": "eslint",
"prettier": "prettier \"src/**/*.{css,html,ts,js,java}\"",
"swiftlint": "node-swiftlint",
"build": "npm run clean && vite build",
"clean": "rimraf ./dist"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@eslint/js": "^8.56.0",
"@rollup/wasm-node": "~4.19.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "~3.3.3",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.1"
}
}