@widgetic/api-sdk-ts 1.11.64 → 1.11.109

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.
Files changed (270) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/CompositionsApi.d.ts +24 -6
  3. package/dist/apis/CompositionsApi.js +73 -6
  4. package/dist/apis/ManagedUsersApi.d.ts +2 -2
  5. package/dist/apis/ManagedUsersApi.js +2 -2
  6. package/dist/apis/PartnerApi.d.ts +502 -21
  7. package/dist/apis/PartnerApi.js +1325 -51
  8. package/dist/apis/PartnersApi.d.ts +63 -5
  9. package/dist/apis/PartnersApi.js +158 -4
  10. package/dist/apis/PublicEmbedApi.d.ts +62 -7
  11. package/dist/apis/PublicEmbedApi.js +126 -6
  12. package/dist/apis/UsersApi.d.ts +19 -3
  13. package/dist/apis/UsersApi.js +46 -2
  14. package/dist/apis/WorkflowsApi.d.ts +394 -0
  15. package/dist/apis/WorkflowsApi.js +1056 -0
  16. package/dist/apis/WorkspacesApi.d.ts +352 -0
  17. package/dist/apis/WorkspacesApi.js +946 -0
  18. package/dist/apis/index.d.ts +2 -0
  19. package/dist/apis/index.js +2 -0
  20. package/dist/esm/apis/CompositionsApi.js +73 -6
  21. package/dist/esm/apis/ManagedUsersApi.js +2 -2
  22. package/dist/esm/apis/PartnerApi.js +1325 -51
  23. package/dist/esm/apis/PartnersApi.js +159 -5
  24. package/dist/esm/apis/PublicEmbedApi.js +127 -7
  25. package/dist/esm/apis/UsersApi.js +47 -3
  26. package/dist/esm/apis/WorkflowsApi.js +1019 -0
  27. package/dist/esm/apis/WorkspacesApi.js +909 -0
  28. package/dist/esm/apis/index.js +2 -0
  29. package/dist/esm/models/AdapterConnection.js +12 -0
  30. package/dist/esm/models/Composition.js +5 -0
  31. package/dist/esm/models/CompositionLastEditedBy.js +43 -0
  32. package/dist/esm/models/ConfirmAdapterConnectionRequest.js +43 -0
  33. package/dist/esm/models/CreateWidget201ResponseData.js +2 -4
  34. package/dist/esm/models/CreateWorkspaceWorkflowFromPreset201Response.js +51 -0
  35. package/dist/esm/models/CreateWorkspaceWorkflowFromPresetRequest.js +45 -0
  36. package/dist/esm/models/CreateWorkspaceWorkflowRequest.js +47 -0
  37. package/dist/esm/models/DeleteWorkspaceWorkflow200Response.js +51 -0
  38. package/dist/esm/models/EditorSession.js +2 -1
  39. package/dist/esm/models/GetPublicCompositionEmbed200Response.js +9 -0
  40. package/dist/esm/models/GetPublicCompositionEmbed200ResponseAdapters.js +44 -0
  41. package/dist/esm/models/GetPublicCompositionEmbed200ResponseAdaptersCaptcha.js +41 -0
  42. package/dist/esm/models/GetPublicCompositionEmbed200ResponseEntries.js +43 -0
  43. package/dist/esm/models/GetPublicCompositionEmbed200ResponseMedia.js +41 -0
  44. package/dist/esm/models/GetPublicWorkflow200Response.js +51 -0
  45. package/dist/esm/models/GetWorkspaceWorkflowStats200Response.js +51 -0
  46. package/dist/esm/models/GetWorkspaceWorkflowVersion200Response.js +51 -0
  47. package/dist/esm/models/ListPartnerWorkflowPresets200Response.js +51 -0
  48. package/dist/esm/models/ListWorkspaceWorkflowCompositionOptions200Response.js +51 -0
  49. package/dist/esm/models/ListWorkspaceWorkflowPresets200Response.js +51 -0
  50. package/dist/esm/models/ListWorkspaceWorkflowVersions200Response.js +51 -0
  51. package/dist/esm/models/ListWorkspaceWorkflows200Response.js +51 -0
  52. package/dist/esm/models/NewEditorSession.js +2 -1
  53. package/dist/esm/models/OfferWorkflowPresetRequest.js +49 -0
  54. package/dist/esm/models/OfferedWorkflowPreset.js +101 -0
  55. package/dist/esm/models/OfferedWorkflowPresetList.js +44 -0
  56. package/dist/esm/models/OfferedWorkflowPresetWidget.js +51 -0
  57. package/dist/esm/models/PartnerNotificationEventType.js +5 -1
  58. package/dist/esm/models/PublicWorkflow.js +73 -0
  59. package/dist/esm/models/PublicWorkflowEventsAccepted.js +47 -0
  60. package/dist/esm/models/PublicWorkflowEventsRequest.js +53 -0
  61. package/dist/esm/models/PublicWorkflowEventsRequestEventsInner.js +57 -0
  62. package/dist/esm/models/PublicWorkflowEventsRequestHeightsInner.js +47 -0
  63. package/dist/esm/models/PublicWorkflowTranslation.js +47 -0
  64. package/dist/esm/models/PublishWorkspaceWorkflow200Response.js +51 -0
  65. package/dist/esm/models/PublishWorkspaceWorkflowRequest.js +43 -0
  66. package/dist/esm/models/RemovePartnerWorkflowPreset200Response.js +51 -0
  67. package/dist/esm/models/ReportPublicWorkflowEvents200Response.js +51 -0
  68. package/dist/esm/models/SaveWorkspaceWorkflow200Response.js +51 -0
  69. package/dist/esm/models/SaveWorkspaceWorkflowRequest.js +50 -0
  70. package/dist/esm/models/SetPartnerWorkflowPreset200Response.js +51 -0
  71. package/dist/esm/models/Widget.js +2 -4
  72. package/dist/esm/models/Workflow.js +96 -0
  73. package/dist/esm/models/WorkflowCompositionAction.js +53 -0
  74. package/dist/esm/models/WorkflowCompositionField.js +63 -0
  75. package/dist/esm/models/WorkflowCompositionOption.js +67 -0
  76. package/dist/esm/models/WorkflowCompositionOptionActions.js +57 -0
  77. package/dist/esm/models/WorkflowCompositionOptionInputs.js +61 -0
  78. package/dist/esm/models/WorkflowCompositionOptions.js +56 -0
  79. package/dist/esm/models/WorkflowConditionCase.js +61 -0
  80. package/dist/esm/models/WorkflowConditionTest.js +67 -0
  81. package/dist/esm/models/WorkflowCounter.js +47 -0
  82. package/dist/esm/models/WorkflowDetail.js +113 -0
  83. package/dist/esm/models/WorkflowDetailAllOfLastEditedBy.js +43 -0
  84. package/dist/esm/models/WorkflowEdge.js +55 -0
  85. package/dist/esm/models/WorkflowFieldReference.js +66 -0
  86. package/dist/esm/models/WorkflowGraph.js +59 -0
  87. package/dist/esm/models/WorkflowIssue.js +62 -0
  88. package/dist/esm/models/WorkflowList.js +56 -0
  89. package/dist/esm/models/WorkflowNode.js +68 -0
  90. package/dist/esm/models/WorkflowNodePosition.js +47 -0
  91. package/dist/esm/models/WorkflowPresetChoice.js +60 -0
  92. package/dist/esm/models/WorkflowPresetChoices.js +44 -0
  93. package/dist/esm/models/WorkflowPresetRemoval.js +43 -0
  94. package/dist/esm/models/WorkflowPresetWidget.js +47 -0
  95. package/dist/esm/models/WorkflowPublishResult.js +54 -0
  96. package/dist/esm/models/WorkflowRemoved.js +43 -0
  97. package/dist/esm/models/WorkflowSchedule.js +66 -0
  98. package/dist/esm/models/WorkflowStats.js +68 -0
  99. package/dist/esm/models/WorkflowStatus.js +48 -0
  100. package/dist/esm/models/WorkflowTrigger.js +64 -0
  101. package/dist/esm/models/WorkflowTriggerValuesInner.js +55 -0
  102. package/dist/esm/models/WorkflowVersion.js +62 -0
  103. package/dist/esm/models/WorkflowVersionDetail.js +71 -0
  104. package/dist/esm/models/WorkflowVersionList.js +44 -0
  105. package/dist/esm/models/WorkflowVersionPublishedBy.js +43 -0
  106. package/dist/esm/models/index.js +69 -0
  107. package/dist/esm/runtime.js +1 -1
  108. package/dist/models/AdapterConnection.d.ts +18 -0
  109. package/dist/models/AdapterConnection.js +12 -0
  110. package/dist/models/Composition.d.ts +13 -0
  111. package/dist/models/Composition.js +5 -0
  112. package/dist/models/CompositionLastEditedBy.d.ts +52 -0
  113. package/dist/models/CompositionLastEditedBy.js +50 -0
  114. package/dist/models/ConfirmAdapterConnectionRequest.d.ts +32 -0
  115. package/dist/models/ConfirmAdapterConnectionRequest.js +50 -0
  116. package/dist/models/CreateWidget201ResponseData.d.ts +2 -8
  117. package/dist/models/CreateWidget201ResponseData.js +2 -4
  118. package/dist/models/CreateWorkspaceWorkflowFromPreset201Response.d.ts +46 -0
  119. package/dist/models/CreateWorkspaceWorkflowFromPreset201Response.js +58 -0
  120. package/dist/models/CreateWorkspaceWorkflowFromPresetRequest.d.ts +38 -0
  121. package/dist/models/CreateWorkspaceWorkflowFromPresetRequest.js +52 -0
  122. package/dist/models/CreateWorkspaceWorkflowRequest.d.ts +44 -0
  123. package/dist/models/CreateWorkspaceWorkflowRequest.js +54 -0
  124. package/dist/models/DeleteWorkspaceWorkflow200Response.d.ts +46 -0
  125. package/dist/models/DeleteWorkspaceWorkflow200Response.js +58 -0
  126. package/dist/models/EditorSession.d.ts +1 -0
  127. package/dist/models/EditorSession.js +2 -1
  128. package/dist/models/GetPublicCompositionEmbed200Response.d.ts +22 -1
  129. package/dist/models/GetPublicCompositionEmbed200Response.js +9 -0
  130. package/dist/models/GetPublicCompositionEmbed200ResponseAdapters.d.ts +39 -0
  131. package/dist/models/GetPublicCompositionEmbed200ResponseAdapters.js +51 -0
  132. package/dist/models/GetPublicCompositionEmbed200ResponseAdaptersCaptcha.d.ts +32 -0
  133. package/dist/models/GetPublicCompositionEmbed200ResponseAdaptersCaptcha.js +48 -0
  134. package/dist/models/GetPublicCompositionEmbed200ResponseEntries.d.ts +38 -0
  135. package/dist/models/GetPublicCompositionEmbed200ResponseEntries.js +50 -0
  136. package/dist/models/GetPublicCompositionEmbed200ResponseMedia.d.ts +32 -0
  137. package/dist/models/GetPublicCompositionEmbed200ResponseMedia.js +48 -0
  138. package/dist/models/GetPublicWorkflow200Response.d.ts +46 -0
  139. package/dist/models/GetPublicWorkflow200Response.js +58 -0
  140. package/dist/models/GetWorkspaceWorkflowStats200Response.d.ts +46 -0
  141. package/dist/models/GetWorkspaceWorkflowStats200Response.js +58 -0
  142. package/dist/models/GetWorkspaceWorkflowVersion200Response.d.ts +46 -0
  143. package/dist/models/GetWorkspaceWorkflowVersion200Response.js +58 -0
  144. package/dist/models/ListPartnerWorkflowPresets200Response.d.ts +46 -0
  145. package/dist/models/ListPartnerWorkflowPresets200Response.js +58 -0
  146. package/dist/models/ListWorkspaceWorkflowCompositionOptions200Response.d.ts +46 -0
  147. package/dist/models/ListWorkspaceWorkflowCompositionOptions200Response.js +58 -0
  148. package/dist/models/ListWorkspaceWorkflowPresets200Response.d.ts +46 -0
  149. package/dist/models/ListWorkspaceWorkflowPresets200Response.js +58 -0
  150. package/dist/models/ListWorkspaceWorkflowVersions200Response.d.ts +46 -0
  151. package/dist/models/ListWorkspaceWorkflowVersions200Response.js +58 -0
  152. package/dist/models/ListWorkspaceWorkflows200Response.d.ts +46 -0
  153. package/dist/models/ListWorkspaceWorkflows200Response.js +58 -0
  154. package/dist/models/NewComposition.d.ts +16 -3
  155. package/dist/models/NewEditorSession.d.ts +2 -1
  156. package/dist/models/NewEditorSession.js +2 -1
  157. package/dist/models/OfferWorkflowPresetRequest.d.ts +50 -0
  158. package/dist/models/OfferWorkflowPresetRequest.js +56 -0
  159. package/dist/models/OfferedWorkflowPreset.d.ts +120 -0
  160. package/dist/models/OfferedWorkflowPreset.js +109 -0
  161. package/dist/models/OfferedWorkflowPresetList.d.ts +33 -0
  162. package/dist/models/OfferedWorkflowPresetList.js +51 -0
  163. package/dist/models/OfferedWorkflowPresetWidget.d.ts +44 -0
  164. package/dist/models/OfferedWorkflowPresetWidget.js +58 -0
  165. package/dist/models/PartnerNotification.d.ts +1 -1
  166. package/dist/models/PartnerNotificationEventType.d.ts +4 -0
  167. package/dist/models/PartnerNotificationEventType.js +5 -1
  168. package/dist/models/PublicWorkflow.d.ts +109 -0
  169. package/dist/models/PublicWorkflow.js +81 -0
  170. package/dist/models/PublicWorkflowEventsAccepted.d.ts +44 -0
  171. package/dist/models/PublicWorkflowEventsAccepted.js +54 -0
  172. package/dist/models/PublicWorkflowEventsRequest.d.ts +59 -0
  173. package/dist/models/PublicWorkflowEventsRequest.js +60 -0
  174. package/dist/models/PublicWorkflowEventsRequestEventsInner.d.ts +53 -0
  175. package/dist/models/PublicWorkflowEventsRequestEventsInner.js +65 -0
  176. package/dist/models/PublicWorkflowEventsRequestHeightsInner.d.ts +38 -0
  177. package/dist/models/PublicWorkflowEventsRequestHeightsInner.js +54 -0
  178. package/dist/models/PublicWorkflowTranslation.d.ts +40 -0
  179. package/dist/models/PublicWorkflowTranslation.js +54 -0
  180. package/dist/models/PublishWorkspaceWorkflow200Response.d.ts +46 -0
  181. package/dist/models/PublishWorkspaceWorkflow200Response.js +58 -0
  182. package/dist/models/PublishWorkspaceWorkflowRequest.d.ts +32 -0
  183. package/dist/models/PublishWorkspaceWorkflowRequest.js +50 -0
  184. package/dist/models/RemovePartnerWorkflowPreset200Response.d.ts +46 -0
  185. package/dist/models/RemovePartnerWorkflowPreset200Response.js +58 -0
  186. package/dist/models/ReportPublicWorkflowEvents200Response.d.ts +46 -0
  187. package/dist/models/ReportPublicWorkflowEvents200Response.js +58 -0
  188. package/dist/models/SaveWorkspaceWorkflow200Response.d.ts +46 -0
  189. package/dist/models/SaveWorkspaceWorkflow200Response.js +58 -0
  190. package/dist/models/SaveWorkspaceWorkflowRequest.d.ts +51 -0
  191. package/dist/models/SaveWorkspaceWorkflowRequest.js +57 -0
  192. package/dist/models/SetAdapterConnectionRequest.d.ts +1 -1
  193. package/dist/models/SetPartnerWorkflowPreset200Response.d.ts +46 -0
  194. package/dist/models/SetPartnerWorkflowPreset200Response.js +58 -0
  195. package/dist/models/UpdateComposition.d.ts +3 -1
  196. package/dist/models/Widget.d.ts +2 -8
  197. package/dist/models/Widget.js +2 -4
  198. package/dist/models/Workflow.d.ts +133 -0
  199. package/dist/models/Workflow.js +103 -0
  200. package/dist/models/WorkflowCompositionAction.d.ts +52 -0
  201. package/dist/models/WorkflowCompositionAction.js +60 -0
  202. package/dist/models/WorkflowCompositionField.d.ts +59 -0
  203. package/dist/models/WorkflowCompositionField.js +71 -0
  204. package/dist/models/WorkflowCompositionOption.d.ts +73 -0
  205. package/dist/models/WorkflowCompositionOption.js +74 -0
  206. package/dist/models/WorkflowCompositionOptionActions.d.ts +55 -0
  207. package/dist/models/WorkflowCompositionOptionActions.js +65 -0
  208. package/dist/models/WorkflowCompositionOptionInputs.d.ts +64 -0
  209. package/dist/models/WorkflowCompositionOptionInputs.js +69 -0
  210. package/dist/models/WorkflowCompositionOptions.d.ts +51 -0
  211. package/dist/models/WorkflowCompositionOptions.js +63 -0
  212. package/dist/models/WorkflowConditionCase.d.ts +61 -0
  213. package/dist/models/WorkflowConditionCase.js +69 -0
  214. package/dist/models/WorkflowConditionTest.d.ts +68 -0
  215. package/dist/models/WorkflowConditionTest.js +75 -0
  216. package/dist/models/WorkflowCounter.d.ts +38 -0
  217. package/dist/models/WorkflowCounter.js +54 -0
  218. package/dist/models/WorkflowDetail.d.ts +166 -0
  219. package/dist/models/WorkflowDetail.js +120 -0
  220. package/dist/models/WorkflowDetailAllOfLastEditedBy.d.ts +42 -0
  221. package/dist/models/WorkflowDetailAllOfLastEditedBy.js +50 -0
  222. package/dist/models/WorkflowEdge.d.ts +50 -0
  223. package/dist/models/WorkflowEdge.js +62 -0
  224. package/dist/models/WorkflowFieldReference.d.ts +63 -0
  225. package/dist/models/WorkflowFieldReference.js +74 -0
  226. package/dist/models/WorkflowGraph.d.ts +53 -0
  227. package/dist/models/WorkflowGraph.js +67 -0
  228. package/dist/models/WorkflowIssue.d.ts +72 -0
  229. package/dist/models/WorkflowIssue.js +70 -0
  230. package/dist/models/WorkflowList.d.ts +51 -0
  231. package/dist/models/WorkflowList.js +63 -0
  232. package/dist/models/WorkflowNode.d.ts +83 -0
  233. package/dist/models/WorkflowNode.js +76 -0
  234. package/dist/models/WorkflowNodePosition.d.ts +38 -0
  235. package/dist/models/WorkflowNodePosition.js +54 -0
  236. package/dist/models/WorkflowPresetChoice.d.ts +60 -0
  237. package/dist/models/WorkflowPresetChoice.js +67 -0
  238. package/dist/models/WorkflowPresetChoices.d.ts +33 -0
  239. package/dist/models/WorkflowPresetChoices.js +51 -0
  240. package/dist/models/WorkflowPresetRemoval.d.ts +32 -0
  241. package/dist/models/WorkflowPresetRemoval.js +50 -0
  242. package/dist/models/WorkflowPresetWidget.d.ts +38 -0
  243. package/dist/models/WorkflowPresetWidget.js +54 -0
  244. package/dist/models/WorkflowPublishResult.d.ts +47 -0
  245. package/dist/models/WorkflowPublishResult.js +61 -0
  246. package/dist/models/WorkflowRemoved.d.ts +32 -0
  247. package/dist/models/WorkflowRemoved.js +50 -0
  248. package/dist/models/WorkflowSchedule.d.ts +69 -0
  249. package/dist/models/WorkflowSchedule.js +74 -0
  250. package/dist/models/WorkflowStats.d.ts +77 -0
  251. package/dist/models/WorkflowStats.js +75 -0
  252. package/dist/models/WorkflowStatus.d.ts +30 -0
  253. package/dist/models/WorkflowStatus.js +56 -0
  254. package/dist/models/WorkflowTrigger.d.ts +77 -0
  255. package/dist/models/WorkflowTrigger.js +72 -0
  256. package/dist/models/WorkflowTriggerValuesInner.d.ts +47 -0
  257. package/dist/models/WorkflowTriggerValuesInner.js +63 -0
  258. package/dist/models/WorkflowVersion.d.ts +63 -0
  259. package/dist/models/WorkflowVersion.js +69 -0
  260. package/dist/models/WorkflowVersionDetail.d.ts +76 -0
  261. package/dist/models/WorkflowVersionDetail.js +78 -0
  262. package/dist/models/WorkflowVersionList.d.ts +33 -0
  263. package/dist/models/WorkflowVersionList.js +51 -0
  264. package/dist/models/WorkflowVersionPublishedBy.d.ts +38 -0
  265. package/dist/models/WorkflowVersionPublishedBy.js +50 -0
  266. package/dist/models/index.d.ts +69 -0
  267. package/dist/models/index.js +69 -0
  268. package/dist/runtime.d.ts +2 -2
  269. package/dist/runtime.js +1 -1
  270. package/package.json +2 -2
