@glassly/cloud-client 0.3.7 → 0.3.8-dev.976
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/package.json +2 -2
- package/src/modules/core/core.ts +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glassly/cloud-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8-dev.976",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "bun test"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@glassly/cloud-protocol": "0.3.
|
|
15
|
+
"@glassly/cloud-protocol": "0.3.8-dev.976",
|
|
16
16
|
"tweetnacl": "^1.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/src/modules/core/core.ts
CHANGED
|
@@ -144,6 +144,8 @@ export interface CoreDeps {
|
|
|
144
144
|
http: HttpClient;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
const NO_CACHE = { "Cache-Control": "no-cache" };
|
|
148
|
+
|
|
147
149
|
/**
|
|
148
150
|
* `cloud.core`. Stateless REST grouped by resource.
|
|
149
151
|
*
|
|
@@ -197,12 +199,16 @@ export class Core {
|
|
|
197
199
|
},
|
|
198
200
|
};
|
|
199
201
|
this.store = {
|
|
200
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* The whole catalog. Small enough that search and tag filters stay on the device.
|
|
204
|
+
* Always revalidated: older Cores mark it cacheable for five minutes, and the
|
|
205
|
+
* platform HTTP cache (NSURLCache on iOS) would otherwise answer a refresh.
|
|
206
|
+
*/
|
|
201
207
|
list(): Promise<StoreCatalogResponse> {
|
|
202
|
-
return http.get<StoreCatalogResponse>("/api/client/store");
|
|
208
|
+
return http.get<StoreCatalogResponse>("/api/client/store", { headers: NO_CACHE });
|
|
203
209
|
},
|
|
204
210
|
get(packageName: string): Promise<StoreListing> {
|
|
205
|
-
return http.get<StoreListing>(`/api/client/store/${encodeURIComponent(packageName)}
|
|
211
|
+
return http.get<StoreListing>(`/api/client/store/${encodeURIComponent(packageName)}`, { headers: NO_CACHE });
|
|
206
212
|
},
|
|
207
213
|
/**
|
|
208
214
|
* Icons and screenshots need the user Bearer, which an <Image> cannot
|