abmp-npm 1.1.74 → 1.1.76

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,6 +1,7 @@
1
1
  const { COLLECTIONS } = require('../../public/consts');
2
2
  const { clearCollection } = require('../cms-data-methods');
3
- const { getSecret } = require('../utils');
3
+ const { CONFIG_KEYS } = require('../consts');
4
+ const { getSecret, getSiteConfigs } = require('../utils');
4
5
 
5
6
  const { migrateInterests } = require('./interests');
6
7
 
@@ -62,10 +63,23 @@ const createHTTPFunctionsHelpers = wixHTTPFunctionsMethods => {
62
63
  return serverError(error);
63
64
  }
64
65
  };
66
+ const getSiteAssociationHandler = async _request => {
67
+ try {
68
+ const siteAssociation = await getSiteConfigs(CONFIG_KEYS.SITE_ASSOCIATION);
69
+ return ok({
70
+ ...responseOptions,
71
+ body: { siteAssociation },
72
+ });
73
+ } catch (error) {
74
+ console.error('Error getting site association:', error);
75
+ return serverError(error);
76
+ }
77
+ };
65
78
 
66
79
  return {
67
80
  post_migrateInterests: withAuth(migrateInterestsHandler),
68
81
  delete_clearCollection: withAuth(clearCollectionHandler),
82
+ get_getSiteAssociation: withAuth(getSiteAssociationHandler),
69
83
  };
70
84
  };
71
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "1.1.74",
3
+ "version": "1.1.76",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "check-cycles": "madge --circular .",