@@ -12,3 +12,5 @@ export * from './TokensApi';
12
12
  export * from './UploadsApi';
13
13
  export * from './UsersApi';
14
14
  export * from './WidgetsApi';
15
+ export * from './WorkflowsApi';
16
+ export * from './WorkspacesApi';
@@ -30,3 +30,5 @@ __exportStar(require("./TokensApi"), exports);
30
30
  __exportStar(require("./UploadsApi"), exports);
31
31
  __exportStar(require("./UsersApi"), exports);
32
32
  __exportStar(require("./WidgetsApi"), exports);
33
+ __exportStar(require("./WorkflowsApi"), exports);
34
+ __exportStar(require("./WorkspacesApi"), exports);
@@ -18,7 +18,7 @@ import { AddAiAnswersKnowledgeDocument201ResponseFromJSON, AddAiAnswersKnowledge
18
18
  */
19
19
  export class CompositionsApi extends runtime.BaseAPI {
20
20
  /**
21
- * Gives the widget\'s AI a document to answer visitors\' questions from. Send the title and the plain text. The call returns once the document is ready to be used, which takes a few seconds, longer for a long text. **How it is used.** The text is cleaned, cut into short passages and each passage is turned into numbers (an embedding) so the widget can find the passages nearest to a question. When a visitor asks, the nearest passages and the question are shown to an AI model, which writes the answer from them and from nothing else; if the documents say nothing about the question the visitor is told so, and the owner is not charged for that question. The titles of the documents an answer used are shown to the visitor as its sources. **What leaves Widgetic.** The text of a document is sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** A widget holds up to 20 documents, each up to 100000 characters, and up to 400000 characters in all (`getAiAnswersKnowledge` reports the current numbers). Text only: convert PDF or Word files to text first. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds are limited to ten in ten minutes per person.
21
+ * Gives the widget\'s AI a document to answer visitors\' questions from. Send the title and the plain text. The call returns once the document is ready to be used, which takes a few seconds, longer for a long text. **How it is used.** The text is cleaned, cut into short passages and each passage is turned into numbers (an embedding) so the widget can find the passages nearest to a question. When a visitor asks, the nearest passages and the question are shown to an AI model, which writes the answer from them and from nothing else; if the documents say nothing about the question the visitor is told so, and the owner is not charged for that question. The titles of the documents an answer used are shown to the visitor as its sources. **What leaves Widgetic.** The text of a document is sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** A widget holds up to 20 documents, each up to 100000 characters, and up to 400000 characters in all (`getAiAnswersKnowledge` reports the current numbers). This call takes text. To add a text file or a picture of a document (a PDF too, once PDFs are read) without turning it into text yourself, use `addAiAnswersKnowledgeFile`. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds are limited to ten in ten minutes per person. A partner\'s customer in an editor session is one person of its own: its adds are not counted with the partner\'s other customers\'.
22
22
  * Add a document for a widget\'s AI to answer from
23
23
  */
24
24
  async addAiAnswersKnowledgeDocumentRaw(requestParameters, initOverrides) {
@@ -54,13 +54,77 @@ export class CompositionsApi extends runtime.BaseAPI {
54
54
  return new runtime.JSONApiResponse(response, (jsonValue) => AddAiAnswersKnowledgeDocument201ResponseFromJSON(jsonValue));
55
55
  }
56
56
  /**
57
- * Gives the widget\'s AI a document to answer visitors\' questions from. Send the title and the plain text. The call returns once the document is ready to be used, which takes a few seconds, longer for a long text. **How it is used.** The text is cleaned, cut into short passages and each passage is turned into numbers (an embedding) so the widget can find the passages nearest to a question. When a visitor asks, the nearest passages and the question are shown to an AI model, which writes the answer from them and from nothing else; if the documents say nothing about the question the visitor is told so, and the owner is not charged for that question. The titles of the documents an answer used are shown to the visitor as its sources. **What leaves Widgetic.** The text of a document is sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** A widget holds up to 20 documents, each up to 100000 characters, and up to 400000 characters in all (`getAiAnswersKnowledge` reports the current numbers). Text only: convert PDF or Word files to text first. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds are limited to ten in ten minutes per person.
57
+ * Gives the widget\'s AI a document to answer visitors\' questions from. Send the title and the plain text. The call returns once the document is ready to be used, which takes a few seconds, longer for a long text. **How it is used.** The text is cleaned, cut into short passages and each passage is turned into numbers (an embedding) so the widget can find the passages nearest to a question. When a visitor asks, the nearest passages and the question are shown to an AI model, which writes the answer from them and from nothing else; if the documents say nothing about the question the visitor is told so, and the owner is not charged for that question. The titles of the documents an answer used are shown to the visitor as its sources. **What leaves Widgetic.** The text of a document is sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** A widget holds up to 20 documents, each up to 100000 characters, and up to 400000 characters in all (`getAiAnswersKnowledge` reports the current numbers). This call takes text. To add a text file or a picture of a document (a PDF too, once PDFs are read) without turning it into text yourself, use `addAiAnswersKnowledgeFile`. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds are limited to ten in ten minutes per person. A partner\'s customer in an editor session is one person of its own: its adds are not counted with the partner\'s other customers\'.
58
58
  * Add a document for a widget\'s AI to answer from
59
59
  */
60
60
  async addAiAnswersKnowledgeDocument(requestParameters, initOverrides) {
61
61
  const response = await this.addAiAnswersKnowledgeDocumentRaw(requestParameters, initOverrides);
62
62
  return await response.value();
63
63
  }
64
+ /**
65
+ * Gives the widget\'s AI a document made from a file. Send a `multipart/form-data` request with the file in the field named `file` and, if you like, a `title`. The file is turned into text and then added exactly as `addAiAnswersKnowledgeDocument` adds text: the same cleaning, the same limits, the same refusal of a copy of a document the widget already has. The call returns once the document is ready to be used, which takes a few seconds (a PDF is read first, so it takes longer). **PDFs are not read yet.** For now a PDF is refused with 415, in a sentence that says what to do instead: paste the text, upload it as a text file, or upload its pages as pictures. What this description says about a PDF is what will hold from the day PDFs are read. **Which files.** - A **PDF** (not read yet, see above), up to 10 MB and 300 pages. Its text is read and its paragraphs are put back together. A PDF that is only pictures of pages (a scan) has no text to read: upload the pages as pictures instead. A PDF locked with a password is refused. - A **text file**: `.txt`, `.text`, `.md`, `.markdown` or `.csv`, in UTF-8, UTF-16 or Windows-1252. - A **picture of a document**: PNG, JPEG or WebP, up to 4 MB. The text in it is read with the same text recognition as the `ocr` adapter. - Word and other office files are not read yet: save the file as a PDF and upload that. What a file is comes from what is in it, not from its name or the type it is sent as. A file that is none of these is refused with 415. **The title.** Left out, the name of the file (without its extension) is the title. Visitors see the title as the source of an answer, so send one that means something to them. **The file is not kept.** Only its text, cut into passages, is kept, and `getAiAnswersKnowledge` never returns it. **What leaves Widgetic.** As for text, the words of the document are sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. A picture is also sent to the text recognition service. A PDF is read on Widgetic\'s own servers and is not sent anywhere to be read. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** The widget\'s limits are those of `addAiAnswersKnowledgeDocument` (up to 20 documents, each up to 100000 characters of text, and up to 400000 characters in all; `getAiAnswersKnowledge` reports the current numbers), and the file is at most 10 MB. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds, from text or from a file, share one limit of ten in ten minutes per person. A partner\'s customer in an editor session is one person of its own: its adds are not counted with the partner\'s other customers\'.
66
+ * Add a text file or a picture of a document (a PDF once PDFs are read) for a widget\'s AI to answer from
67
+ */
68
+ async addAiAnswersKnowledgeFileRaw(requestParameters, initOverrides) {
69
+ if (requestParameters['id'] == null) {
70
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeFile().');
71
+ }
72
+ if (requestParameters['file'] == null) {
73
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling addAiAnswersKnowledgeFile().');
74
+ }
75
+ const queryParameters = {};
76
+ const headerParameters = {};
77
+ if (requestParameters['xManagedUserId'] != null) {
78
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
79
+ }
80
+ if (requestParameters['xManagedUserExternalId'] != null) {
81
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
82
+ }
83
+ if (this.configuration && this.configuration.accessToken) {
84
+ const token = this.configuration.accessToken;
85
+ const tokenString = await token("apiKeyAuth", []);
86
+ if (tokenString) {
87
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
88
+ }
89
+ }
90
+ const consumes = [
91
+ { contentType: 'multipart/form-data' },
92
+ ];
93
+ // @ts-ignore: canConsumeForm may be unused
94
+ const canConsumeForm = runtime.canConsumeForm(consumes);
95
+ let formParams;
96
+ let useForm = false;
97
+ // use FormData to transmit files using content-type "multipart/form-data"
98
+ useForm = canConsumeForm;
99
+ if (useForm) {
100
+ formParams = new FormData();
101
+ }
102
+ else {
103
+ formParams = new URLSearchParams();
104
+ }
105
+ if (requestParameters['file'] != null) {
106
+ formParams.append('file', requestParameters['file']);
107
+ }
108
+ if (requestParameters['title'] != null) {
109
+ formParams.append('title', requestParameters['title']);
110
+ }
111
+ const response = await this.request({
112
+ path: `/compositions/{id}/adapters/ai-answers/knowledge/documents/file`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
113
+ method: 'POST',
114
+ headers: headerParameters,
115
+ query: queryParameters,
116
+ body: formParams,
117
+ }, initOverrides);
118
+ return new runtime.JSONApiResponse(response, (jsonValue) => AddAiAnswersKnowledgeDocument201ResponseFromJSON(jsonValue));
119
+ }
120
+ /**
121
+ * Gives the widget\'s AI a document made from a file. Send a `multipart/form-data` request with the file in the field named `file` and, if you like, a `title`. The file is turned into text and then added exactly as `addAiAnswersKnowledgeDocument` adds text: the same cleaning, the same limits, the same refusal of a copy of a document the widget already has. The call returns once the document is ready to be used, which takes a few seconds (a PDF is read first, so it takes longer). **PDFs are not read yet.** For now a PDF is refused with 415, in a sentence that says what to do instead: paste the text, upload it as a text file, or upload its pages as pictures. What this description says about a PDF is what will hold from the day PDFs are read. **Which files.** - A **PDF** (not read yet, see above), up to 10 MB and 300 pages. Its text is read and its paragraphs are put back together. A PDF that is only pictures of pages (a scan) has no text to read: upload the pages as pictures instead. A PDF locked with a password is refused. - A **text file**: `.txt`, `.text`, `.md`, `.markdown` or `.csv`, in UTF-8, UTF-16 or Windows-1252. - A **picture of a document**: PNG, JPEG or WebP, up to 4 MB. The text in it is read with the same text recognition as the `ocr` adapter. - Word and other office files are not read yet: save the file as a PDF and upload that. What a file is comes from what is in it, not from its name or the type it is sent as. A file that is none of these is refused with 415. **The title.** Left out, the name of the file (without its extension) is the title. Visitors see the title as the source of an answer, so send one that means something to them. **The file is not kept.** Only its text, cut into passages, is kept, and `getAiAnswersKnowledge` never returns it. **What leaves Widgetic.** As for text, the words of the document are sent to OpenAI to be embedded when it is added, and the passages used for a question are sent to the AI model that writes the answer. A picture is also sent to the text recognition service. A PDF is read on Widgetic\'s own servers and is not sent anywhere to be read. Say so in your privacy policy. **Treat every document as public.** An answer can quote or paraphrase anything a document says, to any visitor of the widget. Do not add passwords, keys, personal data or anything that must stay private. **Limits.** The widget\'s limits are those of `addAiAnswersKnowledgeDocument` (up to 20 documents, each up to 100000 characters of text, and up to 400000 characters in all; `getAiAnswersKnowledge` reports the current numbers), and the file is at most 10 MB. Adding a document costs no credits. The same text cannot be added twice to one widget (409). The caller must be allowed to change the widget. An API key needs the `content:write` scope. Adds, from text or from a file, share one limit of ten in ten minutes per person. A partner\'s customer in an editor session is one person of its own: its adds are not counted with the partner\'s other customers\'.
122
+ * Add a text file or a picture of a document (a PDF once PDFs are read) for a widget\'s AI to answer from
123
+ */
124
+ async addAiAnswersKnowledgeFile(requestParameters, initOverrides) {
125
+ const response = await this.addAiAnswersKnowledgeFileRaw(requestParameters, initOverrides);
126
+ return await response.value();
127
+ }
64
128
  /**
65
129
  * Checks if the authenticated user can access a specific composition based on workspace context and permissions.
66
130
  * Check Composition Access
@@ -619,7 +683,7 @@ export class CompositionsApi extends runtime.BaseAPI {
619
683
  return await response.value();
620
684
  }
621
685
  /**
622
- * Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route accepts them only from a website on the composition\'s allowed list, and refuses them while that list is empty (the public JSON of the composition stays open to every website). A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says.
686
+ * Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route looks at the website that page is on. While the composition\'s allowed list is empty (you have not restricted the allowed websites), every website may write; once you list websites, only those may, besides Widgetic\'s own sites, the visitor\'s own machine and your own platform. A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says. The public JSON of the composition stays open to every website. For a composition a team shares (one filed under a project of an organization, or made in a Shopify store\'s workspace) the answer also carries `lastEditedBy` and `lastEditedAt`: who made the latest change and when, so that a teammate who opens it can be told \"Anna changed this at 14:32\". A composition in a personal project leaves both out, and so does an answer given to an editor session or to a call made for one managed user: only a person is told who a teammate is.
623
687
  * Get Composition
624
688
  */
625
689
  async getCompositionByIdRaw(requestParameters, initOverrides) {
@@ -650,7 +714,7 @@ export class CompositionsApi extends runtime.BaseAPI {
650
714
  return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionFromWidget201ResponseFromJSON(jsonValue));
651
715
  }
652
716
  /**
653
- * Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route accepts them only from a website on the composition\'s allowed list, and refuses them while that list is empty (the public JSON of the composition stays open to every website). A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says.
717
+ * Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route looks at the website that page is on. While the composition\'s allowed list is empty (you have not restricted the allowed websites), every website may write; once you list websites, only those may, besides Widgetic\'s own sites, the visitor\'s own machine and your own platform. A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says. The public JSON of the composition stays open to every website. For a composition a team shares (one filed under a project of an organization, or made in a Shopify store\'s workspace) the answer also carries `lastEditedBy` and `lastEditedAt`: who made the latest change and when, so that a teammate who opens it can be told \"Anna changed this at 14:32\". A composition in a personal project leaves both out, and so does an answer given to an editor session or to a call made for one managed user: only a person is told who a teammate is.
654
718
  * Get Composition
655
719
  */
656
720
  async getCompositionById(requestParameters, initOverrides) {
@@ -1505,7 +1569,7 @@ export class CompositionsApi extends runtime.BaseAPI {
1505
1569
  return await response.value();
1506
1570
  }
1507
1571
  /**
1508
- * Updates a specific composition. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry. An editor session (see `createManagedUserEditorSession`) can send only `name`, `content`, `design` and `embedSettings`, and only for a composition made for its managed user. A body that names any other field is refused with `403` and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Send `databaseSchema` to add tables to the composition: the tables that are missing are made, and the ones that exist are left as they are. A `databaseSchema` that cannot be used is refused before anything is saved, with `400` and `INVALID_DATABASE_SCHEMA`. If the composition is saved but its tables cannot be made just now, the answer is still `200` and `meta.warnings` says so.
1572
+ * Updates a specific composition. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry. An editor session (see `createManagedUserEditorSession`) can send only `name`, `content`, `design` and `embedSettings`, and only for a composition made for its managed user. A body that names any other field is refused with `403` and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Send `databaseSchema` to add tables to the composition: the tables that are missing are made, and the ones that exist are left as they are. A `databaseSchema` that cannot be used is refused before anything is saved, with `400` and `INVALID_DATABASE_SCHEMA`. If the composition is saved but its tables cannot be made just now, the answer is still `200` and `meta.warnings` says so. **When several people edit the same composition.** A save that carries `content` can name the content version it started from in the `If-Match` header (the `contentVersion` of the composition you read, or the `ETag` of an earlier answer). If somebody saved the content since, nothing is overwritten: the save is refused with `412` and `CONTENT_VERSION_MISMATCH`, and `error.details.currentVersion` is the version to start again from. For a composition a team shares, `error.details` also says who got there first: `lastEditedBy` (`{ id, name }`, or `null` when nobody can be named) and `lastEditedAt`. An editor session, or a call made for one managed user, is told the version only. A save without `If-Match` still goes through, and the other person\'s change is replaced, as it always was.
1509
1573
  * Update Composition
1510
1574
  */
1511
1575
  async updateCompositionRaw(requestParameters, initOverrides) {
@@ -1521,6 +1585,9 @@ export class CompositionsApi extends runtime.BaseAPI {
1521
1585
  const queryParameters = {};
1522
1586
  const headerParameters = {};
1523
1587
  headerParameters['Content-Type'] = 'application/json';
1588
+ if (requestParameters['ifMatch'] != null) {
1589
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
1590
+ }
1524
1591
  if (requestParameters['idempotencyKey'] != null) {
1525
1592
  headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
1526
1593
  }
@@ -1547,7 +1614,7 @@ export class CompositionsApi extends runtime.BaseAPI {
1547
1614
  return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionFromWidget201ResponseFromJSON(jsonValue));
1548
1615
  }
1549
1616
  /**
1550
- * Updates a specific composition. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry. An editor session (see `createManagedUserEditorSession`) can send only `name`, `content`, `design` and `embedSettings`, and only for a composition made for its managed user. A body that names any other field is refused with `403` and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Send `databaseSchema` to add tables to the composition: the tables that are missing are made, and the ones that exist are left as they are. A `databaseSchema` that cannot be used is refused before anything is saved, with `400` and `INVALID_DATABASE_SCHEMA`. If the composition is saved but its tables cannot be made just now, the answer is still `200` and `meta.warnings` says so.
1617
+ * Updates a specific composition. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry. An editor session (see `createManagedUserEditorSession`) can send only `name`, `content`, `design` and `embedSettings`, and only for a composition made for its managed user. A body that names any other field is refused with `403` and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Send `databaseSchema` to add tables to the composition: the tables that are missing are made, and the ones that exist are left as they are. A `databaseSchema` that cannot be used is refused before anything is saved, with `400` and `INVALID_DATABASE_SCHEMA`. If the composition is saved but its tables cannot be made just now, the answer is still `200` and `meta.warnings` says so. **When several people edit the same composition.** A save that carries `content` can name the content version it started from in the `If-Match` header (the `contentVersion` of the composition you read, or the `ETag` of an earlier answer). If somebody saved the content since, nothing is overwritten: the save is refused with `412` and `CONTENT_VERSION_MISMATCH`, and `error.details.currentVersion` is the version to start again from. For a composition a team shares, `error.details` also says who got there first: `lastEditedBy` (`{ id, name }`, or `null` when nobody can be named) and `lastEditedAt`. An editor session, or a call made for one managed user, is told the version only. A save without `If-Match` still goes through, and the other person\'s change is replaced, as it always was.
1551
1618
  * Update Composition
1552
1619
  */
1553
1620
  async updateComposition(requestParameters, initOverrides) {
@@ -109,7 +109,7 @@ export class ManagedUsersApi extends runtime.BaseAPI {
109
109
  return await response.value();
110
110
  }
111
111
  /**
112
- * Makes a short-lived credential that lets the browser of ONE of your managed users use Widgetic\'s editor pieces, such as the File Browser and the composition editor, without your API key ever reaching that browser. Call this from your server when the page that hosts the editor opens, and hand the `token` in the answer to that page. The token is shown once. It starts with `wgt_ses_` and the browser sends it as `Authorization: Bearer <token>`. It can do only what the `surfaces` you name allow, and only for this managed user: - `files`: upload a file (`uploadsPost`) and list the files uploaded for this user (`uploadsGet`). Every file is filed for this user and stored in your own storage destination, never in Widgetic\'s: a file a customer uploads is yours to keep, and takes none of your storage allowance. Partner storage is not optional, so no session, whatever its surfaces, can be made until you have set a destination (`setPartnerStorageDestination`); until then it is refused with 409 and `PARTNER_STORAGE_REQUIRED`, and when the destination cannot be used with 503 and `STORAGE_DESTINATION_UNAVAILABLE`. A destination you remove after the session was made stops its uploads too (the same 409; the browser is only told that the feature is not available right now). To keep a customer from uploading, leave `files` out of the session and hand the editors your own media library instead (`mediaLibrary`). - `editor`: edit one of this user\'s compositions: read it (`getCompositionById`, its content, design, embed settings and schemas), check a content change (`validateCompositionContent`), and change its name, content, design and embed settings (`updateComposition`, `setDynamicContent`). It can reach only compositions you created for this managed user (tag them with `managedUserId` when you create them); any other composition, including another of your users\', answers 404. - `creator`: use Widgetic\'s widget creator for this user, including its AI. Draw on canvases and save them (`getAllCanvases`, `getCanvas`, `createCanvas`, `updateCanvas`, `previewDeleteCanvas`, `deleteCanvas`); make, change, copy and delete the widgets on them (`createWidget`, `getWidgets`, `getWidgetsBatch`, `updateWidget`, `uploadWidgetThumbnail`, `duplicateWidget`, `deleteWidget`); list and make the compositions of a widget it built (`getAllCompositions`, `createComposition`), which is how it shows the widget with sample values; keep the conversation of each widget (`getConversationsByWidgetId`, `createConversationForWidget`, `updateConversation`, `getMessages`, `createMessage`, `updateMessage`, `restoreCheckpoint`); and read a widget\'s schemas and give it its repository (`getWidgetContentSchema`, `getWidgetDesignSchema`, `updateWidgetRepository`). The AI that builds a widget is part of it: list the models (`agentModelsGet`), open the widget\'s repository (`agentRepositoriesPost`, `agentRepositoriesRepoIdGet`), start a generation and follow or cancel it (`agentCodeGeneratePost`, `operationsStreamGet`, `operationsIdGet`, `operationsIdCancelPost`), build and preview the result (`agentWidgetBuilderRepoHeadWidgetIdGet`, `buildWidgetFromRepo`, `previewWidgetVersion`), publish a version of the widget and move between its versions (`agentWidgetBuilderPublishWidgetIdPost`, `getWidgetPublishHistory`, `setWidgetPublishHistoryLive`, `renameWidgetPublishHistoryTitle`), and turn a stroke or a sentence into a decision (`agentShapeRecognizePost`, `agentDesignResolvePost`). It can also offer the customer your presets as starting points: read them and ask for a copy for this customer (`listMyPresets`, `copyMyPreset`; you choose the presets with `setPartnerPreset`). What the session makes is filed for this managed user, and the lists it reads hold only this user\'s canvases, widgets and compositions. It can reach only canvases, widgets, compositions, repositories, uploaded files and operations made for this managed user (tag the canvases and widgets you create with `managedUserId`); any other canvas, widget, composition, conversation, message, repository, file or operation, including another of your users\', answers 404. The creator also saves the composition it is editing (`updateComposition`, from the `editor` surface) and attaches pictures to its chat (`uploadsPost`, from the `files` surface), and the surfaces do not imply one another: to open the whole creator for a user, ask for `creator`, `editor` and `files` together. A generation or a build one user starts can be followed and cancelled by that user and by you, never by another of your users. The AI is paid for by your account, as your own calls are: its credits and allowances are yours. A session cannot make a widget public (publishing a version does not), file one under a project or an organization, or set anything the creator does not set: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Everything else is refused with 403 and `EDITOR_SESSION_ROUTE_NOT_ALLOWED`: a session cannot read your account, make more sessions, change your presets or delete a composition, and a session without the `creator` surface cannot create or list compositions. Create the composition yourself with your API key, then open the editor on it. A session ends at `expiresAt` (at most four hours), when you end it (`revokeManagedUserEditorSession`), or when the managed user is switched off or deleted. A managed user can have at most 100 live sessions at once (`429 EDITOR_SESSION_LIMIT_REACHED`). A session that is bound to a web page (`allowedOrigin`) is refused from any other origin. The AI the session runs is paid for with your credits. Set `maxCredits` to hold the session to a number of them: once its generations have taken that many (a generation that fails is refunded and does not count), the next one is refused with 402 and `EDITOR_SESSION_CREDIT_LIMIT_REACHED`, and the browser is told only that the feature is not available right now. Without it, the limit Widgetic has set for your account applies when it has set one (the same limit for every session you make, and `maxCredits: null` asks for none), and otherwise the credits of your account are the only ceiling. What each of your users\' sessions has spent is in `getManagedUserUsage`. Each call makes a new session. It does not take an `Idempotency-Key`: the answer holds the token, and the token is never stored where a retry could read it back. The answer is sent with `Cache-Control: no-store`.
112
+ * Makes a short-lived credential that lets the browser of ONE of your managed users use Widgetic\'s editor pieces, such as the File Browser and the composition editor, without your API key ever reaching that browser. Call this from your server when the page that hosts the editor opens, and hand the `token` in the answer to that page. The token is shown once. It starts with `wgt_ses_` and the browser sends it as `Authorization: Bearer <token>`. It can do only what the `surfaces` you name allow, and only for this managed user: - `files`: upload a file (`uploadsPost`) and list the files uploaded for this user (`uploadsGet`). Every file is filed for this user and stored in your own storage destination, never in Widgetic\'s: a file a customer uploads is yours to keep, and takes none of your storage allowance. Partner storage is not optional, so no session, whatever its surfaces, can be made until you have set a destination (`setPartnerStorageDestination`); until then it is refused with 409 and `PARTNER_STORAGE_REQUIRED`, and when the destination cannot be used with 503 and `STORAGE_DESTINATION_UNAVAILABLE`. A destination you remove after the session was made stops its uploads too (the same 409; the browser is only told that the feature is not available right now). To keep a customer from uploading, leave `files` out of the session and hand the editors your own media library instead (`mediaLibrary`). - `editor`: edit one of this user\'s compositions: read it (`getCompositionById`, its content, design, embed settings and schemas), check a content change (`validateCompositionContent`), and change its name, content, design and embed settings (`updateComposition`, `setDynamicContent`). For a widget that answers visitors\' questions from documents (the `ai-answers` adapter), it also lists those documents, adds one as text or as a file (a text file or a picture; a PDF once PDFs are read), and removes one (`getAiAnswersKnowledge`, `addAiAnswersKnowledgeDocument`, `addAiAnswersKnowledgeFile`, `removeAiAnswersKnowledgeDocument`); adding costs no credits, and is limited for each of your users separately. It can reach only compositions you created for this managed user (tag them with `managedUserId` when you create them); any other composition, including another of your users\', answers 404. - `creator`: use Widgetic\'s widget creator for this user, including its AI. Draw on canvases and save them (`getAllCanvases`, `getCanvas`, `createCanvas`, `updateCanvas`, `previewDeleteCanvas`, `deleteCanvas`); make, change, copy and delete the widgets on them (`createWidget`, `getWidgets`, `getWidgetsBatch`, `updateWidget`, `uploadWidgetThumbnail`, `duplicateWidget`, `deleteWidget`); list and make the compositions of a widget it built (`getAllCompositions`, `createComposition`), which is how it shows the widget with sample values; keep the conversation of each widget (`getConversationsByWidgetId`, `createConversationForWidget`, `updateConversation`, `getMessages`, `createMessage`, `updateMessage`, `restoreCheckpoint`); and read a widget\'s schemas and give it its repository (`getWidgetContentSchema`, `getWidgetDesignSchema`, `updateWidgetRepository`). The AI that builds a widget is part of it: list the models (`agentModelsGet`), open the widget\'s repository (`agentRepositoriesPost`, `agentRepositoriesRepoIdGet`), start a generation and follow or cancel it (`agentCodeGeneratePost`, `operationsStreamGet`, `operationsIdGet`, `operationsIdCancelPost`), build and preview the result (`agentWidgetBuilderRepoHeadWidgetIdGet`, `buildWidgetFromRepo`, `previewWidgetVersion`), publish a version of the widget and move between its versions (`agentWidgetBuilderPublishWidgetIdPost`, `getWidgetPublishHistory`, `setWidgetPublishHistoryLive`, `renameWidgetPublishHistoryTitle`), and turn a stroke or a sentence into a decision (`agentShapeRecognizePost`, `agentDesignResolvePost`). It can also offer the customer your presets as starting points: read them and ask for a copy for this customer (`listMyPresets`, `copyMyPreset`; you choose the presets with `setPartnerPreset`). What the session makes is filed for this managed user, and the lists it reads hold only this user\'s canvases, widgets and compositions. It can reach only canvases, widgets, compositions, repositories, uploaded files and operations made for this managed user (tag the canvases and widgets you create with `managedUserId`); any other canvas, widget, composition, conversation, message, repository, file or operation, including another of your users\', answers 404. The creator also saves the composition it is editing (`updateComposition`, from the `editor` surface) and attaches pictures to its chat (`uploadsPost`, from the `files` surface), and the surfaces do not imply one another: to open the whole creator for a user, ask for `creator`, `editor` and `files` together. A generation or a build one user starts can be followed and cancelled by that user and by you, never by another of your users. The AI is paid for by your account, as your own calls are: its credits and allowances are yours. A session cannot make a widget public (publishing a version does not), file one under a project or an organization, or set anything the creator does not set: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. - `workflows`: use Widgetic\'s Workflows editor for this user. List their workflows and the compositions a workflow of theirs can chain (`listWorkspaceWorkflows`, `listWorkspaceWorkflowCompositionOptions`); list the starting points you offer them and make a workflow from one, which gives the user their own copy of every widget it chains, a composition of their own on each copy, and a draft (`listWorkspaceWorkflowPresets`, `createWorkspaceWorkflowFromPreset`; you offer them with `setPartnerWorkflowPreset`); make, open, change and delete one (`createWorkspaceWorkflow`, `getWorkspaceWorkflow`, `saveWorkspaceWorkflow`, `deleteWorkspaceWorkflow`) and copy it (`duplicateWorkspaceWorkflow`); publish it or discard the changes of its draft (`publishWorkspaceWorkflow`, `discardWorkspaceWorkflowChanges`); read and restore its versions (`listWorkspaceWorkflowVersions`, `getWorkspaceWorkflowVersion`, `restoreWorkspaceWorkflowVersion`); pause, resume, archive and unarchive it (`pauseWorkspaceWorkflow`, `resumeWorkspaceWorkflow`, `archiveWorkspaceWorkflow`, `unarchiveWorkspaceWorkflow`); and read its counts (`getWorkspaceWorkflowStats`). The workspace in each path is `personal`: a session has no other, and a path that names an organization is refused. What the session makes is filed for this managed user (`managedUserId`), the lists hold only this user\'s workflows, and it can reach only workflows made for this managed user; any other workflow, including one of yours or of another of your users, answers 404. A workflow can chain only the compositions you made for this managed user (tag them with `managedUserId`): one that belongs to anybody else is not available, and publishing a workflow that uses it is refused. A customer can have at most 50 workflows, and what a customer\'s session reads never says who published a version. A session cannot set who a workflow belongs to or which workspace it is in: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Everything else is refused with 403 and `EDITOR_SESSION_ROUTE_NOT_ALLOWED`: a session cannot read your account, make more sessions, change your presets or delete a composition, and a session without the `creator` surface cannot create or list compositions. Create the composition yourself with your API key, then open the editor on it. A session ends at `expiresAt` (at most four hours), when you end it (`revokeManagedUserEditorSession`), or when the managed user is switched off or deleted. A managed user can have at most 100 live sessions at once (`429 EDITOR_SESSION_LIMIT_REACHED`). A session that is bound to a web page (`allowedOrigin`) is refused from any other origin. The AI the session runs is paid for with your credits. Set `maxCredits` to hold the session to a number of them: once its generations have taken that many (a generation that fails is refunded and does not count), the next one is refused with 402 and `EDITOR_SESSION_CREDIT_LIMIT_REACHED`, and the browser is told only that the feature is not available right now. Without it, the limit Widgetic has set for your account applies when it has set one (the same limit for every session you make, and `maxCredits: null` asks for none), and otherwise the credits of your account are the only ceiling. What each of your users\' sessions has spent is in `getManagedUserUsage`. Each call makes a new session. It does not take an `Idempotency-Key`: the answer holds the token, and the token is never stored where a retry could read it back. The answer is sent with `Cache-Control: no-store`.
113
113
  * Create an editor session for a managed user
114
114
  */
115
115
  async createManagedUserEditorSessionRaw(requestParameters, initOverrides) {
@@ -139,7 +139,7 @@ export class ManagedUsersApi extends runtime.BaseAPI {
139
139
  return new runtime.JSONApiResponse(response, (jsonValue) => EditorSessionResponseFromJSON(jsonValue));
140
140
  }
141
141
  /**
142
- * Makes a short-lived credential that lets the browser of ONE of your managed users use Widgetic\'s editor pieces, such as the File Browser and the composition editor, without your API key ever reaching that browser. Call this from your server when the page that hosts the editor opens, and hand the `token` in the answer to that page. The token is shown once. It starts with `wgt_ses_` and the browser sends it as `Authorization: Bearer <token>`. It can do only what the `surfaces` you name allow, and only for this managed user: - `files`: upload a file (`uploadsPost`) and list the files uploaded for this user (`uploadsGet`). Every file is filed for this user and stored in your own storage destination, never in Widgetic\'s: a file a customer uploads is yours to keep, and takes none of your storage allowance. Partner storage is not optional, so no session, whatever its surfaces, can be made until you have set a destination (`setPartnerStorageDestination`); until then it is refused with 409 and `PARTNER_STORAGE_REQUIRED`, and when the destination cannot be used with 503 and `STORAGE_DESTINATION_UNAVAILABLE`. A destination you remove after the session was made stops its uploads too (the same 409; the browser is only told that the feature is not available right now). To keep a customer from uploading, leave `files` out of the session and hand the editors your own media library instead (`mediaLibrary`). - `editor`: edit one of this user\'s compositions: read it (`getCompositionById`, its content, design, embed settings and schemas), check a content change (`validateCompositionContent`), and change its name, content, design and embed settings (`updateComposition`, `setDynamicContent`). It can reach only compositions you created for this managed user (tag them with `managedUserId` when you create them); any other composition, including another of your users\', answers 404. - `creator`: use Widgetic\'s widget creator for this user, including its AI. Draw on canvases and save them (`getAllCanvases`, `getCanvas`, `createCanvas`, `updateCanvas`, `previewDeleteCanvas`, `deleteCanvas`); make, change, copy and delete the widgets on them (`createWidget`, `getWidgets`, `getWidgetsBatch`, `updateWidget`, `uploadWidgetThumbnail`, `duplicateWidget`, `deleteWidget`); list and make the compositions of a widget it built (`getAllCompositions`, `createComposition`), which is how it shows the widget with sample values; keep the conversation of each widget (`getConversationsByWidgetId`, `createConversationForWidget`, `updateConversation`, `getMessages`, `createMessage`, `updateMessage`, `restoreCheckpoint`); and read a widget\'s schemas and give it its repository (`getWidgetContentSchema`, `getWidgetDesignSchema`, `updateWidgetRepository`). The AI that builds a widget is part of it: list the models (`agentModelsGet`), open the widget\'s repository (`agentRepositoriesPost`, `agentRepositoriesRepoIdGet`), start a generation and follow or cancel it (`agentCodeGeneratePost`, `operationsStreamGet`, `operationsIdGet`, `operationsIdCancelPost`), build and preview the result (`agentWidgetBuilderRepoHeadWidgetIdGet`, `buildWidgetFromRepo`, `previewWidgetVersion`), publish a version of the widget and move between its versions (`agentWidgetBuilderPublishWidgetIdPost`, `getWidgetPublishHistory`, `setWidgetPublishHistoryLive`, `renameWidgetPublishHistoryTitle`), and turn a stroke or a sentence into a decision (`agentShapeRecognizePost`, `agentDesignResolvePost`). It can also offer the customer your presets as starting points: read them and ask for a copy for this customer (`listMyPresets`, `copyMyPreset`; you choose the presets with `setPartnerPreset`). What the session makes is filed for this managed user, and the lists it reads hold only this user\'s canvases, widgets and compositions. It can reach only canvases, widgets, compositions, repositories, uploaded files and operations made for this managed user (tag the canvases and widgets you create with `managedUserId`); any other canvas, widget, composition, conversation, message, repository, file or operation, including another of your users\', answers 404. The creator also saves the composition it is editing (`updateComposition`, from the `editor` surface) and attaches pictures to its chat (`uploadsPost`, from the `files` surface), and the surfaces do not imply one another: to open the whole creator for a user, ask for `creator`, `editor` and `files` together. A generation or a build one user starts can be followed and cancelled by that user and by you, never by another of your users. The AI is paid for by your account, as your own calls are: its credits and allowances are yours. A session cannot make a widget public (publishing a version does not), file one under a project or an organization, or set anything the creator does not set: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Everything else is refused with 403 and `EDITOR_SESSION_ROUTE_NOT_ALLOWED`: a session cannot read your account, make more sessions, change your presets or delete a composition, and a session without the `creator` surface cannot create or list compositions. Create the composition yourself with your API key, then open the editor on it. A session ends at `expiresAt` (at most four hours), when you end it (`revokeManagedUserEditorSession`), or when the managed user is switched off or deleted. A managed user can have at most 100 live sessions at once (`429 EDITOR_SESSION_LIMIT_REACHED`). A session that is bound to a web page (`allowedOrigin`) is refused from any other origin. The AI the session runs is paid for with your credits. Set `maxCredits` to hold the session to a number of them: once its generations have taken that many (a generation that fails is refunded and does not count), the next one is refused with 402 and `EDITOR_SESSION_CREDIT_LIMIT_REACHED`, and the browser is told only that the feature is not available right now. Without it, the limit Widgetic has set for your account applies when it has set one (the same limit for every session you make, and `maxCredits: null` asks for none), and otherwise the credits of your account are the only ceiling. What each of your users\' sessions has spent is in `getManagedUserUsage`. Each call makes a new session. It does not take an `Idempotency-Key`: the answer holds the token, and the token is never stored where a retry could read it back. The answer is sent with `Cache-Control: no-store`.
142
+ * Makes a short-lived credential that lets the browser of ONE of your managed users use Widgetic\'s editor pieces, such as the File Browser and the composition editor, without your API key ever reaching that browser. Call this from your server when the page that hosts the editor opens, and hand the `token` in the answer to that page. The token is shown once. It starts with `wgt_ses_` and the browser sends it as `Authorization: Bearer <token>`. It can do only what the `surfaces` you name allow, and only for this managed user: - `files`: upload a file (`uploadsPost`) and list the files uploaded for this user (`uploadsGet`). Every file is filed for this user and stored in your own storage destination, never in Widgetic\'s: a file a customer uploads is yours to keep, and takes none of your storage allowance. Partner storage is not optional, so no session, whatever its surfaces, can be made until you have set a destination (`setPartnerStorageDestination`); until then it is refused with 409 and `PARTNER_STORAGE_REQUIRED`, and when the destination cannot be used with 503 and `STORAGE_DESTINATION_UNAVAILABLE`. A destination you remove after the session was made stops its uploads too (the same 409; the browser is only told that the feature is not available right now). To keep a customer from uploading, leave `files` out of the session and hand the editors your own media library instead (`mediaLibrary`). - `editor`: edit one of this user\'s compositions: read it (`getCompositionById`, its content, design, embed settings and schemas), check a content change (`validateCompositionContent`), and change its name, content, design and embed settings (`updateComposition`, `setDynamicContent`). For a widget that answers visitors\' questions from documents (the `ai-answers` adapter), it also lists those documents, adds one as text or as a file (a text file or a picture; a PDF once PDFs are read), and removes one (`getAiAnswersKnowledge`, `addAiAnswersKnowledgeDocument`, `addAiAnswersKnowledgeFile`, `removeAiAnswersKnowledgeDocument`); adding costs no credits, and is limited for each of your users separately. It can reach only compositions you created for this managed user (tag them with `managedUserId` when you create them); any other composition, including another of your users\', answers 404. - `creator`: use Widgetic\'s widget creator for this user, including its AI. Draw on canvases and save them (`getAllCanvases`, `getCanvas`, `createCanvas`, `updateCanvas`, `previewDeleteCanvas`, `deleteCanvas`); make, change, copy and delete the widgets on them (`createWidget`, `getWidgets`, `getWidgetsBatch`, `updateWidget`, `uploadWidgetThumbnail`, `duplicateWidget`, `deleteWidget`); list and make the compositions of a widget it built (`getAllCompositions`, `createComposition`), which is how it shows the widget with sample values; keep the conversation of each widget (`getConversationsByWidgetId`, `createConversationForWidget`, `updateConversation`, `getMessages`, `createMessage`, `updateMessage`, `restoreCheckpoint`); and read a widget\'s schemas and give it its repository (`getWidgetContentSchema`, `getWidgetDesignSchema`, `updateWidgetRepository`). The AI that builds a widget is part of it: list the models (`agentModelsGet`), open the widget\'s repository (`agentRepositoriesPost`, `agentRepositoriesRepoIdGet`), start a generation and follow or cancel it (`agentCodeGeneratePost`, `operationsStreamGet`, `operationsIdGet`, `operationsIdCancelPost`), build and preview the result (`agentWidgetBuilderRepoHeadWidgetIdGet`, `buildWidgetFromRepo`, `previewWidgetVersion`), publish a version of the widget and move between its versions (`agentWidgetBuilderPublishWidgetIdPost`, `getWidgetPublishHistory`, `setWidgetPublishHistoryLive`, `renameWidgetPublishHistoryTitle`), and turn a stroke or a sentence into a decision (`agentShapeRecognizePost`, `agentDesignResolvePost`). It can also offer the customer your presets as starting points: read them and ask for a copy for this customer (`listMyPresets`, `copyMyPreset`; you choose the presets with `setPartnerPreset`). What the session makes is filed for this managed user, and the lists it reads hold only this user\'s canvases, widgets and compositions. It can reach only canvases, widgets, compositions, repositories, uploaded files and operations made for this managed user (tag the canvases and widgets you create with `managedUserId`); any other canvas, widget, composition, conversation, message, repository, file or operation, including another of your users\', answers 404. The creator also saves the composition it is editing (`updateComposition`, from the `editor` surface) and attaches pictures to its chat (`uploadsPost`, from the `files` surface), and the surfaces do not imply one another: to open the whole creator for a user, ask for `creator`, `editor` and `files` together. A generation or a build one user starts can be followed and cancelled by that user and by you, never by another of your users. The AI is paid for by your account, as your own calls are: its credits and allowances are yours. A session cannot make a widget public (publishing a version does not), file one under a project or an organization, or set anything the creator does not set: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. - `workflows`: use Widgetic\'s Workflows editor for this user. List their workflows and the compositions a workflow of theirs can chain (`listWorkspaceWorkflows`, `listWorkspaceWorkflowCompositionOptions`); list the starting points you offer them and make a workflow from one, which gives the user their own copy of every widget it chains, a composition of their own on each copy, and a draft (`listWorkspaceWorkflowPresets`, `createWorkspaceWorkflowFromPreset`; you offer them with `setPartnerWorkflowPreset`); make, open, change and delete one (`createWorkspaceWorkflow`, `getWorkspaceWorkflow`, `saveWorkspaceWorkflow`, `deleteWorkspaceWorkflow`) and copy it (`duplicateWorkspaceWorkflow`); publish it or discard the changes of its draft (`publishWorkspaceWorkflow`, `discardWorkspaceWorkflowChanges`); read and restore its versions (`listWorkspaceWorkflowVersions`, `getWorkspaceWorkflowVersion`, `restoreWorkspaceWorkflowVersion`); pause, resume, archive and unarchive it (`pauseWorkspaceWorkflow`, `resumeWorkspaceWorkflow`, `archiveWorkspaceWorkflow`, `unarchiveWorkspaceWorkflow`); and read its counts (`getWorkspaceWorkflowStats`). The workspace in each path is `personal`: a session has no other, and a path that names an organization is refused. What the session makes is filed for this managed user (`managedUserId`), the lists hold only this user\'s workflows, and it can reach only workflows made for this managed user; any other workflow, including one of yours or of another of your users, answers 404. A workflow can chain only the compositions you made for this managed user (tag them with `managedUserId`): one that belongs to anybody else is not available, and publishing a workflow that uses it is refused. A customer can have at most 50 workflows, and what a customer\'s session reads never says who published a version. A session cannot set who a workflow belongs to or which workspace it is in: a body with another field is refused with 403 and `EDITOR_SESSION_FIELD_NOT_ALLOWED`. Everything else is refused with 403 and `EDITOR_SESSION_ROUTE_NOT_ALLOWED`: a session cannot read your account, make more sessions, change your presets or delete a composition, and a session without the `creator` surface cannot create or list compositions. Create the composition yourself with your API key, then open the editor on it. A session ends at `expiresAt` (at most four hours), when you end it (`revokeManagedUserEditorSession`), or when the managed user is switched off or deleted. A managed user can have at most 100 live sessions at once (`429 EDITOR_SESSION_LIMIT_REACHED`). A session that is bound to a web page (`allowedOrigin`) is refused from any other origin. The AI the session runs is paid for with your credits. Set `maxCredits` to hold the session to a number of them: once its generations have taken that many (a generation that fails is refunded and does not count), the next one is refused with 402 and `EDITOR_SESSION_CREDIT_LIMIT_REACHED`, and the browser is told only that the feature is not available right now. Without it, the limit Widgetic has set for your account applies when it has set one (the same limit for every session you make, and `maxCredits: null` asks for none), and otherwise the credits of your account are the only ceiling. What each of your users\' sessions has spent is in `getManagedUserUsage`. Each call makes a new session. It does not take an `Idempotency-Key`: the answer holds the token, and the token is never stored where a retry could read it back. The answer is sent with `Cache-Control: no-store`.
143
143
  * Create an editor session for a managed user
144
144
  */
145
145
  async createManagedUserEditorSession(requestParameters, initOverrides) {