@jsdev_ninja/core 0.8.51 → 0.8.53
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/dist/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +128 -131
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/firebase-api/index.d.ts +2 -10
- package/dist/firebase-api/index.d.ts.map +1 -1
- package/dist/firebase-api/index.js +0 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/lib/firebase-api/index.ts +16 -7
- package/lib/index.tsx +1 -1
- package/package.json +1 -1
|
@@ -14,11 +14,7 @@ export declare const FirestoreApi: {
|
|
|
14
14
|
getPath: ({ companyId, storeId, collectionName, }: {
|
|
15
15
|
companyId: string;
|
|
16
16
|
storeId: string;
|
|
17
|
-
collectionName:
|
|
18
|
-
}) => string;
|
|
19
|
-
getProductsPath: ({ companyId, storeId }: {
|
|
20
|
-
companyId: string;
|
|
21
|
-
storeId: string;
|
|
17
|
+
collectionName: keyof typeof collections;
|
|
22
18
|
}) => string;
|
|
23
19
|
};
|
|
24
20
|
export declare const FirebaseAPI: {
|
|
@@ -26,11 +22,7 @@ export declare const FirebaseAPI: {
|
|
|
26
22
|
getPath: ({ companyId, storeId, collectionName, }: {
|
|
27
23
|
companyId: string;
|
|
28
24
|
storeId: string;
|
|
29
|
-
collectionName:
|
|
30
|
-
}) => string;
|
|
31
|
-
getProductsPath: ({ companyId, storeId }: {
|
|
32
|
-
companyId: string;
|
|
33
|
-
storeId: string;
|
|
25
|
+
collectionName: keyof typeof collections;
|
|
34
26
|
}) => string;
|
|
35
27
|
};
|
|
36
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC;AAEX,eAAO,MAAM,YAAY;uDAKrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC;AAEX,eAAO,MAAM,YAAY;uDAKrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,WAAW,CAAC;KACzC;CAGD,CAAC;AAEF,eAAO,MAAM,WAAW;;2DATpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,WAAW,CAAC;SACzC;;CAOD,CAAC"}
|
|
@@ -14,9 +14,6 @@ export const FirestoreApi = {
|
|
|
14
14
|
getPath: ({ companyId, storeId, collectionName, }) => {
|
|
15
15
|
return `${companyId}/${storeId}/${collectionName}`;
|
|
16
16
|
},
|
|
17
|
-
getProductsPath: ({ companyId, storeId }) => {
|
|
18
|
-
return FirestoreApi.getPath({ companyId, storeId, collectionName: collections.products });
|
|
19
|
-
},
|
|
20
17
|
};
|
|
21
18
|
export const FirebaseAPI = {
|
|
22
19
|
firestore: FirestoreApi,
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const systemCollections = {
|
|
2
|
+
stores: "stores",
|
|
3
|
+
companies: "companies",
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export const storeCollections = {
|
|
2
7
|
products: "products",
|
|
3
8
|
profiles: "profiles",
|
|
4
9
|
cart: "cart",
|
|
@@ -6,25 +11,29 @@ export const collections = {
|
|
|
6
11
|
orders: "orders",
|
|
7
12
|
categories: "categories",
|
|
8
13
|
favorites: "favorites",
|
|
9
|
-
stores: "stores",
|
|
10
|
-
companies: "companies",
|
|
11
14
|
payments: "payments",
|
|
12
15
|
} as const;
|
|
13
16
|
|
|
14
17
|
export const FirestoreApi = {
|
|
18
|
+
systemCollections,
|
|
19
|
+
storeCollections,
|
|
20
|
+
// for client
|
|
15
21
|
getPath: ({
|
|
16
22
|
companyId,
|
|
17
23
|
storeId,
|
|
18
24
|
collectionName,
|
|
25
|
+
id,
|
|
19
26
|
}: {
|
|
20
27
|
companyId: string;
|
|
21
28
|
storeId: string;
|
|
22
|
-
collectionName:
|
|
29
|
+
collectionName: keyof typeof storeCollections;
|
|
30
|
+
id?: string;
|
|
23
31
|
}) => {
|
|
24
|
-
return `${companyId}/${storeId}/${collectionName}`;
|
|
32
|
+
return `${companyId}/${storeId}/${collectionName}${id ? `/${id}` : ""}`;
|
|
25
33
|
},
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
// for backend
|
|
35
|
+
getDocPath: (collectionName: keyof typeof storeCollections) => {
|
|
36
|
+
return `{companyId}/{storeId}/${collectionName}/{id}`;
|
|
28
37
|
},
|
|
29
38
|
};
|
|
30
39
|
|
package/lib/index.tsx
CHANGED