Socket
Socket
Sign inDemoInstall

wpapi

Package Overview
Dependencies
37
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous13Next

1.0.2

Diff

Changelog

Source

v1.0.2 Recto Verso

  • Upgrade Superagent dependency to avoid "double callback" error when JSON response contains extraneous HTML content
  • Fix documentation inaccuracies following the merge of the REST API plugin into WordPress core

Patch release named for Paradis' 2016 LP "Recto Verso".

kadamwhite
published 1.0.1 •

Changelog

Source

v1.0.1 The Only Constant is Change

  • Support endpoints using "plain permalinks", props @luisherranz

This patch release is named for The Only Constant is Change, a track from v1.0 namesake album Emotional Technology by BT.

kadamwhite
published 1.0.0 •

Changelog

Source

v1.0.0 Emotional Technology

  • Add CHANGELOG.md
  • Reduce complexity of, and rename, default routes JSON file
  • BREAKING: Remove third "merge" argument from .param() method signature
  • Document .settings() top-level route handler
  • BREAKING: Return API error objects directly from HTTP transport: only return a transport-level error object in the event of a non-API error
  • Add .status() parameter method mixin
  • Properly register .password() and .sticky() parameter mixins
  • Utilize the HTTP transport methods during auto-discovery process
  • Replace lodash.reduce with custom objectReduce method throughout codebase to reduce browser bundle size

This release is named for BT's 2003 album Emotional Technology.

kadamwhite
published 1.0.0-rc.1 •

kadamwhite
published 0.12.1 •

Changelog

Source

v0.12.1 You Only Live Once -Instrumental-

This patch release fixes an issue where valid post type identifiers (or PCRE capture group names) are not properly intercepted and mapped to camelCase path part setters.

Props @gambry

kadamwhite
published 0.12.0 •

Changelog

Source

v0.12.0 You Only Live Once

This release makes breaking changes to how endpoint filtering methods are bound, specifically reacting to the removal of the ?filter query parameter which is not present in WordPress 4.7's API endpoints.

New filtering methods:

  • .categories()
  • .tags()

Both of these methods support querying by ID only. If a slug is provided it will not work in 4.7, due to the removal of filter, unless the rest-filter plugin is installed & active on the remote WordPress site.

Deprecated filtering methods:

  • .category() (for filtering by associated terms; use .tags())
  • .tag() (for filtering by associated terms; use .tags())

Note: these method names may be retained, but the functionality which delegates to .filter() to query by term slug will be removed.

Removed filtering methods:

  • .name(): use .slug() (deprecated previously)
  • .filter(): available as a mixin but no longer enabled by default
  • .path() (for Pages)

Props @joaojeronimo, @Ohar, @ryelle

This release is named for w.hatano's latest EP You Only Live Once

kadamwhite
published 0.11.0 •

Changelog

Source

v0.11.0 Super

The theme for v0.11 is better parameter handling. Several parameters are now supported that apply to all default content routes, and this release also features a complete overhaul of the handling for registering mixins and custom query parameter setters with .registerRoute().

Parameter convenience methods

.order(), .orderby(), .offset(), .exclude(), .include(), .page(), .perPage() and .slug() are now supported for all request handlers generated by this library, not just for some resources.

Setting Parameters on Custom Routes

The .param( name, val ) method is always available for custom route handler instances, but the convenience of .filter and other overloaded setters was not available to custom routes without some sleuthing through the code for this library (#203). To remedy this situation, a params array can now be provided on the registerRoute configuration object. If a method is available for a parameter (such as filter), it will be used; if no method exists, a setter for that property will be created:

site.handler = site.registerRoute( 'myplugin/v1', 'collection/(?P<id>)', {
    params: [
      // Listing any of the parameters with built-in handlers will
      // assign that built-in chaining method to the route handler:
      'filter',
      'author',
      // `.customparam()` will be created as well, as a shortcut
      // for `.param( 'customparam', val )
      'customparam'
    ]
});

Parameter convenience methods for Beta 14+ & beyond

If you are running the bleeding-edge develop branch of the API, there is now a .sticky( [boolean] ) method to support the new sticky posts handling recently added to the REST API.

If you are actually running the REST API plugin in the future, this library now also provides a .password() method for use in setting the password needed to access the content for a password-protected post. (The PR for adding that parameter should land later this week.)

This release is named for the Pet Shop Boys' latest album Super

Props @edygar, @ludoo0d0a, @marcianosr, @sdgluck, and @stephanmax, for issues, PRs, feedback & discussions.

kadamwhite
published 0.10.0 •

Changelog

Source

v0.10.0 Abaporu

v0.10 standardizes the name of the constructor exposed by this module as "WPAPI", and creates a seam through which HTTP interactions can be customized or overridden. This release is named for Brazilian DJ Gui Boratto's fourth studio album Abaporu (Kompakt, 2014).

Module Naming

The constructor exposed by this module should be referred to as WPAPI in all cases. This has been updated across the documentation site, source code, and examples within code comments.

There is remaining inconsistency throughout the docs & test suite between whether an instance of WPAPI is referred to as wp or as site; this will not be addressed at this time, the identifier used to hold the WP site client instance is left up to the library consumer.

Custom HTTP Transport Behavior

Custom HTTP transport methods may be provided to inject or short-circuit HTTP behavior for each type of request; methods may be specified via a .transport property on the configuration object passed to the WP constructor, or by passing an object of transport methods to the .transport() method on the instantiated WP object.

Props @edygar

kadamwhite
published 0.9.3 •

Changelog

Source

v0.9.3 Frontier Psychiatrist, 85% Instrumental

Built bundles in browser/ did not make it into previous publish!

kadamwhite
published 0.9.2 •

Changelog

Source

v0.9.2 Frontier Psychiatrist

  • Added .toString() method to WPRequest objects, which returns the full rendered URI for a query
  • Added .before and .after chaining methods to specify date queries
  • Improvements to integration tests & documentation

Deprecated Methods:

  • ._renderURI() method on WPRequest object (use .toString)
  • .post() HTTP method on WPRequest object (use .create)
  • .put() HTTP method on WPRequest object (use .update)

Props for this patch release:

Issues, Bugs, Documentation Requests & Discussion: @BenHen75, @brianloveswords, @gnarf, @ludoo0d0a, @nodeGarden, @preschian, @sdgluck, @tommedema, @vtripolitakis, @wblaircox, @z-avanes

I felt strangely hypnotized

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc