primary_care_admin_binder 0.1.197 → 0.1.199

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.
Files changed (2) hide show
  1. package/dist/index.cjs.js +60 -37
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8270,7 +8270,8 @@ var moment = createCommonjsModule(function (module, exports) {
8270
8270
  var fetchData = /*#__PURE__*/function () {
8271
8271
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
8272
8272
  var url,
8273
- jwtTokenFromStorage,
8273
+ jwtToken,
8274
+ token,
8274
8275
  __options,
8275
8276
  res,
8276
8277
  data,
@@ -8279,13 +8280,18 @@ var fetchData = /*#__PURE__*/function () {
8279
8280
  while (1) switch (_context.n) {
8280
8281
  case 0:
8281
8282
  url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
8282
- jwtTokenFromStorage = localStorage.getItem("jwttoken");
8283
+ jwtToken = _args.length > 2 ? _args[2] : undefined;
8284
+ // Host app (primarycarebackoffice) sets window.binderAuthToken from its
8285
+ // in-memory AuthContext on login/refresh - this package can't import that
8286
+ // module directly, and the token is intentionally never persisted to
8287
+ // localStorage, so a plain window global is the bridge.
8288
+ token = jwtToken || (typeof window !== "undefined" ? window.binderAuthToken : undefined);
8283
8289
  __options = {
8284
8290
  method: "POST",
8285
8291
  credentials: "include",
8286
- headers: jwtTokenFromStorage ? {
8287
- "Content-Type": "application/json",
8288
- "jwtToken": jwtTokenFromStorage
8292
+ headers: token ? {
8293
+ "Content-Type": "application/json"
8294
+ // "jwtToken": token
8289
8295
  } : {
8290
8296
  "Content-Type": "application/json"
8291
8297
  },
@@ -8380,7 +8386,6 @@ var fetchDataApi = /*#__PURE__*/function () {
8380
8386
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
8381
8387
  var url,
8382
8388
  input,
8383
- jwtToken,
8384
8389
  __options,
8385
8390
  res,
8386
8391
  _args2 = arguments;
@@ -8389,16 +8394,13 @@ var fetchDataApi = /*#__PURE__*/function () {
8389
8394
  case 0:
8390
8395
  url = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : __baseUrl__;
8391
8396
  input = _args2.length > 1 ? _args2[1] : undefined;
8392
- jwtToken = localStorage.getItem("jwttoken"); // get jwt token from local storage
8393
8397
  __options = input || {};
8394
8398
  __options.credentials = "include";
8395
- if (__options.headers) {
8396
- __options.headers.jwttoken = jwtToken;
8397
- } else {
8399
+ if (__options.headers) ; else {
8398
8400
  __options.headers = {
8399
8401
  "Content-Type": "application/json",
8400
- Accept: "application/json",
8401
- jwttoken: jwtToken
8402
+ Accept: "application/json"
8403
+ // jwttoken: jwtToken,
8402
8404
  };
8403
8405
  }
8404
8406
  _context2.n = 1;
@@ -8796,7 +8798,6 @@ var GET_MOH_USER_DETAIL = createAsyncThunk("practitionerSlice/get_moh_user_detai
8796
8798
  payload = _ref11.payload, jwtToken = _ref11.jwtToken;
8797
8799
  rejectWithValue = _ref12.rejectWithValue;
8798
8800
  _context7.p = 1;
8799
- console.log(jwtToken, "jwtT");
8800
8801
  _context7.n = 2;
8801
8802
  return fetchData({
8802
8803
  body: JSON.stringify(payload)
@@ -11825,8 +11826,13 @@ var query$9 = {
11825
11826
  deleteVitalMaster: function deleteVitalMaster(id) {
11826
11827
  return {
11827
11828
  appcode: _dbName,
11828
- entity: "VitalsCodes",
11829
- filter: "VitalsCodes._id=='".concat(id, "'")
11829
+ collection: "VitalsCodes",
11830
+ filter: {
11831
+ field: "_id",
11832
+ operator: "eq",
11833
+ value: id
11834
+ },
11835
+ metadata_appcode: metaDatadbName$1
11830
11836
  };
11831
11837
  }
11832
11838
  };
@@ -13026,14 +13032,14 @@ var queries$n = {
13026
13032
  attachmentMasterDelete: function attachmentMasterDelete(_id) {
13027
13033
  var activeDbName = getActiveDbName$1();
13028
13034
  return {
13029
- db_name: activeDbName,
13030
13035
  appcode: activeDbName,
13031
- entity: tables.ATTACHMENT_MASTER,
13032
13036
  collection: tables.ATTACHMENT_MASTER,
13033
- is_metadata: true,
13034
- metadataId: getActiveMetadataId$1(),
13035
- metadata_dbname: getActiveMetadataDbName$1(),
13036
- filter: "".concat(tables.ATTACHMENT_MASTER, "._id=='").concat(_id, "'")
13037
+ filter: {
13038
+ field: "_id",
13039
+ operator: "eq",
13040
+ value: _id
13041
+ },
13042
+ metadata_appcode: getActiveMetadataDbName$1()
13037
13043
  };
13038
13044
  }
13039
13045
  };
@@ -26108,8 +26114,13 @@ var Query = {
26108
26114
  attributeDelete: function attributeDelete(id) {
26109
26115
  return {
26110
26116
  appcode: dbName,
26111
- entity: "CA_OrderAttribApplicability",
26112
- filter: "CA_OrderAttribApplicability._key=='".concat(id, "'")
26117
+ collection: "CA_OrderAttribApplicability",
26118
+ filter: {
26119
+ field: "_key",
26120
+ operator: "eq",
26121
+ value: id
26122
+ },
26123
+ metadata_appcode: metaDatadbName$1
26113
26124
  };
26114
26125
  },
26115
26126
  entityTypeName: function entityTypeName(name) {
@@ -34988,19 +34999,21 @@ var queries$9 = {
34988
34999
  };
34989
35000
  },
34990
35001
  permission_delete: function permission_delete(data) {
34991
- var filter = {};
35002
+ var filterObj = {};
34992
35003
  if (data._id) {
34993
- filter = {
34994
- filter: "PermissionManagement._id=='".concat(data._id, "'")
35004
+ filterObj = {
35005
+ filter: {
35006
+ field: "_id",
35007
+ operator: "eq",
35008
+ value: data._id
35009
+ }
34995
35010
  };
34996
35011
  }
34997
35012
  return _objectSpread2({
34998
- "db_name": dbName,
34999
- "entity": "PermissionManagement",
35000
- // "is_metadata": true,
35001
- "metadataId": metaDataId$1,
35002
- "metadata_dbname": metaDatadbName$1
35003
- }, filter);
35013
+ "appcode": dbName,
35014
+ "collection": "PermissionManagement",
35015
+ "metadata_appcode": metaDatadbName$1
35016
+ }, filterObj);
35004
35017
  },
35005
35018
  permission_upsert: function permission_upsert(data) {
35006
35019
  var filter = {};
@@ -38269,8 +38282,13 @@ var query$6 = {
38269
38282
  orderSetComponentDelete: function orderSetComponentDelete(_key) {
38270
38283
  return {
38271
38284
  appcode: "".concat(dbName),
38272
- entity: "CA_OrderSet_Components",
38273
- filter: "CA_OrderSet_Components._key== '".concat(_key, "'")
38285
+ collection: "CA_OrderSet_Components",
38286
+ filter: {
38287
+ field: "_key",
38288
+ operator: "eq",
38289
+ value: _key
38290
+ },
38291
+ metadata_appcode: metaDatadbName$1
38274
38292
  };
38275
38293
  }
38276
38294
  };
@@ -39351,8 +39369,13 @@ var query$5 = {
39351
39369
  orderSetApplicabilityDelete: function orderSetApplicabilityDelete(_key) {
39352
39370
  return {
39353
39371
  appcode: "".concat(dbName),
39354
- entity: "CA_OrderSet_Applicability",
39355
- filter: "CA_OrderSet_Applicability._key== '".concat(_key, "'")
39372
+ collection: "CA_OrderSet_Applicability",
39373
+ filter: {
39374
+ field: "_key",
39375
+ operator: "eq",
39376
+ value: _key
39377
+ },
39378
+ metadata_appcode: metaDatadbName$1
39356
39379
  };
39357
39380
  }
39358
39381
  };
@@ -43979,7 +44002,7 @@ var SYMPTOM_AND_SPECIALTY_READ = createAsyncThunk("symptomAndSpecialtySlice/symp
43979
44002
  case 2:
43980
44003
  data = _context2.v;
43981
44004
  arry = [];
43982
- data.map(function (val) {
44005
+ data === null || data === void 0 || data.map(function (val) {
43983
44006
  if (val._key) {
43984
44007
  var _val$designation, _val$property, _val$description, _val$imageUrl;
43985
44008
  arry.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.197",
3
+ "version": "0.1.199",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",