@evlop/commons 1.0.161 → 1.0.163

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data-sources/index.ts"],"names":[],"mappings":";AAIA,wBAIE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data-sources/index.ts"],"names":[],"mappings":";AAKA,wBAKE"}
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const collection_1 = __importDefault(require("./collection"));
7
7
  const listUrl_1 = __importDefault(require("./listUrl"));
8
8
  const scopeDataSource_1 = __importDefault(require("./scopeDataSource"));
9
+ const url_1 = __importDefault(require("./url"));
9
10
  exports.default = [
10
11
  collection_1.default,
12
+ url_1.default,
11
13
  listUrl_1.default,
12
14
  scopeDataSource_1.default,
13
15
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-sources/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAgD;AAChD,wDAA0C;AAC1C,wEAAgD;AAEhD,kBAAe;IACX,oBAAoB;IACpB,iBAAiB;IACjB,yBAAe;CAClB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-sources/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAgD;AAChD,wDAA0C;AAC1C,wEAAgD;AAChD,gDAAkC;AAElC,kBAAe;IACX,oBAAoB;IACpB,aAAa;IACb,iBAAiB;IACjB,yBAAe;CAClB,CAAC"}
@@ -51,7 +51,7 @@ const listUrlDataSource = (options, { dispatch }) => __awaiter(void 0, void 0, v
51
51
  };
52
52
  });
53
53
  listUrlDataSource.displayName = 'Rest API (Array)';
54
- listUrlDataSource.identifier = 'url';
54
+ listUrlDataSource.identifier = 'array-url';
55
55
  listUrlDataSource.type = 'Array';
