@basetime/a2w-api-ts
Advanced tools
Comparing version 0.1.12 to 0.1.13
@@ -240,2 +240,13 @@ "use strict"; | ||
/** | ||
* Returns a template by ID. | ||
* | ||
* @param id The ID of the template. | ||
*/ | ||
getById = async (id) => { | ||
const url = `${_TemplatesEndpoint.endpoint}/simple/${id}`; | ||
return await this.req.fetch(url, { | ||
method: "GET" | ||
}); | ||
}; | ||
/** | ||
* Returns all of the templates for authenticated organization. | ||
@@ -242,0 +253,0 @@ * |
@@ -206,2 +206,13 @@ // src/Endpoint.ts | ||
/** | ||
* Returns a template by ID. | ||
* | ||
* @param id The ID of the template. | ||
*/ | ||
getById = async (id) => { | ||
const url = `${_TemplatesEndpoint.endpoint}/simple/${id}`; | ||
return await this.req.fetch(url, { | ||
method: "GET" | ||
}); | ||
}; | ||
/** | ||
* Returns all of the templates for authenticated organization. | ||
@@ -208,0 +219,0 @@ * |
@@ -13,2 +13,8 @@ import { Template } from 'passkit-generator/lib/schemas'; | ||
/** | ||
* Returns a template by ID. | ||
* | ||
* @param id The ID of the template. | ||
*/ | ||
getById: (id: string) => Promise<TemplateThumbnail>; | ||
/** | ||
* Returns all of the templates for authenticated organization. | ||
@@ -15,0 +21,0 @@ * |
{ | ||
"name": "@basetime/a2w-api-ts", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Client library that communicates with the addtowallet API.", |
@@ -11,2 +11,3 @@ # AddToWallet Typescript Client | ||
- [Creating a new client with oauth](#creating-a-new-client-with-oauth) | ||
- [Fetching a template by ID](#fetching-a-template-by-id) | ||
- [Fetching templates by tag](#fetching-templates-by-tag) | ||
@@ -64,2 +65,9 @@ - [Fetching a pass](#fetching-a-pass) | ||
### Fetching a template by ID | ||
```ts | ||
const template = await client.templates.getById('id'); | ||
console.log(template); | ||
``` | ||
### Fetching templates by tag | ||
@@ -66,0 +74,0 @@ |
Sorry, the diff of this file is not supported yet
105617
2912
115