@websolutespa/bom-mixer-store 1.7.5 → 1.7.6
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 +6 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +9 -10
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
- package/src/api/api.ts +8 -10
- package/src/decorators/menu.ts +1 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { NextRequest } from 'next/server';
|
|
|
4
4
|
import * as _websolutespa_bom_mixer_store from '@websolutespa/bom-mixer-store';
|
|
5
5
|
|
|
6
6
|
type ApiRequestOptions = FetchRequestOptions;
|
|
7
|
-
declare const defaultApiRequestOptions: ApiRequestOptions;
|
|
8
7
|
declare function getDefaultApiRequestOptions(): ApiRequestOptions;
|
|
9
8
|
|
|
10
9
|
type ICrudMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | string;
|
|
@@ -239,4 +238,4 @@ declare function getStore<T extends IStore>(): Promise<T>;
|
|
|
239
238
|
|
|
240
239
|
declare function varsHandler(): _websolutespa_bom_mixer_store.IHandler<any>;
|
|
241
240
|
|
|
242
|
-
export { ApiRequestOptions, BuildStrategy, COLLECTIONS, IApiHandler, ICrudMethod, IField, IHandler, IPageResolvedRelation, 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, decorateCategories_, decorateCategory_, decorateHref_, decorateHrefs_, decorateLocalizable_, decorateLocalizables_, decorateMenu_, decorateMenus_, decorateNav_, decorateNavs_, decorateRelation_, decorateRelations_, decorateSchema_, decorateSchemas_, decorateStaticRelation_, decorateStaticRelations_,
|
|
241
|
+
export { ApiRequestOptions, BuildStrategy, COLLECTIONS, IApiHandler, ICrudMethod, IField, IHandler, IPageResolvedRelation, 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, decorateCategories_, decorateCategory_, decorateHref_, decorateHrefs_, decorateLocalizable_, decorateLocalizables_, decorateMenu_, decorateMenus_, decorateNav_, decorateNavs_, decorateRelation_, decorateRelations_, decorateSchema_, decorateSchemas_, decorateStaticRelation_, decorateStaticRelations_, errorHandler, findRoute, fromCache, getDefaultApiRequestOptions, getLocalApiUrl, getMockStore, getMockStoreFromData_, getRemoteApiUrl, getRemoteStore, getStore, isApiRequest, isNextRequest, isStaticRequest, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut, mockApiDelete, mockApiFetch, mockApiGet, mockApiPatch, mockApiPost, mockApiPut, mockHandler, nextPhase, optimizeMany_, optimizeOne_, remoteApiDelete, remoteApiFetch, remoteApiGet, remoteApiPatch, remoteApiPost, remoteApiPut, routePost, staticCollections, storeApiDelete, storeApiGet, storeApiPatch, storeApiPost, storeApiPut, storeCacheDuration, storeHandler, storeIndexHandler, storeStrategy, varsHandler };
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,6 @@ __export(src_exports, {
|
|
|
69
69
|
decorateSchemas_: () => decorateSchemas_,
|
|
70
70
|
decorateStaticRelation_: () => decorateStaticRelation_,
|
|
71
71
|
decorateStaticRelations_: () => decorateStaticRelations_,
|
|
72
|
-
defaultApiRequestOptions: () => defaultApiRequestOptions,
|
|
73
72
|
errorHandler: () => errorHandler,
|
|
74
73
|
findRoute: () => findRoute,
|
|
75
74
|
fromCache: () => fromCache,
|
|
@@ -121,18 +120,18 @@ __export(src_exports, {
|
|
|
121
120
|
module.exports = __toCommonJS(src_exports);
|
|
122
121
|
|
|
123
122
|
// src/api/api.ts
|
|
124
|
-
var STORE_BEARER = process.env.STORE_BEARER;
|
|
125
|
-
var defaultApiRequestOptions = {
|
|
126
|
-
// mode: 'cors',
|
|
127
|
-
headers: {
|
|
128
|
-
Authorization: `Bearer ${STORE_BEARER}`
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
123
|
function getDefaultApiRequestOptions() {
|
|
132
124
|
return {
|
|
133
125
|
// mode: 'cors',
|
|
134
126
|
headers: {
|
|
135
|
-
|
|
127
|
+
/**
|
|
128
|
+
* guest user api key (users)
|
|
129
|
+
*/
|
|
130
|
+
Authorization: `users API-Key ${process.env.STORE_API_KEY}`
|
|
131
|
+
/**
|
|
132
|
+
* authenticated end user bearer (end_users)
|
|
133
|
+
*/
|
|
134
|
+
// Authorization: `Bearer ${bearer}`,
|
|
136
135
|
}
|
|
137
136
|
};
|
|
138
137
|
}
|
|
@@ -422,6 +421,7 @@ function decorateMenuRoute_(item) {
|
|
|
422
421
|
type: "route",
|
|
423
422
|
title: item.title,
|
|
424
423
|
href: item.id,
|
|
424
|
+
media: item.media,
|
|
425
425
|
page: item.page,
|
|
426
426
|
schema: item.schema,
|
|
427
427
|
items: []
|
|
@@ -2335,7 +2335,6 @@ function varsHandler() {
|
|
|
2335
2335
|
decorateSchemas_,
|
|
2336
2336
|
decorateStaticRelation_,
|
|
2337
2337
|
decorateStaticRelations_,
|
|
2338
|
-
defaultApiRequestOptions,
|
|
2339
2338
|
errorHandler,
|
|
2340
2339
|
findRoute,
|
|
2341
2340
|
fromCache,
|
package/dist/index.mjs
CHANGED
|
@@ -7,18 +7,18 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
// src/api/api.ts
|
|
10
|
-
var STORE_BEARER = process.env.STORE_BEARER;
|
|
11
|
-
var defaultApiRequestOptions = {
|
|
12
|
-
// mode: 'cors',
|
|
13
|
-
headers: {
|
|
14
|
-
Authorization: `Bearer ${STORE_BEARER}`
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
10
|
function getDefaultApiRequestOptions() {
|
|
18
11
|
return {
|
|
19
12
|
// mode: 'cors',
|
|
20
13
|
headers: {
|
|
21
|
-
|
|
14
|
+
/**
|
|
15
|
+
* guest user api key (users)
|
|
16
|
+
*/
|
|
17
|
+
Authorization: `users API-Key ${process.env.STORE_API_KEY}`
|
|
18
|
+
/**
|
|
19
|
+
* authenticated end user bearer (end_users)
|
|
20
|
+
*/
|
|
21
|
+
// Authorization: `Bearer ${bearer}`,
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -312,6 +312,7 @@ function decorateMenuRoute_(item) {
|
|
|
312
312
|
type: "route",
|
|
313
313
|
title: item.title,
|
|
314
314
|
href: item.id,
|
|
315
|
+
media: item.media,
|
|
315
316
|
page: item.page,
|
|
316
317
|
schema: item.schema,
|
|
317
318
|
items: []
|
|
@@ -2224,7 +2225,6 @@ export {
|
|
|
2224
2225
|
decorateSchemas_,
|
|
2225
2226
|
decorateStaticRelation_,
|
|
2226
2227
|
decorateStaticRelations_,
|
|
2227
|
-
defaultApiRequestOptions,
|
|
2228
2228
|
errorHandler,
|
|
2229
2229
|
findRoute,
|
|
2230
2230
|
fromCache,
|
package/package.json
CHANGED
package/src/api/api.ts
CHANGED
|
@@ -2,20 +2,18 @@ import { FetchRequestOptions } from '@websolutespa/bom-core';
|
|
|
2
2
|
|
|
3
3
|
export type ApiRequestOptions = FetchRequestOptions;
|
|
4
4
|
|
|
5
|
-
const STORE_BEARER = process.env.STORE_BEARER;
|
|
6
|
-
|
|
7
|
-
export const defaultApiRequestOptions: ApiRequestOptions = {
|
|
8
|
-
// mode: 'cors',
|
|
9
|
-
headers: {
|
|
10
|
-
Authorization: `Bearer ${STORE_BEARER}`,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
5
|
export function getDefaultApiRequestOptions(): ApiRequestOptions {
|
|
15
6
|
return {
|
|
16
7
|
// mode: 'cors',
|
|
17
8
|
headers: {
|
|
18
|
-
|
|
9
|
+
/**
|
|
10
|
+
* guest user api key (users)
|
|
11
|
+
*/
|
|
12
|
+
Authorization: `users API-Key ${process.env.STORE_API_KEY}`,
|
|
13
|
+
/**
|
|
14
|
+
* authenticated end user bearer (end_users)
|
|
15
|
+
*/
|
|
16
|
+
// Authorization: `Bearer ${bearer}`,
|
|
19
17
|
},
|
|
20
18
|
};
|
|
21
19
|
}
|