Skip to content

Commit

Permalink
✨ Add Media Uploads model
Browse files Browse the repository at this point in the history
Add model properties for media uploads.

Test plan: Expect to see media upload properties in the development environment.
  • Loading branch information
MeganSteenkamp committed Oct 6, 2023
1 parent 9fef94d commit 3ab015a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/Properties.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="my-6">
<ul
role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5"
>
<slot />
</ul>
</div>
31 changes: 31 additions & 0 deletions src/components/Property.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

---
const { name, type } = Astro.props;
const customDataTypes = ['timestamp', 'bignumber', 'monetary', 'crn', 'location', 'phonenumber'];
const formattedType = type.toLowerCase();
const isLink = customDataTypes.includes(formattedType);
---

<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">
Name
</dt>
<dd>
<code>{ name }</code>
</dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">
{isLink ?
<a href={'/api/data-types#' + formattedType}>{formattedType}</a> :
<span>{formattedType}</span>
}
</dd>
<dt class="sr-only">
Description
</dt>
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
<slot />
</dd>
</dl>
</li>
46 changes: 46 additions & 0 deletions src/content/api/media-uploads.mdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Media Uploads
description: Media Uploads API Reference
draft: true
nav:
path: API
order: 7
---

## Model

### Properties

{% properties %}
{% property name="id" type="string" %}
The Media Upload's unique identifier.
{% /property %}

{% property name="accountId" type="string" %}
The Media Upload's owning Centrapay Account id.
{% /property %}

{% property name="mimeType" type="string" %}
The media (MIME) type of the upload.
{% /property %}

{% property name="fileName" type="string" %}
The file name of the upload.
{% /property %}

{% property name="createdAt" type="timestamp" %}
When the Media Upload was created.
{% /property %}

{% property name="createdBy" type="crn" %}
The User or API Key that created the Media Upload.
{% /property %}

{% property name="updatedAt" type="timestamp" %}
When the Media Upload was updated.
{% /property %}

{% property name="updatedBy" type="crn" %}
The User or API Key that updated the Media Upload.
{% /property %}
{% /properties %}

0 comments on commit 3ab015a

Please sign in to comment.