ugcinc 4.5.0 → 4.5.1

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.
@@ -86,7 +86,28 @@ const definition = (0, types_1.defineNode)({
86
86
  const selectionMode = output.selectionConfig?.mode ?? config.selectionMode;
87
87
  const index = config.outputMode === 'single' ? 0 : ctx.selectionState.consumedCount;
88
88
  const selected = (0, selection_1.selectFromPool)(urlPool, selectionMode, index, `preview-${output.id}`);
89
- result[output.id] = selected ?? null;
89
+ if (!selected) {
90
+ result[output.id] = null;
91
+ continue;
92
+ }
93
+ // Wrap URL in the appropriate PortValue type based on output port type
94
+ const portType = output.type;
95
+ if (portType === 'image') {
96
+ result[output.id] = { url: selected };
97
+ }
98
+ else if (portType === 'video') {
99
+ result[output.id] = { url: selected };
100
+ }
101
+ else if (portType === 'audio') {
102
+ result[output.id] = { url: selected };
103
+ }
104
+ else if (portType === 'social_audio') {
105
+ result[output.id] = { url: selected };
106
+ }
107
+ else {
108
+ // text and other primitive types stay as raw values
109
+ result[output.id] = selected;
110
+ }
90
111
  }
91
112
  return (0, types_1.preview)(result);
92
113
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",