56
56
  listUrlDataSource.configurationOptions = [
57
57
  { type: 'text', key: 'url-source', label: 'API URL', name: 'url', placeholder: 'eg. https://api.example.com/data' },
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,CAAC,YAAY,GAAG,CAAC,OAAO,EAAC,EAAE,CAAA,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;AAE5E,iBAAiB,CAAC,YAAY,GAAG,CAAC,OAAO,EAAC,EAAE;IACxC,MAAM,EAAE,GAAG,GAAG,EAAE,EAAE,cAAc,EAAE,oBAAoB,EAAC,GAAG,OAAO,CAAC;IAClE,IAAI,cAAc,CAAC;IACnB,IAAG;QACC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACrD;IAAA,OAAM,CAAC,EAAC,GAAE;IAEX,OAAO,SAAM,CAAC;QACV,YAAG,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9B,GAAG;QACH,YAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;KAChD,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,qCAAyB,CAAC,CAAA;AAC3C,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { _DataSource } from "../reducers";
2
+ declare const urlDataSource: _DataSource;
3
+ export default urlDataSource;
4
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/data-sources/url.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,QAAA,MAAM,aAAa,EAAE,WA0BpB,CAAA;AAiCD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const lodash_1 = require("lodash");
13
+ const actions_1 = require("../actions");
14
+ const uuid_1 = require("uuid");
15
+ const constants_1 = require("../constants");
16
+ const urlDataSource = (options, { dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const { sourceId, url = sourceId, data, requestOptions, page } = options;
18
+ let reqOptions = {};
19
+ if (requestOptions) {
20
+ if (typeof requestOptions === 'string') {
21
+ try {
22
+ lodash_1.assign(reqOptions, JSON.parse(requestOptions));
23
+ }
24
+ catch (e) {
25
+ console.log('reqOptions', e);
26
+ }
27
+ }
28
+ else if (typeof requestOptions === 'object') {
29
+ lodash_1.assign(reqOptions, requestOptions);
30
+ }
31
+ }
32
+ console.log('reqOptions', reqOptions, requestOptions);
33
+ const pageSize = lodash_1.get(reqOptions, 'pageSize') || options.pageSize;
34
+ const pageSizeParamName = lodash_1.get(reqOptions, 'paramsMap.pageSize', 'pageSize');
35
+ const pageParamName = lodash_1.get(reqOptions, 'paramsMap.page', 'page');
36
+ const { response } = yield dispatch(actions_1.request(url, data, lodash_1.defaultsDeep({ params: { [pageParamName]: page, [pageSizeParamName]: pageSize } }, lodash_1.pick(reqOptions, ['params', 'headers', 'method']))));
37
+ return response;
38
+ });
39
+ urlDataSource.displayName = 'Rest API';
40
+ urlDataSource.identifier = 'url';
41
+ urlDataSource.type = 'Object';
42
+ urlDataSource.configurationOptions = [
43
+ { type: 'text', key: 'url-source', label: 'API URL', name: 'url', placeholder: 'eg. https://api.example.com/data' },
44
+ { type: 'code', key: 'url-params', label: 'Request Options', name: 'requestOptions', minHeight: 100 },
45
+ ];
46
+ urlDataSource.defaultValues = {
47
+ url: '',
48
+ requestOptions: JSON.stringify({ params: {}, data: {}, method: 'get' }, null, 2),
49
+ };
50
+ urlDataSource.keyExtractor = (options) => options.url || options.sourceId;
51
+ urlDataSource.keyExtractor = (options) => {
52
+ const { url = '', requestOptions: requestOptionsString } = options;
53
+ let requestOptions;
54
+ try {
55
+ requestOptions = JSON.parse(requestOptionsString);
56
+ }
57
+ catch (e) { }
58
+ return uuid_1.v5([
59
+ lodash_1.get(requestOptions, 'key', ''),
60
+ url,
61
+ lodash_1.get(requestOptions, 'method', ''),
62
+ JSON.stringify(lodash_1.get(requestOptions, 'data', {})),
63
+ JSON.stringify(lodash_1.get(requestOptions, 'params')),
64
+ ].join(':'), constants_1.DATA_SOURCE_KEY_NAMESPACE);
65
+ };
66
+ exports.default = urlDataSource;
67
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/data-sources/url.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAyD;AACzD,wCAAqC;AAErC,+BAAkC;AAClC,4CAAyD;AAEzD,MAAM,aAAa,GAAgB,CAAO,OAAO,EAAE,EAAC,QAAQ,EAAC,EAAC,EAAE;IAC5D,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzE,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAG,cAAc,EAAC;QACd,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAC;YACnC,IAAG;gBACC,eAAM,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;aAClD;YAAC,OAAM,CAAC,EAAC;gBACN,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;aAChC;SACJ;aAAM,IAAI,OA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F,aAAa,CAAC,aAAa,GAAG;IAC1B,GAAG,EAAE,EAAE;IACP,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,EAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC;CACjF,CAAC;AACF,aAAa,CAAC,YAAY,GAAG,CAAC,OAAO,EAAC,EAAE,CAAA,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;AAExE,aAAa,CAAC,YAAY,GAAG,CAAC,OAAO,EAAC,EAAE;IACpC,MAAM,EAAE,GAAG,GAAG,EAAE,EAAE,cAAc,EAAE,oBAAoB,EAAC,GAAG,OAAO,CAAC;IAClE,IAAI,cAAc,CAAC;IACnB,IAAG;QACC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACrD;IAAA,OAAM,CAAC,EAAC,GAAE;IAEX,OAAO,SAAM,CAAC;QACV,YAAG,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9B,GAAG;QACH,YAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;KAChD,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,qCAAyB,CAAC,CAAA;AAC3C,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCollectionRecord.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecord.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,mBAAqB,MAAM,MAAM,MAAM,QAwBtE,CAAC"}
1
+ {"version":3,"file":"useCollectionRecord.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecord.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,mBAAqB,MAAM,MAAM,MAAM,QAyBtE,CAAC"}
@@ -20,6 +20,8 @@ const useCollectionRecord = (collectionName, id) => {
20
20
  }, [collectionName]);
21
21
  const record = react_redux_1.useSelector((state) => lodash_1.get(state.collection, [key, 'cache', id], defaultValue));
22
22
  const load = react_1.useCallback(() => {
23
+ if (!id)
24
+ return;
23
25
  return dispatch(reducers_1.collectionGetRecord(collectionName, id))
24
26
  .then((r) => r.response);
25
27
  }, [dispatch, collectionName, id]);
