@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.
@@ -14,11 +14,7 @@ export declare const FirestoreApi: {
14
14
  getPath: ({ companyId, storeId, collectionName, }: {
15
15
  companyId: string;
16
16
  storeId: string;
17
- collectionName: string;
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: string;
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,CAAC;KACvB;8CAGyC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAGhF,CAAC;AAEF,eAAO,MAAM,WAAW;;2DAZpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,CAAC;SACvB;kDAGyC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;;CAOhF,CAAC"}
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
@@ -1,4 +1,4 @@
1
1
  export * from "./entities";
2
- export { FirebaseAPI } from "./firebase-api";
3
2
  export * from "./hypPaymentService";
3
+ export { FirebaseAPI } from "./firebase-api";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAC7C,cAAc,qBAAqB,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,3 +1,3 @@
1
1
  export * from "./entities";
2
- export { FirebaseAPI } from "./firebase-api";
3
2
  export * from "./hypPaymentService";
3
+ export { FirebaseAPI } from "./firebase-api";
@@ -1,4 +1,9 @@
1
- export const collections = {
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: string;
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
- getProductsPath: ({ companyId, storeId }: { companyId: string; storeId: string }) => {
27
- return FirestoreApi.getPath({ companyId, storeId, collectionName: collections.products });
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
@@ -1,3 +1,3 @@
1
1
  export * from "./entities";
2
- export { FirebaseAPI } from "./firebase-api";
3
2
  export * from "./hypPaymentService";
3
+ export { FirebaseAPI } from "./firebase-api";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsdev_ninja/core",
3
- "version": "0.8.51",
3
+ "version": "0.8.53",
4
4
  "main": "dist/core.cjs.js",
5
5
  "module": "dist/core.es.js",
6
6
  "types": "dist/index.d.ts",