Coder Social home page Coder Social logo

prismic-client's Introduction

Net Glue Ltd

… is a small web design and development firm located in Devon, UK. We/I have been going for a pretty long time… Since around 2003.

Net Glue Ltd is mostly gsteel

There's not a huge volume of public repositories on this GitHub account - what is here, tends to be open source work relating to Laminas and Mezzio which tends to be the main frameworks and tools we use for making stuff. Also worth mentioning is the open source work we've written for working with the "Prismic" headless content management system.

If you'd like to get in touch, you can find contact details on our old and tired public website, but please bear in mind that our availablity is pretty scant at the moment.

prismic-client's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar gsteel avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

prismic-client's Issues

Always in Preview Mode due to Prismic Toolbar Tracking Cookies

At some point prismic started setting the preview cookie to a JSON payload containing a tracking identifier anywhere you have the toolbar installed.

This meant that there is a cookie set with a value similar to {"_tracker":"SomeUUID"} whether you are logged into the dashboard or not.

The Api::inPreview() method needs to be updated to ignore the presence of the preview cookie when it only contains tracking information

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Warning

Renovate failed to look up the following dependencies: Failed to look up packagist package psr/http-client-implementation.

Files affected: composer.json


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php ~8.1 || ~8.2 || ~8.3
  • laminas/laminas-escaper ^2.9
  • php-http/discovery ^1.18.0
  • psr/cache ^1.0.0 || ^2.0.0 || ^3.0.0
  • psr/http-client-implementation *
  • psr/http-client ^1.0
  • psr/http-factory ^1.0
  • psr/http-message ^1.0 || ^2.0
  • doctrine/coding-standard ^12.0
  • laminas/laminas-diactoros ^3.3.0
  • php-http/cache-plugin ^2.0.0
  • php-http/curl-client ^2.3.1
  • php-http/mock-client ^1.6
  • phpunit/phpunit ^10.5.9
  • psalm/plugin-phpunit ^0.19.0
  • squizlabs/php_codesniffer ^3.8.1
  • symfony/cache ^6.4.2 || ^7.0
  • vimeo/psalm ^5.20.0
github-actions
.github/workflows/continuous-integration.yml
  • actions/checkout v4.1.7
  • shivammathur/setup-php 2.31.1
  • ramsey/composer-install 3.0.0
  • codecov/codecov-action v4
  • actions/checkout v4.1.7
  • shivammathur/setup-php 2.31.1
  • ramsey/composer-install 3.0.0
.github/workflows/release-on-milestone-closed.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Prismic have changed the token expiry error again

As usual, a breaking change has been made by @prismicio - When a preview token expires, the error becomes a 404 and the JSON message body is completely different.

The body now looks like this:

{
  "type":"api_security_error",
  "message":"This preview token has expired",
  "oauth_initiate":"https://something.prismic.io/auth",
  "oauth_token":"https://something.prismic.io/auth/token"
}

The PreviewTokenExpired exception needs to be updated to take this into account.

Paginated Results are Unauthenticated

Attempting to retrieve the next or previous result set fails for repositories that require a token because the URIs provided in the current result set do not include the access_token parameter

Make Query safe to serialise?

It could be very useful for queries to be serialisable. We should be able to get rid of the UriFactory usage pretty easily, and as they are immutable, queries as configuration might yield benefits for consumers

"routers" parameter for queries

Apparently, you can provide a routers query parameter to the API and it will "resolve" urls for documents and links with this information on the server returning the urls in the payload.

This means that all types would possibly contain a top-level url property and url may also be present in links that have Document type.

The documentation is pretty scant:

… but it looks like you can provide router config during initialisation and then reuse the config for every request thereafter. I assume that the config will be included in the meta-data payload as default options for the forms property.

Currently, it looks like routers should be specified as a JSON array of objects, something like this:

let routers = [
    {
        "type": "my-type", // Name of document type
        "path": "/products/:range/:category/:uid", // Where ":category" is the UID of the linked category document and ":range" is the UID of the grandparent category.range document
        "resolvers": {
            "category": "parent-category", // Top-level content relationship to a "category" type where "parent-category" is the property name of "my-type"
            "range": "category.range" // "range" is a property of "category" in this example being a content-relationship to a range document.
        }
    },
    {
        "type": "blog-post",
        "path": "/:lang/blog/:uid" // :lang is the document locale ie 'en-gb'
    },
    // Not yet known whether other types/properties are feasible such as
    {
        "type": "whatever",
        "path": "/:id/:date-published/:tags" // <- Who knows?
    }
];

Deal with BC Break in the Prismic API

Ref: #366

A new field has been added to the shape of images in the response called edit - this breaks the client because it expects the edit field to be an image view or thumbnail.

A fix is already implemented, but this edit property needs to be dealt with properly and we need new fixtures and tests for it.

Investigate and implement the Custom Types API

Been waiting for this for ages, but looks like something is in beta at least:

Prismic Custom Types API

This will enable programatic CRUD of shared slices and document types and will be an invaluable development tool.

Initial thoughts:

  • Probably best implemented as a completely separate Client due to the fact that a specific token must be generated. Confusing the content api and a tool like this would be pretty crap
  • Being able to visually diff the local version and the remote version might be really handy - or, something that could be implemented in the cli tool
  • The cli tool is most likely target for consuming this feature…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.