Skip to content
pi-c Artifact [4b0f38f24c]
Login

Artifact [4b0f38f24c]

Artifact 4b0f38f24cc44a54a93b5933d7dc2433d776a94429dc37a57f226b4e73fe7665:


/* /share to the HTML artifact publisher (share.c): the conversation's HTML page goes to the
 * publisher's HTTP API (POST /api/artifacts) under a token sealed in the credential store as
 * "artifacts" (pic login artifacts) or read from HTML_PUBLISHER_TOKEN, at the address the setting
 * artifactsUrl names. A page over 256 KB goes up as a blob first, as the publisher's own client
 * does. Used by the terminal interface's /share, after the yes. */
#ifndef PIC_SHARE_H
#define PIC_SHARE_H

#include <stddef.h>

#define PIC_SHARE_CRED "artifacts" /* the credential name */

/* Where /share goes now: 1 the artifact publisher, 0 the secret gist. sessionShareDestination
 * gist is 0, artifacts is 1 (even when it is not set up: the share then says what is missing);
 * auto (the default) is 1 only when a token is stored (or HTML_PUBLISHER_TOKEN is set) and
 * artifactsUrl is set. */
int pic_share_artifacts(void);

/* Publishes HTML (N bytes) and puts the viewer link in URL. 0, or -1 with the cause in ERR (never
 * the token). */
int pic_share_publish(const char *html, size_t n, char *url, size_t urlcap, char *err, size_t errcap);

#endif