Skip to content

Commit

Permalink
Ready readme and changelog for initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteel committed Sep 1, 2021
1 parent e4f6aea commit f40c924
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 0.1.0 - TBD
## 0.1.0 - 2021-09-01

### Added

- Nothing.
- Everything.

### Changed

Expand Down
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHP Template Repository
# Prismic Document Type API Client

[![Build Status](https://github.com/netglue/prismic-doctype-client/workflows/Continuous%20Integration/badge.svg)](https://github.com/netglue/prismic-doctype-client/actions?query=workflow%3A"Continuous+Integration")

Expand All @@ -10,11 +10,53 @@

## Introduction

This is a template repo.
This library provides an API client so that you can read and write your document type definitions using the [Prismic Custom Types API](https://prismic.io/docs/technologies/custom-types-api).

Currently, you can list, read, insert and update document types.

The client requires that you make use of _(And similarly, it returns instances of)_ the shipped `Definition` value object.

Typically, you wouldn't interact with the client directly, but as part of a build process that takes care of all that stuff for you. This client is quite fresh, but it's primary use will soon be part of [`netglue/prismic-cli`](https://github.com/netglue/prismic-cli), so that it will become trivial to synchronise your local development document definitions with those in your production Prismic repository _(and vice-versa)_.

## Installation

This is a template repo.
The only supported installation method is via composer:

```shell
composer require --dev netglue/prismic-doctype-client
```

## Configuration

The client has been designed to work with whatever [PSR-18 HTTP Client](https://packagist.org/providers/psr/http-client-implementation) and [PSR-7 and PSR-17 implementations](https://packagist.org/providers/psr/http-factory-implementation) that you like to use. Once you have got hold of an API token for the custom types API, you can create a client with:

```php
<?php
use Prismic\DocumentType\BaseClient;

$client = new BaseClient(
'some-token',
'my-repository-name',
$httpClient, // \Psr\Http\Client\ClientInterface
$requestFactory, // \Psr\Http\Message\RequestFactoryInterface
$uriFactory, // \Psr\Http\Message\UriFactoryInterface
$streamFactory // \Psr\Http\Message\StreamFactoryInterface
)
```

## Limitations/Roadmap

### Authentication

Currently, authentication is only possible with a [permanent access token](https://prismic.io/docs/technologies/custom-types-api#permanent-token-recommended) that you create/retrieve from the Prismic repository settings. Session based tokens are not supported.

### Slices

CRUD operations on shared slices are not yet implemented but are planned for future development. If you really want this feature, you're welcome to contribute.

## Contributing

Please feel free to get involved with development. The project uses PHPUnit for tests, [Psalm](https://psalm.dev) for static analysis and [Infection](https://infection.github.io) for mutation testing. CI should have your back if you want to submit a feature or fix ;)

## License

Expand Down

0 comments on commit f40c924

Please sign in to comment.