poad 2.1.1 → 2.5.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 +10 -72
- package/poad.js +52 -0
- package/LICENSE +0 -21
- package/README.md +0 -63
- package/dist/main/OmneediaClient.d.ts +0 -28
- package/dist/main/OmneediaClient.d.ts.map +0 -1
- package/dist/main/OmneediaClient.js +0 -58
- package/dist/main/OmneediaClient.js.map +0 -1
- package/dist/main/env/prefix-dev.d.ts +0 -7
- package/dist/main/env/prefix-dev.d.ts.map +0 -1
- package/dist/main/env/prefix-dev.js +0 -8
- package/dist/main/env/prefix-dev.js.map +0 -1
- package/dist/main/env/prefix-prod.d.ts +0 -7
- package/dist/main/env/prefix-prod.d.ts.map +0 -1
- package/dist/main/env/prefix-prod.js +0 -8
- package/dist/main/env/prefix-prod.js.map +0 -1
- package/dist/main/env/prefix.d.ts +0 -7
- package/dist/main/env/prefix.d.ts.map +0 -1
- package/dist/main/env/prefix.js +0 -8
- package/dist/main/env/prefix.js.map +0 -1
- package/dist/main/index.d.ts +0 -11
- package/dist/main/index.d.ts.map +0 -1
- package/dist/main/index.js +0 -19
- package/dist/main/index.js.map +0 -1
- package/dist/main/lib/auth.d.ts +0 -22
- package/dist/main/lib/auth.d.ts.map +0 -1
- package/dist/main/lib/auth.js +0 -352
- package/dist/main/lib/auth.js.map +0 -1
- package/dist/main/lib/constants.d.ts +0 -8
- package/dist/main/lib/constants.d.ts.map +0 -1
- package/dist/main/lib/constants.js +0 -11
- package/dist/main/lib/constants.js.map +0 -1
- package/dist/main/lib/db.d.ts +0 -45
- package/dist/main/lib/db.d.ts.map +0 -1
- package/dist/main/lib/db.js +0 -252
- package/dist/main/lib/db.js.map +0 -1
- package/dist/main/lib/error-codes.d.ts +0 -7
- package/dist/main/lib/error-codes.d.ts.map +0 -1
- package/dist/main/lib/error-codes.js +0 -3
- package/dist/main/lib/error-codes.js.map +0 -1
- package/dist/main/lib/errors.d.ts +0 -96
- package/dist/main/lib/errors.d.ts.map +0 -1
- package/dist/main/lib/errors.js +0 -127
- package/dist/main/lib/errors.js.map +0 -1
- package/dist/main/lib/realtime.d.ts +0 -9
- package/dist/main/lib/realtime.d.ts.map +0 -1
- package/dist/main/lib/realtime.js +0 -36
- package/dist/main/lib/realtime.js.map +0 -1
- package/dist/main/lib/request.d.ts +0 -40
- package/dist/main/lib/request.d.ts.map +0 -1
- package/dist/main/lib/request.js +0 -237
- package/dist/main/lib/request.js.map +0 -1
- package/dist/main/lib/types.d.ts +0 -408
- package/dist/main/lib/types.d.ts.map +0 -1
- package/dist/main/lib/types.js +0 -11
- package/dist/main/lib/types.js.map +0 -1
- package/dist/main/lib/util.d.ts +0 -7
- package/dist/main/lib/util.d.ts.map +0 -1
- package/dist/main/lib/util.js +0 -90
- package/dist/main/lib/util.js.map +0 -1
- package/dist/main/lib copy/auth.d.ts +0 -22
- package/dist/main/lib copy/auth.d.ts.map +0 -1
- package/dist/main/lib copy/auth.js +0 -283
- package/dist/main/lib copy/auth.js.map +0 -1
- package/dist/main/lib copy/auth_api.d.ts +0 -23
- package/dist/main/lib copy/auth_api.d.ts.map +0 -1
- package/dist/main/lib copy/auth_api.js +0 -90
- package/dist/main/lib copy/auth_api.js.map +0 -1
- package/dist/main/lib copy/constants.d.ts +0 -8
- package/dist/main/lib copy/constants.d.ts.map +0 -1
- package/dist/main/lib copy/constants.js +0 -11
- package/dist/main/lib copy/constants.js.map +0 -1
- package/dist/main/lib copy/cookies.d.ts +0 -20
- package/dist/main/lib copy/cookies.d.ts.map +0 -1
- package/dist/main/lib copy/cookies.js +0 -144
- package/dist/main/lib copy/cookies.js.map +0 -1
- package/dist/main/lib copy/db.d.ts +0 -45
- package/dist/main/lib copy/db.d.ts.map +0 -1
- package/dist/main/lib copy/db.js +0 -252
- package/dist/main/lib copy/db.js.map +0 -1
- package/dist/main/lib copy/realtime.d.ts +0 -9
- package/dist/main/lib copy/realtime.d.ts.map +0 -1
- package/dist/main/lib copy/realtime.js +0 -36
- package/dist/main/lib copy/realtime.js.map +0 -1
- package/dist/main/lib copy/request.d.ts +0 -40
- package/dist/main/lib copy/request.d.ts.map +0 -1
- package/dist/main/lib copy/request.js +0 -206
- package/dist/main/lib copy/request.js.map +0 -1
- package/dist/main/lib copy/types.d.ts +0 -124
- package/dist/main/lib copy/types.d.ts.map +0 -1
- package/dist/main/lib copy/types.js +0 -3
- package/dist/main/lib copy/types.js.map +0 -1
- package/dist/main/lib copy/util.d.ts +0 -7
- package/dist/main/lib copy/util.d.ts.map +0 -1
- package/dist/main/lib copy/util.js +0 -90
- package/dist/main/lib copy/util.js.map +0 -1
- package/dist/module/OmneediaClient.d.ts +0 -28
- package/dist/module/OmneediaClient.d.ts.map +0 -1
- package/dist/module/OmneediaClient.js +0 -52
- package/dist/module/OmneediaClient.js.map +0 -1
- package/dist/module/env/prefix-dev.d.ts +0 -7
- package/dist/module/env/prefix-dev.d.ts.map +0 -1
- package/dist/module/env/prefix-dev.js +0 -6
- package/dist/module/env/prefix-dev.js.map +0 -1
- package/dist/module/env/prefix-prod.d.ts +0 -7
- package/dist/module/env/prefix-prod.d.ts.map +0 -1
- package/dist/module/env/prefix-prod.js +0 -6
- package/dist/module/env/prefix-prod.js.map +0 -1
- package/dist/module/env/prefix.d.ts +0 -7
- package/dist/module/env/prefix.d.ts.map +0 -1
- package/dist/module/env/prefix.js +0 -6
- package/dist/module/env/prefix.js.map +0 -1
- package/dist/module/index.d.ts +0 -11
- package/dist/module/index.d.ts.map +0 -1
- package/dist/module/index.js +0 -12
- package/dist/module/index.js.map +0 -1
- package/dist/module/lib/auth.d.ts +0 -22
- package/dist/module/lib/auth.d.ts.map +0 -1
- package/dist/module/lib/auth.js +0 -349
- package/dist/module/lib/auth.js.map +0 -1
- package/dist/module/lib/constants.d.ts +0 -8
- package/dist/module/lib/constants.d.ts.map +0 -1
- package/dist/module/lib/constants.js +0 -8
- package/dist/module/lib/constants.js.map +0 -1
- package/dist/module/lib/db.d.ts +0 -45
- package/dist/module/lib/db.d.ts.map +0 -1
- package/dist/module/lib/db.js +0 -246
- package/dist/module/lib/db.js.map +0 -1
- package/dist/module/lib/error-codes.d.ts +0 -7
- package/dist/module/lib/error-codes.d.ts.map +0 -1
- package/dist/module/lib/error-codes.js +0 -2
- package/dist/module/lib/error-codes.js.map +0 -1
- package/dist/module/lib/errors.d.ts +0 -96
- package/dist/module/lib/errors.d.ts.map +0 -1
- package/dist/module/lib/errors.js +0 -108
- package/dist/module/lib/errors.js.map +0 -1
- package/dist/module/lib/realtime.d.ts +0 -9
- package/dist/module/lib/realtime.d.ts.map +0 -1
- package/dist/module/lib/realtime.js +0 -33
- package/dist/module/lib/realtime.js.map +0 -1
- package/dist/module/lib/request.d.ts +0 -40
- package/dist/module/lib/request.d.ts.map +0 -1
- package/dist/module/lib/request.js +0 -231
- package/dist/module/lib/request.js.map +0 -1
- package/dist/module/lib/types.d.ts +0 -408
- package/dist/module/lib/types.d.ts.map +0 -1
- package/dist/module/lib/types.js +0 -8
- package/dist/module/lib/types.js.map +0 -1
- package/dist/module/lib/util.d.ts +0 -7
- package/dist/module/lib/util.d.ts.map +0 -1
- package/dist/module/lib/util.js +0 -81
- package/dist/module/lib/util.js.map +0 -1
- package/dist/module/lib copy/auth.d.ts +0 -22
- package/dist/module/lib copy/auth.d.ts.map +0 -1
- package/dist/module/lib copy/auth.js +0 -277
- package/dist/module/lib copy/auth.js.map +0 -1
- package/dist/module/lib copy/auth_api.d.ts +0 -23
- package/dist/module/lib copy/auth_api.d.ts.map +0 -1
- package/dist/module/lib copy/auth_api.js +0 -87
- package/dist/module/lib copy/auth_api.js.map +0 -1
- package/dist/module/lib copy/constants.d.ts +0 -8
- package/dist/module/lib copy/constants.d.ts.map +0 -1
- package/dist/module/lib copy/constants.js +0 -8
- package/dist/module/lib copy/constants.js.map +0 -1
- package/dist/module/lib copy/cookies.d.ts +0 -20
- package/dist/module/lib copy/cookies.d.ts.map +0 -1
- package/dist/module/lib copy/cookies.js +0 -137
- package/dist/module/lib copy/cookies.js.map +0 -1
- package/dist/module/lib copy/db.d.ts +0 -45
- package/dist/module/lib copy/db.d.ts.map +0 -1
- package/dist/module/lib copy/db.js +0 -246
- package/dist/module/lib copy/db.js.map +0 -1
- package/dist/module/lib copy/realtime.d.ts +0 -9
- package/dist/module/lib copy/realtime.d.ts.map +0 -1
- package/dist/module/lib copy/realtime.js +0 -33
- package/dist/module/lib copy/realtime.js.map +0 -1
- package/dist/module/lib copy/request.d.ts +0 -40
- package/dist/module/lib copy/request.d.ts.map +0 -1
- package/dist/module/lib copy/request.js +0 -200
- package/dist/module/lib copy/request.js.map +0 -1
- package/dist/module/lib copy/types.d.ts +0 -124
- package/dist/module/lib copy/types.d.ts.map +0 -1
- package/dist/module/lib copy/types.js +0 -2
- package/dist/module/lib copy/types.js.map +0 -1
- package/dist/module/lib copy/util.d.ts +0 -7
- package/dist/module/lib copy/util.d.ts.map +0 -1
- package/dist/module/lib copy/util.js +0 -81
- package/dist/module/lib copy/util.js.map +0 -1
- package/dist/umd/941.omneedia.js +0 -1
- package/dist/umd/omneedia.js +0 -2
- package/dist/umd/omneedia.js.LICENSE.txt +0 -1
- package/src/OmneediaClient.ts +0 -65
- package/src/env/prefix-dev.ts +0 -5
- package/src/env/prefix-prod.ts +0 -5
- package/src/env/prefix.ts +0 -5
- package/src/index.ts +0 -26
- package/src/lib/auth.ts +0 -306
- package/src/lib/constants.ts +0 -7
- package/src/lib/db.ts +0 -216
- package/src/lib/error-codes.ts +0 -71
- package/src/lib/errors.ts +0 -153
- package/src/lib/realtime.ts +0 -21
- package/src/lib/request.ts +0 -198
- package/src/lib/types.ts +0 -512
- package/src/lib/util.ts +0 -83
package/package.json
CHANGED
|
@@ -1,80 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poad",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"
|
|
5
|
-
"keywords": [
|
|
6
|
-
"javascript",
|
|
7
|
-
"typescript",
|
|
8
|
-
"omneedia",
|
|
9
|
-
"client-js"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://github.com/omneedia/client-js",
|
|
12
|
-
"bugs": "https://github.com/omneedia/client-js/issues",
|
|
3
|
+
"version": "2.5.2",
|
|
4
|
+
"main": "index.js",
|
|
13
5
|
"license": "MIT",
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
"dist",
|
|
17
|
-
"src"
|
|
18
|
-
],
|
|
19
|
-
"main": "dist/main/index.js",
|
|
20
|
-
"module": "dist/module/index.js",
|
|
21
|
-
"types": "dist/module/index.d.ts",
|
|
22
|
-
"sideEffects": false,
|
|
23
|
-
"repository": "omneedia/client-js",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"clean": "rimraf dist docs",
|
|
26
|
-
"format": "prettier --write \"{src,test}/**/*.ts\"",
|
|
27
|
-
"build": "yarn clean && yarn format && yarn build:main && yarn build:module && yarn build:umd",
|
|
28
|
-
"build:main": "tsc -p tsconfig.json",
|
|
29
|
-
"build:module": "tsc -p tsconfig.module.json",
|
|
30
|
-
"build:umd": "webpack",
|
|
31
|
-
"types-generate": "dts-gen -m '@omneedia/client-js' -s",
|
|
32
|
-
"dev:main": "tsc-watch -p tsconfig.json --onSuccess \"echo Main build successful\"",
|
|
33
|
-
"dev:module": "tsc-watch -p tsconfig.module.json --onSuccess \"echo Module build successful\"",
|
|
34
|
-
"dev:umd": "webpack --watch",
|
|
35
|
-
"dev": "npm-run-all --parallel dev:main dev:module dev:umd"
|
|
6
|
+
"bin": {
|
|
7
|
+
"poad": "./poad.js"
|
|
36
8
|
},
|
|
37
9
|
"dependencies": {
|
|
38
|
-
"@capacitor/browser": "^5.0.6",
|
|
39
|
-
"@capacitor/core": "^5.2.3",
|
|
40
|
-
"@types/isomorphic-fetch": "^0.0.36",
|
|
41
|
-
"@types/jsonwebtoken": "^9.0.0",
|
|
42
10
|
"axios": "^1.7.7",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"isomorphic-search": "^0.13.3",
|
|
50
|
-
"jsonwebtoken": "^9.0.0",
|
|
51
|
-
"next": "^14.2.13",
|
|
52
|
-
"node-fetch": "^3.3.2",
|
|
53
|
-
"react": "^18.3.1",
|
|
54
|
-
"react-dom": "^18.3.1",
|
|
55
|
-
"socket.io-client": "^4.5.4",
|
|
56
|
-
"utf-8-validate": "^6.0.3"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@types/jest": "^26.0.13",
|
|
60
|
-
"husky": "^4.3.0",
|
|
61
|
-
"jest": "^26.4.1",
|
|
62
|
-
"npm-run-all": "^4.1.5",
|
|
63
|
-
"prettier": "^2.5.1",
|
|
64
|
-
"pretty-quick": "^3.1.3",
|
|
65
|
-
"rimraf": "^3.0.2",
|
|
66
|
-
"semantic-release-plugin-update-version-in-files": "^1.1.0",
|
|
67
|
-
"ts-jest": "^26.3.0",
|
|
68
|
-
"ts-loader": "^8.0.11",
|
|
69
|
-
"tsc-watch": "^6.2.0",
|
|
70
|
-
"typedoc": "^0.22.16",
|
|
71
|
-
"typescript": "^4.5.5",
|
|
72
|
-
"webpack": "^5.95.0",
|
|
73
|
-
"webpack-cli": "^4.9.2"
|
|
74
|
-
},
|
|
75
|
-
"jsdelivr": "dist/umd/omneedia.js",
|
|
76
|
-
"unpkg": "dist/umd/omneedia.js",
|
|
77
|
-
"publishConfig": {
|
|
78
|
-
"access": "public"
|
|
11
|
+
"box": "^0.0.4",
|
|
12
|
+
"boxen": "^5.1.2",
|
|
13
|
+
"chalk-v2": "^1.0.2",
|
|
14
|
+
"figlet": "^1.7.0",
|
|
15
|
+
"log-beautify": "^1.2.0",
|
|
16
|
+
"toml": "^3.0.0"
|
|
79
17
|
}
|
|
80
18
|
}
|
package/poad.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const figlet = require('figlet');
|
|
3
|
+
const chalk = require('chalk-v2');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const log = require('log-beautify');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { spawn } = require('child_process');
|
|
8
|
+
const os = require('os');
|
|
9
|
+
const userHomeDir = os.homedir();
|
|
10
|
+
const boxen = require('boxen');
|
|
11
|
+
const axios = require('axios');
|
|
12
|
+
|
|
13
|
+
const { version } = require('./package.json');
|
|
14
|
+
|
|
15
|
+
// Function to check internet connection
|
|
16
|
+
const checkInternetConnection = async () => {
|
|
17
|
+
try {
|
|
18
|
+
await axios.get('https://www.google.com');
|
|
19
|
+
return true;
|
|
20
|
+
} catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Recursively searches for the '.cadriciel' directory.
|
|
27
|
+
* @param {string} startPath - Starting path for the search.
|
|
28
|
+
* @returns {string|null} Path of the found directory or null.
|
|
29
|
+
*/
|
|
30
|
+
function findCadricielDir(startPath) {
|
|
31
|
+
let currentPath = startPath;
|
|
32
|
+
|
|
33
|
+
while (currentPath !== path.parse(currentPath).root) {
|
|
34
|
+
const potentialPath = path.join(currentPath, '.cadriciel/cli');
|
|
35
|
+
if (
|
|
36
|
+
fs.existsSync(potentialPath) &&
|
|
37
|
+
fs.statSync(potentialPath).isDirectory()
|
|
38
|
+
) {
|
|
39
|
+
return potentialPath;
|
|
40
|
+
}
|
|
41
|
+
currentPath = path.dirname(currentPath); // Monter vers le répertoire parent.
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Locating the '.cadriciel' directory starting from the current working directory.
|
|
48
|
+
const CADRICIEL_PATH = findCadricielDir(process.cwd());
|
|
49
|
+
const CADRICIEL_COMMAND = 'oa';
|
|
50
|
+
const CADRICIEL_PERMALINK =
|
|
51
|
+
'https://gist.githubusercontent.com/zucatti/08b37516b23c08028a2b07694f0329b6/raw/cadriciel-url.json';
|
|
52
|
+
global.CADRICIEL_URI = '';
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Supabase
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# `client-js`
|
|
2
|
-
|
|
3
|
-
An isomorphic JavaScript client for Omneedia.
|
|
4
|
-
|
|
5
|
-
- **Documentation:** https://omneedia.com/docs/reference
|
|
6
|
-
- TypeDoc: https://supabase.github.io/omneedia/client-js/
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
First of all, you need to install the library:
|
|
11
|
-
|
|
12
|
-
```sh
|
|
13
|
-
npm install @omneedia/client-js
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Then you're able to import the library and establish the connection with the database:
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
import { createClient } from '@omneedia/client-js'
|
|
20
|
-
|
|
21
|
-
// Create a single omneedia client for interacting with your database
|
|
22
|
-
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### UMD
|
|
26
|
-
|
|
27
|
-
You can now use plain `<script>`s to import client-js from CDNs, like:
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<script src="https://cdn.jsdelivr.net/npm/@omneedia/client-js"></script>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
or even:
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<script src="https://unpkg.com/@omneedia/client-js"></script>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Then you can use it from a global `omneedia` variable:
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<script>
|
|
43
|
-
const { createClient } = omneedia
|
|
44
|
-
const _omneedia = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
|
|
45
|
-
|
|
46
|
-
console.log('Omneedia Instance: ', _omneedia)
|
|
47
|
-
// ...
|
|
48
|
-
</script>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### ESM
|
|
52
|
-
|
|
53
|
-
You can now use type="module" `<script>`s to import client-js from CDNs, like:
|
|
54
|
-
|
|
55
|
-
```html
|
|
56
|
-
<script type="module">
|
|
57
|
-
import { createClient } from 'https://cdn.jsdelivr.net/npm/@omneedia/client-js/+esm'
|
|
58
|
-
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
|
|
59
|
-
|
|
60
|
-
console.log('Omneedia Instance: ', omneedia)
|
|
61
|
-
// ...
|
|
62
|
-
</script>
|
|
63
|
-
```
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import OmneediaQueryDB from './lib/db';
|
|
2
|
-
import OmneediaRealtime from './lib/realtime';
|
|
3
|
-
import OmneediaAuth from './lib/auth';
|
|
4
|
-
import type { GenericSchema } from './lib/types';
|
|
5
|
-
export default class OmneediaClient<Database = any, SchemaName extends string & keyof Database = 'public' extends keyof Database ? 'public' : string & keyof Database, Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any> {
|
|
6
|
-
protected omneediaUrl: String;
|
|
7
|
-
protected omneediaKey: String;
|
|
8
|
-
protected PREFIX: {
|
|
9
|
-
REST: string;
|
|
10
|
-
AUTH: string;
|
|
11
|
-
REALTIME: string;
|
|
12
|
-
};
|
|
13
|
-
auth: OmneediaAuth;
|
|
14
|
-
options: any;
|
|
15
|
-
protected KEY: String;
|
|
16
|
-
protected URI: String;
|
|
17
|
-
protected request: any;
|
|
18
|
-
protected socket: any;
|
|
19
|
-
protected headers(): {
|
|
20
|
-
'Content-Type': string;
|
|
21
|
-
Authorization: string;
|
|
22
|
-
apikey: String;
|
|
23
|
-
};
|
|
24
|
-
constructor(omneediaUrl: String, omneediaKey: String, options?: any);
|
|
25
|
-
from(table: string): OmneediaQueryDB;
|
|
26
|
-
channel(channel: string): OmneediaRealtime;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=OmneediaClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OmneediaClient.d.ts","sourceRoot":"","sources":["../../src/OmneediaClient.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,UAAU,CAAA;AACtC,OAAO,gBAAgB,MAAM,gBAAgB,CAAA;AAC7C,OAAO,YAAY,MAAM,YAAY,CAAA;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,CAAC,OAAO,OAAO,cAAc,CACjC,QAAQ,GAAG,GAAG,EACd,UAAU,SAAS,MAAM,GAAG,MAAM,QAAQ,GAAG,QAAQ,SAAS,MAAM,QAAQ,GACxE,QAAQ,GACR,MAAM,GAAG,MAAM,QAAQ,EAC3B,MAAM,SAAS,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa,GACrE,QAAQ,CAAC,UAAU,CAAC,GACpB,GAAG;IAoBK,SAAS,CAAC,WAAW,EAAE,MAAM;IAAE,SAAS,CAAC,WAAW,EAAE,MAAM;IAlBxE,SAAS,CAAC,MAAM;;;;MAAS;IAElB,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,EAAE,GAAG,CAAA;IAEnB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAK;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,CAAK;IAC1B,SAAS,CAAC,OAAO,EAAE,GAAG,CAAA;IACtB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAO;IAE5B,SAAS,CAAC,OAAO;;;;;gBAQK,WAAW,EAAE,MAAM,EAAY,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IAUhF,IAAI,CAAC,KAAK,EAAE,MAAM;IAIlB,OAAO,CAAC,OAAO,EAAE,MAAM;CAe/B"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const socket_io_client_1 = require("socket.io-client");
|
|
7
|
-
const db_1 = __importDefault(require("./lib/db"));
|
|
8
|
-
const realtime_1 = __importDefault(require("./lib/realtime"));
|
|
9
|
-
const auth_1 = __importDefault(require("./lib/auth"));
|
|
10
|
-
const request_1 = __importDefault(require("./lib/request"));
|
|
11
|
-
const prefix_1 = __importDefault(require("./env/prefix"));
|
|
12
|
-
class OmneediaClient {
|
|
13
|
-
headers() {
|
|
14
|
-
return {
|
|
15
|
-
'Content-Type': 'application/json',
|
|
16
|
-
Authorization: 'Basic ' + this.KEY,
|
|
17
|
-
apikey: this.KEY,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
constructor(omneediaUrl, omneediaKey, options) {
|
|
21
|
-
this.omneediaUrl = omneediaUrl;
|
|
22
|
-
this.omneediaKey = omneediaKey;
|
|
23
|
-
this.PREFIX = prefix_1.default;
|
|
24
|
-
this.KEY = '';
|
|
25
|
-
this.URI = '';
|
|
26
|
-
this.socket = null;
|
|
27
|
-
if (!omneediaUrl)
|
|
28
|
-
throw new Error('omneediaUrl is required.');
|
|
29
|
-
if (!omneediaKey)
|
|
30
|
-
throw new Error('omneediaKey is required.');
|
|
31
|
-
this.URI = omneediaUrl;
|
|
32
|
-
this.KEY = omneediaKey;
|
|
33
|
-
this.request = new request_1.default(this);
|
|
34
|
-
this.auth = new auth_1.default(this, options);
|
|
35
|
-
this.options = options;
|
|
36
|
-
}
|
|
37
|
-
from(table) {
|
|
38
|
-
return new db_1.default(table, this);
|
|
39
|
-
}
|
|
40
|
-
channel(channel) {
|
|
41
|
-
this.socket = (0, socket_io_client_1.io)(String(this.URI), {
|
|
42
|
-
path: this.PREFIX.REALTIME,
|
|
43
|
-
withCredentials: true,
|
|
44
|
-
extraHeaders: {
|
|
45
|
-
apikey: `${this.KEY}`,
|
|
46
|
-
Authorization: `Bearer ${this.KEY}`,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
this.socket.on('connect_error', function (e) {
|
|
50
|
-
if (e.description == 401)
|
|
51
|
-
throw `Invalid authentication credentials (401)`;
|
|
52
|
-
throw `unhandled exception`;
|
|
53
|
-
});
|
|
54
|
-
return new realtime_1.default(channel, this);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.default = OmneediaClient;
|
|
58
|
-
//# sourceMappingURL=OmneediaClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OmneediaClient.js","sourceRoot":"","sources":["../../src/OmneediaClient.ts"],"names":[],"mappings":";;;;;AAAA,uDAAqC;AACrC,kDAAsC;AACtC,8DAA6C;AAC7C,sDAAqC;AACrC,4DAA2C;AAC3C,0DAAiC;AAGjC,MAAqB,cAAc;IAmBvB,OAAO;QACf,OAAO;YACL,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG;YAClC,MAAM,EAAE,IAAI,CAAC,GAAG;SACjB,CAAA;IACH,CAAC;IAED,YAAsB,WAAmB,EAAY,WAAmB,EAAE,OAAa;QAAjE,gBAAW,GAAX,WAAW,CAAQ;QAAY,gBAAW,GAAX,WAAW,CAAQ;QAlB9D,WAAM,GAAG,gBAAM,CAAA;QAKf,QAAG,GAAW,EAAE,CAAA;QAChB,QAAG,GAAW,EAAE,CAAA;QAEhB,WAAM,GAAQ,IAAI,CAAA;QAW1B,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC7D,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC7D,IAAI,CAAC,GAAG,GAAG,WAAW,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,WAAW,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAe,CAAC,IAAI,CAAC,CAAA;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEM,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,YAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IAEM,OAAO,CAAC,OAAe;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAA,qBAAE,EAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACjC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC1B,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE;gBACZ,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE;gBACrB,aAAa,EAAE,UAAU,IAAI,CAAC,GAAG,EAAE;aACpC;SACF,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,UAAU,CAAM;YAC9C,IAAI,CAAC,CAAC,WAAW,IAAI,GAAG;gBAAE,MAAM,0CAA0C,CAAA;YAC1E,MAAM,qBAAqB,CAAA;QAC7B,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,kBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF;AAxDD,iCAwDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix-dev.d.ts","sourceRoot":"","sources":["../../../src/env/prefix-dev.ts"],"names":[],"mappings":";;;;;AAAA,wBAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix-dev.js","sourceRoot":"","sources":["../../../src/env/prefix-dev.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;CACb,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix-prod.d.ts","sourceRoot":"","sources":["../../../src/env/prefix-prod.ts"],"names":[],"mappings":";;;;;AAAA,wBAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix-prod.js","sourceRoot":"","sources":["../../../src/env/prefix-prod.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;CACzB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix.d.ts","sourceRoot":"","sources":["../../../src/env/prefix.ts"],"names":[],"mappings":";;;;;AAAA,wBAIC"}
|
package/dist/main/env/prefix.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix.js","sourceRoot":"","sources":["../../../src/env/prefix.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;CACzB,CAAA"}
|
package/dist/main/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import OmneediaClient from './OmneediaClient';
|
|
2
|
-
import { GenericSchema } from './lib/types';
|
|
3
|
-
export { OmneediaClient as omneediaClient };
|
|
4
|
-
export { OmneediaClient as OmneediaClient };
|
|
5
|
-
/**
|
|
6
|
-
* Omneedia Client.
|
|
7
|
-
*
|
|
8
|
-
* An isomorphic Javascript client for interacting with Postgres.
|
|
9
|
-
*/
|
|
10
|
-
export declare const createClient: <Database = any, SchemaName extends string & keyof Database = "public" extends keyof Database ? "public" : string & keyof Database, Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any>(omneediaUrl: string, omneediaKey: string, options?: any) => OmneediaClient;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/main/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,cAAc,IAAI,cAAc,EAAE,CAAA;AAC3C,OAAO,EAAE,cAAc,IAAI,cAAc,EAAE,CAAA;AAE3C;;;;GAIG;AAEH,eAAO,MAAM,YAAY,2PASV,MAAM,eACN,MAAM,YACT,GAAG,KACZ,cAEF,CAAA"}
|
package/dist/main/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createClient = exports.OmneediaClient = exports.omneediaClient = void 0;
|
|
7
|
-
const OmneediaClient_1 = __importDefault(require("./OmneediaClient"));
|
|
8
|
-
exports.omneediaClient = OmneediaClient_1.default;
|
|
9
|
-
exports.OmneediaClient = OmneediaClient_1.default;
|
|
10
|
-
/**
|
|
11
|
-
* Omneedia Client.
|
|
12
|
-
*
|
|
13
|
-
* An isomorphic Javascript client for interacting with Postgres.
|
|
14
|
-
*/
|
|
15
|
-
const createClient = (omneediaUrl, omneediaKey, options) => {
|
|
16
|
-
return new OmneediaClient_1.default(omneediaUrl, omneediaKey, options);
|
|
17
|
-
};
|
|
18
|
-
exports.createClient = createClient;
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/main/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAElB,yBAFpB,wBAAc,CAEoB;AACd,yBAHpB,wBAAc,CAGoB;AAEzC;;;;GAIG;AAEI,MAAM,YAAY,GAAG,CAS1B,WAAmB,EACnB,WAAmB,EACnB,OAAa,EACG,EAAE;IAClB,OAAO,IAAI,wBAAc,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;AAC9D,CAAC,CAAA;AAdY,QAAA,YAAY,gBAcxB"}
|
package/dist/main/lib/auth.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { MailPhoneProps, PasswordCredentials, ProviderProps, EmailResetProps } from './types';
|
|
2
|
-
export default class OmneediaAuth {
|
|
3
|
-
protected ref: any;
|
|
4
|
-
protected tokenListener: any;
|
|
5
|
-
private options;
|
|
6
|
-
constructor(ref: any, options?: any);
|
|
7
|
-
getNewToken(refresh_token: string | null): Promise<any>;
|
|
8
|
-
private _setUserData;
|
|
9
|
-
signInWithPassword(props: PasswordCredentials): Promise<any>;
|
|
10
|
-
signUp(props: PasswordCredentials): Promise<any>;
|
|
11
|
-
signInWithProvider(props: ProviderProps): Promise<string | true>;
|
|
12
|
-
updateUser(props: any): Promise<any>;
|
|
13
|
-
onAuthStateChange(fn: Function): void;
|
|
14
|
-
resetPasswordForEmail(props: EmailResetProps): Promise<void>;
|
|
15
|
-
signInWithEmail(props: MailPhoneProps): Promise<void>;
|
|
16
|
-
getSession(): boolean | any;
|
|
17
|
-
session: () => boolean | any;
|
|
18
|
-
getUser(token?: string | null): Promise<any>;
|
|
19
|
-
isAuthenticated(): boolean | undefined;
|
|
20
|
-
signOut(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAElG,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,SAAS,CAAC,GAAG,EAAE,GAAG,CAAA;IAClB,SAAS,CAAC,aAAa,EAAE,GAAG,CAAO;IACnC,OAAO,CAAC,OAAO,CAAK;gBACR,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG;IA+BtB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAcpE,OAAO,CAAC,YAAY;IAYP,kBAAkB,CAAC,KAAK,EAAE,mBAAmB;IAoB7C,MAAM,CAAC,KAAK,EAAE,mBAAmB;IAmBjC,kBAAkB,CAAC,KAAK,EAAE,aAAa;IAiDvC,UAAU,CAAC,KAAK,EAAE,GAAG;IAO3B,iBAAiB,CAAC,EAAE,EAAE,QAAQ;IA6CxB,qBAAqB,CAAC,KAAK,EAAE,eAAe;IAW5C,eAAe,CAAC,KAAK,EAAE,cAAc;IAU3C,UAAU,IAAI,OAAO,GAAG,GAAG;IAgB3B,OAAO,QAhBO,OAAO,GAAG,GAAG,CAgBF;IACnB,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAmCnC,eAAe;IAMT,OAAO;CAoBrB"}
|