Skip to content

Commit 2f29689

Browse files
committed
feat(clients): add collections
1 parent aaf1fd9 commit 2f29689

File tree

21 files changed

+583
-15
lines changed

21 files changed

+583
-15
lines changed

clients/algoliasearch-client-javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"packages/*"
88
],
99
"scripts": {
10-
"build": "lerna run build --skip-nx-cache --scope '@algolia/requester-testing' --scope '@algolia/logger-console' --scope 'algoliasearch' --scope '@algolia/client-composition' --scope '@algolia/composition' --scope '@algolia/advanced-personalization' --include-dependencies ",
10+
"build": "lerna run build --skip-nx-cache --scope '@algolia/requester-testing' --scope '@algolia/logger-console' --scope 'algoliasearch' --scope '@algolia/collections' --scope '@algolia/client-composition' --scope '@algolia/composition' --scope '@algolia/advanced-personalization' --include-dependencies ",
1111
"clean": "lerna run clean",
1212
"release:publish": "tsc --project scripts/tsconfig.json && node scripts/dist/publish.js",
1313
"test": "lerna run test $*",

clients/algoliasearch-client-javascript/yarn.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,23 @@ __metadata:
173173
languageName: unknown
174174
linkType: soft
175175

176+
"@algolia/collections@workspace:packages/collections":
177+
version: 0.0.0-use.local
178+
resolution: "@algolia/collections@workspace:packages/collections"
179+
dependencies:
180+
"@algolia/client-common": "npm:5.35.0"
181+
"@algolia/requester-browser-xhr": "npm:5.35.0"
182+
"@algolia/requester-fetch": "npm:5.35.0"
183+
"@algolia/requester-node-http": "npm:5.35.0"
184+
"@arethetypeswrong/cli": "npm:0.18.2"
185+
"@types/node": "npm:22.17.0"
186+
publint: "npm:0.3.12"
187+
rollup: "npm:4.41.0"
188+
tsup: "npm:8.5.0"
189+
typescript: "npm:5.9.2"
190+
languageName: unknown
191+
linkType: soft
192+
176193
"@algolia/composition@workspace:packages/composition":
177194
version: 0.0.0-use.local
178195
resolution: "@algolia/composition@workspace:packages/composition"

config/clients.config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"abtesting",
66
"abtesting-v3",
77
"analytics",
8+
"collections",
89
"composition",
910
"ingestion",
1011
"insights",
@@ -39,6 +40,10 @@
3940
"name": "abtesting-v3",
4041
"output": "clients/algoliasearch-client-dart/packages/client_abtesting_v3"
4142
},
43+
{
44+
"name": "collections",
45+
"output": "clients/algoliasearch-client-dart/packages/client_collections"
46+
},
4247
{
4348
"name": "composition",
4449
"output": "clients/algoliasearch-client-dart/packages/client_composition"
@@ -76,6 +81,7 @@
7681
"abtesting",
7782
"abtesting-v3",
7883
"analytics",
84+
"collections",
7985
"composition",
8086
"ingestion",
8187
"insights",
@@ -105,6 +111,7 @@
105111
"abtesting",
106112
"abtesting-v3",
107113
"analytics",
114+
"collections",
108115
"composition",
109116
"ingestion",
110117
"insights",
@@ -153,6 +160,12 @@
153160
"name": "analytics",
154161
"output": "clients/algoliasearch-client-javascript/packages/client-analytics"
155162
},
163+
{
164+
"name": "collections",
165+
"output": "clients/algoliasearch-client-javascript/packages/collections",
166+
"isStandaloneClient": true,
167+
"clientName": "collections"
168+
},
156169
{
157170
"name": "composition",
158171
"output": "clients/algoliasearch-client-javascript/packages/composition",
@@ -218,6 +231,7 @@
218231
"abtesting",
219232
"abtesting-v3",
220233
"analytics",
234+
"collections",
221235
"composition",
222236
"ingestion",
223237
"insights",
@@ -247,6 +261,7 @@
247261
"abtesting",
248262
"abtesting-v3",
249263
"analytics",
264+
"collections",
250265
"composition",
251266
"ingestion",
252267
"insights",
@@ -276,6 +291,7 @@
276291
"abtesting",
277292
"abtesting-v3",
278293
"analytics",
294+
"collections",
279295
"composition",
280296
"ingestion",
281297
"insights",
@@ -312,6 +328,7 @@
312328
"abtesting",
313329
"abtesting-v3",
314330
"analytics",
331+
"collections",
315332
"composition",
316333
"ingestion",
317334
"insights",
@@ -341,6 +358,7 @@
341358
"abtesting",
342359
"abtesting-v3",
343360
"analytics",
361+
"collections",
344362
"composition",
345363
"ingestion",
346364
"insights",
@@ -370,6 +388,7 @@
370388
"abtesting",
371389
"abtesting-v3",
372390
"analytics",
391+
"collections",
373392
"composition",
374393
"ingestion",
375394
"insights",

config/clients.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"abtesting",
1515
"abtesting-v3",
1616
"analytics",
17+
"collections",
1718
"composition",
1819
"ingestion",
1920
"insights",
@@ -38,6 +39,7 @@
3839
"abtesting",
3940
"abtesting-v3",
4041
"analytics",
42+
"collections",
4143
"composition",
4244
"composition-full",
4345
"ingestion",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
indexName:
2+
name: indexName
3+
in: query
4+
required: true
5+
description: Name of the index.
6+
schema:
7+
type: string
8+
example: ALGOLIA_INDEX_NAME
9+
10+
paginationLimit:
11+
name: limit
12+
in: query
13+
description: Number of items to fetch.
14+
required: false
15+
schema:
16+
$ref: './schemas/pagination.yml#/limit'
17+
18+
paginationOffset:
19+
name: offset
20+
in: query
21+
description: Number of items to skip.
22+
required: false
23+
schema:
24+
$ref: './schemas/pagination.yml#/offset'
25+
26+
pathCollectionID:
27+
name: collectionID
28+
in: path
29+
required: true
30+
description: Unique identifier of a collection.
31+
schema:
32+
$ref: './schemas/common.yml#/collectionID'
33+
34+
query:
35+
name: query
36+
in: query
37+
required: false
38+
description: Query to filter collections.
39+
schema:
40+
$ref: './schemas/common.yml#/query'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
description: Collection not found.
2+
content:
3+
application/json:
4+
schema:
5+
title: collectionNotFoundResponse
6+
type: object
7+
properties:
8+
message:
9+
type: string
10+
example: 'Collection not found'
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Collection:
2+
type: object
3+
properties:
4+
id:
5+
type: string
6+
example: '5db3039e-04b5-4ed6-a00e-ba3304032c5a'
7+
name:
8+
type: string
9+
example: 'Summer Deals'
10+
indexName:
11+
type: string
12+
example: 'prod_products_EN'
13+
createdAt:
14+
type: string
15+
format: date-time
16+
example: '2024-10-07T00:00:00Z'
17+
updatedAt:
18+
type: string
19+
format: date-time
20+
example: '2024-10-07T00:00:00Z'
21+
status:
22+
$ref: '#/CollectionStatus'
23+
conditions:
24+
$ref: 'condition.yml#/Conditions'
25+
records:
26+
type: array
27+
items:
28+
type: string
29+
30+
CollectionStatus:
31+
type: string
32+
description: |
33+
Collection commit status.
34+
Only returned if the request API key has write ACLs.
35+
enum:
36+
- COMMITTED
37+
- COMMITTING
38+
- TO_COMMIT
39+
40+
CollectionUpsert:
41+
type: object
42+
description: API request body for upserting a Collection.
43+
properties:
44+
id:
45+
type: string
46+
indexName:
47+
type: string
48+
name:
49+
type: string
50+
description:
51+
type: string
52+
add:
53+
type: array
54+
description: a list of objectIDs.
55+
minItems: 0
56+
items:
57+
type: string
58+
remove:
59+
type: array
60+
description: a list of objectIDs.
61+
minItems: 0
62+
items:
63+
type: string
64+
conditions:
65+
$ref: 'condition.yml#/Conditions'
66+
required:
67+
- indexName
68+
- name
69+
70+
CollectionsResponse:
71+
type: object
72+
allOf:
73+
- type: object
74+
properties:
75+
items:
76+
type: array
77+
items:
78+
$ref: '#/Collection'
79+
required:
80+
- items
81+
- $ref: 'pagination.yml#/Pagination'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
collectionID:
2+
type: string
3+
# format: uuid
4+
description: Universally unique identifier (UUID) of a collection.
5+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
6+
7+
query:
8+
type: string
9+
description: Query to filter collections.
10+
example: Summer collection
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Conditions:
2+
type: object
3+
description: Conditions to filter records.
4+
properties:
5+
facetFilters:
6+
$ref: '../../../common/schemas/SearchParams.yml#/facetFilters'
7+
numericFilters:
8+
$ref: '../../../common/schemas/SearchParams.yml#/numericFilters'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Pagination:
2+
type: object
3+
description: Paginated API response.
4+
additionalProperties: false
5+
properties:
6+
total:
7+
type: integer
8+
minimum: 0
9+
description: Total number of items across all pages.
10+
limit:
11+
$ref: '#/limit'
12+
offset:
13+
$ref: '#/offset'
14+
required:
15+
- total
16+
- limit
17+
- offset
18+
19+
limit:
20+
type: integer
21+
description: Number of items to fetch.
22+
minimum: 1
23+
maximum: 50
24+
default: 10
25+
26+
offset:
27+
type: integer
28+
description: Number of items to skip.
29+
minimum: 0
30+
default: 0

0 commit comments

Comments
 (0)