@quatrain/cloudwrapper-supabase 0.1.2 → 0.1.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractCloudWrapper, DatabaseTriggerType } from '@quatrain/
|
|
1
|
+
import { AbstractCloudWrapper, DatabaseTriggerType } from '@quatrain/cloudwrapper';
|
|
2
2
|
import { SupabaseClient, RealtimeChannel } from '@supabase/supabase-js';
|
|
3
3
|
export type SupabaseParams = {
|
|
4
4
|
useEmulator?: boolean;
|
|
@@ -21,14 +21,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.SupabaseCloudWrapper = exports.eventMap = void 0;
|
|
24
|
-
const
|
|
24
|
+
const cloudwrapper_1 = require("@quatrain/cloudwrapper");
|
|
25
|
+
const backend_1 = require("@quatrain/backend");
|
|
25
26
|
const supabase_js_1 = require("@supabase/supabase-js");
|
|
26
27
|
exports.eventMap = {
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
28
|
+
[backend_1.BackendAction.CREATE]: 'INSERT',
|
|
29
|
+
[backend_1.BackendAction.UPDATE]: 'UPDATE',
|
|
30
|
+
[backend_1.BackendAction.DELETE]: 'DELETE',
|
|
30
31
|
};
|
|
31
|
-
class SupabaseCloudWrapper extends
|
|
32
|
+
class SupabaseCloudWrapper extends cloudwrapper_1.AbstractCloudWrapper {
|
|
32
33
|
constructor(params) {
|
|
33
34
|
super(params);
|
|
34
35
|
this._isInitialized = false;
|
|
@@ -64,7 +65,7 @@ class SupabaseCloudWrapper extends core_1.AbstractCloudWrapper {
|
|
|
64
65
|
}
|
|
65
66
|
_initialize() {
|
|
66
67
|
if (this._isInitialized === false) {
|
|
67
|
-
|
|
68
|
+
cloudwrapper_1.CloudWrapper.log(`Supabase App init`);
|
|
68
69
|
this._supabaseClient = (0, supabase_js_1.createClient)(this._params.url, this._params.key);
|
|
69
70
|
this._realtimeClient = this._supabaseClient.channel('table-db-changes');
|
|
70
71
|
this._isInitialized = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/cloudwrapper-supabase",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Cloud Wrapper adapter for Supabase",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,15 +14,14 @@
|
|
|
14
14
|
"@quatrain/core": "^1.0.0-beta2"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@quatrain/backend": "^1.0.1",
|
|
18
|
+
"@quatrain/cloudwrapper": "^1.0.0",
|
|
17
19
|
"@quatrain/core": "^1.0.0-beta16",
|
|
18
|
-
"@supabase/supabase-js": "^2.45.1"
|
|
19
|
-
"firebase-admin": "^12.1.0",
|
|
20
|
-
"firebase-functions": "^4.9.0"
|
|
20
|
+
"@supabase/supabase-js": "^2.45.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@tsconfig/recommended": "^1.0.1",
|
|
24
24
|
"@types/jest": "^27.0.3",
|
|
25
|
-
"@types/pg": "^8.11.4",
|
|
26
25
|
"jest": "^27.4.7",
|
|
27
26
|
"jest-node-exports-resolver": "^1.1.6",
|
|
28
27
|
"jest-serial-runner": "^1.2.1",
|