ketting 7.5.0 → 7.5.2

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/changelog.md ADDED
@@ -0,0 +1,1005 @@
1
+ ChangeLog
2
+ =========
3
+
4
+ 7.5.2 (2024-09-19)
5
+ ------------------
6
+
7
+ * Updating dependencies.
8
+
9
+
10
+ 7.5.1 (2022-09-03)
11
+ ------------------
12
+
13
+ * Typescript 4.8 support!
14
+
15
+
16
+ 7.5.0 (2022-08-26)
17
+ ------------------
18
+
19
+ * #401: The mechanism that de-duplicates identical requests is now a bit
20
+ smarter, and will not de-duplicate requests that are significantly different
21
+ such as a different `Accept` header. (@hugothomas @reda-alaoui)
22
+ * #450: `value` field for some HAL inputs were ignored (color, checkbox,
23
+ radio).
24
+
25
+
26
+ 7.4.2 (2022-05-11)
27
+ ------------------
28
+
29
+ * Added support for `minLength` and `maxLength` attributes on textarea fields
30
+ in HAL Forms. (@dayre).
31
+
32
+
33
+ 7.4.1 (2022-03-21)
34
+ ------------------
35
+
36
+ Idential to the last beta. Contains the following features that were introduced
37
+ in the previous betas:
38
+
39
+ * #433: Fixed race condition when processing nested `_embedded` resources and
40
+ emiting `update` events. The order at which they happen is now consistent.
41
+ When the `update` event happens, the entire cache should be up to date.
42
+ * #328: `Resource.go()` and `Client.go()` can now take a `Link` object as the
43
+ argument.
44
+
45
+
46
+ 7.4.1-beta.1 (2022-03-20)
47
+ -------------------------
48
+
49
+ * Fixed a bug that was introduced with #433.
50
+
51
+
52
+ 7.4.1-beta.0 (2022-03-20)
53
+ -------------------------
54
+
55
+ * #433: Fixed race condition when processing nested `_embedded` resources and
56
+ emiting `update` events. The order at which they happen is now consistent.
57
+ When the `update` event happens, the entire cache should be up to date.
58
+ * #328: `Resource.go()` and `Client.go()` can now take a `Link` object as the
59
+ argument.
60
+
61
+
62
+ 7.4.0 (2022-03-17)
63
+ ------------------
64
+
65
+ * #426: Setting up cache dependencies through `inv-by` links is now possible
66
+ via HAL `_links` and in embedded resources, as well as links from all the
67
+ other formats.
68
+ * #425: Fewer warnings related to 'Max listeners exceeded'. The default of 10
69
+ is too low for typical Ketting applications.
70
+
71
+
72
+ 7.3.0 (2022-01-06)
73
+ ------------------
74
+
75
+ * #416: Cache-dependencies setup with `inv-by` links are now respected when
76
+ manually clearing resource caches.
77
+ * #414: Don't attempt to parse the response if it had a `204` status, even if
78
+ there was a `Content-Type` header.
79
+ * #408: Emit a warning when an `_embedded` HAL item is missing a good `self`
80
+ link.
81
+
82
+
83
+ 7.2.0 (2021-08-04)
84
+ ------------------
85
+
86
+ * #395: Relative URIs in embedded HAL documents are now resolved using the
87
+ 'self' link in the embedded document, instead of the parent. Although not
88
+ explicitly said in the HAL standards, I feel this is the right behavior. Most
89
+ users will not see a difference, but if you relied on the old behavior this
90
+ could cause some subtle BC breaks.
91
+
92
+
93
+ 7.1.1 (2021-06-15)
94
+ ------------------
95
+
96
+ * #392: The `action()` function on State classes would only return the default
97
+ action (@reda-alaoui).
98
+ * Changed how Cache classes are exported, as an experiment to see if IDE docs
99
+ are more complete.
100
+
101
+
102
+ 7.1.0 (2021-05-27)
103
+ ------------------
104
+
105
+ * Support for the `inv-by` Link relationship type from the [Linked Cache
106
+ Invalidation draft][2]. This link lets a resource tell the client that it's
107
+ cache should expire when the linked resource's cache also expires.
108
+ * The 'prompt' field in HAL Forms for properties with 'options' set was
109
+ ignored.
110
+
111
+
112
+ 7.0.1 (2021-05-04)
113
+ ------------------
114
+
115
+ * No longer testing Node 10 and Node 15. Added Node 16.
116
+ * Actions are now retained when caching. Before this, action information was
117
+ dropped which meant that any actions in embedded resources were not
118
+ accessible. (@hugothomas)
119
+
120
+
121
+ 7.0.0 (2021-04-11)
122
+ ------------------
123
+
124
+ * New major version! See Github for a list of changes.
125
+ * `Title` header is now defined as a HTTP Entity Header.
126
+
127
+
128
+ 7.0.0-beta.5 (2021-03-08)
129
+ -------------------------
130
+
131
+ * `label` and `value` were parsed in reverse.
132
+
133
+
134
+ 7.0.0-beta.4 (2021-02-26)
135
+ -------------------------
136
+
137
+ * Added renderAs 'checkbox' to multi-select fields in actions.
138
+ * Export `OptionDataSource`.
139
+
140
+
141
+ 7.0.0-beta.3 (2021-02-21)
142
+ -------------------------
143
+
144
+ * Support for HAL Forms version `2021-02-20`, which adds the 'options'
145
+ property.
146
+ * Kettings now has support for 'dropdown' fields, allowing users to provide
147
+ lists of possible options in 3 different ways: 1. An inline list 2. An
148
+ external HTTP resource (JSON body or CSV body) 3. Provided as links from a
149
+ hypermedia source. Only 1 and 2 are supported by HAL Forms, 3 is just an
150
+ internal feature until there is a format that has first-class support for
151
+ this.
152
+ * A bit of a rewrite of 'fields' again. Only a single type is exported, and all
153
+ the types are cleaned up.
154
+
155
+
156
+ 7.0.0-beta.2 (2021-01-25)
157
+ -------------------------
158
+
159
+ * Support for Siren 'title' on fields. This was an oversight.
160
+
161
+
162
+ 7.0.0-beta.1 (2021-01-25)
163
+ -------------------------
164
+
165
+ * Remove support for `Prefer-Push`. Browsers are basically dropping HTTP/2
166
+ Push, and not enough work is done to make this very interesting. [More
167
+ background](https://evertpot.com/http-2-push-is-dead/).
168
+ * Revert 'unifiying URLs' PR, we're back to using `url.resolve` in node.
169
+
170
+
171
+ 7.0.0-beta.0 (2021-01-19)
172
+ -------------------------
173
+
174
+ * Note: this release has a number of BC breaks, which will only affect you if
175
+ you wrote custom format parsers. See the wiki for more details.
176
+ * #326: State objects now have `follow()` and `followAll()` methods.
177
+ * #322: Add `type`, `status`, `detail`, `instance` properties to `Problem`
178
+ class, for better support of [`application/problem+json`][6]. (@sazzer).
179
+ * #327: If a response is received with a `Content-Location` header, the
180
+ response will now immediately get stored in the cache.
181
+ * Support for [`draft-dalal-deprecation-header`][7]. Ketting will now emit
182
+ warnings if a `Deprecation` header is detected, and will also provide
183
+ information from the `Sunset` header and include the uri of the `deprecation`
184
+ link relation.
185
+ * Support for the latest [HAL-Forms][5] features, including `target`, `step`,
186
+ `min`, `max`, `type`, `minLength`, `maxLength`, `placeholder`, `cols`,
187
+ `rows`.
188
+ * Support multiple HAL Forms, as per the latest spec updates. Before only a
189
+ 'default' form was supported.
190
+ * Add `textarea` form field type.
191
+ * #324: Only use `{cache: 'no-cache'}` with `.refresh()`, not `.get()`.
192
+ * Fixed a subtle URL resolving bug in browsers. (Node was not affected).
193
+
194
+
195
+ 6.2.0 (2020-12-01)
196
+ ------------------
197
+
198
+ * Updated `fetch-mw-oauth2`, which has a few new features: * Fixed a race
199
+ condition where two 401's in quick succession could result in two OAuth2
200
+ refresh requests, ultimately causing 1 to fail. * Preemptively refresh if we
201
+ know when the access token will expire.
202
+
203
+
204
+ 6.1.4 (2020-11-30)
205
+ ------------------
206
+
207
+ * #302: Templated links without template data don't work.
208
+
209
+
210
+ 6.1.3 (2020-11-19)
211
+ ------------------
212
+
213
+ * Add a `getCache()` function to Resource, which allows a user to get the
214
+ latest Resource State in a synchronous manner.
215
+ * #292: Parse Siren's 'value' property in action fields.
216
+ * `fetch-mw-oauth2` dependency had a bug related to refreshing tokens. This
217
+ release ships with a version without that bug.
218
+
219
+
220
+ 6.1.2 (2020-11-09)
221
+ ------------------
222
+
223
+ * Update the `fetch-mw-oauth2` dependency, which adds an `onAuthError` event.
224
+
225
+
226
+ 6.1.1 (2020-11-05)
227
+ ------------------
228
+
229
+ * `state.links.delete()` can now take a `href` argument to delete a specific
230
+ link from its list.
231
+ * Improvements in error messaging.
232
+ * Upgrade to Webpack 5
233
+
234
+
235
+ 6.1.0 (2020-10-04)
236
+ ------------------
237
+
238
+ * Large changes in the actions/form system. This should still be considered
239
+ experimental and could cause some minor BC breaks.
240
+ * Actions are now effectively a serialization of a HTML form, and it's now
241
+ possible to introspect information such as the `target`, `method`,
242
+ `contentType`, etc.
243
+ * Some refactoring in the `State` objects, simplifiying these significantly.
244
+
245
+
246
+ 6.0.4 (2020-10-04)
247
+ ------------------
248
+
249
+ * State objects now have an `actions()` method that return all defined actions.
250
+
251
+
252
+ 6.0.3 (2020-09-30)
253
+ ------------------
254
+
255
+ * #241: Add `application/prs.hal-forms+json` to Accept header and treat as HAL
256
+ (@reda-alaoui).
257
+ * #260: `action()` could not be successfully called on a HAL action.
258
+ (@reda-alaoui).
259
+ * Add `action()` function to `State` interface.
260
+
261
+
262
+ 6.0.2 (2020-09-28)
263
+ ------------------
264
+
265
+ * #248: Parse JSON objects that have an array at the top-level.
266
+ * #257: `ETag` and `Last-Modified` are now treated as 'Content headers', which
267
+ means they will get returned from `getContentHeaders()`.
268
+
269
+
270
+ 6.0.1 (2020-09-09)
271
+ ------------------
272
+
273
+ * Quick re-release. Some files were left in the `dist/` directory that were not
274
+ cleaned up.
275
+
276
+
277
+ 6.0.0 (2020-09-09)
278
+ ------------------
279
+
280
+ * New major release!
281
+ * Added support for [Siren][1] action fields.
282
+ * Added support for [HAL Forms][4].
283
+
284
+
285
+ 6.0.0-beta.2 (2020-08-15)
286
+ -------------------------
287
+
288
+ * Support `draft-nottingham-link-hint` on Links.
289
+ * Added: `client.fetcher.advertiseKetting`. Setting this to false will cause
290
+ Ketting to *not* set the `User-Agent` header.
291
+ * `Resource.patch()` will now return a `State `object if the server responded
292
+ with `200 OK` and a body.
293
+
294
+
295
+ 6.0.0-beta.1 (2020-08-10)
296
+ -------------------------
297
+
298
+ * #229: Embedded resources were not cached. (@madsmadsen)
299
+ * #230: Respect `headers` property in options of `refresh()` function.
300
+ (@madsmadsen)
301
+ * Lots of Ketting 6 doc updates.
302
+ * JSDocs everywhere gotten a fresh proof read.
303
+
304
+
305
+ 6.0.0-beta.0 (2020-07-06)
306
+ -------------------------
307
+
308
+ * Switched from tslint to eslint.
309
+ * Feature complete!
310
+
311
+
312
+ 6.0.0-alpha.7 (2020-06-19)
313
+ --------------------------
314
+
315
+ * `isState()` type guard is exported.
316
+
317
+
318
+ 6.0.0-alpha.6 (2020-06-16)
319
+ --------------------------
320
+
321
+ * The Links object now has a default 'context', making it easier to add
322
+ relative links.
323
+ * Links now has an easier to use API for setting or adding new links.
324
+ * Links now has a `.delete()` method to delete by `rel`.
325
+
326
+
327
+ 6.0.0-alpha.5 (2020-06-08)
328
+ --------------------------
329
+
330
+ * Added 'actions', allowing users to automatically submit actions and/or Forms
331
+ for supported formats.
332
+ * Action support is added for `text/html` and `application/vnd.siren+json`
333
+ * Supported content-types for actions are `application/json` and
334
+ `application/x-www-form-urlencoded`.
335
+ * `State` objects now have a reference to `Client`.
336
+ * `resolve()` function is now a package export, providing a cross-platform
337
+ function for resolving urls.
338
+ * `Resource` has now a `updateCache` function for local state changes without
339
+ submitting to the server.
340
+ * `refresh()` now emits an `update` event.
341
+
342
+
343
+ 6.0.0-alpha.4 (2020-05-11)
344
+ --------------------------
345
+
346
+ * Fixing bugs related to `patch()`, `post()` in the browser build.
347
+
348
+
349
+ 6.0.0-alpha.3 (2020-05-10)
350
+ --------------------------
351
+
352
+ * `Resources` implement EventEmitter, and can emit `stale`, `update` and
353
+ `delete` events.
354
+ * The 'body' property on State is now 'data'
355
+ * #141: Added `head()` function and ability to follow links just through `HEAD`
356
+ methods via the `Link` header.
357
+ * Added a `NeverCache` and `ShortCache` if automatically storing every `State`
358
+ object until invalidation is not desired.
359
+ * When calling `put()` with a new `State` object, that object will now be
360
+ placed in cache.
361
+ * When refreshing, `fetch()` is now given the 'reload' cache setting, so that
362
+ `refresh()` is a true Refresh, even with a browser cache.
363
+ * #130: Support relative bookmark URIs when using Ketting in a browser.
364
+ * Siren was not correctly parsed.
365
+ * Add `.clone()` method to all `State` object.
366
+
367
+
368
+ 6.0.0-alpha.2 (2020-05-03)
369
+ --------------------------
370
+
371
+ * `State` is now exported.
372
+ * #184: Added a new `postFollow()` function that takes over the role of
373
+ `post()`. `post()` is now intended for RPC-like operations and form
374
+ submissions.
375
+
376
+
377
+ 6.0.0-alpha.1 (2020-05-03)
378
+ --------------------------
379
+
380
+ * Re-release. The build contained a few older files that weren't meant to be
381
+ packaged.
382
+
383
+
384
+ 6.0.0-alpha.0 (2020-04-28)
385
+ --------------------------
386
+
387
+ * Big BC-breaking rewrite. Changes are numerous, but the important ones are
388
+ listed here.
389
+ * `Resource.get()` now returns a `State` object instead of just a response
390
+ body. This object has methods to make it easier to manipulate and get
391
+ information about the response, including links. It's also a stable,
392
+ non-async object.
393
+ * `Ketting` class is now called `Client`. It's still exposed as `Ketting` as
394
+ well for BC purposes.
395
+ * `Client.getResource()` has been removed. Use `Client.go()` instead.
396
+ * A HTTP Fetch middleware system has been added, for easier manipulation of
397
+ requests and responses. Middlewares can be added for every request, or for
398
+ specific origins (domains).
399
+ * All authentication settings have been removed, and reimplemented as fetch
400
+ middlewares. They take roughly the same options, but the setup has changed.
401
+ * `Resource.get()`, `Resource.put()`, etc. can now all take custom headers and
402
+ other options to manipulate the request.
403
+ * In the past you could just send a body with `Resource.post()`, `.put()`,
404
+ .`patch()`. Now this body must be a wrapped in an object with at least a
405
+ `.body` property. This is an annoying BC break but will allow for more
406
+ flexibility that was previous impossible.
407
+ * Proper support for 'binary' resources.
408
+ * Hal Links will now be reserialized on `put()`.
409
+ * `Resource.link`, `Resource.links` and `Resource.hasLink` has been deprecated,
410
+ but not removed.
411
+ * `Link` objects are now a simple typescript type, and no longer implemented as
412
+ a class.
413
+ * `FollowerOne` is now `FollowPromiseOne` and `FollowerMany` is now
414
+ `FollowPromiseMany`.
415
+ * All things called `Representor` has been removed, and rewritten with a
416
+ completely new API. A `HAL representor` is now a `HalState`.
417
+ * #175: Nested embedded items are now also placed in the cache.
418
+
419
+
420
+ 5.2.1 (2020-03-03)
421
+ ------------------
422
+
423
+ * Use the `title=` attribute from the HTTP Link header, if it exists.
424
+
425
+
426
+ 5.2.0 (2020-02-17)
427
+ ------------------
428
+
429
+ * Added 'finally()' to custom follower promises.
430
+ * All representors are now exported in the `representor` namespace.
431
+
432
+
433
+ 5.1.2 (2020-02-12)
434
+ ------------------
435
+
436
+ * Correct return type on followAll, so it may be chained with preFetch. This
437
+ was only an issue when doing 'multiple hops'.
438
+
439
+
440
+ 5.1.1 (2020-01-10)
441
+ ------------------
442
+
443
+ * #173: De-duplicate HAL links if they appear in _embedded and _links.
444
+
445
+
446
+ 5.1.0 (2020-01-05)
447
+ ------------------
448
+
449
+ * Support for the [Collection+json][4] format.
450
+ * Added a `preferTransclude()` method on the Follower objects. This
451
+ automatically adds a `Prefer: tranclude="rel"` header.
452
+
453
+
454
+ 5.0.1 (2019-12-09)
455
+ ------------------
456
+
457
+ * Update all dependencies.
458
+
459
+
460
+ 5.0.0 (2019-11-22)
461
+ ------------------
462
+
463
+ * This version is the exact same as the previous alpha.
464
+
465
+
466
+ 5.0.0-alpha.7 (2019-11-12)
467
+ --------------------------
468
+
469
+ * Added `hasLink` on Resources and Representations.
470
+
471
+
472
+ 5.0.0-alpha.6 (2019-11-06)
473
+ --------------------------
474
+
475
+ * Fixed a bug in `getOptions()`
476
+
477
+
478
+ 5.0.0-alpha.5 (2019-11-06)
479
+ --------------------------
480
+
481
+ * Added a `preferPush()` method to 'Follower' objects, allowing you to
482
+ automatically send [`Prefer-Push`][3] headers when following links.
483
+ * Moved all functionality related to the 'Repreprentor' in a utility class,
484
+ making both the `Ketting` and `Resource` classes simpler.
485
+ * Simplified `Resource.refresh()`, making it easier to read and do less work.
486
+ * When calling `.post()`, the function will only return a new resource if the
487
+ HTTP response code was `201`.
488
+ * If the HTTP response code to a `post()` call was `205`, it will now return
489
+ the current resource.
490
+ * Removed the logic for automatically adding `Prefer-Push` headers. This was
491
+ unreliable, and usually did the wrong thing. The new system is 100% opt-in
492
+ and developer-driven.
493
+ * Added `Ketting.getOptions()` to return a list of options that were passed to
494
+ Ketting. The options will be enhanced with OAuth2 refresh and access tokens
495
+ as they become available, meaning that it can be used to place in
496
+ LocalStorage to remember sessions. This feature is experimental and
497
+ incomplete. It might change even in minor versions.
498
+
499
+
500
+ 5.0.0-alpha.4 (2019-10-31)
501
+ --------------------------
502
+
503
+ * This version is identical to the last, but fixes an issue on npmjs.com.
504
+ Updating is not needed.
505
+
506
+
507
+ 5.0.0-alpha.3 (2019-10-31)
508
+ --------------------------
509
+
510
+ * It's now possible to tell Ketting to prefetch every resource when following
511
+ links via `Resource.follow('foo').preFetch()`.
512
+ * `Link` and `LinkNotFound` are now both exported.
513
+ * Documentation overhaul.
514
+
515
+
516
+ 5.0.0-alpha.2 (2019-10-21)
517
+ --------------------------
518
+
519
+ * Slight tweak to the webpack build, so that other typescript + webpack
520
+ projects can use the webpack build and use the minified files.
521
+
522
+
523
+ 5.0.0-alpha.1 (2019-10-21)
524
+ --------------------------
525
+
526
+ * Now supports the 'invalidates' link rel. When specified in a HTTP response,
527
+ Ketting will automatically clear the cache of any related resources. See
528
+ [draft-nottingham-linked-cache-inv-04][2].
529
+
530
+
531
+ 5.0.0-alpha.0 (2019-10-18)
532
+ --------------------------
533
+
534
+ * Support for the [Siren][1] format.
535
+ * Rewrite of the 'representation' system, which is responsible for supporting
536
+ all the different media types. This results in a few small BC breaks.
537
+ * NEW: `follow()` and `followAll()` now throw `LinkNotFound` instead of the
538
+ generic `Error` when a link could not be found.
539
+ * NEW: Resources now have a `link(rel: string)` function, which returns a a
540
+ single `Link` object.
541
+ * BC BREAK: `Ketting.getRepresentor()` is now `Ketting.createRepresentation()`
542
+ and is responsible for constructing the object instead of just returning a
543
+ constructor.
544
+ * BC Break: `body`, `links` and `embedded` on `Representor` objects are all
545
+ gone and replaced with `getBody()`, `getLinks()` and `getEmbedded()`.
546
+ * BUG: Hal is now more lenient with broken responses.
547
+ * NEW: Compatible with Typescript's `strictNullChecks` setting. Overall
548
+ stronger typing all around.
549
+ * NEW: Hal responses from the HAL representor are now properly typed.
550
+ * CHANGE: Link chaining system has been rewritten, opening the door to new
551
+ features that weren't possible before.
552
+
553
+
554
+ 4.0.4 (2019-10-31)
555
+ ------------------
556
+
557
+ * This version is identical to the last, but fixes an issue on npmjs.com.
558
+ Updating is not needed.
559
+
560
+
561
+ 4.0.3 (2019-09-11)
562
+ ------------------
563
+
564
+ * The internal resource cache will now evict items for any non-safe HTTP
565
+ method.
566
+
567
+
568
+ 4.0.2 (2019-09-05)
569
+ ------------------
570
+
571
+ * Broke Typescript exports again
572
+
573
+
574
+ 4.0.1 (2019-09-05)
575
+ ------------------
576
+
577
+ * Fix Typescript defintion files so Ketting may be imported correctly.
578
+
579
+
580
+ 4.0.0 (2019-09-04)
581
+ ------------------
582
+
583
+ * #129: Using the package in non-typescript node.js now works with a simple
584
+ `const Ketting = require('ketting')`.
585
+ * #129: Fixed the browser distribution. the `Ketting` constructor is registered
586
+ globally again.
587
+
588
+
589
+ 4.0.0-alpha.0 (2019-04-22)
590
+ --------------------------
591
+
592
+ * The old format for OAuth2 setup is now no longer supported.
593
+ * It's now possible to specify per-domain authentication using wildcards. This
594
+ allows you to set up specific authentication credentials for specific
595
+ domains. This might be useful in case you talk to multiple API's with a
596
+ single client.
597
+
598
+
599
+ 3.1.0 (2019-03-28)
600
+ ------------------
601
+
602
+ * If Ketting anticipates that a user might want to fetch multiple resources in
603
+ sequence (a follow chain), it will now add `Prefer-Push` header and a
604
+ `Prefer: transclude` header. Both are experimental internet drafts to suggest
605
+ to a server to do a HTTP/2 push or embed a child resource respecitvely. This
606
+ feature is experimental and might change as these drafts change.
607
+
608
+
609
+ 3.0.2 (2019-03-19)
610
+ ------------------
611
+
612
+ * A mistake was made when releasing version 3. A branched was not merged in
613
+ entirely, which caused some of the new OAuth2 features to be partially
614
+ missing. This has now been corrected.
615
+
616
+
617
+ 3.0.1 (2019-03-18)
618
+ ------------------
619
+
620
+ * Updated dependencies
621
+
622
+
623
+ 3.0.0 (2019-03-18)
624
+ ------------------
625
+
626
+ * Switched OAuth2 implementation from `client-oauth2` to `fetch-mw-oauth2`.
627
+ This adds support for `authorization_code` auth, removes 11 dependencies and
628
+ reduces the minified Ketting build from 69KB to 28KB.
629
+ * OAuth2 options now have a new format. The old format is still supported, but
630
+ will be removed from a future version.
631
+ * The `baseHref` propertyname was renamed to `Context` on the `Link` type. The
632
+ new name matches the name from RFC8288. This is a small BC break.
633
+
634
+
635
+ 2.5.1 (2019-03-01)
636
+ ------------------
637
+
638
+ * #120: The system that de-duplicates identical requests will cache failures
639
+ forever. This is now fixed. Highly recommended update.
640
+
641
+
642
+ 2.5.0 (2019-01-22)
643
+ ------------------
644
+
645
+ * Basic JSON:API support. Currently only links appearing in the top-level
646
+ document are supported.
647
+ * #113: Support for Typescript environments that don't have `esModuleInterop`
648
+ set to true.
649
+ * Added a 'go' function for easily getting resources based on relative uris.
650
+
651
+
652
+ 2.4.1 (2018-11-07)
653
+ ------------------
654
+
655
+ * If a link appears in both `_embedded` and `_links`, they will be
656
+ de-duplicated. HAL technically requires links to appear in both places, so
657
+ scanning `_embedded` should not be needed. However, most implementations will
658
+ not add links `_links` if they were already `_embedded`. This change caters
659
+ both usages.
660
+
661
+
662
+ 2.4.0 (2018-11-05)
663
+ ------------------
664
+
665
+ * The `Resource` class is now a generic typescript type. This allows a user of
666
+ the library to define specific 'types of resources' and leverage static
667
+ * A few documentation updates.
668
+
669
+ typing for `GET` and `PUT` requests.
670
+
671
+
672
+ 2.3.0 (2018-10-10)
673
+ ------------------
674
+
675
+ * Better handling of `Content-Types`. When following HAL links that have a
676
+ `type` parameter, the type is rememebered and used in `Accept` and
677
+ `Content-Type` headers, for `GET`, `PUT` and `POST` requests.
678
+ * If no `type` was provided, it will use the last `Content-Type` header from
679
+ `GET` response.
680
+ * If that `GET` request never happened, it uses the first 'default'
681
+ `Content-Type` from client.contentTypes, and enumerates all mime-types from
682
+ that list for `Accept` headers.
683
+ * No longer incorrectly sends `text/plain` Content-Types.
684
+ * Optimization: If multiple calls are made to ask for a Resource's current
685
+ representation, all these calls are coalesced into one. The big benefit is
686
+ that there are no longer multiple parallel `GET` requests.
687
+ * Webpack browser build is set to 'production' mode.
688
+ * Fixed: After refreshing an OAuth2 token, the new access token wasn't used.
689
+
690
+
691
+ 2.2.1 (2018-09-19)
692
+ ------------------
693
+
694
+ * Refreshing OAuth2 tokens without having a refresh_token. `client_credentials`
695
+ in particular shouldn't return a `refresh_token`, so for these cases, new
696
+ access tokens are acquired using a new `client_credentials` request.
697
+
698
+
699
+ 2.2.0 (2018-09-18)
700
+ ------------------
701
+
702
+ * Support for OAuth2 `client_credentials` grant.
703
+
704
+
705
+ 2.1.0 (2018-09-14)
706
+ ------------------
707
+
708
+ * No longer ships with `cross-fetch` and `whatwg-fetch`. To use this library in
709
+ a browser, you must run this in a browser that supports `fetch` or provide
710
+ your own polyfill.
711
+ * Updated dependencies
712
+
713
+
714
+ 2.0.4 (2018-09-12)
715
+ ------------------
716
+
717
+ * Fixed bug: HAL title values weren't parsed.
718
+
719
+
720
+ 2.0.3 (2018-08-23)
721
+ ------------------
722
+
723
+ * Exporting 'Resource' for TS purposes.
724
+
725
+
726
+ 2.0.2 (2018-08-23)
727
+ ------------------
728
+
729
+ * Updated dependencies
730
+ * Fixed a typescript definition problem.
731
+
732
+
733
+ 2.0.1 (2018-06-17)
734
+ ------------------
735
+
736
+ * Same as last build.
737
+
738
+
739
+ 2.0.0 (2018-06-17)
740
+ ------------------
741
+
742
+ * #71: Total conversion to Typescript.
743
+ * BC break: Minified files are now in the `browser/` directory, not the `dist/`
744
+ directory.
745
+ * #78: Webpack build had a broken version of `querystring`, which caused
746
+ `Link:` header parsing to fail in browsers.
747
+ * #80: `resource.fetch()` would throw an exception with some combinations of
748
+ arguments.
749
+ * #90: `get()` and `refresh()` will now throw an Error when a server did not
750
+ include a content-type.
751
+ * #89: Refactored OAuth utility to be a bit more clear.
752
+ * #83: Support for `resource.patch()`. The implementation is pretty basic. Let
753
+ us know how you would like to use it!
754
+
755
+
756
+ 1.1.0 (2018-04-07)
757
+ ------------------
758
+
759
+ * #70: Moved all source from `lib/` to `src/`. This is prepping for typescript
760
+ support.
761
+ * #73: Mocha tests can now be ran in a browser.
762
+ * #76: Fixed a browser bug: Headers is not a constructor.
763
+
764
+
765
+ 1.0.0 (2018-03-25)
766
+ ------------------
767
+
768
+ * #66: Support for Accept header weighing with the q= parameter.
769
+ * #68: Updated all dependencies to their latest version.
770
+
771
+
772
+ 0.10.3 (2018-01-31)
773
+ -------------------
774
+
775
+ * #63: It was not possible to expand templated links with variables after more
776
+ than one chained hop. (@mhum).
777
+
778
+
779
+ 0.10.2 (2018-01-31)
780
+ -------------------
781
+
782
+ * #62: It was not possible to override headers such as `Content-Type` when
783
+ calling `Resource.fetch()`, if these were also set in the `fetchInit`
784
+ defaults. (@mhum).
785
+
786
+
787
+ 0.10.1 (2018-01-31)
788
+ -------------------
789
+
790
+ * #60: Chaining more than 2 `follow` statements did not work.
791
+
792
+
793
+ 0.10.0 (2017-11-16)
794
+ -------------------
795
+
796
+ * #19: Support for OAuth2 access and refresh tokens. When used, the library can
797
+ automatically refresh the access token if the previous one expired. It can
798
+ also supports the `client_credentials` OAuth2 grant (@mhum).
799
+
800
+
801
+ 0.9.0 (2017-09-23)
802
+ ------------------
803
+
804
+ * #52: Now using the new URL object in browsers for resolving relative urls,
805
+ and falling back to a DOM based url resolving mechanism if it's not
806
+ available. This causes the browser distribution to drop another 10KB to 46KB.
807
+ * Moved a bunch of utility objects into a `util/` directory, so it's more clear
808
+ what the important API's are.
809
+ * #55: Fixed another problem related to the fetchInit function in firefox.
810
+
811
+
812
+ 0.8.3 (2017-09-10)
813
+ ------------------
814
+
815
+ * Including the sourcemap file in the NPM distribution.
816
+
817
+
818
+ 0.8.2 (2017-09-10)
819
+ ------------------
820
+
821
+ * #53: Regression related to the new 'fetchInit' option.
822
+ * Now generating source maps.
823
+
824
+
825
+ 0.8.1 (2017-09-04)
826
+ ------------------
827
+
828
+ * #50: Allow Fetch settings to be passed to the constructor of Ketting, so that
829
+ settings such as `credentials: include` may be passed.
830
+
831
+
832
+ 0.8.0 (2017-08-28)
833
+ ------------------
834
+
835
+ * #49: Removed support for expanding CURIEs in HAL. This was in conflict with
836
+ the HAL standard. The canonical relation type is the prefix in the REL, not
837
+ the expanded CURIE uri.
838
+
839
+
840
+ 0.7.1 (2017-08-24)
841
+ ------------------
842
+
843
+ * Lots of documentation updates.
844
+ * Including web distribution in NPM package.
845
+
846
+
847
+ 0.7.0 (2017-08-21)
848
+ ------------------
849
+
850
+ * This library is now called Ketting. It used to be called Restl. Ketting is
851
+ the dutch word for chain.
852
+ * Automatically expanding Curies in the HAL `_link` object.
853
+
854
+
855
+ 0.6.0 (2017-08-20)
856
+ ------------------
857
+
858
+ * #15: Browser support via webpack!
859
+ * #45: Removed Bluebird dependency.
860
+ * #16: Parsing the HTTP `Link` header (RFC5988).
861
+ * #30: Added support for automatically parsing `application/problem+json` error
862
+ responses and throwing better exceptions. (RFC7807).
863
+ * #47: Link object now uses an object as its only constructor argument.
864
+
865
+
866
+ 0.5.0 (2017-08-08)
867
+ ------------------
868
+
869
+ * #41: Support for parsing HTML5. The library can now extract `link` and `a`
870
+ elements with `rel` attributes.
871
+ * Removed the `accept` option. This should now be controlled with the
872
+ `contentTypes` property.
873
+ * #40: Removed support for the Requests library. This library now only used the
874
+ Fetch API, to make it compatible with browsers in the future.
875
+
876
+
877
+ 0.4.2 (2017-08-03)
878
+ ------------------
879
+
880
+ * #39: Making it easier to fire off custom HTTP requests on a resource using
881
+ the Fetch API. You can now just provide the `init` argument without providing
882
+ a url.
883
+
884
+
885
+ 0.4.1 (2017-07-07)
886
+ ------------------
887
+
888
+ * #38: Add HTTP response to HTTP-related exceptions.
889
+
890
+
891
+ 0.4.0 (2017-07-07)
892
+ ------------------
893
+
894
+ * #37: Support for templated uris.
895
+
896
+
897
+ 0.3.2 (2017-04-27)
898
+ ------------------
899
+
900
+ * #33: Support for OAuth2 Bearer token.
901
+
902
+
903
+ 0.3.1 (2017-04-26)
904
+ ------------------
905
+
906
+ * #31: Support for setting a standard `Content-Type` HTTP header.
907
+
908
+
909
+ 0.3.0 (2017-04-24)
910
+ ------------------
911
+
912
+ * #28: Support for Basic Authentication
913
+
914
+
915
+ 0.2.1 (2017-04-21)
916
+ ------------------
917
+
918
+ * #27: Fixed exception messages, they missed the HTTP status code.
919
+
920
+
921
+ 0.2.0 (2017-04-21)
922
+ ------------------
923
+
924
+ * #17: Now using the Fetch API instead of the requests library. The requests
925
+ library is kept around for BC purposes, but this will eventually be removed.
926
+ * #25: the resourceCache was accidentally shared between Client instances.
927
+
928
+
929
+ 0.1.2 (2017-04-19)
930
+ ------------------
931
+
932
+ * #11: Added test framework.
933
+ * #11: Added `follow()` function on Client object for an easy shortcut.
934
+
935
+
936
+ 0.1.1 (2017-04-03)
937
+ ------------------
938
+
939
+ * #10: Returning the response body from the `refresh()` function, similar to
940
+ `GET` but cache-defeating.
941
+
942
+
943
+ 0.1.0 (2017-02-13)
944
+ ------------------
945
+
946
+ * #7: Strip `_embedded` and `_links` from `Representation.body`. They are
947
+ already available through `Representation.embedded` and
948
+ `Representation.links`.
949
+ * Added a cache for resources in the Client object, which ensures that if you
950
+ request the same resource twice, you'll end up with the same object.
951
+ * #6: Automatically parse `_embedded` and treat items in this object as real
952
+ resources.
953
+ * Fixed a bug in `post()`.
954
+ * Allowing custom headers to be set, and allowing default headers to be
955
+ overridden.
956
+ * Automatically resolve all urls from `links()`.
957
+
958
+
959
+ 0.0.4 (2017-02-06)
960
+ ------------------
961
+
962
+ * Bugfixes.
963
+ * Linting with eslint.
964
+
965
+
966
+ 0.0.3 (2017-02-06)
967
+ ------------------
968
+
969
+ * Now using Bluebird for promises, so we can extend them.
970
+ * #2: Custom requests are now possible on `Resource` objects.
971
+ * #3: Promises returned from `follow()` now have a `follow()` function
972
+ themselves, making it extremely easy to hop from link to link.
973
+ * Added a `post()` method for making new resources. This function returns a
974
+ `Resource` object again if the response contained a `Location` header.
975
+ * #4: Things in the `_embedded` property are now also treated as links and can
976
+ be followed.
977
+ * The `links()` method on Resource now have a `rel` argument for easy
978
+ filtering.
979
+ * Added a `followAll()` function for getting collections.
980
+
981
+
982
+ 0.0.2 (2017-01-03)
983
+ ------------------
984
+
985
+ * `PUT` request.
986
+ * `DELETE` request.
987
+
988
+
989
+ 0.0.1 (2016-12-28)
990
+ ------------------
991
+
992
+ * First version!
993
+ * Parses HAL `_links`.
994
+ * Follows links.
995
+ * `GET` requests.
996
+ * `refresh()` function.
997
+
998
+ [1]: https://github.com/kevinswiber/siren
999
+ [2]: https://tools.ietf.org/html/draft-nottingham-linked-cache-inv-04
1000
+ [3]: https://tools.ietf.org/html/draft-pot-prefer-push
1001
+ [4]: http://amundsen.com/media-types/collection/format/
1002
+ [5]: http://rwcbook.github.io/hal-forms/
1003
+ [6]: https://tools.ietf.org/html/rfc7807 "Problem Details for HTTP APIs"
1004
+ [7]: https://tools.ietf.org/html/draft-dalal-deprecation-header-03 "The
1005
+ Deprecation HTTP Header Field"