@evcraddock/slug-api 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openapi.js CHANGED
@@ -640,6 +640,7 @@ export const openApiDocument = {
640
640
  put: {
641
641
  operationId: "accounts.update",
642
642
  summary: "Update an account by ID",
643
+ description: "Changing the URL of an account referenced by following returns 409; other metadata remains editable.",
643
644
  security: [{ bearerAuth: [] }],
644
645
  parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer" } }],
645
646
  requestBody: {
@@ -661,18 +662,21 @@ export const openApiDocument = {
661
662
  },
662
663
  "401": authenticationErrorResponse,
663
664
  "404": notFoundErrorResponse,
665
+ "409": conflictErrorResponse,
664
666
  "422": validationErrorResponse,
665
667
  },
666
668
  },
667
669
  delete: {
668
670
  operationId: "accounts.delete",
669
671
  summary: "Delete an account by ID",
672
+ description: "Accounts referenced by following (including inactive records) cannot be deleted; returns 409.",
670
673
  security: [{ bearerAuth: [] }],
671
674
  parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer" } }],
672
675
  responses: {
673
676
  "204": { description: "Account deleted." },
674
677
  "401": authenticationErrorResponse,
675
678
  "404": notFoundErrorResponse,
679
+ "409": conflictErrorResponse,
676
680
  "422": validationErrorResponse,
677
681
  },
678
682
  },
@@ -818,6 +822,87 @@ export const openApiDocument = {
818
822
  },
819
823
  },
820
824
  },
