Skip to content

Commit ae9d4a2

Browse files
authored
feat(Search): Adds next exports to Search resources (#756)
~Depends on #753 (currently showing _that_ diff, but will be merged to `main`)~
1 parent f7826bc commit ae9d4a2

14 files changed

Lines changed: 641 additions & 4 deletions

File tree

src/services/search/__tests__/__snapshots__/entry.spec.ts.snap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ exports[`search – entry get 1`] = `
1313
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/entry?subject=123abc",
1414
}
1515
`;
16+
17+
exports[`search – entry next get 1`] = `
18+
{
19+
"headers": {
20+
"accept": "*/*",
21+
"accept-encoding": "gzip,deflate",
22+
"connection": "close",
23+
"host": "search.api.globus.org",
24+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
25+
},
26+
"method": "GET",
27+
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/entry?subject=123abc",
28+
}
29+
`;

src/services/search/__tests__/__snapshots__/index.spec.ts.snap

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,147 @@ exports[`search – index ingest 1`] = `
112112
}
113113
`;
114114

115+
exports[`search – index next create 1`] = `
116+
{
117+
"headers": {
118+
"accept": "*/*",
119+
"accept-encoding": "gzip,deflate",
120+
"connection": "close",
121+
"content-length": "61",
122+
"content-type": "application/json",
123+
"host": "search.api.globus.org",
124+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
125+
},
126+
"json": {
127+
"description": "example description",
128+
"display_name": "foobar",
129+
},
130+
"method": "POST",
131+
"url": "https://search.api.globus.org/v1/index",
132+
}
133+
`;
134+
135+
exports[`search – index next create role 1`] = `
136+
{
137+
"headers": {
138+
"accept": "*/*",
139+
"accept-encoding": "gzip,deflate",
140+
"connection": "close",
141+
"content-length": "54",
142+
"content-type": "application/json",
143+
"host": "search.api.globus.org",
144+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
145+
},
146+
"json": {
147+
"principal": "some-principal-urn",
148+
"role_name": "admin",
149+
},
150+
"method": "POST",
151+
"url": "https://search.api.globus.org/v1/index/some-uuid/role",
152+
}
153+
`;
154+
155+
exports[`search – index next delete role 1`] = `
156+
{
157+
"headers": {
158+
"accept": "*/*",
159+
"accept-encoding": "gzip,deflate",
160+
"connection": "close",
161+
"host": "search.api.globus.org",
162+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
163+
},
164+
"method": "DELETE",
165+
"url": "https://search.api.globus.org/v1/index/some-uuid/role/some-role-id",
166+
}
167+
`;
168+
169+
exports[`search – index next get 1`] = `
170+
{
171+
"headers": {
172+
"accept": "*/*",
173+
"accept-encoding": "gzip,deflate",
174+
"connection": "close",
175+
"host": "search.api.globus.org",
176+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
177+
},
178+
"method": "GET",
179+
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae",
180+
}
181+
`;
182+
183+
exports[`search – index next get roles 1`] = `
184+
{
185+
"headers": {
186+
"accept": "*/*",
187+
"accept-encoding": "gzip,deflate",
188+
"connection": "close",
189+
"host": "search.api.globus.org",
190+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
191+
},
192+
"method": "GET",
193+
"url": "https://search.api.globus.org/v1/index/some-uuid/role_list",
194+
}
195+
`;
196+
197+
exports[`search – index next getAll 1`] = `
198+
{
199+
"headers": {
200+
"accept": "*/*",
201+
"accept-encoding": "gzip,deflate",
202+
"connection": "close",
203+
"host": "search.api.globus.org",
204+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
205+
},
206+
"method": "GET",
207+
"url": "https://search.api.globus.org/v1/index_list",
208+
}
209+
`;
210+
211+
exports[`search – index next ingest 1`] = `
212+
{
213+
"headers": {
214+
"accept": "*/*",
215+
"accept-encoding": "gzip,deflate",
216+
"connection": "close",
217+
"content-length": "85",
218+
"content-type": "application/json",
219+
"host": "search.api.globus.org",
220+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
221+
},
222+
"method": "POST",
223+
"url": "https://search.api.globus.org/v1/index/some-uuid/ingest",
224+
}
225+
`;
226+
227+
exports[`search – index next remove 1`] = `
228+
{
229+
"headers": {
230+
"accept": "*/*",
231+
"accept-encoding": "gzip,deflate",
232+
"connection": "close",
233+
"host": "search.api.globus.org",
234+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
235+
},
236+
"method": "DELETE",
237+
"url": "https://search.api.globus.org/v1/index/some-uuid",
238+
}
239+
`;
240+
241+
exports[`search – index next reopen 1`] = `
242+
{
243+
"headers": {
244+
"accept": "*/*",
245+
"accept-encoding": "gzip,deflate",
246+
"connection": "close",
247+
"content-length": "0",
248+
"host": "search.api.globus.org",
249+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
250+
},
251+
"method": "POST",
252+
"url": "https://search.api.globus.org/v1/index/some-uuid/reopen",
253+
}
254+
`;
255+
115256
exports[`search – index remove 1`] = `
116257
{
117258
"headers": {

src/services/search/__tests__/__snapshots__/query.spec.ts.snap

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,36 @@ exports[`search – query allows get without Authorization header 1`] = `
1313
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/search?q=hello%2Bworld",
1414
}
1515
`;
16+
17+
exports[`search – query next get 1`] = `
18+
{
19+
"headers": {
20+
"accept": "*/*",
21+
"accept-encoding": "gzip,deflate",
22+
"connection": "close",
23+
"host": "search.api.globus.org",
24+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
25+
},
26+
"method": "GET",
27+
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/search?q=test",
28+
}
29+
`;
30+
31+
exports[`search – query next post 1`] = `
32+
{
33+
"headers": {
34+
"accept": "*/*",
35+
"accept-encoding": "gzip,deflate",
36+
"connection": "close",
37+
"content-length": "12",
38+
"content-type": "application/json",
39+
"host": "search.api.globus.org",
40+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
41+
},
42+
"json": {
43+
"q": "test",
44+
},
45+
"method": "POST",
46+
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/search",
47+
}
48+
`;

src/services/search/__tests__/__snapshots__/subject.spec.ts.snap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ exports[`search – subject get 1`] = `
1313
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/subject?subject=123abc&result_format_version=2017-09-01",
1414
}
1515
`;
16+
17+
exports[`search – subject next get 1`] = `
18+
{
19+
"headers": {
20+
"accept": "*/*",
21+
"accept-encoding": "gzip,deflate",
22+
"connection": "close",
23+
"host": "search.api.globus.org",
24+
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
25+
},
26+
"method": "GET",
27+
"url": "https://search.api.globus.org/v1/index/524de2f6-d1a6-4b49-9286-d8dccb4196ae/subject?subject=123abc&result_format_version=2017-09-01",
28+
}
29+
`;

src/services/search/__tests__/entry.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,26 @@ describe('search – entry', () => {
1717
headers,
1818
}).toMatchSnapshot();
1919
});
20+
21+
describe('next', () => {
22+
test('get', async () => {
23+
const {
24+
req: { url, method, headers },
25+
} = await mirror(
26+
await entry.next.get({
27+
index_id: '524de2f6-d1a6-4b49-9286-d8dccb4196ae',
28+
request: {
29+
query: {
30+
subject: '123abc',
31+
},
32+
},
33+
}),
34+
);
35+
expect({
36+
url,
37+
method,
38+
headers,
39+
}).toMatchSnapshot();
40+
});
41+
});
2042
});

0 commit comments

Comments
 (0)