@hyve-sdk/js 2.2.0 → 2.3.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/dist/index.d.mts CHANGED
@@ -665,6 +665,12 @@ declare class HyveClient {
665
665
  * Unmount Stripe checkout element
666
666
  */
667
667
  unmountBillingCheckout(): void;
668
+ /**
669
+ * Fetches the rendered HTML view for a project machine
670
+ * @param machineId The machine ID to render
671
+ * @returns Promise resolving to the rendered HTML string
672
+ */
673
+ getMachineRender(machineId: string): Promise<string>;
668
674
  }
669
675
 
670
676
  /**
package/dist/index.d.ts CHANGED
@@ -665,6 +665,12 @@ declare class HyveClient {
665
665
  * Unmount Stripe checkout element
666
666
  */
667
667
  unmountBillingCheckout(): void;
668
+ /**
669
+ * Fetches the rendered HTML view for a project machine
670
+ * @param machineId The machine ID to render
671
+ * @returns Promise resolving to the rendered HTML string
672
+ */
673
+ getMachineRender(machineId: string): Promise<string>;
668
674
  }
669
675
 
670
676
  /**
package/dist/index.js CHANGED
@@ -2200,6 +2200,33 @@ var HyveClient = class {
2200
2200
  unmountBillingCheckout() {
2201
2201
  this.billingService.unmountCheckoutElement();
2202
2202
  }
2203
+ /**
2204
+ * Fetches the rendered HTML view for a project machine
2205
+ * @param machineId The machine ID to render
2206
+ * @returns Promise resolving to the rendered HTML string
2207
+ */
2208
+ async getMachineRender(machineId) {
2209
+ if (!this.jwtToken) {
2210
+ throw new Error(
2211
+ "No JWT token available. Ensure hyve-access and game-id are present in the URL."
2212
+ );
2213
+ }
2214
+ const gameId = this.requireGameId();
2215
+ logger.debug(`Fetching machine render for machine: ${machineId}`);
2216
+ const url = `${this.apiBaseUrl}/api/v1/project/machines/${machineId}/render?game_id=${gameId}`;
2217
+ const response = await fetch(url, {
2218
+ headers: {
2219
+ Authorization: `Bearer ${this.jwtToken}`
2220
+ }
2221
+ });
2222
+ if (!response.ok) {
2223
+ const errorText = await response.text();
2224
+ throw new Error(`Machine render request failed: ${response.status} ${errorText}`);
2225
+ }
2226
+ const html = await response.text();
2227
+ logger.info(`Machine render fetched successfully for machine: ${machineId}`);
2228
+ return html;
2229
+ }
2203
2230
  };
2204
2231
  // Annotate the CommonJS export names for ESM import in node:
2205
2232
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -2160,6 +2160,33 @@ var HyveClient = class {
2160
2160
  unmountBillingCheckout() {
2161
2161
  this.billingService.unmountCheckoutElement();
2162
2162
  }
2163
+ /**
2164
+ * Fetches the rendered HTML view for a project machine
2165
+ * @param machineId The machine ID to render
2166
+ * @returns Promise resolving to the rendered HTML string
2167
+ */
2168
+ async getMachineRender(machineId) {
2169
+ if (!this.jwtToken) {
2170
+ throw new Error(
2171
+ "No JWT token available. Ensure hyve-access and game-id are present in the URL."
2172
+ );
2173
+ }
2174
+ const gameId = this.requireGameId();
2175
+ logger.debug(`Fetching machine render for machine: ${machineId}`);
2176
+ const url = `${this.apiBaseUrl}/api/v1/project/machines/${machineId}/render?game_id=${gameId}`;
2177
+ const response = await fetch(url, {
2178
+ headers: {
2179
+ Authorization: `Bearer ${this.jwtToken}`
2180
+ }
2181
+ });
2182
+ if (!response.ok) {
2183
+ const errorText = await response.text();
2184
+ throw new Error(`Machine render request failed: ${response.status} ${errorText}`);
2185
+ }
2186
+ const html = await response.text();
2187
+ logger.info(`Machine render fetched successfully for machine: ${machineId}`);
2188
+ return html;
2189
+ }
2163
2190
  };
