Options
All
  • Public
  • Public/Protected
  • All
Menu

Privacy is used to set the privacy mode of an item. By default, items are public, meaning world-readable but not listed in any public Graphistry catalogs.

Setting the privacy, by default, makes it private to the user. No notifications are made.

Various options allow sharing with the organization, sharing with specific users, and sending notifications. When sharing with others, view or edit permissions may be given.

See all convenience method Dataset.privacy




example

Set a dataset to private

import { Privacy } from '@graphistry/node-api';
await (new Privacy('myDatasetID')).upload(client);

example

Set a dataset to public

import { Privacy } from '@graphistry/node-api';
await (new Privacy('myDatasetID', 'public')).upload(client);

example

Set a dataset to private, and share it with one user with a notification

import { Privacy } from '@graphistry/node-api';
await (new Privacy(
'myDatasetID', undefined, undefined, undefined,
['friend@company.com'], true, "Check out my great viz!"
)).upload(client);

Hierarchy

  • Privacy

Index

Constructors

  • new Privacy(id: string, kind?: "dataset", mode?: Mode, modeAction?: ModeAction, invitedUsers?: string[], notify?: boolean, message?: string): Privacy
  • See examples at top of file

    Create sharing configuration in preperation for uploading.

    Parameters

    • id: string

      The id of the item to set privacy on

    • Optional kind: "dataset"

      The kind of item to set privacy on, defaults to 'dataset'

    • Optional mode: Mode

      The privacy mode, 'private', 'public', or 'organization'

    • Optional modeAction: ModeAction

      The action to allow, 'view', 'edit', or 'share'

    • Optional invitedUsers: string[]

      The list of Graphistry user emails to share with

    • Optional notify: boolean

      Whether to send notifications to the invited users

    • Optional message: string

      The message to send to the invited users

    Returns Privacy

Properties

id: string
invitedUsers: string[]
kind: "dataset"
message: string
mode: Mode
modeAction: ModeActionRaw
notify: boolean

Methods

  • upload(client: ClientType): Promise<Privacy>
  • See examples at top of file

    Upload the privacy configuration to the server for an item

    throws

    Error if the client is not configured

    throws

    Error if the upload fails

    Parameters

    • client: ClientType

      The client to use to upload the privacy

    Returns Promise<Privacy>

    The privacy object