@pbvision/partner-sdk 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -108,7 +108,7 @@ import { PBVision } from '@pbvision/partner-sdk';
108
108
  const pbv = new PBVision(YOUR_API_KEY, { useProdServer: false });
109
109
  // you can omit this metadata, or provide some or all of this object—whatever you'd like!
110
110
  const optionalMetadata = {
111
- userEmails: [], // passthrough partners must provide at least one email here
111
+ userEmails: [],
112
112
  name: 'Dink Championship 2024',
113
113
  desc: 'A longer description, if you want',
114
114
  gameStartEpoch: 1711393200, // when the game was played
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.5",
4
+ "version": "0.1.7",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
package/src/index.js CHANGED
@@ -62,13 +62,13 @@ export class PBVision {
62
62
  * @param {VideoMetadata} [metadata]
63
63
  * @returns {VideoUrlToDownloadResponse}
64
64
  */
65
- async sendVideoUrlToDownload (videoUrl, { userEmails = [], name, desc, gameStartEpoch } = {}) {
65
+ async sendVideoUrlToDownload (videoUrl, { userEmails = [], name, desc, gameStartEpoch, facility, court } = {}) {
66
66
  assert(typeof videoUrl === 'string' && videoUrl.startsWith('http'),
67
67
  'URL must be a string beginning with http')
68
68
  assert(videoUrl.split('?')[0].endsWith('.mp4'), 'video URL must have the .mp4 extension')
69
69
  const resp = await this.__callAPI(
70
70
  'add_video_by_url',
71
- { url: videoUrl, userEmails, name, desc, gameStartEpoch })
71
+ { url: videoUrl, userEmails, name, desc, gameStartEpoch, facility, court })
72
72
  return JSON.parse(resp)
73
73
  }
74
74
 
@@ -100,6 +100,8 @@ export class PBVision {
100
100
  * time of the game, or if that isn't provided then the time of the upload)
101
101
  * @property {string} [desc] a longer description of the game
102
102
  * @property {integer} [gameStartEpoch] the epoch at which the game started
103
+ * @property {string} [facility] the facility where the game was recorded (e.g., "Cool Club #3 - Barcelona")
104
+ * @property {string} [court] the court where the game was recorded (e.g., "11A")
103
105
  */
104
106
 
105
107
  /**
@@ -112,10 +114,10 @@ export class PBVision {
112
114
  * @param {VideoMetadata} [metadata]
113
115
  * @returns {VideoUrlToDownloadResponse}
114
116
  */
115
- async uploadVideo (mp4Filename, { userEmails = [], name, desc, gameStartEpoch } = {}) {
117
+ async uploadVideo (mp4Filename, { userEmails = [], name, desc, gameStartEpoch, facility, court } = {}) {
116
118
  const pieces = mp4Filename.split('.')
117
119
  const ext = pieces[pieces.length - 1]
118
- const makeVIDResp = await this.__callAPI('make_video_id', { userEmails, name, desc, gameStartEpoch, fileExt: ext })
120
+ const makeVIDResp = await this.__callAPI('make_video_id', { userEmails, name, desc, gameStartEpoch, facility, court, fileExt: ext })
119
121
  const { hasCredits, vid } = JSON.parse(makeVIDResp)
120
122
  if (hasCredits === false) {
121
123
  return { hasCredits }