UNPKG

16.3 kBMarkdownView Raw
1# Changelog
2
3This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
5The following changes have been implemented but not released yet:
6
7## [Unreleased]
8
9The following sections document changes that have been released already:
10
11## [1.11.1] - 2021-09-02
12
13### Bugs fixed
14
15- In some cases, Thing.getDate() would return null while Thing.setDate() had been
16 called prior. Thanks to a contribution from @AJamesPhillips, this is now fixed.
17- The submodule export for `./access/universal` was broken.
18
19## [1.11.0] - 2021-08-12
20
21### New features
22
23- The builder returned by `buildThing()` is now stateful. This means you can now
24 do something like this:
25
26 ```javascript
27 const bookmarkBuilder = buildThing()
28 .addUrl(
29 "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
30 "http://www.w3.org/2002/01/bookmark#Bookmark"
31 )
32 .addUrl("http://www.w3.org/2002/01/bookmark#recalls", form.url);
33
34 if (typeof form.title !== "undefined") {
35 // In earlier versions, this would be discarded:
36 bookmarkBuilder.addStringNoLocale(
37 "http://purl.org/dc/terms/title",
38 form.title
39 );
40 }
41
42 const bookmark = bookmarkBuilder.build();
43 ```
44
45## [1.10.1] - 2021-08-03
46
47### Deprecations
48
49- Access Control Policies will no longer support adding a `vcard:Group` to a
50 Rule. Therefore, the low-level ACPs APIs as well as the Universal Access APIs
51 no longer support defining access for a `vcard:Group`. To define access for
52 multiple agents at the same time, use the mechanism-specific APIs.
53
54### Bugs fixed
55
56- In some cases where the Universal Access APIs would previously bail out, they
57 can now correctly read and change access (at the cost of potentially making
58 more HTTP requests). It will now also work on instances of Inrupt's
59 Enterprise Solid Server not located on inrupt.com, and can now also return the
60 Pod Owner's access on inrupt.com.
61 It will still be unable to report access settings that the current user is not
62 allowed to see.
63
64## [1.10.0] - 2021-07-01
65
66### New features
67
68- We now offer support for the `Date` data type and `Time` data type.
69 This includes all `set`, `get`, `add` and `remove` methods to modify the Time
70 or Date of a Thing.
71 `Time` is a custom data type following the format:
72
73```typescript
74type Time = {
75 hour: number;
76 minute: number;
77 second: number;
78 timezoneHourOffset?: number;
79 timezoneMinuteOffset?: number;
80};
81```
82
83The added methods are: `setDate`, `setTime`, `getDate`, `getDateAll`,
84`getTime`, `getTimeAll`, `addDate`, `addTime`, `removeDate`, `removeTime`.
85
86### Bugs fixed
87
88- An update to one of our transitive dependencies (`@rdfjs/data-model`) caused
89 the functions to get data from a Thing (`getInteger`, `getUrl`, etc.) to
90 break when used in Node.
91
92## [1.9.0] - 2021-06-15
93
94### New features
95
96- To ease interoperability with generic RDF libraries, it is now possibile to
97 export SolidDatasets into RDF/JS Datasets using `toRdfJsDataset`, and to
98 import existing RDF/JS Dataset for storing on a Solid Pod using
99 `fromRdfJsDataset`.
100- A new function `buildThing()` makes it easier to set multiple properties on a
101 Thing in one go. So instead of:
102
103```javascript
104let newThing = createThing();
105newThing = addUrl(newThing, rdf.type, schema.Person);
106newThing = addStringNoLocale(newThing, schema.givenName, "Vincent");
107```
108
109you can now avoid having to repeat `newThing`:
110
111```javascript
112const newThing = buildThing()
113 .addUrl(rdf.type, schema.Person)
114 .addStringNoLocale(schema.givenName, "Vincent")
115 .build();
116```
117
118### Bugs fixed
119
120- Since version 1.8.0, TypeScript would no longer warn you if you omitted the
121 second argument to `asUrl` in cases where it's required, thereby risking
122 runtime errors. In most of these cases, TypeScript should now warn you again.
123
124## [1.8.1] - 2021-05-25
125
126### Bugs fixed
127
128- The Universal access API's would sometimes attempt to create Access Policies
129 and Rules with invalid URLs, which could be rejected by some Solid servers.
130
131## [1.8.0] - 2021-05-18
132
133### Changed
134
135- `getUrl` now returns local URLs (e.g. #my-thing)
136- `getThing` now returns empty Things if they were added, rather than `null`.
137- The internal structure of SolidDatasets has been reworked. This shouldn't
138 affect you if you relied on just our public API's, but if you were
139 manipulating the data directly, you might need to update to use our public
140 API's. If something's not covered that you need, please [file an
141 issue](https://github.com/inrupt/solid-client-js/issues/new/choose).
142
143### New features
144
145- `getSolidDataset` now returns atomic objects, making it easier to integrate
146 with other tools in the JavaScript ecosystem, easier to debug, and easier to
147 serialise.
148
149## [1.7.0] - 2021-05-06
150
151### Deprecated
152
153- With Node.js version 10 [reaching end-of-life on
154 2021-04-30](https://github.com/nodejs/Release), @inrupt/solid-client no longer
155 actively supports it. It will not stop working right away, but it will no
156 longer be actively tested and no special effort will be made to keep it from
157 breaking.
158
159### New features
160
161- Node.js version 16 is now supported.
162- The function `getLinkedResourceUrlAll` that gives you all Resources linked to
163 a given Resource, indexed by their relation to the given Resource.
164- The function `getEffectiveAccess`, which tells you what access the current
165 user has and, if supported by the server, what access unauthenticated users
166 have to the given Resource.
167
168### Bugs fixed
169
170- While the API documentation mentioned an `isThingLocal` function, it could not
171 actually be imported from `@inrupt/solid-client`.
172
173## [1.6.1] - 2021-04-01
174
175### Bugs fixed
176
177- Saving a dataset to an IRI with a hash fragment (e.g. the WebID) is processed
178 as an update, and not anymore as an overwrite.
179- An update in one of our dependencies caused writes to a Pod to fail. This
180 dependency has now been pinned to an older, working version while we
181 investigate further. For more info, see
182 https://github.com/inrupt/solid-client-js/issues/957.
183
184## [1.6.0] - 2021-03-22
185
186### New features
187
188- A number of new `acp/*` modules are now available that support working
189 directly with Access Control Policies on Pod servers that implement this
190 experimental proposal.
191
192## [1.5.0] - 2021-03-08
193
194### New features
195
196- `@inrupt/solid-client/access/universal`: an early preview of a set of APIs to
197 manage Access which are agnostic to the Access Control mechanism actually
198 implemented (from the user's point of view). Currently, these modules
199 support the two known access controls for Solid, i.e. Web Access Control and
200 Access Control Policies.
201
202## [1.4.0] - 2021-02-19
203
204### Bugs fixed
205
206- Saving a SolidDataset with a Thing obtained from a different SolidDataset would fail if that Thing
207 contained an RDF Blank Node.
208- Saving back a SolidDataset you just fetched used to result in a "412: Conflict" error.
209
210### New features
211
212- `setGroupDefaultAccess`: A function to set a Group's access modes for all the child Resources of a Container, in the
213 case this Container is controlled using WAC.
214- `setGroupResourceAccess`: A function to set a Group's access modes for a given Resource, in the case this Resource is
215 controlled using WAC.
216
217## [1.3.0] - 2021-01-07
218
219### New features
220
221- If you know the content type of a file to upload via `overwriteFile` or `saveFileInContainer`,
222 you can now manually set it using the `contentType` property in their `options` parameters.
223- `getContainedResourceUrlAll`: a function that returns the URLs for each resource contained in
224 the given Container.
225- FetchError now contains the server response (`error.response`).
226
227### Bugs fixed
228
229- Files sent to a Pod via `overwriteFile` or `saveFileInContainer` without a known content type
230 were rejected by Inrupt's Enterprise Solid Server with a 400 Bad Request, as
231 the Solid specification says it should do. To avoid this, solid-client now sets the content type
232 to `application/octet-stream` by default if no content type is known for the given file.
233
234## [1.2.0] - 2020-12-02
235
236### New features
237
238- It is now possible to import solid-client as an ES module in Node.
239- A number of error messages have been improved that should make it easier for you to identify what
240 went wrong. If you encounter more unhelpful error messages, please
241 [let us know](https://github.com/inrupt/solid-client-js/issues/new?assignees=&labels=bug&template=bug_report.md&title=).
242
243### Bugs fixed
244
245- While the documentation mentioned `hasAcl()`, solid-client did not actually export that function.
246- Dates in between the years 0 and 100 AD were not parsed properly.
247
248## [1.1.0] - 2020-11-16
249
250### New features
251
252- When a function that makes an HTTP request, such as `getSolidDataset`, receives an error response
253 from the server, the error's status code and status text are now exposed via the `.statusCode`
254 and `.statusText` properties, respectively, on the thrown (/returned in the rejected Promise)
255 Error object.
256- Additionally, to help you mock the above errors in your unit tests, we now export
257 `mockFetchError()`. Pass it the URL the fake fetch targeted, and optionally the status code
258 that caused the error.
259
260### Bugs fixed
261
262- Our property-based tests discovered a new edge case in which reading a Datetime from the Pod used
263 to fail. That edge case is now handled properly.
264- Using solid-client with TypeScript would result in the following error:
265 `error TS2305: Module '"../constants"' has no exported member 'acp'.` This is now fixed, and we
266 are working on preventing such errors in the future.
267
268## [1.0.0] - 2020-11-04
269
270The big v1! There are no major changes in this release, but from now on, when we intend to change
271our publicly-documented non-experimental API's, we will bump up the major version to help you plan
272the impact of the upgrade.
273
274### Deprecations
275
276- solid-client will no longer attempt to automatically load solid-auth-client, because it comes with
277 security risks. It is recommended to use
278 [solid-client-authn-browser](https://www.npmjs.com/package/@inrupt/solid-client-authn-browser)
279 instead. It will remain possible to pass a `fetch` function generated by solid-auth-client to the
280 data fetching functions in solid-client.
281
282## [0.6.4] - 2020-11-03
283
284### Bugs fixed
285
286- The compiled code of solid-client was not sent to the correct location, causing imports to fail.
287 This bug was introduced in version 0.6.2.
288
289## [0.6.3] - 2020-11-03
290
291This release contains no public changes.
292
293## [0.6.2] - 2020-10-30
294
295### Bugs fixed
296
297- When writing non-RDF data, the request headers were incorrectly set.
298
299## [0.6.1] - 2020-10-15
300
301### Bugs fixed
302
303- All `get*WithAcl()` functions would always fetch _both_ the Resource's own ACL and its fallback
304 ACL, causing issues when the Resource is the Pod's root, but not at the root of the domain,
305 resulting in an attempt to find a fallback ACL for a Resource outside of the Pod. These functions
306 will now only attempt to fetch the Fallback ACL if the Resource's own ACL is not available. Hence,
307 only at most one of the two will be available at any time.
308
309## [0.6.0] - 2020-10-14
310
311### New features
312
313- `deleteSolidDataset` and `deleteContainer`: two functions that allow you to delete a SolidDataset
314 and a Container from the user's Pod, respectively.
315- `hasServerResourceInfo`: a function that determines whether server-provided information about the
316 Resource is present, such as which server-managed Resources are linked to it.
317- `getPodOwner` and `isPodOwner` allow you to check who owns the Pod that contains a given Resource,
318 if supported by the Pod server and exposed to the current user.
319
320## [0.5.1] - 2020-10-13
321
322### Bugs fixed
323
324- The type definition of `asUrl` caused the compiler to complain when passing it a Thing of which
325 the final URL was either known or not known yet, when using TypeScript.
326
327## [0.5.0] - 2020-09-24
328
329### Breaking changes
330
331- All previously deprecated functions have been removed (their replacements are still available).
332- Previously, if no data with the given URL could be found, `getThing` would return a new, empty
333 Thing. From now on, it will return `null` in those situations.
334
335### Bugs fixed
336
337- `createAclFromFallbackAcl` did not correctly initialise the new ACL: rules that applied to the
338 applicable Resource's children _before_ the new ACL was created (i.e. defined in the fallback ACL)
339 no longer applied after saving the new one. This is now fixed.
340
341## [0.4.0] - 2020-09-15
342
343### Deprecations
344
345- The experimental function `fetchResourceInfoWithAcl` has been deprecated. It is replaced by the
346 otherwise identical (but still experimental) `getResourceInfoWithAcl`.
347
348### New features
349
350- `getResourceInfo`: Function fetching metadata for a resource, without fetching the resource itself. This enables
351 having lightwheight interaction with a Pod before fetching a large file.
352- When fetching data from or storing data to a Pod results in an error, those error messages now
353 contain more information about what data was being sent, and where it was sent to.
354
355### Bugs fixed
356
357- When creating a new Container on Node Solid Server using `createContainerAt`, no error would be
358 thrown when the Container already exists. Now, as with other Solid servers, an error will be
359 thrown if the Container you are trying to create already exists.
360- The second, optional parameter to functions like `getSolidDataset`, which allows you to pass e.g.
361 your own `fetch` function, was not included in our type definitions. This prevented editors from
362 autocompleting them, and could cause compilation errors for developers using TypeScript.
363
364## [0.3.0] - 2020-09-03
365
366### New features
367
368- `thingAsMarkdown()`, `solidDatasetAsMarkdown()` and `changeLogAsMarkdown`: functions that take a
369 Thing and SolidDataset (with local changes), respectively, and returns a string representation of
370 it that can assist in debugging issues.
371
372## [0.2.0] - 2020-08-27
373
374### New features
375
376- `hasResourceInfo`: a function that can verify whether its parameter (e.g. a file or a
377 SolidDataset) was fetched from somewhere, or was initialised in-memory.
378- `createContainerAt` and `createContainerInContainer`: two functions that can help you create an
379 empty Container at a given location or in another Container on the Pod, respectively.
380- `isThing`: a function that can verify whether its parameter is a Thing.
381- `mockSolidDatasetFrom`, `mockContainerFrom`, `mockFileFrom`, `mockThingFrom`,
382 `addMockResourceAclTo` and `addMockFallbackAclTo`: functions that allow you to mock the
383 solid-client data structures in your unit tests.
384- `getFileWithAcl`: like `getSolidDatasetWithAcl`, this function lets you fetch a file along with
385 its ACLs, if available.
386- The legacy predicate `acl:defaultForNew` is now supported by our library. If you interact with a
387 server where it is used to stipulate default access, `@inrupt/solid-client` will behave as expected.
388
389### Bugs fixed
390
391- `getSourceUrl` used to throw an error when called on a Resource that was not fetched from
392 somewhere (and hence had no source URL). It now returns `null` in that case.
393- Giving more rights to an Agent or Group could lead to privilege escalation for an app identified
394 by an `acl:origin` predicate in the ACL.
395- While we allow reading data of different types, they are stored as plain strings. While multiple
396 serialisations of data are often possible, we only supported one per data type. What this means
397 is that, whereas we would correctly return `true` for a boolean stored as `"1"`, we would not do
398 so for `"true"`, even though both are valid serialisations of the value `true` according to the
399 XML Schema Datatypes specification: https://www.w3.org/TR/xmlschema-2. solid-client now recognises
400 all valid serialisations of all supported data types as defined by that specification.
401
402## [0.1.0] - 2020-08-06
403
404### New features
405
406First release! What's possible with this first release:
407
408- Fetch data from Solid Pods or other public sources that publish Turtle data.
409- Store data back to Solid Pods.
410- Read data from datasets.
411- Manipulate data in datasets.
412- Inspect a user's, group's and public permissions w.r.t. a given Resource or child Resources of a
413 Container. (Experimental.)
414- Retrieve, delete and/or write any file (including non-RDF) from/to a Pod. (Experimental.)