@@ -1 +1 @@
1
- {"version":3,"file":"useCollectionRecord.js","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecord.tsx"],"names":[],"mappings":";;;AAAA,iCAAwD;AACxD,6CAAuD;AACvD,mCAA6B;AAC7B,0CAA0E;AAE1E,wCAAmC;AAEnC,MAAM,YAAY,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAElC,MAAM,mBAAmB,GAAG,CAAE,cAAsB,EAAE,EAAU,EAAE,EAAE;IACvE,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,eAAO,CAAC,GAAE,EAAE;QAChC,IAAG,CAAC,cAAc;YAAE,OAAO;QAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,gCAAqB,CAAC,cAAc,CAAC,CAAC,CAAA;QAC7D,IAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QACvB,OAAO,eAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,MAAM,GAAG,yBAAW,CAAE,CAAC,KAAS,EAAE,EAAE,CAAC,YAAG,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,OAAO,EAAC,EAAE,CAAC,EAAE,YAAY,CAA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AAC,CAAC;IAErB,MAAM,MAAM,GAAG,yBAAW,CAAE,CAAC,KAAS,EAAE,EAAE,CAAC,YAAG,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,OAAO,EAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;IAEnG,MAAM,IAAI,GAAG,mBAAW,CAAC,GAAE,EAAE;QACzB,IAAG,CAAC,EAAE;YAAE,OAAO;QACf,OAAO,QAAQ,CAAC,8BAAmB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;aACvD,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC,EAAE,CAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;IAGpC,iBAAS,CAAC,GAAE,EAAE;QACV,IAAI,EAAE,CAAC;IACX,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,eAAO,CAAC,GAAE,EAAE,CAAA,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC;AAzBW,QAAA,mBAAmB,uBAyB9B"}
@@ -1,9 +1,14 @@
1
- export declare const ADD_ADMIN_MENU_ITEM = "ADD_MENU_ITEM";
1
+ export declare const ADD_ADMIN_MENU_ITEM = "ADD_ADMIN_MENU_ITEM";
2
+ export declare const REMOVE_ADMIN_MENU_ITEM = "REMOVE_ADMIN_MENU_ITEM";
2
3
  export declare function addAdminMenuItem(id: any, data: any): {
3
4
  type: string;
4
5
  id: any;
5
6
  data: any;
6
7
  };
8
+ export declare function removeAdminMenuItem(id: any): {
9
+ type: string;
10
+ id: any;
11
+ };
7
12
  declare const _default: (state: any, action: any) => any;
8
13
  export default _default;
9
14
  //# sourceMappingURL=adminMenus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adminMenus.d.ts","sourceRoot":"","sources":["../../../src/reducers/adminMenus.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,wBAAgB,gBAAgB,CAAC,EAAE,KAAA,EAAE,IAAI,KAAA;;;;EAMxC;;AAKD,wBAQC"}
