@stinkycomputing/sesame-api-client 1.4.0 → 1.4.1-alpha.0
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 +47 -0
- package/dist/browser.cjs +27 -4
- package/dist/browser.cjs.map +2 -2
- package/dist/browser.mjs +27 -4
- package/dist/browser.mjs.map +2 -2
- package/dist/command-list.d.ts +14 -1
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.cjs +67 -10
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +67 -10
- package/dist/index.mjs.map +2 -2
- package/dist/sesame-api-client.d.ts +19 -1
- package/dist/sesame-api-client.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,6 +146,35 @@ cl.add_transport_command('cam1', { type: 'play' });
|
|
|
146
146
|
await client.execute(cl);
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
### Animations
|
|
150
|
+
|
|
151
|
+
Use the `keyframe()` helper to build type-safe animation keyframes. The easing parameters are constrained to the `EaseKind` enum, so invalid values are caught at compile time:
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { CommandList, keyframe, EaseKind, sesame } from '@stinkycomputing/sesame-api-client';
|
|
155
|
+
|
|
156
|
+
const cl = new CommandList();
|
|
157
|
+
|
|
158
|
+
cl.animate_property(
|
|
159
|
+
{ compositor: 'main', node: 'cam1-node' }, // property domain
|
|
160
|
+
'cam1-node', // address
|
|
161
|
+
'opacity', // property name
|
|
162
|
+
sesame.v1.compositor.AnimationChannelEvaluationMode.HOLD, // before
|
|
163
|
+
sesame.v1.compositor.AnimationChannelEvaluationMode.HOLD, // after
|
|
164
|
+
[
|
|
165
|
+
keyframe(0, { floatValue: 0.0 }),
|
|
166
|
+
keyframe(500000, { floatValue: 1.0 }, EaseKind.QUADRATIC_INOUT),
|
|
167
|
+
keyframe(1000000, { floatValue: 0.5 }, EaseKind.CUBIC_IN, EaseKind.CUBIC_OUT),
|
|
168
|
+
]
|
|
169
|
+
);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The `keyframe(timeUs, value, easingIn?, easingOut?)` parameters:
|
|
173
|
+
- **timeUs** — time in microseconds
|
|
174
|
+
- **value** — a `PropValue` (`floatValue`, `intValue`, `vec4Value`, `stringValue`, or `boolValue`)
|
|
175
|
+
- **easingIn** *(optional)* — easing curve entering this keyframe (`EaseKind`)
|
|
176
|
+
- **easingOut** *(optional)* — easing curve leaving this keyframe (`EaseKind`)
|
|
177
|
+
|
|
149
178
|
## Deployment Notes
|
|
150
179
|
|
|
151
180
|
When using this package in a bundled application (e.g., with esbuild):
|
|
@@ -160,6 +189,24 @@ This approach gives you:
|
|
|
160
189
|
- ✅ Fast deployment
|
|
161
190
|
- ✅ No version conflicts
|
|
162
191
|
|
|
192
|
+
## Publishing
|
|
193
|
+
|
|
194
|
+
The package is published manually to npm from a local machine.
|
|
195
|
+
|
|
196
|
+
### Prerequisites (one-time setup)
|
|
197
|
+
|
|
198
|
+
1. Create the `@stinkycomputing` organization on [npmjs.com](https://www.npmjs.com/org/create)
|
|
199
|
+
2. Log in to npm: `npm login`
|
|
200
|
+
|
|
201
|
+
### Release process
|
|
202
|
+
|
|
203
|
+
1. Update the version in `package.json`
|
|
204
|
+
2. Build: `npm run build`
|
|
205
|
+
3. Publish:
|
|
206
|
+
- **Stable release:** `npm publish --access public`
|
|
207
|
+
- **Prerelease:** `npm publish --access public --tag alpha` (or `beta`, etc.)
|
|
208
|
+
4. Commit and tag: `git tag api-client-vX.Y.Z && git push origin api-client-vX.Y.Z`
|
|
209
|
+
|
|
163
210
|
## License
|
|
164
211
|
|
|
165
212
|
MIT
|
package/dist/browser.cjs
CHANGED
|
@@ -21442,10 +21442,10 @@ var CommandList = class {
|
|
|
21442
21442
|
transitionTimeUs: (clip.transitionTime || 0) * 1e3,
|
|
21443
21443
|
speed: clip.speed || 1,
|
|
21444
21444
|
audioRouting: clip.audioRouting,
|
|
21445
|
-
startTimeUs:
|
|
21446
|
-
endTimeUs:
|
|
21447
|
-
transitionType: sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21448
|
-
transitionFadeColor: { x: 0, y: 0, z: 0, w: 0 }
|
|
21445
|
+
startTimeUs: clip.startTime,
|
|
21446
|
+
endTimeUs: clip.endTime,
|
|
21447
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21448
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21449
21449
|
})),
|
|
21450
21450
|
sourceId,
|
|
21451
21451
|
userPlaylistId: playlist.id,
|
|
@@ -21494,6 +21494,29 @@ var CommandList = class {
|
|
|
21494
21494
|
case "set_recorder":
|
|
21495
21495
|
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_MONITOR;
|
|
21496
21496
|
break;
|
|
21497
|
+
case "take":
|
|
21498
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TAKE;
|
|
21499
|
+
break;
|
|
21500
|
+
case "pre_roll":
|
|
21501
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_PRE_ROLL;
|
|
21502
|
+
break;
|
|
21503
|
+
case "post_roll":
|
|
21504
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_POST_ROLL;
|
|
21505
|
+
break;
|
|
21506
|
+
case "next_playlist_clip":
|
|
21507
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_NEXT;
|
|
21508
|
+
break;
|
|
21509
|
+
case "skip_next_playlist_clip":
|
|
21510
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SKIP_NEXT;
|
|
21511
|
+
break;
|
|
21512
|
+
case "transitions_disabled":
|
|
21513
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TRANSITIONS_DISABLED;
|
|
21514
|
+
useIntValue = true;
|
|
21515
|
+
break;
|
|
21516
|
+
case "set_scrubbing":
|
|
21517
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SET_SCRUBBING;
|
|
21518
|
+
useIntValue = true;
|
|
21519
|
+
break;
|
|
21497
21520
|
default:
|
|
21498
21521
|
throw new Error("Unknown transport command type: " + msg.type);
|
|
21499
21522
|
}
|