825
+ "/following/{id}/activity": {
826
+ get: {
827
+ operationId: "following.activity.list",
828
+ summary: "Download buffered posts and boosts from one followed account",
829
+ description: "Non-consuming, actor-scoped delivery buffer of posts and boosts, without an opt-in filter. No read acknowledgment or deletion. Ordered by stable receipt sequence, not original publication time. Cursors survive deletion and remain usable when hasMore is false. Handle each item's kind; boosts distinguish sharing from original-author attribution. See docs/specs/12-incoming-activity.md for delivery and retry semantics.",
830
+ security: [{ bearerAuth: [] }],
831
+ parameters: [
832
+ { name: "id", in: "path", required: true, schema: { type: "integer", minimum: 1 } },
833
+ {
834
+ name: "limit",
835
+ in: "query",
836
+ required: false,
837
+ schema: { type: "integer", minimum: 1, maximum: 100, default: 50 },
838
+ },
839
+ {
840
+ name: "cursor",
841
+ in: "query",
842
+ required: false,
843
+ description: "Opaque continuation for this actor/following pair. Omit for the oldest available copy. Invalid/cross-scope cursors return 422.",
844
+ schema: { type: "string", minLength: 1, maxLength: 2048 },
845
+ },
846
+ ],
847
+ responses: {
848
+ "200": {
849
+ description: "Available copies at query time; concurrent explicit deletion may change later responses. Cache-Control: no-store.",
850
+ content: {
851
+ "application/json": { schema: { $ref: "#/components/schemas/IncomingActivityPage" } },
852
+ },
853
+ },
854
+ "401": authenticationErrorResponse,
855
+ "404": notFoundErrorResponse,
856
+ "422": validationErrorResponse,
857
+ "501": notImplementedErrorResponse,
858
+ },
859
+ },
860
+ delete: {
861
+ operationId: "following.activity.remove",
862
+ summary: "Remove selected buffered website copies",
863
+ description: "Atomic body removal in the selected followed account and configured actor only. Does not remove remote originals, owned publications or client bodies. Missing/already-removed/out-of-scope IDs are harmless; duplicates are coalesced. Retry identical requests after uncertain responses; removed may be zero. No read or persistence acknowledgment. Bodies are removed; minimal deduplication identities remain indefinitely.",
864
+ security: [{ bearerAuth: [] }],
865
+ parameters: [
866
+ { name: "id", in: "path", required: true, schema: { type: "integer", minimum: 1 } },
867
+ ],
868
+ requestBody: {
869
+ required: true,
870
+ description: "JSON payload, at most 16384 bytes. Validate the entire batch before changing anything.",
871
+ "x-max-body-bytes": 16384,
872
+ content: {
873
+ "application/json": {
874
+ schema: { $ref: "#/components/schemas/RemoveIncomingActivityRequest" },
875
+ example: { ids: ["b40eac11-4a38-44cc-a969-ecf2e7c4654b"] },
876
+ },
877
+ },
878
+ },
879
+ responses: {
880
+ "200": {
881
+ description: "Number of copies actually removed by this request; zero is a successful idempotent retry, not an error.",
882
+ content: {
883
+ "application/json": {
884
+ schema: { $ref: "#/components/schemas/RemoveIncomingActivityResponse" },
885
+ },
886
+ },
887
+ },
888
+ "401": authenticationErrorResponse,
889
+ "404": notFoundErrorResponse,
890
+ "413": {
891
+ description: "JSON payload exceeds 16384 bytes; no changes.",
892
+ content: {
893
+ "application/json": {
894
+ schema: { $ref: "#/components/schemas/PayloadTooLargeResponse" },
895
+ },
896
+ },
897
+ },
898
+ "422": validationErrorResponse,
899
+ "500": {
900
+ description: "Persistence failure rolls back the batch. A lost/uncertain transport response never establishes whether removal committed; retry the same IDs.",
901
+ },
902
+ "501": notImplementedErrorResponse,
903
+ },
904
+ },
905
+ },
821
906
  "/following/{id}/unfollow": {
822
907
  post: {
823
908
  operationId: "following.unfollow",
@@ -1579,7 +1664,7 @@ export const openApiDocument = {
1579
1664
  type: "object",
1580
1665
  required: [
1581
1666
  "id",
1582
- "contactId",
1667
+ "accountId",
1583
1668
  "profileUrl",
1584
1669
  "displayName",
1585
1670
  "handle",
@@ -1594,7 +1679,10 @@ export const openApiDocument = {
1594
1679
  ],
1595
1680
  properties: {
1596
1681
  id: { type: "integer" },
1597
- contactId: { type: "integer" },
1682
+ accountId: {
1683
+ type: "integer",
1684
+ description: "Followed contact-owned account ID. Resolve its ownerId through GET /accounts/{id} for contact attribution.",
1685
+ },
1598
1686
  profileUrl: { type: "string", format: "uri" },
1599
1687
  displayName: { type: "string" },
1600
1688
  handle: { type: "string" },
@@ -1611,6 +1699,226 @@ export const openApiDocument = {
1611
1699
  unfollowedAt: { type: ["string", "null"], format: "date-time" },
1612
1700
  },
1613
1701
  },
1702
+ IncomingPost: {
1703
+ type: "object",
1704
+ description: "Immutable first-delivery snapshot of a remote post, not an owned publication. Account/Contact attribution uses existing shapes. For posts, sharing and author attribution are equal. Remote content is untrusted; sanitize HTML before rendering. No attachment binaries are fetched.",
1705
+ required: [
1706
+ "id",
1707
+ "kind",
1708
+ "activityId",
1709
+ "objectId",
1710
+ "objectType",
1711
+ "url",
1712
+ "title",
1713
+ "contentHtml",
1714
+ "contentText",
1715
+ "publishedAt",
1716
+ "receivedAt",
1717
+ "sharingAccount",
1718
+ "sharingContact",
1719
+ "authorAccount",
1720
+ "authorContact",
1721
+ ],
1722
+ properties: {
1723
+ id: {
1724
+ type: "string",
1725
+ format: "uuid",
1726
+ description: "Opaque buffered-copy identity, not an activity or original-object ID. Treat as opaque and use only for this followed account.",
1727
+ },
1728
+ kind: { type: "string", const: "post" },
1729
+ activityId: { type: "string", format: "uri" },
1730
+ objectId: { type: "string", format: "uri" },
1731
+ objectType: { type: "string", enum: ["Note", "Article", "Page"] },
1732
+ url: { type: "string", format: "uri" },
1733
+ title: { type: ["string", "null"] },
1734
+ contentHtml: {
1735
+ type: "string",
1736
+ description: "Original remote HTML, untrusted and not sanitized. Clients must sanitize before rendering; never execute embedded scripts.",
1737
+ },
1738
+ contentText: {
1739
+ type: "string",
1740
+ description: "Plain-text derivative, not a trusted instruction or a substitute for the preserved HTML.",
1741
+ },
1742
+ publishedAt: { type: ["string", "null"], format: "date-time" },
1743
+ receivedAt: { type: "string", format: "date-time" },
1744
+ sharingAccount: { $ref: "#/components/schemas/Account" },
1745
+ sharingContact: { $ref: "#/components/schemas/Contact" },
1746
+ authorAccount: { $ref: "#/components/schemas/Account" },
1747
+ authorContact: { $ref: "#/components/schemas/Contact" },
1748
+ },
1749
+ },
1750
+ IncomingAuthorAccount: {
1751
+ description: "Original-author attribution using the existing Account shape. A unique saved contact account uses its real IDs; otherwise use an unsaved snapshot with null id/ownerType/ownerId and no persistent account/contact creation. Never pass a null ID to account-management routes.",
1752
+ oneOf: [
1753
+ { $ref: "#/components/schemas/Account" },
1754
+ {
1755
+ type: "object",
1756
+ required: [
1757
+ "id",
1758
+ "ownerType",
1759
+ "ownerId",
1760
+ "label",
1761
+ "url",
1762
+ "avatarUrl",
1763
+ "kind",
1764
+ "protocol",
1765
+ "isDefault",
1766
+ "sortOrder",
1767
+ ],
1768
+ properties: {
1769
+ id: { type: "null" },
1770
+ ownerType: { type: "null" },
1771
+ ownerId: { type: "null" },
1772
+ label: {
1773
+ type: "string",
1774
+ description: "Resolved original-author display name, or its URI if enrichment is unavailable.",
1775
+ },
1776
+ url: {
1777
+ type: "string",
1778
+ format: "uri",
1779
+ description: "Stable original-author actor URI from the canonical original.",
1780
+ },
1781
+ avatarUrl: { type: ["string", "null"], format: "uri" },
1782
+ kind: { type: "string", const: "social" },
1783
+ protocol: { type: "string", const: "activitypub" },
1784
+ isDefault: { type: "boolean", const: false },
1785
+ sortOrder: { type: "integer", const: 0 },
1786
+ },
1787
+ },
1788
+ ],
1789
+ },
1790
+ IncomingBoost: {
1791
+ type: "object",
1792
+ description: "One newly delivered boost of a remote post, including older originals. The followed sharing account is distinct from the original author. Resolve the referenced canonical original, not posting history. Distinct Announce activity IDs are distinct copies even for the same original; retries of an observed ID never resurrect a removed copy. Existing post payloads are unchanged.",
1793
+ required: [
1794
+ "id",
1795
+ "kind",
1796
+ "activityId",
1797
+ "objectId",
1798
+ "objectType",
1799
+ "url",
1800
+ "title",
1801
+ "contentHtml",
1802
+ "contentText",
1803
+ "publishedAt",
1804
+ "sharedAt",
1805
+ "receivedAt",
1806
+ "sharingAccount",
1807
+ "sharingContact",
1808
+ "authorAccount",
1809
+ "authorContact",
1810
+ ],
1811
+ properties: {
1812
+ id: {
1813
+ type: "string",
1814
+ format: "uuid",
1815
+ description: "Opaque buffered-copy identity; not the Announce or original-object ID.",
1816
+ },
1817
+ kind: { type: "string", const: "boost" },
1818
+ activityId: {
1819
+ type: "string",
1820
+ format: "uri",
1821
+ description: "Delivered Announce identity.",
1822
+ },
1823
+ objectId: {
1824
+ type: "string",
1825
+ format: "uri",
1826
+ description: "Canonical remote original-object identity, independent of this boost.",
1827
+ },
1828
+ objectType: { type: "string", enum: ["Note", "Article", "Page"] },
1829
+ url: { type: "string", format: "uri" },
1830
+ title: { type: ["string", "null"] },
1831
+ contentHtml: {
1832
+ type: "string",
1833
+ description: "Untrusted original HTML; sanitize before rendering and never execute embedded scripts.",
1834
+ },
1835
+ contentText: { type: "string" },
1836
+ publishedAt: {
1837
+ type: ["string", "null"],
1838
+ format: "date-time",
1839
+ description: "Original publication time, not the boost's age or receipt order.",
1840
+ },
1841
+ sharedAt: {
1842
+ type: ["string", "null"],
1843
+ format: "date-time",
1844
+ description: "Announce publication time, if supplied; not proof of receipt.",
1845
+ },
1846
+ receivedAt: { type: "string", format: "date-time" },
1847
+ sharingAccount: { $ref: "#/components/schemas/Account" },
1848
+ sharingContact: { $ref: "#/components/schemas/Contact" },
1849
+ authorAccount: { $ref: "#/components/schemas/IncomingAuthorAccount" },
1850
+ authorContact: {
1851
+ oneOf: [{ $ref: "#/components/schemas/Contact" }, { type: "null" }],
1852
+ description: "Frozen known Contact attribution, or null for an unsaved/ambiguous original author.",
1853
+ },
1854
+ },
1855
+ },
1856
+ IncomingActivityPage: {
1857
+ type: "object",
1858
+ required: ["data", "meta"],
1859
+ properties: {
1860
+ data: {
1861
+ type: "array",
1862
+ maxItems: 100,
1863
+ items: {
1864
+ oneOf: [
1865
+ { $ref: "#/components/schemas/IncomingPost" },
1866
+ { $ref: "#/components/schemas/IncomingBoost" },
1867
+ ],
1868
+ discriminator: {
1869
+ propertyName: "kind",
1870
+ mapping: {
1871
+ post: "#/components/schemas/IncomingPost",
1872
+ boost: "#/components/schemas/IncomingBoost",
1873
+ },
1874
+ },
1875
+ },
1876
+ },
1877
+ meta: {
1878
+ type: "object",
1879
+ required: ["nextCursor", "hasMore", "limit"],
1880
+ properties: {
1881
+ nextCursor: {
1882
+ type: "string",
1883
+ description: "Continuation after the last returned copy, or unchanged position for an empty page; usable for polling new arrivals. Advancing this cursor is a client choice, not proof of persistence.",
1884
+ },
1885
+ hasMore: {
1886
+ type: "boolean",
1887
+ description: "More copies were available at query time, not a guarantee against concurrent deletion.",
1888
+ },
1889
+ limit: { type: "integer", minimum: 1, maximum: 100 },
1890
+ },
1891
+ },
1892
+ },
1893
+ },
1894
+ RemoveIncomingActivityRequest: {
1895
+ type: "object",
1896
+ additionalProperties: false,
1897
+ required: ["ids"],
1898
+ properties: {
1899
+ ids: {
1900
+ type: "array",
1901
+ minItems: 1,
1902
+ maxItems: 100,
1903
+ items: {
1904
+ type: "string",
1905
+ format: "uuid",
1906
+ pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
1907
+ },
1908
+ },
1909
+ },
1910
+ },
1911
+ RemoveIncomingActivityResponse: {
1912
+ type: "object",
1913
+ required: ["data"],
1914
+ properties: {
1915
+ data: {
1916
+ type: "object",
1917
+ required: ["removed"],
1918
+ properties: { removed: { type: "integer", minimum: 0, maximum: 100 } },
1919
+ },
1920
+ },
1921
+ },
1614
1922
  FollowingResponse: {
1615
1923
  type: "object",
1616
1924
  required: ["data"],