1
+ {"version":3,"file":"adminMenus.d.ts","sourceRoot":"","sources":["../../../src/reducers/adminMenus.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D,wBAAgB,gBAAgB,CAAC,EAAE,KAAA,EAAE,IAAI,KAAA;;;;EAMxC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAA;;;EAKrC;;AAKD,wBAWC"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addAdminMenuItem = exports.ADD_ADMIN_MENU_ITEM = void 0;
4
- exports.ADD_ADMIN_MENU_ITEM = 'ADD_MENU_ITEM';
3
+ exports.removeAdminMenuItem = exports.addAdminMenuItem = exports.REMOVE_ADMIN_MENU_ITEM = exports.ADD_ADMIN_MENU_ITEM = void 0;
4
+ exports.ADD_ADMIN_MENU_ITEM = 'ADD_ADMIN_MENU_ITEM';
5
+ exports.REMOVE_ADMIN_MENU_ITEM = 'REMOVE_ADMIN_MENU_ITEM';
5
6
  function addAdminMenuItem(id, data) {
6
7
  return {
7
8
  type: exports.ADD_ADMIN_MENU_ITEM,
@@ -10,12 +11,22 @@ function addAdminMenuItem(id, data) {
10
11
  };
11
12
  }
12
13
  exports.addAdminMenuItem = addAdminMenuItem;
14
+ function removeAdminMenuItem(id) {
15
+ return {
16
+ type: exports.REMOVE_ADMIN_MENU_ITEM,
17
+ id,
18
+ };
19
+ }
20
+ exports.removeAdminMenuItem = removeAdminMenuItem;
13
21
  let initialState = [];
14
22
  exports.default = (state = initialState, action) => {
15
23
  switch (action.type) {
16
24
  case exports.ADD_ADMIN_MENU_ITEM: {
17
25
  return [...state, Object.assign({ id: action.id }, action.data)];
18
26
  }
27
+ case exports.REMOVE_ADMIN_MENU_ITEM: {
28
+ return state.filter(item => item.id !== action.id);
29
+ }
19
30
  default:
20
31
  return state;
21
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adminMenus.js","sourceRoot":"","sources":["../../../src/reducers/adminMenus.tsx"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,eAAe,CAAC;AAEnD,SAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI;IACrC,OAAO;QACH,IAAI,EAAE,2BAAmB;QACzB,EAAE;QACF,IAAI,EAAE,IAAI;KACb,CAAC;AACN,CAAC;AAND,4CAMC;AAED,IAAI,YAAY,GAAO,EAAE,CAAC;AAG1B,kBAAe,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,EAAC,EAAE;IAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,2BAAmB,CAAC,CAAA;YACrB,OAAO,CAAC,GAAG,KAAK,kBAAG,EAAE,EAAE,MAAM,CAAC,EAAE,IAAK,MAAM,CAAC,IAAI,EAAE,CAAA;SACrD;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
1
+ {"version":3,"file":"adminMenus.js","sourceRoot":"","sources":["../../../src/reducers/adminMenus.tsx"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,SAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI;IACrC,OAAO;QACH,IAAI,EAAE,2BAAmB;QACzB,EAAE;QACF,IAAI,EAAE,IAAI;KACb,CAAC;AACN,CAAC;AAND,4CAMC;AAED,SAAgB,mBAAmB,CAAC,EAAE;IAClC,OAAO;QACH,IAAI,EAAE,8BAAsB;QAC5B,EAAE;KACL,CAAC;AACN,CAAC;AALD,kDAKC;AAED,IAAI,YAAY,GAAO,EAAE,CAAC;AAG1B,kBAAe,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,EAAC,EAAE;IAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,2BAAmB,CAAC,CAAA;YACrB,OAAO,CAAC,GAAG,KAAK,kBAAG,EAAE,EAAE,MAAM,CAAC,EAAE,IAAK,MAAM,CAAC,IAAI,EAAE,CAAA;SACrD;QACD,KAAK,8BAAsB,CAAC,CAAA;YACxB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;SACtD;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
@@ -1,3 +1,4 @@
1
+ export declare const UNREGISTER_MODEL = "collection/unregister_model";
1
2
  export declare const REGISTER_MODEL = "collection/register_model";
2
3
  export declare const COLLECTION_LOAD_PAGE_STARTED = "COLLECTION_LOAD_PAGE_STARTED";
3
4
  export declare const COLLECTION_LOAD_PAGE_SUCCESS = "COLLECTION_LOAD_PAGE_SUCCESS";
@@ -21,6 +22,10 @@ export declare function registerModel(model: any): {
21
22
  type: string;
22
23
  model: any;
23
24
  };
25
+ export declare function unregisterModel(model: any): {
26
+ type: string;
27
+ model: any;
28
+ };
24
29
  export declare const getModelForCollection: (collectionName: any) => (dispatch: any, getState: any) => any;
25
30
  export declare function getCollection(collectionName: string, { page, pageSize, search, sort, key }: {
26
31
  page: number;
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/reducers/collection.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,8BAA8B,CAAC;AAE1D,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,4BAA4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+B,oCAAoC,CAAC;AAEjF,wBAAgB,aAAa,CAAC,KAAK,KAAA;;;EAKlC;AAED,wBAAgB,eAAe,CAAC,KAAK,KAAA;;;EAKpC;AAED,eAAO,MAAM,qBAAqB,gEAIjC,CAAA;AAED,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,IAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAA0B,EAAE,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAC,EAAE,MAAM,KAAK;;;;;;;;;;;;EAMhN;AAED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,IAAQ,EAAE,IAAI,EAAE,MAAM,EAAG,GAA0B,EAAE;;;;;CAAA,EAAE,MAAM,KAAK;;;;;;;;;;;;EAM9H;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,KAAA;;;;;;;;;;;;EAO7D;AAED,wBAAgB,mBAAmB,CAAC,cAAc,KAAA,EAAE,IAAI,EAAE,GAAG;;;;;;;;;;;;EAO5D;AAED,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,KAAA;;;;;;;;;;;;EAQhE;AAED,wBAAgB,sBAAsB,CAAC,cAAc,KAAA,EAAE,EAAE,KAAA,EAAE,OAAO,EAAE,GAAG;;;;;;;;;;;;EAOtE;AAyBD,QAAA,MAAM,UAAU,kCA2Gf,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.collectionUpdateRecord = exports.collectionDeleteRecord = exports.collectionAddRecord = exports.collectionGetRecord = exports.collectionLoadMore = exports.getCollection = exports.getModelForCollection = exports.registerModel = exports.COLLECTION_UPDATE_RECORD_FAILED = exports.COLLECTION_UPDATE_RECORD_SUCCESS = exports.COLLECTION_UPDATE_RECORD_STARTED = exports.COLLECTION_ADD_RECORD_FAILED = exports.COLLECTION_ADD_RECORD_SUCCESS = exports.COLLECTION_ADD_RECORD_STARTED = exports.COLLECTION_DELETE_RECORD_FAILED = exports.COLLECTION_DELETE_RECORD_SUCCESS = exports.COLLECTION_DELETE_RECORD_STARTED = exports.COLLECTION_GET_RECORD_FAILED = exports.COLLECTION_GET_RECORD_SUCCESS = exports.COLLECTION_GET_RECORD_STARTED = exports.COLLECTION_LOAD_MORE_FAILED = exports.COLLECTION_LOAD_MORE_SUCCESS = exports.COLLECTION_LOAD_MORE_STARTED = exports.COLLECTION_LOAD_PAGE_FAILED = exports.COLLECTION_LOAD_PAGE_SUCCESS = exports.COLLECTION_LOAD_PAGE_STARTED = exports.REGISTER_MODEL = void 0;
3
+ exports.collectionUpdateRecord = exports.collectionDeleteRecord = exports.collectionAddRecord = exports.collectionGetRecord = exports.collectionLoadMore = exports.getCollection = exports.getModelForCollection = exports.unregisterModel = exports.registerModel = exports.COLLECTION_UPDATE_RECORD_FAILED = exports.COLLECTION_UPDATE_RECORD_SUCCESS = exports.COLLECTION_UPDATE_RECORD_STARTED = exports.COLLECTION_ADD_RECORD_FAILED = exports.COLLECTION_ADD_RECORD_SUCCESS = exports.COLLECTION_ADD_RECORD_STARTED = exports.COLLECTION_DELETE_RECORD_FAILED = exports.COLLECTION_DELETE_RECORD_SUCCESS = exports.COLLECTION_DELETE_RECORD_STARTED = exports.COLLECTION_GET_RECORD_FAILED = exports.COLLECTION_GET_RECORD_SUCCESS = exports.COLLECTION_GET_RECORD_STARTED = exports.COLLECTION_LOAD_MORE_FAILED = exports.COLLECTION_LOAD_MORE_SUCCESS = exports.COLLECTION_LOAD_MORE_STARTED = exports.COLLECTION_LOAD_PAGE_FAILED = exports.COLLECTION_LOAD_PAGE_SUCCESS = exports.COLLECTION_LOAD_PAGE_STARTED = exports.REGISTER_MODEL = exports.UNREGISTER_MODEL = void 0;
4
4
  const change_case_1 = require("change-case");
5
5
  const lodash_1 = require("lodash");
6
6
  const restApi_1 = require("../actions/restApi");
7
+ exports.UNREGISTER_MODEL = 'collection/unregister_model';
7
8
  exports.REGISTER_MODEL = 'collection/register_model';
8
9
  exports.COLLECTION_LOAD_PAGE_STARTED = 'COLLECTION_LOAD_PAGE_STARTED';
9
10
  exports.COLLECTION_LOAD_PAGE_SUCCESS = 'COLLECTION_LOAD_PAGE_SUCCESS';
@@ -30,6 +31,13 @@ function registerModel(model) {
30
31
  };
31
32
  }
32
33
  exports.registerModel = registerModel;
34
+ function unregisterModel(model) {
35
+ return {
36
+ type: exports.UNREGISTER_MODEL,
37
+ model,
38
+ };
39
+ }
40
+ exports.unregisterModel = unregisterModel;
33
41
  const getModelForCollection = (collectionName) => (dispatch, getState) => {
34
42
  const state = getState();
35
43
  const models = state.collection.models;
@@ -108,6 +116,8 @@ const collection = (state = initialState, action) => {
108
116
  ...state.models,
109
117
  action.model,
110
118
  ].filter(m => m) });
119
+ case exports.UNREGISTER_MODEL:
120
+ return Object.assign(Object.assign({}, state), { models: state.models.filter(model => model.collectionName !== action.model.collectionName) });
111
121
  case exports.COLLECTION_LOAD_MORE_STARTED:
112
122
  case exports.COLLECTION_LOAD_PAGE_STARTED: {
113
123
  const { key } = action;
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/reducers/collection.tsx"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,mCAAsD;AACtD,gDAAgE;AAEnD,QAAA,cAAc,GAAG,2BAA2B,CAAC;AAE7C,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AAE5D,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,QAAA,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,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;YACjC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,uBAAuB,EAAE,GAAG,KAAK,CAAC;YACjE,MAAM,IAAI,GAAG,QAAQ,CAAC;YACtB,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;YACrB,MAAM,QAAQ,mCACP,aAAa,KAChB,KAAK,8DAAO,aAAa,CAAC,KAAK,GAAK,cAAK,CAAC,KAAK,EAAE,IAAI,CAAC,GAAK,cAAK,CAAC,KAAK,EAAE,MAAM,CAAC,GAAK,cAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAC1G,CAAC;YACF,uCACO,KAAK,KACR,CAAC,GAAG,CAAC,EAAE,QAAQ,IACjB;SACL;QACD,KAAK,wCAAgC,CAAC,CAAA;YAClC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,EAAC,EAAE,GAAG,IAAI,EAAC,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;YACrD,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,uBAAuB,EAAE,GAAG,KAAK,CAAC;YACjE,MAAM,QAAQ,mCACP,aAAa,KAChB,KAAK,EAAE,eAAM,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,IAAS,EAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAI,EAAE,CAAC,EAC/D,KAAK,EAAE,aAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,GACzC,CAAC;YACF,uCACO,KAAK,KACR,CAAC,GAAG,CAAC,EAAE,QAAQ,IACjB;SACL;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -13,13 +13,13 @@ export interface _DataSource extends Function {
13
13
  type: 'Object' | 'Array';
14
14
  configurationOptions: Array<any>;
15
15
  defaultValues?: Object;
16
- load?: (options: any, { scope: Object, dispatch: Function }: {
17
- scope: any;
18
- dispatch: any;
16
+ load?: (options: any, helpers: {
17
+ scope: Object;
18
+ dispatch: Function;
19
19
  }) => Promise<any>;
20
- keyExtractor: (options: any, { scope: Object, dispatch: Function }: {
21
- scope: any;
22
- dispatch: any;
20
+ keyExtractor: (options: any, helpers: {
21
+ scope: Object;
22
+ dispatch: Function;
23
23
  }) => string;
24
24
  }
25
25
  export declare function registerDataSource(dataSource: _DataSource): {
@@ -1 +1 @@
1
- {"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../../src/reducers/dataSource.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AACvE,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,mCAAmC,wCAAwC,CAAC;AACzF,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,WAAY,SAAQ,QAAQ;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAC,OAAO,CAAC;IACvB,oBAAoB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC;;;KAAA,KAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1E,YAAY,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EA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E,WAAW;;;EAKzD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;;;;EAMhD;;AAQD,wBAyBC"}
@@ -1,5 +1,7 @@
1
1
  export declare const REGISTER_PAGE_ROUTE = "REGISTER_PAGE_ROUTE";
2
2
  export declare const REGISTER_PAGE_TYPE = "REGISTER_PAGE_TYPE";
3
+ export declare const UNREGISTER_PAGE_ROUTE = "UNREGISTER_PAGE_ROUTE";
4
+ export declare const UNREGISTER_PAGE_TYPE = "UNREGISTER_PAGE_TYPE";
3
5
  export declare const ROUTE_TYPE_PATH = "PATH";
4
6
  export declare const SITE_PAGE = "SITE_PAGE";
5
7
  export declare const VIEW_PAGE = "PAGE_VIEWER";
@@ -9,18 +11,32 @@ export declare function registerPageType(pageType: any): {
9
11
  type: string;
10
12
  pageType: any;
11
13
  };
14
+ export declare function unregisterPageType(pageType: any): {
15
+ type: string;
16
+ pageType: any;
17
+ };
12
18
  export declare function registerSitePage(id: any, data: any): {
13
19
  type: string;
14
20
  id: any;
15
21
  key: string;
16
22
  data: any;
17
23
  };
24
+ export declare function unregisterSitePage(id: any): {
25
+ type: string;
26
+ id: any;
27
+ key: string;
28
+ };
18
29
  export declare function registerAdminPage(id: any, data: any): {
19
30
  type: string;
20
31
  id: any;
21
32
  key: string;
22
33
  data: any;
23
34
  };
35
+ export declare function unregisterAdminPage(id: any): {
36
+ type: string;
37
+ id: any;
38
+ key: string;
39
+ };
24
40
  export declare function getPagePath(typeOrId: any, options: any, platform?: any): (dispatch: any, getState: any) => any;
25
41
  export declare function getPageRouteName(pathOrId: any, platform?: string): (dispatch: any, getState: any) => any;
26
42
  export declare function getPath(type: string, options?: any): (dispatch: any, getState: any) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/reducers/routes.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,kBAAkB,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A,EAAE,IAAI,KAAA;;;;;EAOxC;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAA;;;;EAMpC;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAA,EAAE,IAAI,KAAA;;;;;EAOzC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAA;;;;EAMrC;AAED,wBAAgB,WAAW,CAAE,QAAQ,KAAA,EAAE,OAAO,KAAA,EAAE,QAAQ,MAAO,yCAQ9D;AAED,wBAAgB,gBAAgB,CAAE,QAAQ,KAAA,EAAE,QAAQ,SAAQ,yCAQ3D;AAED,wBAAgB,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAG,GAAG,yCAmBpD;gCAgBqB,GAAG;AAAzB,wBA2CC"}
@@ -14,11 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getPath = exports.getPageRouteName = exports.getPagePath = exports.registerAdminPage = exports.registerSitePage = exports.registerPageType = exports.ROUTE_404 = exports.PAGE_EDITOR = exports.VIEW_PAGE = exports.SITE_PAGE = exports.ROUTE_TYPE_PATH = exports.REGISTER_PAGE_TYPE = exports.REGISTER_PAGE_ROUTE = void 0;
17
+ exports.getPath = exports.getPageRouteName = exports.getPagePath = exports.unregisterAdminPage = exports.registerAdminPage = exports.unregisterSitePage = exports.registerSitePage = exports.unregisterPageType = exports.registerPageType = exports.ROUTE_404 = exports.PAGE_EDITOR = exports.VIEW_PAGE = exports.SITE_PAGE = exports.ROUTE_TYPE_PATH = exports.UNREGISTER_PAGE_TYPE = exports.UNREGISTER_PAGE_ROUTE = exports.REGISTER_PAGE_TYPE = exports.REGISTER_PAGE_ROUTE = void 0;
18
18
  const react_router_1 = require("react-router");
19
19
  const lodash_1 = __importDefault(require("lodash"));
20
20
  exports.REGISTER_PAGE_ROUTE = 'REGISTER_PAGE_ROUTE';
21
21
  exports.REGISTER_PAGE_TYPE = 'REGISTER_PAGE_TYPE';
22
+ exports.UNREGISTER_PAGE_ROUTE = 'UNREGISTER_PAGE_ROUTE';
23
+ exports.UNREGISTER_PAGE_TYPE = 'UNREGISTER_PAGE_TYPE';
22
24
  exports.ROUTE_TYPE_PATH = 'PATH';
23
25
  exports.SITE_PAGE = 'SITE_PAGE';
24
26
  exports.VIEW_PAGE = 'PAGE_VIEWER';
@@ -31,6 +33,13 @@ function registerPageType(pageType) {
31
33
  };
32
34
  }
33
35
  exports.registerPageType = registerPageType;
36
+ function unregisterPageType(pageType) {
37
+ return {
38
+ type: exports.UNREGISTER_PAGE_TYPE,
39
+ pageType: pageType
40
+ };
41
+ }
42
+ exports.unregisterPageType = unregisterPageType;
34
43
  function registerSitePage(id, data) {
35
44
  return {
36
45
  type: exports.REGISTER_PAGE_ROUTE,
@@ -40,6 +49,14 @@ function registerSitePage(id, data) {
40
49
  };
41
50
  }
42
51
  exports.registerSitePage = registerSitePage;
52
+ function unregisterSitePage(id) {
53
+ return {
54
+ type: exports.UNREGISTER_PAGE_ROUTE,
55
+ id,
56
+ key: 'site'
57
+ };
58
+ }
59
+ exports.unregisterSitePage = unregisterSitePage;
43
60
  function registerAdminPage(id, data) {
44
61
  return {
45
62
  type: exports.REGISTER_PAGE_ROUTE,
@@ -49,6 +66,14 @@ function registerAdminPage(id, data) {
49
66
  };
50
67
  }
51
68
  exports.registerAdminPage = registerAdminPage;
69
+ function unregisterAdminPage(id) {
70
+ return {
71
+ type: exports.UNREGISTER_PAGE_ROUTE,
72
+ id,
73
+ key: 'admin'
74
+ };
75
+ }
76
+ exports.unregisterAdminPage = unregisterAdminPage;
52
77
  function getPagePath(typeOrId, options, platform = null) {
53
78
  return (dispatch, getState) => {
54
79
  const { pages: { records: { data: pages = [] } } } = getState();
@@ -122,11 +147,19 @@ exports.default = (state = initialState, action) => {
122
147
  }
123
148
  return Object.assign(Object.assign({}, state), { [key]: newRoutes });
124
149
  }
150
+ case exports.UNREGISTER_PAGE_ROUTE: {
151
+ const { id, key } = action;
152
+ const { [key]: oldRoutes } = state;
153
+ const newRoutes = oldRoutes.filter(route => route.id !== id);
154
+ return Object.assign(Object.assign({}, state), { [key]: newRoutes });
155
+ }
125
156
  case exports.REGISTER_PAGE_TYPE:
126
157
  return Object.assign(Object.assign({}, state), { pageTypes: [
127
158
  ...state.pageTypes,
128
159
  action.pageType,
129
160
  ] });
161
+ case exports.UNREGISTER_PAGE_TYPE:
162
+ return Object.assign(Object.assign({}, state), { pageTypes: state.pageTypes.filter(pageType => pageType !== action.pageType) });
130
163
  default:
131
164
  return state;
132
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/reducers/routes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,oDAAuB;AAEV,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAE1C,QAAA,eAAe,GAAG,MAAM,CAAC;AACzB,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,SAAS,GAAG,aAAa,CAAC;AAC1B,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,SAAS,GAAG,WAAW,CAAC;AAErC,SAAgB,gBAAgB,CAAC,QAAQ;IACrC,OAAO;QACH,IAAI,EAAE,0BAAkB;QACxB,QAAQ,EAAE,QAAQ;KACrB,CAAC;AACN,CAAC;AALD,4CAKC;AAED,SAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI;IACrC,OAAO;QACH,IAAI,EAAE,2BAAmB;QACzB,EAAE;QACF,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,IAAI;KACb,CAAC;AACN,CAAC;AAPD,4CAOC;AAED,SAAgB,iBAAiB,CAAC,EAAE,EAAE,IAAI;IACtC,OAAO;QACH,IAAI,EAAE,2BAAmB;QACzB,EAAE;QACF,GAAG,EAAE,OAAO;QACZ,I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AAG,KAAK,CAAC,SAAS;oBAClB,MAAM,CAAC,QAAQ;iBAClB,IACH;QACN,KAAK,4BAAoB;YACrB,uCACO,KAAK,KACR,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,IAC7E;QACN;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.161",
3
+ "version": "1.0.163",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {