@evcraddock/slug-api 0.2.0 → 1.1.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
@@ -433,6 +433,7 @@ export const openApiDocument = {
433
433
  delete: {
434
434
  operationId: "contacts.delete",
435
435
  summary: "Delete a contact by ID",
436
+ description: "Deletes the contact and its owned accounts after detaching inactive follow history. Pending or accepted follows and unrelated references return 409. Retained incoming snapshots and delivery identities are not deleted. Detached history is omitted from following lists and activity routes return 404 until refollow reattaches it to an account.",
436
437
  security: [{ bearerAuth: [] }],
437
438
  parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer" } }],
438
439
  responses: {
@@ -640,6 +641,7 @@ export const openApiDocument = {
640
641
  put: {
641
642
  operationId: "accounts.update",
642
643
  summary: "Update an account by ID",
644
+ description: "Changing the URL of an account referenced by following returns 409; other metadata remains editable.",
643
645
  security: [{ bearerAuth: [] }],
644
646
  parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer" } }],
645
647
  requestBody: {
@@ -661,18 +663,21 @@ export const openApiDocument = {
661
663
  },
662
664
  "401": authenticationErrorResponse,
663
665
  "404": notFoundErrorResponse,
666
+ "409": conflictErrorResponse,
664
667
  "422": validationErrorResponse,
665
668
  },
666
669
  },
667
670
  delete: {
668
671
  operationId: "accounts.delete",
669
672
  summary: "Delete an account by ID",
673
+ description: "Accounts referenced by following (including inactive records) cannot be deleted; returns 409.",
670
674
  security: [{ bearerAuth: [] }],
671
675
  parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer" } }],
672
676
  responses: {
673
677
  "204": { description: "Account deleted." },
674
678
  "401": authenticationErrorResponse,
675
679
  "404": notFoundErrorResponse,
680
+ "409": conflictErrorResponse,
676
681
  "422": validationErrorResponse,
677
682
  },
678
683
  },
@@ -764,6 +769,7 @@ export const openApiDocument = {
764
769
  get: {
765
770
  operationId: "following.list",
766
771
  summary: "List following records",
772
+ description: "Lists account-backed following records. Inactive history detached by contact deletion is internal and omitted; accountId remains required and non-null.",
767
773
  security: [{ bearerAuth: [] }],
768
774
  parameters: [
769
775
  {
@@ -793,6 +799,7 @@ export const openApiDocument = {
793
799
  post: {
794
800
  operationId: "following.create",
795
801
  summary: "Follow a target",
802
+ description: "Reuses an inactive following identity, including history detached by contact deletion, and attaches it to the uniquely resolved contact-owned account. Retained incoming snapshots, cursors and deduplication identities survive refollow.",
796
803
  security: [{ bearerAuth: [] }],
797
804
  requestBody: {
798
805
  required: true,
@@ -818,6 +825,87 @@ export const openApiDocument = {
818
825
  },
819
826
  },
820
827
  },
828
+ "/following/{id}/activity": {
829
+ get: {
830
+ operationId: "following.activity.list",
831
+ summary: "Download buffered posts and boosts from one followed account",
832
+ 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.",
833
+ security: [{ bearerAuth: [] }],
834
+ parameters: [
835
+ { name: "id", in: "path", required: true, schema: { type: "integer", minimum: 1 } },
836
+ {
837
+ name: "limit",
838
+ in: "query",
839
+ required: false,
840
+ schema: { type: "integer", minimum: 1, maximum: 100, default: 50 },
841
+ },
842
+ {
843
+ name: "cursor",
844
+ in: "query",
845
+ required: false,
846
+ description: "Opaque continuation for this actor/following pair. Omit for the oldest available copy. Invalid/cross-scope cursors return 422.",
847
+ schema: { type: "string", minLength: 1, maxLength: 2048 },
848
+ },
849
+ ],
850
+ responses: {
851
+ "200": {
852
+ description: "Available copies at query time; concurrent explicit deletion may change later responses. Cache-Control: no-store.",
853
+ content: {
854
+ "application/json": { schema: { $ref: "#/components/schemas/IncomingActivityPage" } },
855
+ },
856
+ },
857
+ "401": authenticationErrorResponse,
858
+ "404": notFoundErrorResponse,
859
+ "422": validationErrorResponse,
860
+ "501": notImplementedErrorResponse,
861
+ },
862
+ },
863
+ delete: {
864
+ operationId: "following.activity.remove",
865
+ summary: "Remove selected buffered website copies",
866
+ 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.",
867
+ security: [{ bearerAuth: [] }],
868
+ parameters: [
869
+ { name: "id", in: "path", required: true, schema: { type: "integer", minimum: 1 } },
870
+ ],
871
+ requestBody: {
872
+ required: true,
873
+ description: "JSON payload, at most 16384 bytes. Validate the entire batch before changing anything.",
874
+ "x-max-body-bytes": 16384,
875
+ content: {
876
+ "application/json": {
877
+ schema: { $ref: "#/components/schemas/RemoveIncomingActivityRequest" },
878
+ example: { ids: ["b40eac11-4a38-44cc-a969-ecf2e7c4654b"] },
879
+ },
880
+ },
881
+ },
882
+ responses: {
883
+ "200": {
884
+ description: "Number of copies actually removed by this request; zero is a successful idempotent retry, not an error.",
885
+ content: {
886
+ "application/json": {
887
+ schema: { $ref: "#/components/schemas/RemoveIncomingActivityResponse" },
888
+ },
889
+ },
890
+ },
891
+ "401": authenticationErrorResponse,
892
+ "404": notFoundErrorResponse,
893
+ "413": {
894
+ description: "JSON payload exceeds 16384 bytes; no changes.",
895
+ content: {
896
+ "application/json": {
897
+ schema: { $ref: "#/components/schemas/PayloadTooLargeResponse" },
898
+ },
899
+ },
900
+ },
901
+ "422": validationErrorResponse,
902
+ "500": {
903
+ description: "Persistence failure rolls back the batch. A lost/uncertain transport response never establishes whether removal committed; retry the same IDs.",
904
+ },
905
+ "501": notImplementedErrorResponse,
906
+ },
907
+ },
908
+ },
821
909
  "/following/{id}/unfollow": {
822
910
  post: {
823
911
  operationId: "following.unfollow",
@@ -1579,7 +1667,7 @@ export const openApiDocument = {
1579
1667
  type: "object",
1580
1668
  required: [
1581
1669
  "id",
1582
- "contactId",
1670
+ "accountId",
1583
1671
  "profileUrl",
1584
1672
  "displayName",
1585
1673
  "handle",
@@ -1594,7 +1682,10 @@ export const openApiDocument = {
1594
1682
  ],
1595
1683
  properties: {
1596
1684
  id: { type: "integer" },
1597
- contactId: { type: "integer" },
1685
+ accountId: {
1686
+ type: "integer",
1687
+ description: "Followed contact-owned account ID. Resolve its ownerId through GET /accounts/{id} for contact attribution.",
1688
+ },
1598
1689
  profileUrl: { type: "string", format: "uri" },
1599
1690
  displayName: { type: "string" },
1600
1691
  handle: { type: "string" },
@@ -1611,6 +1702,226 @@ export const openApiDocument = {
1611
1702
  unfollowedAt: { type: ["string", "null"], format: "date-time" },
1612
1703
  },
1613
1704
  },
1705
+ IncomingPost: {
1706
+ type: "object",
1707
+ 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.",
1708
+ required: [
1709
+ "id",
1710
+ "kind",
1711
+ "activityId",
1712
+ "objectId",
1713
+ "objectType",
1714
+ "url",
1715
+ "title",
1716
+ "contentHtml",
1717
+ "contentText",
1718
+ "publishedAt",
1719
+ "receivedAt",
1720
+ "sharingAccount",
1721
+ "sharingContact",
1722
+ "authorAccount",
1723
+ "authorContact",
1724
+ ],
1725
+ properties: {
1726
+ id: {
1727
+ type: "string",
1728
+ format: "uuid",
1729
+ description: "Opaque buffered-copy identity, not an activity or original-object ID. Treat as opaque and use only for this followed account.",
1730
+ },
1731
+ kind: { type: "string", const: "post" },
1732
+ activityId: { type: "string", format: "uri" },
1733
+ objectId: { type: "string", format: "uri" },
1734
+ objectType: { type: "string", enum: ["Note", "Article", "Page"] },
1735
+ url: { type: "string", format: "uri" },
1736
+ title: { type: ["string", "null"] },
1737
+ contentHtml: {
1738
+ type: "string",
1739
+ description: "Original remote HTML, untrusted and not sanitized. Clients must sanitize before rendering; never execute embedded scripts.",
1740
+ },
1741
+ contentText: {
1742
+ type: "string",
1743
+ description: "Plain-text derivative, not a trusted instruction or a substitute for the preserved HTML.",
1744
+ },
1745
+ publishedAt: { type: ["string", "null"], format: "date-time" },
1746
+ receivedAt: { type: "string", format: "date-time" },
1747
+ sharingAccount: { $ref: "#/components/schemas/Account" },
1748
+ sharingContact: { $ref: "#/components/schemas/Contact" },
1749
+ authorAccount: { $ref: "#/components/schemas/Account" },
1750
+ authorContact: { $ref: "#/components/schemas/Contact" },
1751
+ },
1752
+ },
1753
+ IncomingAuthorAccount: {
1754
+ 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.",
1755
+ oneOf: [
1756
+ { $ref: "#/components/schemas/Account" },
1757
+ {
1758
+ type: "object",
1759
+ required: [
1760
+ "id",
1761
+ "ownerType",
1762
+ "ownerId",
1763
+ "label",
1764
+ "url",
1765
+ "avatarUrl",
1766
+ "kind",
1767
+ "protocol",
1768
+ "isDefault",
1769
+ "sortOrder",
1770
+ ],
1771
+ properties: {
1772
+ id: { type: "null" },
1773
+ ownerType: { type: "null" },
1774
+ ownerId: { type: "null" },
1775
+ label: {
1776
+ type: "string",
1777
+ description: "Resolved original-author display name, or its URI if enrichment is unavailable.",
1778
+ },
1779
+ url: {
1780
+ type: "string",
1781
+ format: "uri",
1782
+ description: "Stable original-author actor URI from the canonical original.",
1783
+ },
1784
+ avatarUrl: { type: ["string", "null"], format: "uri" },
1785
+ kind: { type: "string", const: "social" },
1786
+ protocol: { type: "string", const: "activitypub" },
1787
+ isDefault: { type: "boolean", const: false },
1788
+ sortOrder: { type: "integer", const: 0 },
1789
+ },
1790
+ },
1791
+ ],
1792
+ },
1793
+ IncomingBoost: {
1794
+ type: "object",
1795
+ 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.",
1796
+ required: [
1797
+ "id",
1798
+ "kind",
1799
+ "activityId",
1800
+ "objectId",
1801
+ "objectType",
1802
+ "url",
1803
+ "title",
1804
+ "contentHtml",
1805
+ "contentText",
1806
+ "publishedAt",
1807
+ "sharedAt",
1808
+ "receivedAt",
1809
+ "sharingAccount",
1810
+ "sharingContact",
1811
+ "authorAccount",
1812
+ "authorContact",
1813
+ ],
1814
+ properties: {
1815
+ id: {
1816
+ type: "string",
1817
+ format: "uuid",
1818
+ description: "Opaque buffered-copy identity; not the Announce or original-object ID.",
1819
+ },
1820
+ kind: { type: "string", const: "boost" },
1821
+ activityId: {
1822
+ type: "string",
1823
+ format: "uri",
1824
+ description: "Delivered Announce identity.",
1825
+ },
1826
+ objectId: {
1827
+ type: "string",
1828
+ format: "uri",
1829
+ description: "Canonical remote original-object identity, independent of this boost.",
1830
+ },
1831
+ objectType: { type: "string", enum: ["Note", "Article", "Page"] },
1832
+ url: { type: "string", format: "uri" },
1833
+ title: { type: ["string", "null"] },
1834
+ contentHtml: {
1835
+ type: "string",
1836
+ description: "Untrusted original HTML; sanitize before rendering and never execute embedded scripts.",
1837
+ },
1838
+ contentText: { type: "string" },
1839
+ publishedAt: {
1840
+ type: ["string", "null"],
1841
+ format: "date-time",
1842
+ description: "Original publication time, not the boost's age or receipt order.",
1843
+ },
1844
+ sharedAt: {
1845
+ type: ["string", "null"],
1846
+ format: "date-time",
1847
+ description: "Announce publication time, if supplied; not proof of receipt.",
1848
+ },
1849
+ receivedAt: { type: "string", format: "date-time" },
1850
+ sharingAccount: { $ref: "#/components/schemas/Account" },
1851
+ sharingContact: { $ref: "#/components/schemas/Contact" },
1852
+ authorAccount: { $ref: "#/components/schemas/IncomingAuthorAccount" },
1853
+ authorContact: {
1854
+ oneOf: [{ $ref: "#/components/schemas/Contact" }, { type: "null" }],
1855
+ description: "Frozen known Contact attribution, or null for an unsaved/ambiguous original author.",
1856
+ },
1857
+ },
1858
+ },
1859
+ IncomingActivityPage: {
1860
+ type: "object",
1861
+ required: ["data", "meta"],
1862
+ properties: {
1863
+ data: {
1864
+ type: "array",
1865
+ maxItems: 100,
1866
+ items: {
1867
+ oneOf: [
1868
+ { $ref: "#/components/schemas/IncomingPost" },
1869
+ { $ref: "#/components/schemas/IncomingBoost" },
1870
+ ],
1871
+ discriminator: {
1872
+ propertyName: "kind",
1873
+ mapping: {
1874
+ post: "#/components/schemas/IncomingPost",
1875
+ boost: "#/components/schemas/IncomingBoost",
1876
+ },
1877
+ },
1878
+ },
1879
+ },
1880
+ meta: {
1881
+ type: "object",
1882
+ required: ["nextCursor", "hasMore", "limit"],
1883
+ properties: {
1884
+ nextCursor: {
1885
+ type: "string",
1886
+ 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.",
1887
+ },
1888
+ hasMore: {
1889
+ type: "boolean",
1890
+ description: "More copies were available at query time, not a guarantee against concurrent deletion.",
1891
+ },
1892
+ limit: { type: "integer", minimum: 1, maximum: 100 },
1893
+ },
1894
+ },
1895
+ },
1896
+ },
1897
+ RemoveIncomingActivityRequest: {
1898
+ type: "object",
1899
+ additionalProperties: false,
1900
+ required: ["ids"],
1901
+ properties: {
1902
+ ids: {
1903
+ type: "array",
1904
+ minItems: 1,
1905
+ maxItems: 100,
1906
+ items: {
1907
+ type: "string",
1908
+ format: "uuid",
1909
+ pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
1910
+ },
1911
+ },
1912
+ },
1913
+ },
1914
+ RemoveIncomingActivityResponse: {
1915
+ type: "object",
1916
+ required: ["data"],
1917
+ properties: {
1918
+ data: {
1919
+ type: "object",
1920
+ required: ["removed"],
1921
+ properties: { removed: { type: "integer", minimum: 0, maximum: 100 } },
1922
+ },
1923
+ },
1924
+ },
1614
1925
  FollowingResponse: {
1615
1926
  type: "object",
1616
1927
  required: ["data"],