Skip to content

Commit 21772e0

Browse files
committed
Bump version
1 parent 36248fb commit 21772e0

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@crystallize/js-api-client",
33
"license": "MIT",
4-
"version": "0.6.1",
4+
"version": "0.7.0",
55
"author": "Crystallize <[email protected]> (https://crystallize.com)",
66
"contributors": [
77
"Sébastien Morel <[email protected]>"

src/core/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function post<T>(
2222
config: ClientConfiguration,
2323
query: string,
2424
variables?: VariablesType,
25-
init?: RequestInit,
25+
init?: RequestInit | any | undefined,
2626
): Promise<T> {
2727
try {
2828
const response = await fetch(path, {

src/core/dump-tenant/dumper.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { CrystallizeSearcher } from '../..';
2-
import { catalogueFetcherGraphqlBuilder } from '../catalogue';
31
import { MassClientInterface } from '../massCallClient';
42
import { buildNestedNavigationQuery, NavigationType } from '../navigation';
53
import { createSearcher } from '../search';
@@ -144,7 +142,7 @@ export const createDumper = (apiClient: MassClientInterface, options: DumperOpti
144142
// grids
145143
grids.forEach(({ language, requestId }: { language: string; requestId: string }) => {
146144
if (results[requestId]) {
147-
function handleRow(row: any) {
145+
const handleRow = (row: any) => {
148146
return {
149147
columns: row.columns.map((c: any) => ({
150148
layout: c.layout,
@@ -156,13 +154,13 @@ export const createDumper = (apiClient: MassClientInterface, options: DumperOpti
156154
},
157155
})),
158156
};
159-
}
160-
function handleGrid(grid: any): any {
157+
};
158+
const handleGrid = (grid: any): any => {
161159
return {
162160
...grid,
163161
rows: grid.rows?.map(handleRow) || [],
164162
};
165-
}
163+
};
166164
spec.grids[language] = results[requestId].grid?.getMany?.map(handleGrid) || [];
167165
}
168166
});

src/core/massCallClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function createMassCallClient(
7777
let increment = options.initialSpawn ?? 1;
7878
const sleeper = createFibonnaciSleeper();
7979

80-
console.log('⚠️ MassCallClient is experimental and may not work as expected.');
80+
console.log('⚠️ MassCallClient is experimental and may not work as expected.');
8181

8282
const execute = async () => {
8383
failedPromises = [];

tests/search.test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const { CrystallizeSearcher } = require('../dist/index.js');
1+
const { createSearcher, createClient } = require('../dist/index.js');
22

33
test('Search Query Test', async () => {
4+
const CrystallizeClient = createClient({
5+
tenantIdentifier: 'furniture',
6+
});
7+
48
const nodeQuery = {
59
name: true,
610
path: true,
@@ -14,7 +18,7 @@ test('Search Query Test', async () => {
1418
let count;
1519

1620
count = 0;
17-
for await (const item of CrystallizeSearcher.search('en', nodeQuery, filter, orderBy, pageInfo, {
21+
for await (const item of createSearcher(CrystallizeClient).search('en', nodeQuery, filter, orderBy, pageInfo, {
1822
total: 14,
1923
perPage: 5,
2024
})) {
@@ -24,7 +28,7 @@ test('Search Query Test', async () => {
2428
expect(count).toBe(14);
2529

2630
count = 0;
27-
for await (const item of CrystallizeSearcher.search('en', nodeQuery, filter, orderBy, pageInfo, {
31+
for await (const item of createSearcher(CrystallizeClient).search('en', nodeQuery, filter, orderBy, pageInfo, {
2832
total: 14,
2933
perPage: 10,
3034
})) {

0 commit comments

Comments
 (0)