@agnostack/next-shopify 4.0.0-canary.2 → 4.0.0-canary.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.
|
@@ -9,7 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import
|
|
12
|
+
import { cert, getApp, getApps, initializeApp } from 'firebase-admin/app';
|
|
13
|
+
import { getFirestore } from 'firebase-admin/firestore';
|
|
13
14
|
import { ensureArray, stringEmpty, objectNotEmpty, COLLECTION_ROOT, STATE_PREFIX, } from '../../shared/index.js';
|
|
14
15
|
const singleton = Symbol('singleton');
|
|
15
16
|
const singletonEnforcer = Symbol('singletonEnforcer');
|
|
@@ -32,12 +33,13 @@ export class FirebaseSessionHandler {
|
|
|
32
33
|
/** @param {any} [firebaseConfig] */
|
|
33
34
|
initializeFireStore(firebaseConfig) {
|
|
34
35
|
if (objectNotEmpty(firebaseConfig)) {
|
|
35
|
-
const project =
|
|
36
|
-
?
|
|
37
|
-
|
|
36
|
+
const project = getApps().length
|
|
37
|
+
? getApp()
|
|
38
|
+
: initializeApp({
|
|
39
|
+
credential: cert(firebaseConfig),
|
|
38
40
|
databaseURL: `https://${firebaseConfig.project_id}.firebaseio.com`,
|
|
39
|
-
})
|
|
40
|
-
this.firestore = project
|
|
41
|
+
});
|
|
42
|
+
this.firestore = getFirestore(project);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
@@ -10,12 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
14
|
exports.findSessionIdsByShop = exports.deleteSessionsCallback = exports.deleteState = exports.storeState = exports.loadState = exports.loadCallback = exports.updateCallback = exports.storeCallback = exports.FirebaseSessionHandler = void 0;
|
|
18
|
-
const
|
|
15
|
+
const app_1 = require("firebase-admin/app");
|
|
16
|
+
const firestore_1 = require("firebase-admin/firestore");
|
|
19
17
|
const index_js_1 = require("../../shared/index.js");
|
|
20
18
|
const singleton = Symbol('singleton');
|
|
21
19
|
const singletonEnforcer = Symbol('singletonEnforcer');
|
|
@@ -38,12 +36,13 @@ class FirebaseSessionHandler {
|
|
|
38
36
|
/** @param {any} [firebaseConfig] */
|
|
39
37
|
initializeFireStore(firebaseConfig) {
|
|
40
38
|
if ((0, index_js_1.objectNotEmpty)(firebaseConfig)) {
|
|
41
|
-
const project =
|
|
42
|
-
?
|
|
43
|
-
|
|
39
|
+
const project = (0, app_1.getApps)().length
|
|
40
|
+
? (0, app_1.getApp)()
|
|
41
|
+
: (0, app_1.initializeApp)({
|
|
42
|
+
credential: (0, app_1.cert)(firebaseConfig),
|
|
44
43
|
databaseURL: `https://${firebaseConfig.project_id}.firebaseio.com`,
|
|
45
|
-
})
|
|
46
|
-
this.firestore =
|
|
44
|
+
});
|
|
45
|
+
this.firestore = (0, firestore_1.getFirestore)(project);
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnostack/next-shopify",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.4",
|
|
4
4
|
"author": "agnoStack Dev <developers@agnostack.com> (https://agnostack.com)",
|
|
5
5
|
"owner": "agnoStack",
|
|
6
6
|
"description": "Please contact agnoStack via info@agnostack.com for any questions",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@agnostack/env": "*",
|
|
98
98
|
"@agnostack/next-plugins": "*",
|
|
99
99
|
"@agnostack/verifyd": "*",
|
|
100
|
-
"firebase-admin": ">=
|
|
100
|
+
"firebase-admin": ">=10.0.0",
|
|
101
101
|
"http-proxy": ">=1.18.1",
|
|
102
102
|
"next": ">=15.0.0",
|
|
103
103
|
"react": ">=18.0.0",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"@typescript-eslint/parser": "8.x",
|
|
160
160
|
"eslint": "9.x",
|
|
161
161
|
"eslint-plugin-import": "2.x",
|
|
162
|
-
"firebase-admin": "
|
|
162
|
+
"firebase-admin": "13.10.0",
|
|
163
163
|
"globals": "16.x",
|
|
164
164
|
"http-proxy": "1.18.1",
|
|
165
165
|
"husky": "9.x",
|