Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • createJWS(content: string, identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }): Promise<JWSResponse>
  • Create a signed JWS string using specified identity. Content param must be a complete JSON string containing data to be used.

    Parameters

    • content: string

      JSON string to encrypt

    • identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }

      obj containing identity to use

      • did: string
      • didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...
      • keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[]

    Returns Promise<JWSResponse>

    Success or Failure Message Response and signed JWS string

  • createPost(skeleton: { body: string; canonicalUrl: string; description: string; geo: string; image: string; lang: string; politicalSubdivision: string; publishDate: number; reply: undefined | string; title: string }, identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }): Promise<DataResponse>
  • Assembles a Post object from a PostSkeleton.

    Parameters

    • skeleton: { body: string; canonicalUrl: string; description: string; geo: string; image: string; lang: string; politicalSubdivision: string; publishDate: number; reply: undefined | string; title: string }

      post skeleton object

      • body: string
      • canonicalUrl: string
      • description: string
      • geo: string
      • image: string
      • lang: string
      • politicalSubdivision: string
      • publishDate: number
      • reply: undefined | string
      • title: string
    • identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }

      obj containing identity to use

      • did: string
      • didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...
      • keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[]

    Returns Promise<DataResponse>

    Success or Failure Message Response with post as data

  • createUrlPost(url: string, identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }, filters?: false | { body: undefined | string[]; canonicalUrl: undefined | string[]; description: undefined | string[]; geo: undefined | string[]; image: undefined | string[]; lang: undefined | string[]; politicalSubdivision: undefined | string[]; publishDate: undefined | number[]; reply: undefined | string[]; title: undefined | string[] }): Promise<DataResponse>
  • Create a post object using the web page as its url. OG data is pulled and used to fill in the post information. Note: currently, no post body is retrieved.

    Parameters

    • url: string

      url of web page to pull og data from

    • identity: { did: string; didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...; keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[] }

      obj containing identity to use

      • did: string
      • didDoc: { "@context": ("https://www.w3.org/ns/did/v1" | "https://vpsqr.com/ns/did-psqr/v1")[]; id: string; psqr: { publicIdentity: { name: string; description?: string | undefined; image?: string | undefined; url?: string | undefined; tagline?: string | undefined; bio?: string | undefined; }; publicKeys: { ...; }[]; permiss...
      • keyPairs: { kid: string; private: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } & { d: string; }; public?: { x: string; y: string; crv: "P-384"; alg: "ES384"; kty: "EC"; kid: string; } | undefined; }[]
    • filters: false | { body: undefined | string[]; canonicalUrl: undefined | string[]; description: undefined | string[]; geo: undefined | string[]; image: undefined | string[]; lang: undefined | string[]; politicalSubdivision: undefined | string[]; publishDate: undefined | number[]; reply: undefined | string[]; title: undefined | string[] } = false

      object containing the filter lists

    Returns Promise<DataResponse>

    Response obj with post as data

  • Publish multiple posts asynchronously with a limit of 100 concurrent requests.

    Parameters

    • postData: JWSData[]

      array of objects containing the hash and the JWS

    • config: PutConfig

      base post config to change the hash of for each post

    • lgr: Function = ...

      optional logger function

    Returns Promise<ListResponse[]>

    Array of list responses for each post

  • putPost(jwsPost: { token: string }, config: PutConfig, lgr?: Function, ax?: false | AxiosInstance): Promise<ListResponse>
  • Publish Post data to specified Broadcaster(s). Data parameter must be the complete string that is to be sent to the Broadcaster.

    Parameters

    • jwsPost: { token: string }

      JwsPost obj to be published to broadcaster

      • token: string
    • config: PutConfig

      general request config including broadcaster(s)

    • lgr: Function = ...

      logger function to log activity

    • ax: false | AxiosInstance = false

      custom instance of axios to use instead of default

    Returns Promise<ListResponse>

    outcome of PUT request