Skip to main content

Module shared

Module shared 

Source
Expand description

Primitives shared across the AWS Support handlers: id synthesis, the submitter identity, and ISO-8601 timestamps. Kept in one place so the create / describe paths cannot diverge on wire format.

Functions§

current_year
The current UTC year, used in the case-{account}-{year}-{hex} case id.
display_id
A 10-digit numeric displayId derived from the case id so it round-trips.
hash_str
FNV-1a hash for deterministic synthesis of ids from a seed so a given resource’s derived value is stable across reads and restarts.
hex32
A fresh 32-hex-character random id (used for the case-id tail).
iso_now
Current time as an ISO-8601 UTC string with millisecond precision, e.g. 2013-08-23T20:10:32.000Z. The Support TimeCreated / ExpiryTime shapes carry no @timestampFormat, and the live service returns ISO-8601 strings.
new_attachment_id
A fresh attachment id (attachment-{32 hex}).
new_attachment_set_id
A fresh attachment-set id (as-{32 hex}), matching the live service’s opaque token shape.
new_case_id
AWS-shaped Support case id: case-{account}-{year}-{16 hex}.
str_member
Read a string member from a request body.