2164
2191
  export {
2165
2192
  AdsService,
package/dist/react.d.mts CHANGED
@@ -440,6 +440,12 @@ declare class HyveClient {
440
440
  * Unmount Stripe checkout element
441
441
  */
442
442
  unmountBillingCheckout(): void;
443
+ /**
444
+ * Fetches the rendered HTML view for a project machine
445
+ * @param machineId The machine ID to render
446
+ * @returns Promise resolving to the rendered HTML string
447
+ */
448
+ getMachineRender(machineId: string): Promise<string>;
443
449
  }
444
450
 
445
451
  interface HyveSdkProviderProps {
package/dist/react.d.ts CHANGED
@@ -440,6 +440,12 @@ declare class HyveClient {
440
440
  * Unmount Stripe checkout element
441
441
  */
442
442
  unmountBillingCheckout(): void;
443
+ /**
444
+ * Fetches the rendered HTML view for a project machine
445
+ * @param machineId The machine ID to render
446
+ * @returns Promise resolving to the rendered HTML string
447
+ */
448
+ getMachineRender(machineId: string): Promise<string>;
443
449
  }
444
450
 
445
451
  interface HyveSdkProviderProps {
package/dist/react.js CHANGED
@@ -2151,6 +2151,33 @@ var HyveClient = class {
2151
2151
  unmountBillingCheckout() {
2152
2152
  this.billingService.unmountCheckoutElement();
2153
2153
  }
2154
+ /**
2155
+ * Fetches the rendered HTML view for a project machine
2156
+ * @param machineId The machine ID to render
2157
+ * @returns Promise resolving to the rendered HTML string
2158
+ */
2159
+ async getMachineRender(machineId) {
2160
+ if (!this.jwtToken) {
2161
+ throw new Error(
2162
+ "No JWT token available. Ensure hyve-access and game-id are present in the URL."
2163
+ );
2164
+ }
2165
+ const gameId = this.requireGameId();
2166
+ logger.debug(`Fetching machine render for machine: ${machineId}`);
2167
+ const url = `${this.apiBaseUrl}/api/v1/project/machines/${machineId}/render?game_id=${gameId}`;
2168
+ const response = await fetch(url, {
2169
+ headers: {
2170
+ Authorization: `Bearer ${this.jwtToken}`
2171
+ }
2172
+ });
2173
+ if (!response.ok) {
2174
+ const errorText = await response.text();
2175
+ throw new Error(`Machine render request failed: ${response.status} ${errorText}`);
2176
+ }
2177
+ const html = await response.text();
2178
+ logger.info(`Machine render fetched successfully for machine: ${machineId}`);
2179
+ return html;
2180
+ }
2154
2181
  };
2155
2182
 
2156
2183
  // src/react.tsx
package/dist/react.mjs CHANGED
@@ -2130,6 +2130,33 @@ var HyveClient = class {
2130
2130
  unmountBillingCheckout() {
2131
2131
  this.billingService.unmountCheckoutElement();
2132
2132
  }
2133
+ /**
2134
+ * Fetches the rendered HTML view for a project machine
2135
+ * @param machineId The machine ID to render
2136
+ * @returns Promise resolving to the rendered HTML string
2137
+ */
2138
+ async getMachineRender(machineId) {
2139
+ if (!this.jwtToken) {
2140
+ throw new Error(
2141
+ "No JWT token available. Ensure hyve-access and game-id are present in the URL."
2142
+ );
2143
+ }
2144
+ const gameId = this.requireGameId();
2145
+ logger.debug(`Fetching machine render for machine: ${machineId}`);
2146
+ const url = `${this.apiBaseUrl}/api/v1/project/machines/${machineId}/render?game_id=${gameId}`;
2147
+ const response = await fetch(url, {
2148
+ headers: {
2149
+ Authorization: `Bearer ${this.jwtToken}`
2150
+ }
2151
+ });
2152
+ if (!response.ok) {
2153
+ const errorText = await response.text();
2154
+ throw new Error(`Machine render request failed: ${response.status} ${errorText}`);
2155
+ }
2156
+ const html = await response.text();
2157
+ logger.info(`Machine render fetched successfully for machine: ${machineId}`);
2158
+ return html;
2159
+ }
2133
2160
  };
2134
2161
 
2135
2162
  // src/react.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyve-sdk/js",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Hyve SDK - TypeScript wrapper for Hyve game server integration",
5
5
  "private": false,
6
6
  "publishConfig": {