@animaapp/anima-sdk 0.6.20 → 0.6.21

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.ts CHANGED
@@ -91,6 +91,10 @@ export declare type BaseResult = {
91
91
  tokenUsage: number;
92
92
  };
93
93
 
94
+ export declare type BaseSettings = {
95
+ codegenSettings?: Record<string, unknown>;
96
+ };
97
+
94
98
  export declare class CodegenError extends Error {
95
99
  status?: number;
96
100
  detail?: unknown;
@@ -119,7 +123,7 @@ export declare type CodegenResult = BaseResult & {
119
123
  */
120
124
  export declare type CodegenRouteErrorReason = "Not all frames id from responsive pages are mentioned on the nodes id list" | "Too many screens to import";
121
125
 
122
- export declare type CodegenSettings = {
126
+ export declare type CodegenSettings = BaseSettings & {
123
127
  language?: "typescript" | "javascript";
124
128
  model?: string;
125
129
  framework: "react" | "html";
@@ -142,7 +146,6 @@ export declare type CodegenSettings = {
142
146
  enableDisplayDataId?: boolean;
143
147
  enableDisplayDataName?: boolean;
144
148
  url?: string;
145
- codegenSettings?: Record<string, unknown>;
146
149
  };
147
150
 
148
151
  /**
@@ -327,7 +330,7 @@ export declare type GetCodeFromPromptParams = {
327
330
  webhookUrl?: string;
328
331
  };
329
332
 
330
- export declare type GetCodeFromPromptSettings = {
333
+ export declare type GetCodeFromPromptSettings = BaseSettings & {
331
334
  language?: "typescript";
332
335
  framework: "react" | "html";
333
336
  styling: "tailwind" | "inline_styles";
@@ -368,7 +371,7 @@ export declare type GetCodeFromWebsiteParams = {
368
371
  webhookUrl?: string;
369
372
  };
370
373
 
371
- export declare type GetCodeFromWebsiteSettings = {
374
+ export declare type GetCodeFromWebsiteSettings = BaseSettings & {
372
375
  language?: "typescript";
373
376
  framework: "react" | "html";
374
377
  styling: "tailwind" | "inline_styles";
package/dist/index.js CHANGED
@@ -3990,12 +3990,13 @@ class ea {
3990
3990
  */
3991
3991
  generateCodeFromPrompt(n) {
3992
3992
  return C(this, arguments, function* (e, t = {}, s) {
3993
+ var o;
3993
3994
  let a = e.tracking;
3994
3995
  A(this, E) && "userId" in A(this, E) && A(this, E).userId && (a != null && a.externalId || (a = { externalId: A(this, E).userId }));
3995
3996
  const i = {
3996
3997
  tracking: a,
3997
3998
  assetsStorage: e.assetsStorage,
3998
- params: {
3999
+ params: u({
3999
4000
  prompt: e.prompt,
4000
4001
  conventions: {
4001
4002
  language: e.settings.language,
@@ -4003,7 +4004,7 @@ class ea {
4003
4004
  styling: e.settings.styling,
4004
4005
  uiLibrary: e.settings.uiLibrary
4005
4006
  }
4006
- },
4007
+ }, (o = e.settings.codegenSettings) != null ? o : {}),
4007
4008
  webhookUrl: e.webhookUrl
4008
4009
  };
4009
4010
  return console.log("P2C Request Body:", JSON.stringify(i, null, 2)), Se(this, ie, De).call(this, "/v1/p2c", i, t, "p2c", s);