@websolutespa/bom-mixer-store 1.4.6 → 1.6.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @websolutespa/bom-mixer-store
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Patch Changes
6
+
7
+ - f664993: Added: useLivePreview
8
+ - Updated dependencies [6cbf4cb]
9
+ - @websolutespa/bom-core@0.6.7
10
+
3
11
  ## 1.4.6
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -107,6 +107,9 @@ declare function mockHandler(): any;
107
107
  declare function getMockStoreFromData_<T extends IStore>(data?: IMemoryStore): T;
108
108
  declare function getMockStore<T extends IStore = IStore>(): Promise<T>;
109
109
 
110
+ declare const RemoteServiceStrategy: {
111
+ draft: boolean;
112
+ };
110
113
  /**
111
114
  * This service handle call to remote api (bowl or over)
112
115
  */
@@ -217,4 +220,4 @@ declare function findRoute(store: IStore, pathname: string, href: string): Promi
217
220
 
218
221
  declare function getStore<T extends IStore>(): Promise<T>;
219
222
 
220
- export { ApiRequestOptions, BuildStrategy, COLLECTIONS, IApiHandler, ICrudMethod, IField, IHandler, KNOWN_COLLECTIONS, MAX_INT, MOCK_COLLECTIONS, MapTo, MockMenuService, MockPageService, MockService, NextPhase, RemoteMenuService, RemotePageService, RemoteService, SERVICE_DEFAULT_DEPTH, STATIC_COLLECTIONS, StaticService, StaticServiceConfig, StaticServiceSrc, StoreStrategy, apiHandler, buildStrategy, collectionDelete, collectionGet, collectionPatch, collectionPost, decorateHref_, decorateHrefs_, decorateMenu_, decorateMenus_, decorateNav_, decorateNavs_, decorateRelation_, decorateRelations_, decorateSchema_, decorateSchemas_, decorateStaticRelation_, decorateStaticRelations_, defaultApiRequestOptions, errorHandler, findRoute, fromCache, getDefaultApiRequestOptions, getLocalApiUrl, getMockStore, getMockStoreFromData_, getRemoteStore, getStore, isApiRequest, isNextRequest, isStaticRequest, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut, localizeItem_, localizeItems_, mockApiDelete, mockApiFetch, mockApiGet, mockApiPatch, mockApiPost, mockApiPut, mockHandler, nextPhase, remoteApiDelete, remoteApiFetch, remoteApiGet, remoteApiPatch, remoteApiPost, remoteApiPut, routePost, staticCollections, storeApiDelete, storeApiGet, storeApiPatch, storeApiPost, storeApiPut, storeCacheDuration, storeHandler, storeIndexHandler, storeStrategy };
223
+ export { ApiRequestOptions, BuildStrategy, COLLECTIONS, IApiHandler, ICrudMethod, IField, IHandler, KNOWN_COLLECTIONS, MAX_INT, MOCK_COLLECTIONS, MapTo, MockMenuService, MockPageService, MockService, NextPhase, RemoteMenuService, RemotePageService, RemoteService, RemoteServiceStrategy, SERVICE_DEFAULT_DEPTH, STATIC_COLLECTIONS, StaticService, StaticServiceConfig, StaticServiceSrc, StoreStrategy, apiHandler, buildStrategy, collectionDelete, collectionGet, collectionPatch, collectionPost, decorateHref_, decorateHrefs_, decorateMenu_, decorateMenus_, decorateNav_, decorateNavs_, decorateRelation_, decorateRelations_, decorateSchema_, decorateSchemas_, decorateStaticRelation_, decorateStaticRelations_, defaultApiRequestOptions, errorHandler, findRoute, fromCache, getDefaultApiRequestOptions, getLocalApiUrl, getMockStore, getMockStoreFromData_, getRemoteStore, getStore, isApiRequest, isNextRequest, isStaticRequest, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut, localizeItem_, localizeItems_, mockApiDelete, mockApiFetch, mockApiGet, mockApiPatch, mockApiPost, mockApiPut, mockHandler, nextPhase, remoteApiDelete, remoteApiFetch, remoteApiGet, remoteApiPatch, remoteApiPost, remoteApiPut, routePost, staticCollections, storeApiDelete, storeApiGet, storeApiPatch, storeApiPost, storeApiPut, storeCacheDuration, storeHandler, storeIndexHandler, storeStrategy };
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ __export(src_exports, {
42
42
  RemoteMenuService: () => RemoteMenuService,
43
43
  RemotePageService: () => RemotePageService,
44
44
  RemoteService: () => RemoteService,
45
+ RemoteServiceStrategy: () => RemoteServiceStrategy,
45
46
  SERVICE_DEFAULT_DEPTH: () => SERVICE_DEFAULT_DEPTH,
46
47
  STATIC_COLLECTIONS: () => STATIC_COLLECTIONS,
47
48
  StaticService: () => StaticService,
@@ -1291,6 +1292,9 @@ async function remoteApiDelete(url, options = {}) {
1291
1292
  }
1292
1293
 
1293
1294
  // src/remote/remote.service.ts
1295
+ var RemoteServiceStrategy = {
1296
+ draft: false
1297
+ };
1294
1298
  var RemoteService = class {
1295
1299
  constructor(key, store) {
1296
1300
  if (!key) {
@@ -1304,6 +1308,7 @@ var RemoteService = class {
1304
1308
  }
1305
1309
  async findOne(id, params = {}) {
1306
1310
  params.richText = String(params.richText) === "true" ? true : false;
1311
+ params.draft = RemoteServiceStrategy.draft;
1307
1312
  const query = (0, import_bom_core12.qsSerialize)(params);
1308
1313
  const search = query ? `?${query}` : "";
1309
1314
  const url = `/${this.key}/${encodeURIComponent(id)}${search}`;
@@ -1315,6 +1320,7 @@ var RemoteService = class {
1315
1320
  }
1316
1321
  async findMany(params = {}) {
1317
1322
  params.richText = String(params.richText) === "true" ? true : false;
1323
+ params.draft = RemoteServiceStrategy.draft;
1318
1324
  params.pagination = false;
1319
1325
  const query = (0, import_bom_core12.qsSerialize)(params);
1320
1326
  const search = query ? `?${query}` : "";
@@ -1325,6 +1331,7 @@ var RemoteService = class {
1325
1331
  }
1326
1332
  async findPaged(params = {}) {
1327
1333
  params.richText = String(params.richText) === "true" ? true : false;
1334
+ params.draft = RemoteServiceStrategy.draft;
1328
1335
  params.pagination = true;
1329
1336
  const query = (0, import_bom_core12.qsSerialize)(params);
1330
1337
  const search = query ? `?${query}` : "";
@@ -1471,7 +1478,7 @@ async function getRemoteStoreStaticBuild_() {
1471
1478
  return fromCache(async () => {
1472
1479
  console.log("getRemoteStoreStaticBuild_");
1473
1480
  const store = {};
1474
- const url = "/store?pagination=true&richText=false";
1481
+ const url = "/store";
1475
1482
  const json = await remoteApiGet(url);
1476
1483
  if (json != null) {
1477
1484
  const collections = Object.keys(json);
@@ -1909,6 +1916,7 @@ async function storeApiDelete(url, options = {}) {
1909
1916
  RemoteMenuService,
1910
1917
  RemotePageService,
1911
1918
  RemoteService,
1919
+ RemoteServiceStrategy,
1912
1920
  SERVICE_DEFAULT_DEPTH,
1913
1921
  STATIC_COLLECTIONS,
1914
1922
  StaticService,
package/dist/index.mjs CHANGED
@@ -1188,6 +1188,9 @@ async function remoteApiDelete(url, options = {}) {
1188
1188
  }
1189
1189
 
1190
1190
  // src/remote/remote.service.ts
1191
+ var RemoteServiceStrategy = {
1192
+ draft: false
1193
+ };
1191
1194
  var RemoteService = class {
1192
1195
  constructor(key, store) {
1193
1196
  if (!key) {
@@ -1201,6 +1204,7 @@ var RemoteService = class {
1201
1204
  }
1202
1205
  async findOne(id, params = {}) {
1203
1206
  params.richText = String(params.richText) === "true" ? true : false;
1207
+ params.draft = RemoteServiceStrategy.draft;
1204
1208
  const query = qsSerialize2(params);
1205
1209
  const search = query ? `?${query}` : "";
1206
1210
  const url = `/${this.key}/${encodeURIComponent(id)}${search}`;
@@ -1212,6 +1216,7 @@ var RemoteService = class {
1212
1216
  }
1213
1217
  async findMany(params = {}) {
1214
1218
  params.richText = String(params.richText) === "true" ? true : false;
1219
+ params.draft = RemoteServiceStrategy.draft;
1215
1220
  params.pagination = false;
1216
1221
  const query = qsSerialize2(params);
1217
1222
  const search = query ? `?${query}` : "";
@@ -1222,6 +1227,7 @@ var RemoteService = class {
1222
1227
  }
1223
1228
  async findPaged(params = {}) {
1224
1229
  params.richText = String(params.richText) === "true" ? true : false;
1230
+ params.draft = RemoteServiceStrategy.draft;
1225
1231
  params.pagination = true;
1226
1232
  const query = qsSerialize2(params);
1227
1233
  const search = query ? `?${query}` : "";
@@ -1368,7 +1374,7 @@ async function getRemoteStoreStaticBuild_() {
1368
1374
  return fromCache(async () => {
1369
1375
  console.log("getRemoteStoreStaticBuild_");
1370
1376
  const store = {};
1371
- const url = "/store?pagination=true&richText=false";
1377
+ const url = "/store";
1372
1378
  const json = await remoteApiGet(url);
1373
1379
  if (json != null) {
1374
1380
  const collections = Object.keys(json);
@@ -1805,6 +1811,7 @@ export {
1805
1811
  RemoteMenuService,
1806
1812
  RemotePageService,
1807
1813
  RemoteService,
1814
+ RemoteServiceStrategy,
1808
1815
  SERVICE_DEFAULT_DEPTH,
1809
1816
  STATIC_COLLECTIONS,
1810
1817
  StaticService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-store",
3
- "version": "1.4.6",
3
+ "version": "1.6.0",
4
4
  "description": "Mixer Store module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -2,6 +2,10 @@ import { IEntity, IEquatable, IPagedResult, IQuerable, IStore, qsSerialize, Quer
2
2
  import { decorateSchema_, decorateSchemas_ } from '../decorators';
3
3
  import { remoteApiDelete, remoteApiGet, remoteApiPost, remoteApiPut } from './remote.api';
4
4
 
5
+ export const RemoteServiceStrategy = {
6
+ draft: false,
7
+ };
8
+
5
9
  /**
6
10
  * This service handle call to remote api (bowl or over)
7
11
  */
@@ -23,6 +27,7 @@ export class RemoteService<T extends IEntity = IEntity> implements IQuerable<T>
23
27
 
24
28
  async findOne<B extends T = T>(id: IEquatable, params: QueryParams = {}): Promise<B | undefined> {
25
29
  params.richText = String(params.richText) === 'true' ? true : false;
30
+ params.draft = RemoteServiceStrategy.draft;
26
31
  const query = qsSerialize(params);
27
32
  const search = query ? `?${query}` : '';
28
33
  const url = `/${this.key}/${encodeURIComponent(id)}${search}`;
@@ -36,6 +41,7 @@ export class RemoteService<T extends IEntity = IEntity> implements IQuerable<T>
36
41
 
37
42
  async findMany<B extends T = T>(params: QueryParams = {}): Promise<B[]> {
38
43
  params.richText = String(params.richText) === 'true' ? true : false;
44
+ params.draft = RemoteServiceStrategy.draft;
39
45
  params.pagination = false;
40
46
  const query = qsSerialize(params);
41
47
  const search = query ? `?${query}` : '';
@@ -48,6 +54,7 @@ export class RemoteService<T extends IEntity = IEntity> implements IQuerable<T>
48
54
 
49
55
  async findPaged<B extends T = T>(params: QueryParams = {}): Promise<IPagedResult<B>> {
50
56
  params.richText = String(params.richText) === 'true' ? true : false;
57
+ params.draft = RemoteServiceStrategy.draft;
51
58
  params.pagination = true;
52
59
  const query = qsSerialize(params);
53
60
  const search = query ? `?${query}` : '';
@@ -50,7 +50,7 @@ async function getRemoteStoreStaticBuild_<T extends IStore>(): Promise<T> {
50
50
  return fromCache<T>(async () => {
51
51
  console.log('getRemoteStoreStaticBuild_');
52
52
  const store: IStore = {};
53
- const url = '/store?pagination=true&richText=false';
53
+ const url = '/store';
54
54
  const json = await remoteApiGet<IMemoryStore>(url);
55
55
  if (json != null) {
56
56
  const collections = Object.keys(json);