@pisell/utils 1.0.7 → 1.0.9
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/es/firebase/config/index.d.ts +2 -1
- package/es/firebase/config/index.js +8 -7
- package/es/firebase/index.d.ts +15 -6
- package/es/firebase/index.js +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/firebase/config/index.d.ts +2 -1
- package/lib/firebase/config/index.js +8 -7
- package/lib/firebase/index.d.ts +15 -6
- package/lib/firebase/index.js +9 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +19 -0
- package/package.json +4 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
declare let firebaseConfig: {
|
|
2
2
|
apiKey: string;
|
|
3
3
|
authDomain: string;
|
|
4
|
+
databaseURL: string;
|
|
4
5
|
projectId: string;
|
|
5
6
|
storageBucket: string;
|
|
6
7
|
messagingSenderId: string;
|
|
7
8
|
appId: string;
|
|
8
|
-
|
|
9
|
+
measurementId: string;
|
|
9
10
|
};
|
|
10
11
|
declare type InjectedConfigType = {
|
|
11
12
|
apiKey: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var firebaseConfig = {
|
|
2
|
-
apiKey:
|
|
3
|
-
authDomain:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
apiKey: "AIzaSyBhWzh3z3eGW08oeUH6jKNP_H3msyuBEQc",
|
|
3
|
+
authDomain: "pisell-dev-d6421.firebaseapp.com",
|
|
4
|
+
databaseURL: "https://pisell-dev-d6421-default-rtdb.asia-southeast1.firebasedatabase.app",
|
|
5
|
+
projectId: "pisell-dev-d6421",
|
|
6
|
+
storageBucket: "pisell-dev-d6421.appspot.com",
|
|
7
|
+
messagingSenderId: "426955619429",
|
|
8
|
+
appId: "1:426955619429:web:17b5fc88934bebb6dc1a8c",
|
|
9
|
+
measurementId: "G-YJ5G113V4L"
|
|
9
10
|
};
|
|
10
11
|
export var injectConfig = function injectConfig(context) {
|
|
11
12
|
firebaseConfig = context;
|
package/es/firebase/index.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
declare const firebaseApp:
|
|
1
|
+
declare const firebaseApp: any;
|
|
2
2
|
export { firebaseApp };
|
|
3
3
|
export declare const getPath: (path: string) => string;
|
|
4
4
|
export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
|
|
5
|
-
export declare const signUp: (email: string, password: string) => Promise<
|
|
6
|
-
export declare const signInUser: (email: string, password: string) => Promise<
|
|
7
|
-
export declare const signOutUser: () => Promise<
|
|
5
|
+
export declare const signUp: (email: string, password: string) => Promise<any>;
|
|
6
|
+
export declare const signInUser: (email: string, password: string) => Promise<any>;
|
|
7
|
+
export declare const signOutUser: () => Promise<any>;
|
|
8
8
|
export declare const readData: (path: string) => Promise<any>;
|
|
9
|
-
export declare const writeData: (path: string, data: any) => Promise<
|
|
10
|
-
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) =>
|
|
9
|
+
export declare const writeData: (path: string, data: any) => Promise<any>;
|
|
10
|
+
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => any;
|
|
11
11
|
export declare const removeDataListener: (listener: any) => void;
|
|
12
|
+
declare const _default: {
|
|
13
|
+
signInUser: (email: string, password: string) => Promise<any>;
|
|
14
|
+
signOutUser: () => Promise<any>;
|
|
15
|
+
readData: (path: string) => Promise<any>;
|
|
16
|
+
writeData: (path: string, data: any) => Promise<any>;
|
|
17
|
+
onDataChange: (path: string, callback: (snapshot: any) => void) => any;
|
|
18
|
+
removeDataListener: (listener: any) => void;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
package/es/firebase/index.js
CHANGED
|
@@ -176,4 +176,13 @@ export var onDataChange = function onDataChange(path, callback) {
|
|
|
176
176
|
// 移除监听器
|
|
177
177
|
export var removeDataListener = function removeDataListener(listener) {
|
|
178
178
|
off(listener); // 移除监听器
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export default {
|
|
182
|
+
signInUser: signInUser,
|
|
183
|
+
signOutUser: signOutUser,
|
|
184
|
+
readData: readData,
|
|
185
|
+
writeData: writeData,
|
|
186
|
+
onDataChange: onDataChange,
|
|
187
|
+
removeDataListener: removeDataListener
|
|
179
188
|
};
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
declare let firebaseConfig: {
|
|
2
2
|
apiKey: string;
|
|
3
3
|
authDomain: string;
|
|
4
|
+
databaseURL: string;
|
|
4
5
|
projectId: string;
|
|
5
6
|
storageBucket: string;
|
|
6
7
|
messagingSenderId: string;
|
|
7
8
|
appId: string;
|
|
8
|
-
|
|
9
|
+
measurementId: string;
|
|
9
10
|
};
|
|
10
11
|
declare type InjectedConfigType = {
|
|
11
12
|
apiKey: string;
|
|
@@ -24,13 +24,14 @@ __export(config_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(config_exports);
|
|
26
26
|
var firebaseConfig = {
|
|
27
|
-
apiKey: "
|
|
28
|
-
authDomain: "
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
apiKey: "AIzaSyBhWzh3z3eGW08oeUH6jKNP_H3msyuBEQc",
|
|
28
|
+
authDomain: "pisell-dev-d6421.firebaseapp.com",
|
|
29
|
+
databaseURL: "https://pisell-dev-d6421-default-rtdb.asia-southeast1.firebasedatabase.app",
|
|
30
|
+
projectId: "pisell-dev-d6421",
|
|
31
|
+
storageBucket: "pisell-dev-d6421.appspot.com",
|
|
32
|
+
messagingSenderId: "426955619429",
|
|
33
|
+
appId: "1:426955619429:web:17b5fc88934bebb6dc1a8c",
|
|
34
|
+
measurementId: "G-YJ5G113V4L"
|
|
34
35
|
};
|
|
35
36
|
var injectConfig = (context) => {
|
|
36
37
|
firebaseConfig = context;
|
package/lib/firebase/index.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
declare const firebaseApp:
|
|
1
|
+
declare const firebaseApp: any;
|
|
2
2
|
export { firebaseApp };
|
|
3
3
|
export declare const getPath: (path: string) => string;
|
|
4
4
|
export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
|
|
5
|
-
export declare const signUp: (email: string, password: string) => Promise<
|
|
6
|
-
export declare const signInUser: (email: string, password: string) => Promise<
|
|
7
|
-
export declare const signOutUser: () => Promise<
|
|
5
|
+
export declare const signUp: (email: string, password: string) => Promise<any>;
|
|
6
|
+
export declare const signInUser: (email: string, password: string) => Promise<any>;
|
|
7
|
+
export declare const signOutUser: () => Promise<any>;
|
|
8
8
|
export declare const readData: (path: string) => Promise<any>;
|
|
9
|
-
export declare const writeData: (path: string, data: any) => Promise<
|
|
10
|
-
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) =>
|
|
9
|
+
export declare const writeData: (path: string, data: any) => Promise<any>;
|
|
10
|
+
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => any;
|
|
11
11
|
export declare const removeDataListener: (listener: any) => void;
|
|
12
|
+
declare const _default: {
|
|
13
|
+
signInUser: (email: string, password: string) => Promise<any>;
|
|
14
|
+
signOutUser: () => Promise<any>;
|
|
15
|
+
readData: (path: string) => Promise<any>;
|
|
16
|
+
writeData: (path: string, data: any) => Promise<any>;
|
|
17
|
+
onDataChange: (path: string, callback: (snapshot: any) => void) => any;
|
|
18
|
+
removeDataListener: (listener: any) => void;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
package/lib/firebase/index.js
CHANGED
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/firebase/index.ts
|
|
30
30
|
var firebase_exports = {};
|
|
31
31
|
__export(firebase_exports, {
|
|
32
|
+
default: () => firebase_default,
|
|
32
33
|
firebaseApp: () => firebaseApp,
|
|
33
34
|
getPath: () => getPath,
|
|
34
35
|
onDataChange: () => onDataChange,
|
|
@@ -113,6 +114,14 @@ var onDataChange = (path, callback) => {
|
|
|
113
114
|
var removeDataListener = (listener) => {
|
|
114
115
|
(0, import_database.off)(listener);
|
|
115
116
|
};
|
|
117
|
+
var firebase_default = {
|
|
118
|
+
signInUser,
|
|
119
|
+
signOutUser,
|
|
120
|
+
readData,
|
|
121
|
+
writeData,
|
|
122
|
+
onDataChange,
|
|
123
|
+
removeDataListener
|
|
124
|
+
};
|
|
116
125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
117
126
|
0 && (module.exports = {
|
|
118
127
|
firebaseApp,
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
5
11
|
var __copyProps = (to, from, except, desc) => {
|
|
6
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -11,10 +17,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
11
17
|
return to;
|
|
12
18
|
};
|
|
13
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
14
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
29
|
|
|
16
30
|
// src/index.ts
|
|
17
31
|
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
firebase: () => import_firebase.default
|
|
34
|
+
});
|
|
18
35
|
module.exports = __toCommonJS(src_exports);
|
|
19
36
|
__reExport(src_exports, require("./otherUtils"), module.exports);
|
|
20
37
|
__reExport(src_exports, require("./typeUtils"), module.exports);
|
|
@@ -22,8 +39,10 @@ __reExport(src_exports, require("./document"), module.exports);
|
|
|
22
39
|
__reExport(src_exports, require("./date"), module.exports);
|
|
23
40
|
__reExport(src_exports, require("./platform"), module.exports);
|
|
24
41
|
__reExport(src_exports, require("./log"), module.exports);
|
|
42
|
+
var import_firebase = __toESM(require("./firebase"));
|
|
25
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
44
|
0 && (module.exports = {
|
|
45
|
+
firebase,
|
|
27
46
|
...require("./otherUtils"),
|
|
28
47
|
...require("./typeUtils"),
|
|
29
48
|
...require("./document"),
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"typings": "./lib/index.d.ts",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"father": "^4.1.0",
|
|
10
|
-
"dayjs": "^1.11.9"
|
|
10
|
+
"dayjs": "^1.11.9"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
11
13
|
"firebase": "^10.5.0"
|
|
12
14
|
},
|
|
13
15
|
"files": [
|