@pbvision/partner-sdk 0.1.10 → 0.1.11

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.
Files changed (3) hide show
  1. package/README.md +13 -1
  2. package/package.json +1 -1
  3. package/src/index.js +22 -0
package/README.md CHANGED
@@ -12,6 +12,7 @@ standard length game, so we'll notify your servers when the results are ready.
12
12
  - [Send Videos](#send-videos)
13
13
  - [Option 1: PBV downloads your video from a URL](#option-1-pbv-downloads-your-video-from-a-url)
14
14
  - [Option 2: Upload your video](#option-2-upload-your-video)
15
+ - [Video Editors](#video-editors)
15
16
  - [After Video Processing is Done](#after-video-processing-is-done)
16
17
  - [Callback Data](#callback-data)
17
18
  - [Video Guidelines](#video-guidelines)
@@ -117,10 +118,21 @@ const optionalMetadata = {
117
118
  await pbv.uploadVideo(YOUR_VIDEO_FILENAME, optionalMetadata);
118
119
  ```
119
120
 
121
+ ### Video Editors
122
+
123
+ Editors can tag themselves and friends in the video. They also have access to
124
+ the video even if the video is private (to make uploaded by your partner
125
+ account private by default, please email us).
126
+
127
+ You can get the current list of editors on a video by using the `getVideoEditors()`
128
+ method. Similarly, the `setVideoEditors()` method can be used to change the
129
+ email addresses which have editor access on your video.
130
+
120
131
  ## After Video Processing is Done
121
132
 
122
133
  When our AI is done processing your video, we will email the players in the
123
- game (_if_ their email addresses were provided via `userEmails`).
134
+ game (_if_ their email addresses were provided via `userEmails`). These users
135
+ will be "editors" on the video and be able to tag themselves and their friends.
124
136
 
125
137
  If you [provided a webhook](#webhook-setup), then we'll send
126
138
  an HTTP POST request to your server. Your server should acknowledge this
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pbvision/partner-sdk",
3
3
  "description": "SDK for interacting with the PB Vision pickleball AI engine.",
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
package/src/index.js CHANGED
@@ -47,6 +47,28 @@ export class PBVision {
47
47
  return this.__callAPI('webhook/set', { url: webhookUrl })
48
48
  }
49
49
 
50
+ /**
51
+ * Gets the email addresses (if any) which have editor access to a video your
52
+ * partner account uploaded.
53
+ *
54
+ * @param {string} vid video id
55
+ */
56
+ async getVideoEditors (vid) {
57
+ return this.__callAPI('video/editors/get', { vid })
58
+ }
59
+
60
+ /**
61
+ * Sets the email addresses (if any) which have editor access to a video your
62
+ * partner account uploaded.
63
+ *
64
+ * @param {string} vid video id
65
+ * @param {Array<string>} editorEmails a list of 0 to 4 email addresses to
66
+ * allow edit access to the video (replaces any previous editors list).
67
+ */
68
+ async setVideoEditors (vid, editorEmails) {
69
+ return this.__callAPI('video/editors/set', { vid, editorEmails })
70
+ }
71
+
50
72
  /**
51
73
  * @typedef {Object} VideoUrlToDownloadResponse
52
74
  * @property {string} vid the ID of the new video