Skip to content

Instantly share code, notes, and snippets.

View mamund's full-sized avatar

Mike Amundsen mamund

View GitHub Profile

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Add Events

Place the events on the proper line in the table

  • Cart.ItemAdded
  • Cart.ItemRemoved

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Add Resources

Place the resource(s) on the proper line in the table below

  • Book (two lines)
  • CartItem, Cart (two lines)

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Complete Shopping Profile

Operation Name Description Participants Resource(s) Emitted Events Operation Details Traits
listBooks() List books by category or release date Customer, Call Center Book Books.Listed Request Parameters: categoryId, releaseDate Returns: Books[] read

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Add Operations

Place these operations on the proper lines in the table below.

  • viewCart()
  • clearCart()
@mamund
mamund / person-uber.html
Last active May 28, 2021 07:41
an UBER representation (and resulting HTML document) that uses transclusions
<html>
<head>
<title>Person</title>
<link rel="related" href="http://example.org/uber/person-uber.xml" />
</head>
<body>
<dl>
<dt>NAME:</dt>
<dd>Mike Amundsen</dd>
<dt>PHOTO:</dt>
@mamund
mamund / suggest-working.md
Last active March 12, 2021 03:39
Working Skeleton for HAL-FORMS SUGGEST control

Below is an updated workinging model for HAL-FORMS options control. See notes below for details. Comments welcome.

{
  "_templates" : {
    "default" : {
      ...
      "properties" : [
        {
 "name" : "...", 
<alps version="1.0">
<link rel="help" href="http://example.org/documentation/products.html" />
<doc>
This is a prototype product API.
</doc>
<!-- transitions -->
<descriptor id="item" type="safe" rt="#product">
<doc>Retrieve A Single Product</doc>
</descriptor>
@mamund
mamund / def-sample.xml
Last active August 17, 2020 21:49
ALPS document w/ various examples of the `def` element
<alps>
<doc>Sample Service</doc>
<!-- properties -->
<descriptor id="identifier" def="https://schema.org/identifier" />
<descriptor id="givenName" def="https://schema.org/givenName" />
<descriptor id="familyName" def="https://schema.org/familyName" />
<descriptor id="status" def="https://schema.org/status" />
<descriptor id="dateCreated" def="https://schema.org/dateCreated" />
<descriptor id="dateModified" def="https://schema.org/dateModified" />
@mamund
mamund / api-design-example.xml
Last active August 17, 2020 21:19
API Design Example
<alps>
<doc>Simple Banking Example</doc>
<!-- actions -->
<descriptor id="getList" type="safe" />
<descriptor id="getStatus" type="safe" />
<descriptor id="updateStatus" type="idempotent">
<descriptor href="#accountId" />
<descriptor href="#actionStatus" />
</descriptor>
<descriptor id="updatePreferences" type="idempotent">
@mamund
mamund / 2020-01-23b.js
Last active January 24, 2020 13:56
self-describing messages
/*
who does it better?
*/
// this
{
"rel" : "http://example.org/vocabularies/customer-communiations#customers/update-name-and-sms"
"href" : "http://example.org/customers/123"
"type" : "..."
}