@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,13 +12,13 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { AccountCreditBalanceResponseFromJSON, AddAiAnswersKnowledgeDocument201ResponseFromJSON, AddAiAnswersKnowledgeDocumentRequestToJSON, AddDomainRequestToJSON, CanvasResponseFromJSON, CheckCompositionAccessResponseFromJSON, CompositionDataSourceResponseFromJSON, CompositionEntriesDescriptionResponseFromJSON, CompositionEntriesReadingResponseFromJSON, CompositionEntryDeleteSuccessFromJSON, CompositionEntryItemsPageSuccessFromJSON, CompositionResponseFromJSON, CopyPartnerPresetRequestToJSON, CreateCanvasRequestToJSON, CreateCompositionContentItem201ResponseFromJSON, CreateCompositionContentItemRequestToJSON, CreateCompositionDatabaseRecord201ResponseFromJSON, CreateCompositionFromPresetRequestToJSON, CreateCompositionFromWidget201ResponseFromJSON, CreateCompositionFromWidgetRequestToJSON, CreateUserApiKeyRequestToJSON, CreateWidget201ResponseFromJSON, CreatedUserApiKeyResponseFromJSON, DeleteCompositionContentItemResponseFromJSON, DeleteCompositionDataSourceResponseFromJSON, DeleteManagedUser200ResponseFromJSON, DeletePersonalWorkspaceDomainResponseFromJSON, DeleteUserApiKeyResponseFromJSON, DuplicateComposition202ResponseFromJSON, DuplicateCompositionRequestToJSON, EditorSessionResponseFromJSON, GetAiAnswersKnowledge200ResponseFromJSON, GetAllCanvasesResponseFromJSON, GetAllCompositions200ResponseFromJSON, GetAllManagedUsers200ResponseFromJSON, GetCompositionContentResponseFromJSON, GetCompositionContentSchemaResponseFromJSON, GetCompositionDataSourceResponseFromJSON, GetCompositionDatabaseRecords200ResponseFromJSON, GetCompositionDesignResponseFromJSON, GetCompositionDesignSchemaResponseFromJSON, GetCompositionEmbedSchemaResponseFromJSON, GetCompositionEmbedSettingsResponseFromJSON, GetCompositionPreviewResponseFromJSON, GetCompositionVersions200ResponseFromJSON, GetCompositionsBatchRequestToJSON, GetCompositionsBatchResponseFromJSON, GetInvoicesByPartnerId200ResponseFromJSON, GetManagedUserEntitlementsResponseFromJSON, GetManagedUserLimits200ResponseFromJSON, GetManagedUserStorageUsage200ResponseFromJSON, GetManagedUsersByManagerIdResponseFromJSON, GetPartnerBillingOverview200ResponseFromJSON, GetPartnerCreditTransactions200ResponseFromJSON, GetPartnerDesignDefaults200ResponseFromJSON, GetPartnerEntitlementsResponseFromJSON, GetPersonalWorkspaceDomains200ResponseFromJSON, GetPublicCompositionEmbed200ResponseFromJSON, GetUserAdapterConnections200ResponseFromJSON, GetUserApiKeyUsageLogsResponseFromJSON, GetUserApiKeys200ResponseFromJSON, GetWidgets200ResponseFromJSON, GetWidgetsBatchRequestToJSON, GetWidgetsBatchResponseFromJSON, ListPartnerPresets200ResponseFromJSON, ManagedUserEntriesPageSuccessFromJSON, ManagedUserResponseFromJSON, ManagedUserUsageResponseFromJSON, MyPartnersResponseFromJSON, NewCompositionToJSON, NewEditorSessionToJSON, NewManagedUserToJSON, NewWidgetToJSON, OperationsIdGetResponseFromJSON, PartnerAnalyticsByManagedUserResponseFromJSON, PartnerAnalyticsSummaryResponseFromJSON, PartnerAnalyticsTimelineResponseFromJSON, PartnerAnalyticsTopWidgetsResponseFromJSON, PartnerContractResponseFromJSON, PartnerDataDatabaseRemovalResponseFromJSON, PartnerDataDatabaseResponseFromJSON, PartnerEntryContextSecretResponseFromJSON, PartnerEntryContextSigningResponseFromJSON, PartnerExtraCreditsInvoiceResponseFromJSON, PartnerNotificationDeliveryLogResponseFromJSON, PartnerNotificationDeliveryResponseFromJSON, PartnerNotificationPageResponseFromJSON, PartnerNotificationSettingsChangeResponseFromJSON, PartnerNotificationSettingsResponseFromJSON, PartnerNotificationTestEventRequestToJSON, PartnerNotificationTestEventResultResponseFromJSON, PartnerPresetCopyResponseFromJSON, PartnerPresetRemovalResponseFromJSON, PartnerPresetResponseFromJSON, PartnerStorageDestinationResponseFromJSON, PartnerStorageRemovalResponseFromJSON, PartnerStorageUsageResponseFromJSON, PersonalWorkspaceDomainResultResponseFromJSON, PostPublicCompositionEmbedStatus200ResponseFromJSON, PostPublicCompositionEmbedStatusRequestToJSON, PublicAdapterCallRequestToJSON, PublicAdapterCallResultFromJSON, PublicAdapterFileResultFromJSON, PublicCompositionEntryCreatedFromJSON, PublicCompositionEntryRequestToJSON, RemoveAiAnswersKnowledgeDocument200ResponseFromJSON, RemoveUserAdapterConnection200ResponseFromJSON, RequestExtraCreditsToJSON, RevokeManagedUserEditorSessionsResponseFromJSON, SetAdapterConnectionRequestToJSON, SetCompositionDataSourceRequestToJSON, SetDynamicContentRequestToJSON, SetDynamicContentResponseFromJSON, SetManagedUserLimitsRequestToJSON, SetPartnerDataDatabaseRequestToJSON, SetPartnerDesignDefaultsRequestToJSON, SetPartnerPresetRequestToJSON, SetPartnerStorageDestinationRequestToJSON, SetUserAdapterConnection200ResponseFromJSON, UpdateCanvasRequestToJSON, UpdateCompositionToJSON, UpdateCompositionStatusRequestToJSON, UpdateDomainRequestToJSON, UpdateManagedUserToJSON, UpdatePartnerEntryContextSigningRequestToJSON, UpdatePartnerNotificationSettingsRequestToJSON, UpdateUserApiKeyRequestToJSON, UploadLimitsResponseFromJSON, UploadResponseFromJSON, UploadsGet200ResponseFromJSON, UploadsIdDelete200ResponseFromJSON, UserApiKeyResponseFromJSON, ValidateCompositionContentResponseFromJSON, ValidateToken200ResponseFromJSON, } from '../models/index.js';
15
+ import { AccountCreditBalanceResponseFromJSON, AddAiAnswersKnowledgeDocument201ResponseFromJSON, AddAiAnswersKnowledgeDocumentRequestToJSON, AddDomainRequestToJSON, CanvasResponseFromJSON, CheckCompositionAccessResponseFromJSON, CompositionDataSourceResponseFromJSON, CompositionEntriesDescriptionResponseFromJSON, CompositionEntriesReadingResponseFromJSON, CompositionEntryDeleteSuccessFromJSON, CompositionEntryItemsPageSuccessFromJSON, CompositionResponseFromJSON, ConfirmAdapterConnectionRequestToJSON, CopyPartnerPresetRequestToJSON, CreateCanvasRequestToJSON, CreateCompositionContentItem201ResponseFromJSON, CreateCompositionContentItemRequestToJSON, CreateCompositionDatabaseRecord201ResponseFromJSON, CreateCompositionFromPresetRequestToJSON, CreateCompositionFromWidget201ResponseFromJSON, CreateCompositionFromWidgetRequestToJSON, CreateUserApiKeyRequestToJSON, CreateWidget201ResponseFromJSON, CreateWorkspaceWorkflowFromPreset201ResponseFromJSON, CreateWorkspaceWorkflowFromPresetRequestToJSON, CreateWorkspaceWorkflowRequestToJSON, CreatedUserApiKeyResponseFromJSON, DeleteCompositionContentItemResponseFromJSON, DeleteCompositionDataSourceResponseFromJSON, DeleteManagedUser200ResponseFromJSON, DeletePersonalWorkspaceDomainResponseFromJSON, DeleteUserApiKeyResponseFromJSON, DeleteWorkspaceWorkflow200ResponseFromJSON, DuplicateComposition202ResponseFromJSON, DuplicateCompositionRequestToJSON, EditorSessionResponseFromJSON, GetAiAnswersKnowledge200ResponseFromJSON, GetAllCanvasesResponseFromJSON, GetAllCompositions200ResponseFromJSON, GetAllManagedUsers200ResponseFromJSON, GetCompositionContentResponseFromJSON, GetCompositionContentSchemaResponseFromJSON, GetCompositionDataSourceResponseFromJSON, GetCompositionDatabaseRecords200ResponseFromJSON, GetCompositionDesignResponseFromJSON, GetCompositionDesignSchemaResponseFromJSON, GetCompositionEmbedSchemaResponseFromJSON, GetCompositionEmbedSettingsResponseFromJSON, GetCompositionPreviewResponseFromJSON, GetCompositionVersions200ResponseFromJSON, GetCompositionsBatchRequestToJSON, GetCompositionsBatchResponseFromJSON, GetInvoicesByPartnerId200ResponseFromJSON, GetManagedUserEntitlementsResponseFromJSON, GetManagedUserLimits200ResponseFromJSON, GetManagedUserStorageUsage200ResponseFromJSON, GetManagedUsersByManagerIdResponseFromJSON, GetPartnerBillingOverview200ResponseFromJSON, GetPartnerCreditTransactions200ResponseFromJSON, GetPartnerDesignDefaults200ResponseFromJSON, GetPartnerEntitlementsResponseFromJSON, GetPersonalWorkspaceDomains200ResponseFromJSON, GetPublicCompositionEmbed200ResponseFromJSON, GetPublicWorkflow200ResponseFromJSON, GetUserAdapterConnections200ResponseFromJSON, GetUserApiKeyUsageLogsResponseFromJSON, GetUserApiKeys200ResponseFromJSON, GetWidgets200ResponseFromJSON, GetWidgetsBatchRequestToJSON, GetWidgetsBatchResponseFromJSON, GetWorkspaceWorkflowStats200ResponseFromJSON, GetWorkspaceWorkflowVersion200ResponseFromJSON, ListPartnerPresets200ResponseFromJSON, ListPartnerWorkflowPresets200ResponseFromJSON, ListWorkspaceWorkflowCompositionOptions200ResponseFromJSON, ListWorkspaceWorkflowPresets200ResponseFromJSON, ListWorkspaceWorkflowVersions200ResponseFromJSON, ListWorkspaceWorkflows200ResponseFromJSON, ManagedUserEntriesPageSuccessFromJSON, ManagedUserResponseFromJSON, ManagedUserUsageResponseFromJSON, MyPartnersResponseFromJSON, NewCompositionToJSON, NewEditorSessionToJSON, NewManagedUserToJSON, NewWidgetToJSON, OfferWorkflowPresetRequestToJSON, OperationsIdGetResponseFromJSON, PartnerAnalyticsByManagedUserResponseFromJSON, PartnerAnalyticsSummaryResponseFromJSON, PartnerAnalyticsTimelineResponseFromJSON, PartnerAnalyticsTopWidgetsResponseFromJSON, PartnerContractResponseFromJSON, PartnerDataDatabaseRemovalResponseFromJSON, PartnerDataDatabaseResponseFromJSON, PartnerEntryContextSecretResponseFromJSON, PartnerEntryContextSigningResponseFromJSON, PartnerExtraCreditsInvoiceResponseFromJSON, PartnerNotificationDeliveryLogResponseFromJSON, PartnerNotificationDeliveryResponseFromJSON, PartnerNotificationPageResponseFromJSON, PartnerNotificationSettingsChangeResponseFromJSON, PartnerNotificationSettingsResponseFromJSON, PartnerNotificationTestEventRequestToJSON, PartnerNotificationTestEventResultResponseFromJSON, PartnerPresetCopyResponseFromJSON, PartnerPresetRemovalResponseFromJSON, PartnerPresetResponseFromJSON, PartnerStorageDestinationResponseFromJSON, PartnerStorageRemovalResponseFromJSON, PartnerStorageUsageResponseFromJSON, PersonalWorkspaceDomainResultResponseFromJSON, PostPublicCompositionEmbedStatus200ResponseFromJSON, PostPublicCompositionEmbedStatusRequestToJSON, PublicAdapterCallRequestToJSON, PublicAdapterCallResultFromJSON, PublicAdapterFileResultFromJSON, PublicCompositionEntryCreatedFromJSON, PublicCompositionEntryRequestToJSON, PublicWorkflowEventsRequestToJSON, PublishWorkspaceWorkflow200ResponseFromJSON, PublishWorkspaceWorkflowRequestToJSON, RemoveAiAnswersKnowledgeDocument200ResponseFromJSON, RemovePartnerWorkflowPreset200ResponseFromJSON, RemoveUserAdapterConnection200ResponseFromJSON, ReportPublicWorkflowEvents200ResponseFromJSON, RequestExtraCreditsToJSON, RevokeManagedUserEditorSessionsResponseFromJSON, SaveWorkspaceWorkflow200ResponseFromJSON, SaveWorkspaceWorkflowRequestToJSON, SetAdapterConnectionRequestToJSON, SetCompositionDataSourceRequestToJSON, SetDynamicContentRequestToJSON, SetDynamicContentResponseFromJSON, SetManagedUserLimitsRequestToJSON, SetPartnerDataDatabaseRequestToJSON, SetPartnerDesignDefaultsRequestToJSON, SetPartnerPresetRequestToJSON, SetPartnerStorageDestinationRequestToJSON, SetPartnerWorkflowPreset200ResponseFromJSON, SetUserAdapterConnection200ResponseFromJSON, UpdateCanvasRequestToJSON, UpdateCompositionToJSON, UpdateCompositionStatusRequestToJSON, UpdateDomainRequestToJSON, UpdateManagedUserToJSON, UpdatePartnerEntryContextSigningRequestToJSON, UpdatePartnerNotificationSettingsRequestToJSON, UpdateUserApiKeyRequestToJSON, UploadLimitsResponseFromJSON, UploadResponseFromJSON, UploadsGet200ResponseFromJSON, UploadsIdDelete200ResponseFromJSON, UserApiKeyResponseFromJSON, ValidateCompositionContentResponseFromJSON, ValidateToken200ResponseFromJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
19
19
  export class PartnerApi 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 PartnerApi 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
  * Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. So is the website where a partner your account administers integrates Widgetic, with every subdomain of it (`platformDomain` in the answer of `GET /partners/mine`), so there is nothing to add for it either and a list can never lock it out. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. There is no limit on the list of an account that administers a partner, so a partner can add the website of each of its customers as they publish on their own domain, one call each. Any other account can list at most 50 websites, and the 51st is answered with a 409 (`BUSINESS_STATE_CONFLICT`). A wildcard such as `*.example.com` counts as one website, not one per subdomain, so use it instead of listing each subdomain. A page that frames a widget can name only so many websites to the browser (about fifty of ordinary length). Past that, the browser no longer checks the list for that page; the lookup that the Embed SDK makes for the widget still refuses every website that is not on the list.
66
130
  * Allow a website to show your widgets
@@ -100,7 +164,49 @@ export class PartnerApi extends runtime.BaseAPI {
100
164
  return await response.value();
101
165
  }
102
166
  /**
103
- * The door a widget\'s adapter module calls, from the visitor\'s browser, for the operations that cannot run in the browser: anything with a secret, a charge in credits or the owner\'s storage behind it. A widget that uses such an adapter is handed the address of this route as `adapters.url` in its `widgetic:host` message (see the host bridge contract) and calls `{adapters.url}/{adapterId}/{operation}`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/{adapterId}/{operation}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **What it serves.** Only an adapter, and a version of it, that the widget\'s LIVE manifest (what the version that is published uses) lists, and only an operation that runs on the gateway. Anything else is one 404 `ADAPTER_NOT_AVAILABLE`, whatever the reason, so the route is no way to ask what a widget contains. An adapter an administrator stopped offering to NEW widgets keeps serving the widgets that already use it. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or a website the owner allowed (or the owner\'s own platform). Page script cannot forge it. A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. When the partner of the owner signs the host context, a context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`. **Cost and retries.** An operation priced in credits is charged to the owner of the widget (for a customer a partner manages, to the partner\'s administrator, within the monthly credits set for that customer), once for each `requestId`, before it runs, and given back if it does not answer. A `requestId` that was charged and not given back is 409 `REQUEST_ALREADY_USED` and the operation is NOT run a second time; one whose charge was given back may be tried again with the same `requestId`. A visitor never sees an owner\'s balance: a feature that cannot be used because its owner has no credits left, because the customer\'s monthly credits are spent, or because an administrator stopped the adapter, is the same 503 `ADAPTER_UNAVAILABLE` as every other \"not right now\". The owner is told through a notice. **Limits.** In front of everything, 120 calls a minute for each visitor address and composition and 600 a minute for a composition (429 `RATE_LIMITED`). Then, for each operation of a widget, a rate for each visitor address a minute and a cap for the widget a day: 30 and 5000 for an operation that is free, 10 and 500 for one that costs credits, unless the adapter says otherwise (never above 120 and 100000). A visitor over the rate is 429 `RATE_LIMITED`; a widget over its cap is 429 `WIDGET_LIMIT_REACHED`. Both carry a `Retry-After` header. The body is at most 64 KiB (413 `PAYLOAD_TOO_LARGE`) and JSON (415 `UNSUPPORTED_MEDIA_TYPE`); an operation has 30 seconds to answer (504 `ADAPTER_TIMEOUT`, and the charge is given back).
167
+ * Takes a workflow out of the default list and stops it serving: its embeds show only their first composition, as when paused. It is kept, with its versions and counts, until it is deleted. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can archive.
168
+ * Archive a Workflow
169
+ */
170
+ async archiveWorkspaceWorkflowRaw(requestParameters, initOverrides) {
171
+ if (requestParameters['workspaceId'] == null) {
172
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling archiveWorkspaceWorkflow().');
173
+ }
174
+ if (requestParameters['workflowId'] == null) {
175
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling archiveWorkspaceWorkflow().');
176
+ }
177
+ const queryParameters = {};
178
+ const headerParameters = {};
179
+ if (requestParameters['xManagedUserId'] != null) {
180
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
181
+ }
182
+ if (requestParameters['xManagedUserExternalId'] != null) {
183
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
184
+ }
185
+ if (this.configuration && this.configuration.accessToken) {
186
+ const token = this.configuration.accessToken;
187
+ const tokenString = await token("apiKeyAuth", []);
188
+ if (tokenString) {
189
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
190
+ }
191
+ }
192
+ const response = await this.request({
193
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/archive`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
194
+ method: 'POST',
195
+ headers: headerParameters,
196
+ query: queryParameters,
197
+ }, initOverrides);
198
+ return new runtime.JSONApiResponse(response, (jsonValue) => SaveWorkspaceWorkflow200ResponseFromJSON(jsonValue));
199
+ }
200
+ /**
201
+ * Takes a workflow out of the default list and stops it serving: its embeds show only their first composition, as when paused. It is kept, with its versions and counts, until it is deleted. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can archive.
202
+ * Archive a Workflow
203
+ */
204
+ async archiveWorkspaceWorkflow(requestParameters, initOverrides) {
205
+ const response = await this.archiveWorkspaceWorkflowRaw(requestParameters, initOverrides);
206
+ return await response.value();
207
+ }
208
+ /**
209
+ * The door a widget\'s adapter module calls, from the visitor\'s browser, for the operations that cannot run in the browser: anything with a secret, a charge in credits or the owner\'s storage behind it. A widget that uses such an adapter is handed the address of this route as `adapters.url` in its `widgetic:host` message (see the host bridge contract) and calls `{adapters.url}/{adapterId}/{operation}`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/{adapterId}/{operation}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **What it serves.** Only an adapter, and a version of it, that the widget\'s LIVE manifest (what the version that is published uses) lists, and only an operation that runs on the gateway. Anything else is one 404 `ADAPTER_NOT_AVAILABLE`, whatever the reason, so the route is no way to ask what a widget contains. An adapter an administrator stopped offering to NEW widgets keeps serving the widgets that already use it. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). Page script cannot forge it. A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. When the partner of the owner signs the host context, a context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`. **Cost and retries.** An operation priced in credits is charged to the owner of the widget (for a customer a partner manages, to the partner\'s administrator, within the monthly credits set for that customer), once for each `requestId`, before it runs, and given back if it does not answer. A `requestId` that was charged and not given back is 409 `REQUEST_ALREADY_USED` and the operation is NOT run a second time; one whose charge was given back may be tried again with the same `requestId`. A visitor never sees an owner\'s balance: a feature that cannot be used because its owner has no credits left, because the customer\'s monthly credits are spent, or because an administrator stopped the adapter, is the same 503 `ADAPTER_UNAVAILABLE` as every other \"not right now\". The owner is told through a notice. **Limits.** In front of everything, 120 calls a minute for each visitor address and composition and 600 a minute for a composition (429 `RATE_LIMITED`). Then, for each operation of a widget, a rate for each visitor address a minute and a cap for the widget a day: 30 and 5000 for an operation that is free, 10 and 500 for one that costs credits, unless the adapter says otherwise (never above 120 and 100000). A visitor over the rate is 429 `RATE_LIMITED`; a widget over its cap is 429 `WIDGET_LIMIT_REACHED`. Both carry a `Retry-After` header. The body is at most 64 KiB (413 `PAYLOAD_TOO_LARGE`) and JSON (415 `UNSUPPORTED_MEDIA_TYPE`); an operation has 30 seconds to answer (504 `ADAPTER_TIMEOUT`, and the charge is given back).
104
210
  * Call a gateway operation of an adapter a published widget uses
105
211
  */
106
212
  async callPublicCompositionAdapterRaw(requestParameters, initOverrides) {
@@ -129,7 +235,7 @@ export class PartnerApi extends runtime.BaseAPI {
129
235
  return new runtime.JSONApiResponse(response, (jsonValue) => PublicAdapterCallResultFromJSON(jsonValue));
130
236
  }
131
237
  /**
132
- * The door a widget\'s adapter module calls, from the visitor\'s browser, for the operations that cannot run in the browser: anything with a secret, a charge in credits or the owner\'s storage behind it. A widget that uses such an adapter is handed the address of this route as `adapters.url` in its `widgetic:host` message (see the host bridge contract) and calls `{adapters.url}/{adapterId}/{operation}`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/{adapterId}/{operation}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **What it serves.** Only an adapter, and a version of it, that the widget\'s LIVE manifest (what the version that is published uses) lists, and only an operation that runs on the gateway. Anything else is one 404 `ADAPTER_NOT_AVAILABLE`, whatever the reason, so the route is no way to ask what a widget contains. An adapter an administrator stopped offering to NEW widgets keeps serving the widgets that already use it. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or a website the owner allowed (or the owner\'s own platform). Page script cannot forge it. A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. When the partner of the owner signs the host context, a context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`. **Cost and retries.** An operation priced in credits is charged to the owner of the widget (for a customer a partner manages, to the partner\'s administrator, within the monthly credits set for that customer), once for each `requestId`, before it runs, and given back if it does not answer. A `requestId` that was charged and not given back is 409 `REQUEST_ALREADY_USED` and the operation is NOT run a second time; one whose charge was given back may be tried again with the same `requestId`. A visitor never sees an owner\'s balance: a feature that cannot be used because its owner has no credits left, because the customer\'s monthly credits are spent, or because an administrator stopped the adapter, is the same 503 `ADAPTER_UNAVAILABLE` as every other \"not right now\". The owner is told through a notice. **Limits.** In front of everything, 120 calls a minute for each visitor address and composition and 600 a minute for a composition (429 `RATE_LIMITED`). Then, for each operation of a widget, a rate for each visitor address a minute and a cap for the widget a day: 30 and 5000 for an operation that is free, 10 and 500 for one that costs credits, unless the adapter says otherwise (never above 120 and 100000). A visitor over the rate is 429 `RATE_LIMITED`; a widget over its cap is 429 `WIDGET_LIMIT_REACHED`. Both carry a `Retry-After` header. The body is at most 64 KiB (413 `PAYLOAD_TOO_LARGE`) and JSON (415 `UNSUPPORTED_MEDIA_TYPE`); an operation has 30 seconds to answer (504 `ADAPTER_TIMEOUT`, and the charge is given back).
238
+ * The door a widget\'s adapter module calls, from the visitor\'s browser, for the operations that cannot run in the browser: anything with a secret, a charge in credits or the owner\'s storage behind it. A widget that uses such an adapter is handed the address of this route as `adapters.url` in its `widgetic:host` message (see the host bridge contract) and calls `{adapters.url}/{adapterId}/{operation}`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/{adapterId}/{operation}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **What it serves.** Only an adapter, and a version of it, that the widget\'s LIVE manifest (what the version that is published uses) lists, and only an operation that runs on the gateway. Anything else is one 404 `ADAPTER_NOT_AVAILABLE`, whatever the reason, so the route is no way to ask what a widget contains. An adapter an administrator stopped offering to NEW widgets keeps serving the widgets that already use it. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). Page script cannot forge it. A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. When the partner of the owner signs the host context, a context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`. **Cost and retries.** An operation priced in credits is charged to the owner of the widget (for a customer a partner manages, to the partner\'s administrator, within the monthly credits set for that customer), once for each `requestId`, before it runs, and given back if it does not answer. A `requestId` that was charged and not given back is 409 `REQUEST_ALREADY_USED` and the operation is NOT run a second time; one whose charge was given back may be tried again with the same `requestId`. A visitor never sees an owner\'s balance: a feature that cannot be used because its owner has no credits left, because the customer\'s monthly credits are spent, or because an administrator stopped the adapter, is the same 503 `ADAPTER_UNAVAILABLE` as every other \"not right now\". The owner is told through a notice. **Limits.** In front of everything, 120 calls a minute for each visitor address and composition and 600 a minute for a composition (429 `RATE_LIMITED`). Then, for each operation of a widget, a rate for each visitor address a minute and a cap for the widget a day: 30 and 5000 for an operation that is free, 10 and 500 for one that costs credits, unless the adapter says otherwise (never above 120 and 100000). A visitor over the rate is 429 `RATE_LIMITED`; a widget over its cap is 429 `WIDGET_LIMIT_REACHED`. Both carry a `Retry-After` header. The body is at most 64 KiB (413 `PAYLOAD_TOO_LARGE`) and JSON (415 `UNSUPPORTED_MEDIA_TYPE`); an operation has 30 seconds to answer (504 `ADAPTER_TIMEOUT`, and the charge is given back).
133
239
  * Call a gateway operation of an adapter a published widget uses
134
240
  */
135
241
  async callPublicCompositionAdapter(requestParameters, initOverrides) {
@@ -169,6 +275,94 @@ export class PartnerApi extends runtime.BaseAPI {
169
275
  const response = await this.checkCompositionAccessRaw(requestParameters, initOverrides);
170
276
  return await response.value();
171
277
  }
278
+ /**
279
+ * Some credentials are an email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getPartnerAdapterConnections`). Saving one with `setPartnerAdapterConnection` emails a six-digit code to it; this gives the code back. Only then is the address used: until it is confirmed, the widgets of the partner\'s customers that need it are not charged and their visitors are told the feature is unavailable. The code works for 30 minutes and for five wrong tries. After that, save the address again and a new code is emailed (not sooner than a minute after the last one). A code that is not made of digits is refused without counting as a try. Confirming an address that is already confirmed answers 200 with the same state, so a retry of a request that went through is harmless. Saving a different address, or the same one before it was confirmed, starts again. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
280
+ * Confirm a partner\'s adapter address with the code that was emailed to it
281
+ */
282
+ async confirmPartnerAdapterConnectionRaw(requestParameters, initOverrides) {
283
+ if (requestParameters['partnerId'] == null) {
284
+ throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling confirmPartnerAdapterConnection().');
285
+ }
286
+ if (requestParameters['adapterId'] == null) {
287
+ throw new runtime.RequiredError('adapterId', 'Required parameter "adapterId" was null or undefined when calling confirmPartnerAdapterConnection().');
288
+ }
289
+ if (requestParameters['credentialKey'] == null) {
290
+ throw new runtime.RequiredError('credentialKey', 'Required parameter "credentialKey" was null or undefined when calling confirmPartnerAdapterConnection().');
291
+ }
292
+ if (requestParameters['confirmAdapterConnectionRequest'] == null) {
293
+ throw new runtime.RequiredError('confirmAdapterConnectionRequest', 'Required parameter "confirmAdapterConnectionRequest" was null or undefined when calling confirmPartnerAdapterConnection().');
294
+ }
295
+ const queryParameters = {};
296
+ const headerParameters = {};
297
+ headerParameters['Content-Type'] = 'application/json';
298
+ if (this.configuration && this.configuration.accessToken) {
299
+ const token = this.configuration.accessToken;
300
+ const tokenString = await token("apiKeyAuth", []);
301
+ if (tokenString) {
302
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
303
+ }
304
+ }
305
+ const response = await this.request({
306
+ path: `/partners/{partnerId}/adapter-connections/{adapterId}/{credentialKey}/confirm`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))).replace(`{${"adapterId"}}`, encodeURIComponent(String(requestParameters['adapterId']))).replace(`{${"credentialKey"}}`, encodeURIComponent(String(requestParameters['credentialKey']))),
307
+ method: 'POST',
308
+ headers: headerParameters,
309
+ query: queryParameters,
310
+ body: ConfirmAdapterConnectionRequestToJSON(requestParameters['confirmAdapterConnectionRequest']),
311
+ }, initOverrides);
312
+ return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
313
+ }
314
+ /**
315
+ * Some credentials are an email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getPartnerAdapterConnections`). Saving one with `setPartnerAdapterConnection` emails a six-digit code to it; this gives the code back. Only then is the address used: until it is confirmed, the widgets of the partner\'s customers that need it are not charged and their visitors are told the feature is unavailable. The code works for 30 minutes and for five wrong tries. After that, save the address again and a new code is emailed (not sooner than a minute after the last one). A code that is not made of digits is refused without counting as a try. Confirming an address that is already confirmed answers 200 with the same state, so a retry of a request that went through is harmless. Saving a different address, or the same one before it was confirmed, starts again. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
316
+ * Confirm a partner\'s adapter address with the code that was emailed to it
317
+ */
318
+ async confirmPartnerAdapterConnection(requestParameters, initOverrides) {
319
+ const response = await this.confirmPartnerAdapterConnectionRaw(requestParameters, initOverrides);
320
+ return await response.value();
321
+ }
322
+ /**
323
+ * Some credentials are an email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getUserAdapterConnections`). Saving one with `setUserAdapterConnection` emails a six-digit code to it; this gives the code back. Only then is the address used: until it is confirmed, the widgets that need it are not charged and their visitors are told the feature is unavailable. The code works for 30 minutes and for five wrong tries. After that, save the address again and a new code is emailed (not sooner than a minute after the last one). A code that is not made of digits is refused without counting as a try. Confirming an address that is already confirmed answers 200 with the same state, so a retry of a request that went through is harmless. Saving a different address, or the same one before it was confirmed, starts again. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator.
324
+ * Confirm an adapter address with the code that was emailed to it
325
+ */
326
+ async confirmUserAdapterConnectionRaw(requestParameters, initOverrides) {
327
+ if (requestParameters['userId'] == null) {
328
+ throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling confirmUserAdapterConnection().');
329
+ }
330
+ if (requestParameters['adapterId'] == null) {
331
+ throw new runtime.RequiredError('adapterId', 'Required parameter "adapterId" was null or undefined when calling confirmUserAdapterConnection().');
332
+ }
333
+ if (requestParameters['credentialKey'] == null) {
334
+ throw new runtime.RequiredError('credentialKey', 'Required parameter "credentialKey" was null or undefined when calling confirmUserAdapterConnection().');
335
+ }
336
+ if (requestParameters['confirmAdapterConnectionRequest'] == null) {
337
+ throw new runtime.RequiredError('confirmAdapterConnectionRequest', 'Required parameter "confirmAdapterConnectionRequest" was null or undefined when calling confirmUserAdapterConnection().');
338
+ }
339
+ const queryParameters = {};
340
+ const headerParameters = {};
341
+ headerParameters['Content-Type'] = 'application/json';
342
+ if (this.configuration && this.configuration.accessToken) {
343
+ const token = this.configuration.accessToken;
344
+ const tokenString = await token("apiKeyAuth", []);
345
+ if (tokenString) {
346
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
347
+ }
348
+ }
349
+ const response = await this.request({
350
+ path: `/users/{userId}/adapter-connections/{adapterId}/{credentialKey}/confirm`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))).replace(`{${"adapterId"}}`, encodeURIComponent(String(requestParameters['adapterId']))).replace(`{${"credentialKey"}}`, encodeURIComponent(String(requestParameters['credentialKey']))),
351
+ method: 'POST',
352
+ headers: headerParameters,
353
+ query: queryParameters,
354
+ body: ConfirmAdapterConnectionRequestToJSON(requestParameters['confirmAdapterConnectionRequest']),
355
+ }, initOverrides);
356
+ return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
357
+ }
358
+ /**
359
+ * Some credentials are an email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getUserAdapterConnections`). Saving one with `setUserAdapterConnection` emails a six-digit code to it; this gives the code back. Only then is the address used: until it is confirmed, the widgets that need it are not charged and their visitors are told the feature is unavailable. The code works for 30 minutes and for five wrong tries. After that, save the address again and a new code is emailed (not sooner than a minute after the last one). A code that is not made of digits is refused without counting as a try. Confirming an address that is already confirmed answers 200 with the same state, so a retry of a request that went through is harmless. Saving a different address, or the same one before it was confirmed, starts again. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator.
360
+ * Confirm an adapter address with the code that was emailed to it
361
+ */
362
+ async confirmUserAdapterConnection(requestParameters, initOverrides) {
363
+ const response = await this.confirmUserAdapterConnectionRaw(requestParameters, initOverrides);
364
+ return await response.value();
365
+ }
172
366
  /**
173
367
  * Copies the preset `key` (see `setPartnerPreset`) onto a new canvas for one of your managed users, so their widget creator opens on a widget of their own that starts from yours. The copy is a draft widget in your account, filed under the managed user: `getAllWidgets` with `managedUserId` lists it, and no other managed user\'s editor can reach it. The copy carries the preset\'s code, design and content schemas, and thumbnail, and starts from a fork of its code repository, so the user\'s chat edits begin where yours left off. It does not carry the preset\'s database or its compositions. It is not a preset itself, and changing or removing the preset afterwards never touches it. To start a composition (the content and design editor) instead, you do not need a copy: call `createComposition` with the preset\'s `widgetId` (from `listPartnerPresets`) and the managed user. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry, so one copy is made, not two. A copy that could not be made leaves nothing behind (503 `PRESET_COPY_FAILED`). The managed user must be yours and active.
174
368
  * Give a managed user a copy of one of your presets
@@ -537,7 +731,7 @@ export class PartnerApi extends runtime.BaseAPI {
537
731
  return await response.value();
538
732
  }
539
733
  /**
540
- * 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`.
734
+ * 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`.
541
735
  * Create an editor session for a managed user
542
736
  */
543
737
  async createManagedUserEditorSessionRaw(requestParameters, initOverrides) {
@@ -567,7 +761,7 @@ export class PartnerApi extends runtime.BaseAPI {
567
761
  return new runtime.JSONApiResponse(response, (jsonValue) => EditorSessionResponseFromJSON(jsonValue));
568
762
  }
569
763
  /**
570
- * 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`.
764
+ * 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`.
571
765
  * Create an editor session for a managed user
572
766
  */
573
767
  async createManagedUserEditorSession(requestParameters, initOverrides) {
@@ -575,7 +769,7 @@ export class PartnerApi extends runtime.BaseAPI {
575
769
  return await response.value();
576
770
  }
577
771
  /**
578
- * Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Allowed whatever the partner\'s standing: a partner that has run out of credits, or is stopped for an unpaid contract invoice, can still buy. No contract is needed. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
772
+ * Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Available only to partners that have an active paid contract in force with Widgetic (`NO_PAID_CONTRACT` when none is in force) and no overdue contract invoice (`CONTRACT_INVOICE_OVERDUE` while a contract invoice is past its due day). A partner that has run out of credits during its period can buy more at the list price. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
579
773
  * Buy extra credits for a partner
580
774
  */
581
775
  async createPartnerExtraCreditsInvoiceRaw(requestParameters, initOverrides) {
@@ -611,7 +805,7 @@ export class PartnerApi extends runtime.BaseAPI {
611
805
  return new runtime.JSONApiResponse(response, (jsonValue) => PartnerExtraCreditsInvoiceResponseFromJSON(jsonValue));
612
806
  }
613
807
  /**
614
- * Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Allowed whatever the partner\'s standing: a partner that has run out of credits, or is stopped for an unpaid contract invoice, can still buy. No contract is needed. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
808
+ * Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Available only to partners that have an active paid contract in force with Widgetic (`NO_PAID_CONTRACT` when none is in force) and no overdue contract invoice (`CONTRACT_INVOICE_OVERDUE` while a contract invoice is past its due day). A partner that has run out of credits during its period can buy more at the list price. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
615
809
  * Buy extra credits for a partner
616
810
  */
617
811
  async createPartnerExtraCreditsInvoice(requestParameters, initOverrides) {
@@ -619,7 +813,7 @@ export class PartnerApi extends runtime.BaseAPI {
619
813
  return await response.value();
620
814
  }
621
815
  /**
622
- * Public append-only write into a published composition database. No API key. The browser must send a permitted `Origin` header (the artifact iframe origin or a website the owner allowed). When the request comes from the shared artifact origin, it must also carry the per-composition write token (`X-Widgetic-Write-Token` header or `writeToken` body field, handed to the widget in `widgetic:host` as `entries.writeToken` and returned as `entryWriteToken` on `getPublicCompositionEmbed`). Host `context` is stored for partner attribution; it is not authenticated unless the partner signs it (see **Signed context**). Request bodies are limited to 16 KB before parsing. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/entries/{table}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **Signed context.** A partner that wants to trust `context` (to bill a customer by it, say) makes a signing secret (`rotatePartnerEntryContextSecret`), and its server signs the context it hands to the embed. The signature travels inside `context` as two reserved keys, `widgetic_exp` (UTC seconds, at most seven days ahead) and `widgetic_sig`. The gateway checks them after the `Origin` and before anything else is judged, stored or announced, and keeps and announces the context WITHOUT them. A context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`; when the check cannot be made just now the answer is a retryable 503 `CONTEXT_SIGNATURE_UNAVAILABLE`, never an unchecked entry. Until a partner makes a secret nothing changes: the two keys are dropped and the rest is taken as it came. A signature is good until its `widgetic_exp` and may be used again until then, so a partner that must count each submission once keeps a unique value of its own (a `submissionId`, say) in the context. The recipe and a test vector are in the description of `rotatePartnerEntryContextSecret`.
816
+ * Public append-only write into a published composition database. No API key. The browser must send a permitted `Origin` header: the artifact iframe origin, or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). When the request comes from the shared artifact origin, it must also carry the per-composition write token (`X-Widgetic-Write-Token` header or `writeToken` body field, handed to the widget in `widgetic:host` as `entries.writeToken` and returned as `entryWriteToken` on `getPublicCompositionEmbed`). Host `context` is stored for partner attribution; it is not authenticated unless the partner signs it (see **Signed context**). Request bodies are limited to 16 KB before parsing. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/entries/{table}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **Signed context.** A partner that wants to trust `context` (to bill a customer by it, say) makes a signing secret (`rotatePartnerEntryContextSecret`), and its server signs the context it hands to the embed. The signature travels inside `context` as two reserved keys, `widgetic_exp` (UTC seconds, at most seven days ahead) and `widgetic_sig`. The gateway checks them after the `Origin` and before anything else is judged, stored or announced, and keeps and announces the context WITHOUT them. A context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`; when the check cannot be made just now the answer is a retryable 503 `CONTEXT_SIGNATURE_UNAVAILABLE`, never an unchecked entry. Until a partner makes a secret nothing changes: the two keys are dropped and the rest is taken as it came. A signature is good until its `widgetic_exp` and may be used again until then, so a partner that must count each submission once keeps a unique value of its own (a `submissionId`, say) in the context. The recipe and a test vector are in the description of `rotatePartnerEntryContextSecret`.
623
817
  * Append a visitor entry through the gateway
624
818
  */
625
819
  async createPublicCompositionEntryRaw(requestParameters, initOverrides) {
@@ -638,6 +832,9 @@ export class PartnerApi extends runtime.BaseAPI {
638
832
  if (requestParameters['xWidgeticWriteToken'] != null) {
639
833
  headerParameters['X-Widgetic-Write-Token'] = String(requestParameters['xWidgeticWriteToken']);
640
834
  }
835
+ if (requestParameters['xWidgeticVisitorId'] != null) {
836
+ headerParameters['X-Widgetic-Visitor-Id'] = String(requestParameters['xWidgeticVisitorId']);
837
+ }
641
838
  const response = await this.request({
642
839
  path: `/embed/compositions/{compositionId}/entries/{table}`.replace(`{${"compositionId"}}`, encodeURIComponent(String(requestParameters['compositionId']))).replace(`{${"table"}}`, encodeURIComponent(String(requestParameters['table']))),
643
840
  method: 'POST',
@@ -648,7 +845,7 @@ export class PartnerApi extends runtime.BaseAPI {
648
845
  return new runtime.JSONApiResponse(response, (jsonValue) => PublicCompositionEntryCreatedFromJSON(jsonValue));
649
846
  }
650
847
  /**
651
- * Public append-only write into a published composition database. No API key. The browser must send a permitted `Origin` header (the artifact iframe origin or a website the owner allowed). When the request comes from the shared artifact origin, it must also carry the per-composition write token (`X-Widgetic-Write-Token` header or `writeToken` body field, handed to the widget in `widgetic:host` as `entries.writeToken` and returned as `entryWriteToken` on `getPublicCompositionEmbed`). Host `context` is stored for partner attribution; it is not authenticated unless the partner signs it (see **Signed context**). Request bodies are limited to 16 KB before parsing. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/entries/{table}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **Signed context.** A partner that wants to trust `context` (to bill a customer by it, say) makes a signing secret (`rotatePartnerEntryContextSecret`), and its server signs the context it hands to the embed. The signature travels inside `context` as two reserved keys, `widgetic_exp` (UTC seconds, at most seven days ahead) and `widgetic_sig`. The gateway checks them after the `Origin` and before anything else is judged, stored or announced, and keeps and announces the context WITHOUT them. A context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`; when the check cannot be made just now the answer is a retryable 503 `CONTEXT_SIGNATURE_UNAVAILABLE`, never an unchecked entry. Until a partner makes a secret nothing changes: the two keys are dropped and the rest is taken as it came. A signature is good until its `widgetic_exp` and may be used again until then, so a partner that must count each submission once keeps a unique value of its own (a `submissionId`, say) in the context. The recipe and a test vector are in the description of `rotatePartnerEntryContextSecret`.
848
+ * Public append-only write into a published composition database. No API key. The browser must send a permitted `Origin` header: the artifact iframe origin, or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). When the request comes from the shared artifact origin, it must also carry the per-composition write token (`X-Widgetic-Write-Token` header or `writeToken` body field, handed to the widget in `widgetic:host` as `entries.writeToken` and returned as `entryWriteToken` on `getPublicCompositionEmbed`). Host `context` is stored for partner attribution; it is not authenticated unless the partner signs it (see **Signed context**). Request bodies are limited to 16 KB before parsing. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/entries/{table}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **Signed context.** A partner that wants to trust `context` (to bill a customer by it, say) makes a signing secret (`rotatePartnerEntryContextSecret`), and its server signs the context it hands to the embed. The signature travels inside `context` as two reserved keys, `widgetic_exp` (UTC seconds, at most seven days ahead) and `widgetic_sig`. The gateway checks them after the `Origin` and before anything else is judged, stored or announced, and keeps and announces the context WITHOUT them. A context that is not signed as the partner requires is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`, `CONTEXT_SIGNATURE_INVALID` or `CONTEXT_SIGNATURE_EXPIRED`; when the check cannot be made just now the answer is a retryable 503 `CONTEXT_SIGNATURE_UNAVAILABLE`, never an unchecked entry. Until a partner makes a secret nothing changes: the two keys are dropped and the rest is taken as it came. A signature is good until its `widgetic_exp` and may be used again until then, so a partner that must count each submission once keeps a unique value of its own (a `submissionId`, say) in the context. The recipe and a test vector are in the description of `rotatePartnerEntryContextSecret`.
652
849
  * Append a visitor entry through the gateway
653
850
  */
654
851
  async createPublicCompositionEntry(requestParameters, initOverrides) {
@@ -740,6 +937,106 @@ export class PartnerApi extends runtime.BaseAPI {
740
937
  const response = await this.createWidgetRaw(requestParameters, initOverrides);
741
938
  return await response.value();
742
939
  }
940
+ /**
941
+ * Makes a draft workflow. Give it a composition and the workflow is born with one block, which starts it; without one it starts empty. A workspace holds up to 500 workflows. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can create one.
942
+ * Create a Workflow
943
+ */
944
+ async createWorkspaceWorkflowRaw(requestParameters, initOverrides) {
945
+ if (requestParameters['workspaceId'] == null) {
946
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling createWorkspaceWorkflow().');
947
+ }
948
+ if (requestParameters['idempotencyKey'] == null) {
949
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling createWorkspaceWorkflow().');
950
+ }
951
+ if (requestParameters['createWorkspaceWorkflowRequest'] == null) {
952
+ throw new runtime.RequiredError('createWorkspaceWorkflowRequest', 'Required parameter "createWorkspaceWorkflowRequest" was null or undefined when calling createWorkspaceWorkflow().');
953
+ }
954
+ const queryParameters = {};
955
+ const headerParameters = {};
956
+ headerParameters['Content-Type'] = 'application/json';
957
+ if (requestParameters['idempotencyKey'] != null) {
958
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
959
+ }
960
+ if (requestParameters['xManagedUserId'] != null) {
961
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
962
+ }
963
+ if (requestParameters['xManagedUserExternalId'] != null) {
964
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
965
+ }
966
+ if (this.configuration && this.configuration.accessToken) {
967
+ const token = this.configuration.accessToken;
968
+ const tokenString = await token("apiKeyAuth", []);
969
+ if (tokenString) {
970
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
971
+ }
972
+ }
973
+ const response = await this.request({
974
+ path: `/workspaces/{workspaceId}/workflows`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
975
+ method: 'POST',
976
+ headers: headerParameters,
977
+ query: queryParameters,
978
+ body: CreateWorkspaceWorkflowRequestToJSON(requestParameters['createWorkspaceWorkflowRequest']),
979
+ }, initOverrides);
980
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
981
+ }
982
+ /**
983
+ * Makes a draft workflow. Give it a composition and the workflow is born with one block, which starts it; without one it starts empty. A workspace holds up to 500 workflows. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can create one.
984
+ * Create a Workflow
985
+ */
986
+ async createWorkspaceWorkflow(requestParameters, initOverrides) {
987
+ const response = await this.createWorkspaceWorkflowRaw(requestParameters, initOverrides);
988
+ return await response.value();
989
+ }
990
+ /**
991
+ * Makes your own copy of a starting point (`listWorkspaceWorkflowPresets`): a copy of every widget it chains (an ordinary private widget that serves the starting point\'s published code), a composition of your own on each copy (a draft, with the content, design, embed settings and tables of the original), and a draft workflow wired like the starting point\'s live version. The workflow is named as you ask, or after the starting point. Nothing you do to the copy reaches the starting point, and nothing its offerer changes afterwards reaches your copy. The workflow stays a draft: publish it when it is ready. A start takes a few seconds, because each widget is copied. Send an `Idempotency-Key` so that asking again after a timeout makes one copy. When a start fails (503 with `details.reason` `preset_copy_failed`) the compositions it made are removed again, so asking again is safe; the widget copies it made stay in the workspace as ordinary widgets. The workspace\'s limit of workflows is checked before anything is copied. A starting point that is not offered to you, or that can no longer be started, is 404. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can start one.
992
+ * Start a Workflow from a starting point
993
+ */
994
+ async createWorkspaceWorkflowFromPresetRaw(requestParameters, initOverrides) {
995
+ if (requestParameters['workspaceId'] == null) {
996
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling createWorkspaceWorkflowFromPreset().');
997
+ }
998
+ if (requestParameters['idempotencyKey'] == null) {
999
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling createWorkspaceWorkflowFromPreset().');
1000
+ }
1001
+ if (requestParameters['createWorkspaceWorkflowFromPresetRequest'] == null) {
1002
+ throw new runtime.RequiredError('createWorkspaceWorkflowFromPresetRequest', 'Required parameter "createWorkspaceWorkflowFromPresetRequest" was null or undefined when calling createWorkspaceWorkflowFromPreset().');
1003
+ }
1004
+ const queryParameters = {};
1005
+ const headerParameters = {};
1006
+ headerParameters['Content-Type'] = 'application/json';
1007
+ if (requestParameters['idempotencyKey'] != null) {
1008
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
1009
+ }
1010
+ if (requestParameters['xManagedUserId'] != null) {
1011
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
1012
+ }
1013
+ if (requestParameters['xManagedUserExternalId'] != null) {
1014
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
1015
+ }
1016
+ if (this.configuration && this.configuration.accessToken) {
1017
+ const token = this.configuration.accessToken;
1018
+ const tokenString = await token("apiKeyAuth", []);
1019
+ if (tokenString) {
1020
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1021
+ }
1022
+ }
1023
+ const response = await this.request({
1024
+ path: `/workspaces/{workspaceId}/workflows/from-preset`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
1025
+ method: 'POST',
1026
+ headers: headerParameters,
1027
+ query: queryParameters,
1028
+ body: CreateWorkspaceWorkflowFromPresetRequestToJSON(requestParameters['createWorkspaceWorkflowFromPresetRequest']),
1029
+ }, initOverrides);
1030
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
1031
+ }
1032
+ /**
1033
+ * Makes your own copy of a starting point (`listWorkspaceWorkflowPresets`): a copy of every widget it chains (an ordinary private widget that serves the starting point\'s published code), a composition of your own on each copy (a draft, with the content, design, embed settings and tables of the original), and a draft workflow wired like the starting point\'s live version. The workflow is named as you ask, or after the starting point. Nothing you do to the copy reaches the starting point, and nothing its offerer changes afterwards reaches your copy. The workflow stays a draft: publish it when it is ready. A start takes a few seconds, because each widget is copied. Send an `Idempotency-Key` so that asking again after a timeout makes one copy. When a start fails (503 with `details.reason` `preset_copy_failed`) the compositions it made are removed again, so asking again is safe; the widget copies it made stay in the workspace as ordinary widgets. The workspace\'s limit of workflows is checked before anything is copied. A starting point that is not offered to you, or that can no longer be started, is 404. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can start one.
1034
+ * Start a Workflow from a starting point
1035
+ */
1036
+ async createWorkspaceWorkflowFromPreset(requestParameters, initOverrides) {
1037
+ const response = await this.createWorkspaceWorkflowFromPresetRaw(requestParameters, initOverrides);
1038
+ return await response.value();
1039
+ }
743
1040
  /**
744
1041
  * Deletes a canvas together with every widget on it. Called with an editor session, only a canvas whose widgets were all made for the session\'s managed user can be deleted; one that also holds somebody else\'s widgets is refused with 409 and `CANVAS_HAS_OTHER_WIDGETS`, and nothing is deleted. Delete such a canvas with your API key.
745
1042
  * Delete Canvas
@@ -1109,6 +1406,48 @@ export class PartnerApi extends runtime.BaseAPI {
1109
1406
  const response = await this.deleteUserApiKeyRaw(requestParameters, initOverrides);
1110
1407
  return await response.value();
1111
1408
  }
1409
+ /**
1410
+ * Deletes a workflow, in whatever state it is in (draft, live, paused or archived), with all its versions and counts. It cannot be undone: archive the workflow instead to keep it. The compositions it chained are not touched, and a page whose embed still names the workflow shows the embed\'s first composition, as for a paused one. Asking for a workflow that is already gone is \"not found\". For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can delete.
1411
+ * Delete a Workflow
1412
+ */
1413
+ async deleteWorkspaceWorkflowRaw(requestParameters, initOverrides) {
1414
+ if (requestParameters['workspaceId'] == null) {
1415
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceWorkflow().');
1416
+ }
1417
+ if (requestParameters['workflowId'] == null) {
1418
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling deleteWorkspaceWorkflow().');
1419
+ }
1420
+ const queryParameters = {};
1421
+ const headerParameters = {};
1422
+ if (requestParameters['xManagedUserId'] != null) {
1423
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
1424
+ }
1425
+ if (requestParameters['xManagedUserExternalId'] != null) {
1426
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
1427
+ }
1428
+ if (this.configuration && this.configuration.accessToken) {
1429
+ const token = this.configuration.accessToken;
1430
+ const tokenString = await token("apiKeyAuth", []);
1431
+ if (tokenString) {
1432
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1433
+ }
1434
+ }
1435
+ const response = await this.request({
1436
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
1437
+ method: 'DELETE',
1438
+ headers: headerParameters,
1439
+ query: queryParameters,
1440
+ }, initOverrides);
1441
+ return new runtime.JSONApiResponse(response, (jsonValue) => DeleteWorkspaceWorkflow200ResponseFromJSON(jsonValue));
1442
+ }
1443
+ /**
1444
+ * Deletes a workflow, in whatever state it is in (draft, live, paused or archived), with all its versions and counts. It cannot be undone: archive the workflow instead to keep it. The compositions it chained are not touched, and a page whose embed still names the workflow shows the embed\'s first composition, as for a paused one. Asking for a workflow that is already gone is \"not found\". For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can delete.
1445
+ * Delete a Workflow
1446
+ */
1447
+ async deleteWorkspaceWorkflow(requestParameters, initOverrides) {
1448
+ const response = await this.deleteWorkspaceWorkflowRaw(requestParameters, initOverrides);
1449
+ return await response.value();
1450
+ }
1112
1451
  /**
1113
1452
  * Names the tables a composition\'s widget keeps entries in (the votes, ratings, answers or sign-ups its visitors left), their columns, and how many entries each holds. Call it first to learn the table and column names that `readCompositionEntries` takes. A widget that only shows content keeps nothing of its own: the answer is `hasData: false` with no tables, and that is not an error. A table that could not be counted has `rows: null`, which is not zero. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
1114
1453
  * Describe What a Composition Keeps
@@ -1149,22 +1488,22 @@ export class PartnerApi extends runtime.BaseAPI {
1149
1488
  return await response.value();
1150
1489
  }
1151
1490
  /**
1152
- * Creates a duplicate of an existing composition for the authenticated user. The duplicate is made after the answer: the call returns `202` with an `operationId`. Ask `GET /operations/{id}` for that operation until its `status` is `completed`; the new composition is named in `metadata.newCompositionId`. A problem with the duplicate\'s database (for example, tables that could not be made just now) is listed in `metadata.warnings`, which is absent when there is none. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry, so one duplicate is made, not two.
1153
- * Duplicate Composition
1491
+ * Puts the draft back to the live version (its graph and its time zone). Only for a workflow that has been published; one that never was has no live version to go back to. Names the `revision` the editor read. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can discard.
1492
+ * Discard the Unpublished Changes of a Workflow
1154
1493
  */
1155
- async duplicateCompositionRaw(requestParameters, initOverrides) {
1156
- if (requestParameters['id'] == null) {
1157
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling duplicateComposition().');
1494
+ async discardWorkspaceWorkflowChangesRaw(requestParameters, initOverrides) {
1495
+ if (requestParameters['workspaceId'] == null) {
1496
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling discardWorkspaceWorkflowChanges().');
1158
1497
  }
1159
- if (requestParameters['idempotencyKey'] == null) {
1160
- throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling duplicateComposition().');
1498
+ if (requestParameters['workflowId'] == null) {
1499
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling discardWorkspaceWorkflowChanges().');
1500
+ }
1501
+ if (requestParameters['publishWorkspaceWorkflowRequest'] == null) {
1502
+ throw new runtime.RequiredError('publishWorkspaceWorkflowRequest', 'Required parameter "publishWorkspaceWorkflowRequest" was null or undefined when calling discardWorkspaceWorkflowChanges().');
1161
1503
  }
1162
1504
  const queryParameters = {};
1163
1505
  const headerParameters = {};
1164
1506
  headerParameters['Content-Type'] = 'application/json';
1165
- if (requestParameters['idempotencyKey'] != null) {
1166
- headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
1167
- }
1168
1507
  if (requestParameters['xManagedUserId'] != null) {
1169
1508
  headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
1170
1509
  }
@@ -1179,22 +1518,117 @@ export class PartnerApi extends runtime.BaseAPI {
1179
1518
  }
1180
1519
  }
1181
1520
  const response = await this.request({
1182
- path: `/compositions/{id}/duplicate`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
1521
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/discard`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
1183
1522
  method: 'POST',
1184
1523
  headers: headerParameters,
1185
1524
  query: queryParameters,
1186
- body: DuplicateCompositionRequestToJSON(requestParameters['duplicateCompositionRequest']),
1525
+ body: PublishWorkspaceWorkflowRequestToJSON(requestParameters['publishWorkspaceWorkflowRequest']),
1187
1526
  }, initOverrides);
1188
- return new runtime.JSONApiResponse(response, (jsonValue) => DuplicateComposition202ResponseFromJSON(jsonValue));
1527
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
1189
1528
  }
1190
1529
  /**
1191
- * Creates a duplicate of an existing composition for the authenticated user. The duplicate is made after the answer: the call returns `202` with an `operationId`. Ask `GET /operations/{id}` for that operation until its `status` is `completed`; the new composition is named in `metadata.newCompositionId`. A problem with the duplicate\'s database (for example, tables that could not be made just now) is listed in `metadata.warnings`, which is absent when there is none. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry, so one duplicate is made, not two.
1530
+ * Puts the draft back to the live version (its graph and its time zone). Only for a workflow that has been published; one that never was has no live version to go back to. Names the `revision` the editor read. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can discard.
1531
+ * Discard the Unpublished Changes of a Workflow
1532
+ */
1533
+ async discardWorkspaceWorkflowChanges(requestParameters, initOverrides) {
1534
+ const response = await this.discardWorkspaceWorkflowChangesRaw(requestParameters, initOverrides);
1535
+ return await response.value();
1536
+ }
1537
+ /**
1538
+ * Creates a duplicate of an existing composition for the authenticated user. The duplicate is made after the answer: the call returns `202` with an `operationId`. Ask `GET /operations/{id}` for that operation until its `status` is `completed`; the new composition is named in `metadata.newCompositionId`. A problem with the duplicate\'s database (for example, tables that could not be made just now) is listed in `metadata.warnings`, which is absent when there is none. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry, so one duplicate is made, not two.
1539
+ * Duplicate Composition
1540
+ */
1541
+ async duplicateCompositionRaw(requestParameters, initOverrides) {
1542
+ if (requestParameters['id'] == null) {
1543
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling duplicateComposition().');
1544
+ }
1545
+ if (requestParameters['idempotencyKey'] == null) {
1546
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling duplicateComposition().');
1547
+ }
1548
+ const queryParameters = {};
1549
+ const headerParameters = {};
1550
+ headerParameters['Content-Type'] = 'application/json';
1551
+ if (requestParameters['idempotencyKey'] != null) {
1552
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
1553
+ }
1554
+ if (requestParameters['xManagedUserId'] != null) {
1555
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
1556
+ }
1557
+ if (requestParameters['xManagedUserExternalId'] != null) {
1558
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
1559
+ }
1560
+ if (this.configuration && this.configuration.accessToken) {
1561
+ const token = this.configuration.accessToken;
1562
+ const tokenString = await token("apiKeyAuth", []);
1563
+ if (tokenString) {
1564
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1565
+ }
1566
+ }
1567
+ const response = await this.request({
1568
+ path: `/compositions/{id}/duplicate`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
1569
+ method: 'POST',
1570
+ headers: headerParameters,
1571
+ query: queryParameters,
1572
+ body: DuplicateCompositionRequestToJSON(requestParameters['duplicateCompositionRequest']),
1573
+ }, initOverrides);
1574
+ return new runtime.JSONApiResponse(response, (jsonValue) => DuplicateComposition202ResponseFromJSON(jsonValue));
1575
+ }
1576
+ /**
1577
+ * Creates a duplicate of an existing composition for the authenticated user. The duplicate is made after the answer: the call returns `202` with an `operationId`. Ask `GET /operations/{id}` for that operation until its `status` is `completed`; the new composition is named in `metadata.newCompositionId`. A problem with the duplicate\'s database (for example, tables that could not be made just now) is listed in `metadata.warnings`, which is absent when there is none. The `Idempotency-Key` header is required (`400` without it). Send the same key when you retry, so one duplicate is made, not two.
1192
1578
  * Duplicate Composition
1193
1579
  */
1194
1580
  async duplicateComposition(requestParameters, initOverrides) {
1195
1581
  const response = await this.duplicateCompositionRaw(requestParameters, initOverrides);
1196
1582
  return await response.value();
1197
1583
  }
1584
+ /**
1585
+ * Makes a draft copy of a workflow (its draft graph, not its versions or counts), named \"<name> (copy)\". For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can duplicate.
1586
+ * Duplicate a Workflow
1587
+ */
1588
+ async duplicateWorkspaceWorkflowRaw(requestParameters, initOverrides) {
1589
+ if (requestParameters['workspaceId'] == null) {
1590
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling duplicateWorkspaceWorkflow().');
1591
+ }
1592
+ if (requestParameters['workflowId'] == null) {
1593
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling duplicateWorkspaceWorkflow().');
1594
+ }
1595
+ if (requestParameters['idempotencyKey'] == null) {
1596
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling duplicateWorkspaceWorkflow().');
1597
+ }
1598
+ const queryParameters = {};
1599
+ const headerParameters = {};
1600
+ if (requestParameters['idempotencyKey'] != null) {
1601
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
1602
+ }
1603
+ if (requestParameters['xManagedUserId'] != null) {
1604
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
1605
+ }
1606
+ if (requestParameters['xManagedUserExternalId'] != null) {
1607
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
1608
+ }
1609
+ if (this.configuration && this.configuration.accessToken) {
1610
+ const token = this.configuration.accessToken;
1611
+ const tokenString = await token("apiKeyAuth", []);
1612
+ if (tokenString) {
1613
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1614
+ }
1615
+ }
1616
+ const response = await this.request({
1617
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/duplicate`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
1618
+ method: 'POST',
1619
+ headers: headerParameters,
1620
+ query: queryParameters,
1621
+ }, initOverrides);
1622
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
1623
+ }
1624
+ /**
1625
+ * Makes a draft copy of a workflow (its draft graph, not its versions or counts), named \"<name> (copy)\". For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can duplicate.
1626
+ * Duplicate a Workflow
1627
+ */
1628
+ async duplicateWorkspaceWorkflow(requestParameters, initOverrides) {
1629
+ const response = await this.duplicateWorkspaceWorkflowRaw(requestParameters, initOverrides);
1630
+ return await response.value();
1631
+ }
1198
1632
  /**
1199
1633
  * Streams up to 50,000 matching rows in batches of 1,000. Tables without cursor paging export at most one batch; when more rows exist the response sets `X-Widgetic-Export-Truncated: true`. Rate limit 20 requests per minute.
1200
1634
  * Export composition entry items
@@ -1492,7 +1926,7 @@ export class PartnerApi extends runtime.BaseAPI {
1492
1926
  return await response.value();
1493
1927
  }
1494
1928
  /**
1495
- * 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.
1929
+ * 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.
1496
1930
  * Get Composition
1497
1931
  */
1498
1932
  async getCompositionByIdRaw(requestParameters, initOverrides) {
@@ -1523,7 +1957,7 @@ export class PartnerApi extends runtime.BaseAPI {
1523
1957
  return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionFromWidget201ResponseFromJSON(jsonValue));
1524
1958
  }
1525
1959
  /**
1526
- * 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.
1960
+ * 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.
1527
1961
  * Get Composition
1528
1962
  */
1529
1963
  async getCompositionById(requestParameters, initOverrides) {
@@ -3015,6 +3449,92 @@ export class PartnerApi extends runtime.BaseAPI {
3015
3449
  const response = await this.getPublicCompositionIframeRaw(requestParameters, initOverrides);
3016
3450
  return await response.value();
3017
3451
  }
3452
+ /**
3453
+ * Public read of a workflow for the embed that carries `workflow-id`. No API key. The answer is the live version (its graph, the composition a new visitor starts on, the time zone, the languages its compositions can be shown in, and the token that lets the browser report counts), or `status: paused` with nothing else, in which case the embed shows only its first composition. A workflow that is a draft, archived or unknown answers 404, and the embed then behaves as a plain embed of its `composition-id`. So does a workflow whose owner is not being served (a plan that lapsed, a partner whose agreement is not in force): the answer is the one the compositions of that owner give. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. The answer may be reused for a few seconds (`Cache-Control: public, max-age=15`), so a publish or a pause reaches visitors within moments. The graph is readable by anyone who has the workflow\'s id: its rules run in the visitor\'s browser, so a rule must never hold a secret.
3454
+ * Read the published Workflow of an embed
3455
+ */
3456
+ async getPublicWorkflowRaw(requestParameters, initOverrides) {
3457
+ if (requestParameters['workflowId'] == null) {
3458
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getPublicWorkflow().');
3459
+ }
3460
+ const queryParameters = {};
3461
+ const headerParameters = {};
3462
+ const response = await this.request({
3463
+ path: `/embed/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
3464
+ method: 'GET',
3465
+ headers: headerParameters,
3466
+ query: queryParameters,
3467
+ }, initOverrides);
3468
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetPublicWorkflow200ResponseFromJSON(jsonValue));
3469
+ }
3470
+ /**
3471
+ * Public read of a workflow for the embed that carries `workflow-id`. No API key. The answer is the live version (its graph, the composition a new visitor starts on, the time zone, the languages its compositions can be shown in, and the token that lets the browser report counts), or `status: paused` with nothing else, in which case the embed shows only its first composition. A workflow that is a draft, archived or unknown answers 404, and the embed then behaves as a plain embed of its `composition-id`. So does a workflow whose owner is not being served (a plan that lapsed, a partner whose agreement is not in force): the answer is the one the compositions of that owner give. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. The answer may be reused for a few seconds (`Cache-Control: public, max-age=15`), so a publish or a pause reaches visitors within moments. The graph is readable by anyone who has the workflow\'s id: its rules run in the visitor\'s browser, so a rule must never hold a secret.
3472
+ * Read the published Workflow of an embed
3473
+ */
3474
+ async getPublicWorkflow(requestParameters, initOverrides) {
3475
+ const response = await this.getPublicWorkflowRaw(requestParameters, initOverrides);
3476
+ return await response.value();
3477
+ }
3478
+ /**
3479
+ * A page that runs a published workflow, for a place that can only be given an address or an iframe: a chat messenger, a link page, a site builder, a blog that follows oEmbed. No API key, no SDK to add. The page holds the Embed SDK and the same tag a website carries (`<widgetic workflow-id composition-id>`), so a visitor moves from one composition to the next in place, by the same rules, exactly as on a website. A paused workflow shows its first composition alone, as its embeds do. **What the frame can count.** Only what happens inside it: entries, a widget\'s goals and actions, and waits. The page events a website can send to a workflow (`widgetic:workflow-event`) are events of the page around the embed, and they do not cross an iframe, so a connection that waits for one never fires from a frame. A workflow that is a draft, is archived, or does not exist, and one whose owner is not being served, answers 404 with a short page that gives no reason. If the owner of the workflow\'s first composition listed the websites it may appear on, the page is sent with `Content-Security-Policy: frame-ancestors` naming those websites (and Widgetic\'s own), so a browser refuses to show it inside any other website. Opening the address directly still works. An owner who listed nothing is not restricted. The page links its oEmbed card, so a site that follows oEmbed turns the address of the frame into an embed. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/frame`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
3480
+ * Show a published Workflow in a page of its own
3481
+ */
3482
+ async getPublicWorkflowFrameRaw(requestParameters, initOverrides) {
3483
+ if (requestParameters['workflowId'] == null) {
3484
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getPublicWorkflowFrame().');
3485
+ }
3486
+ const queryParameters = {};
3487
+ const headerParameters = {};
3488
+ const response = await this.request({
3489
+ path: `/embed/workflows/{workflowId}/frame`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
3490
+ method: 'GET',
3491
+ headers: headerParameters,
3492
+ query: queryParameters,
3493
+ }, initOverrides);
3494
+ if (this.isJsonMime(response.headers.get('content-type'))) {
3495
+ return new runtime.JSONApiResponse(response);
3496
+ }
3497
+ else {
3498
+ return new runtime.TextApiResponse(response);
3499
+ }
3500
+ }
3501
+ /**
3502
+ * A page that runs a published workflow, for a place that can only be given an address or an iframe: a chat messenger, a link page, a site builder, a blog that follows oEmbed. No API key, no SDK to add. The page holds the Embed SDK and the same tag a website carries (`<widgetic workflow-id composition-id>`), so a visitor moves from one composition to the next in place, by the same rules, exactly as on a website. A paused workflow shows its first composition alone, as its embeds do. **What the frame can count.** Only what happens inside it: entries, a widget\'s goals and actions, and waits. The page events a website can send to a workflow (`widgetic:workflow-event`) are events of the page around the embed, and they do not cross an iframe, so a connection that waits for one never fires from a frame. A workflow that is a draft, is archived, or does not exist, and one whose owner is not being served, answers 404 with a short page that gives no reason. If the owner of the workflow\'s first composition listed the websites it may appear on, the page is sent with `Content-Security-Policy: frame-ancestors` naming those websites (and Widgetic\'s own), so a browser refuses to show it inside any other website. Opening the address directly still works. An owner who listed nothing is not restricted. The page links its oEmbed card, so a site that follows oEmbed turns the address of the frame into an embed. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/frame`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
3503
+ * Show a published Workflow in a page of its own
3504
+ */
3505
+ async getPublicWorkflowFrame(requestParameters, initOverrides) {
3506
+ const response = await this.getPublicWorkflowFrameRaw(requestParameters, initOverrides);
3507
+ return await response.value();
3508
+ }
3509
+ /**
3510
+ * Public read of one version of a workflow, for a visitor who started on it before a newer one was published: they finish on the version they started on (for up to 30 days; after that they get the latest). The graph of a version never changes once published; the languages its compositions can be shown in (`translations`) are read each time, as for the live version. Like the read of the live version, it answers `status: paused` with nothing else while the workflow is paused, and 404 when the workflow is a draft or archived, or has no such version. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/versions/{versionId}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
3511
+ * Read one published version of a Workflow
3512
+ */
3513
+ async getPublicWorkflowVersionRaw(requestParameters, initOverrides) {
3514
+ if (requestParameters['workflowId'] == null) {
3515
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getPublicWorkflowVersion().');
3516
+ }
3517
+ if (requestParameters['versionId'] == null) {
3518
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling getPublicWorkflowVersion().');
3519
+ }
3520
+ const queryParameters = {};
3521
+ const headerParameters = {};
3522
+ const response = await this.request({
3523
+ path: `/embed/workflows/{workflowId}/versions/{versionId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
3524
+ method: 'GET',
3525
+ headers: headerParameters,
3526
+ query: queryParameters,
3527
+ }, initOverrides);
3528
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetPublicWorkflow200ResponseFromJSON(jsonValue));
3529
+ }
3530
+ /**
3531
+ * Public read of one version of a workflow, for a visitor who started on it before a newer one was published: they finish on the version they started on (for up to 30 days; after that they get the latest). The graph of a version never changes once published; the languages its compositions can be shown in (`translations`) are read each time, as for the live version. Like the read of the live version, it answers `status: paused` with nothing else while the workflow is paused, and 404 when the workflow is a draft or archived, or has no such version. **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/versions/{versionId}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
3532
+ * Read one published version of a Workflow
3533
+ */
3534
+ async getPublicWorkflowVersion(requestParameters, initOverrides) {
3535
+ const response = await this.getPublicWorkflowVersionRaw(requestParameters, initOverrides);
3536
+ return await response.value();
3537
+ }
3018
3538
  /**
3019
3539
  * Widget adapters are capabilities a widget can use, and some of them act through a service the owner has an account with: an adapter that sends email needs the owner\'s email provider key, one that sends texts needs the owner\'s SMS provider key. This lists every key an adapter takes from an owner and whether this account has connected it, so a settings page can show what is missing. An empty list means no adapter takes a key from an owner at the moment. The list never contains a key: only whether one is connected and when it was last set. Connect a key with `setUserAdapterConnection`; take it away with `removeUserAdapterConnection`. The widgets of customers a partner manages use the partner\'s keys instead (`getPartnerAdapterConnections`). The caller must be the account itself (an API key of that account works, with the `account:read` scope), or a Widgetic administrator.
3020
3540
  * See which adapter keys an account has connected
@@ -3275,6 +3795,144 @@ export class PartnerApi extends runtime.BaseAPI {
3275
3795
  const response = await this.getWidgetsBatchRaw(requestParameters, initOverrides);
3276
3796
  return await response.value();
3277
3797
  }
3798
+ /**
3799
+ * Reads a workflow with its draft graph and the version that is live. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
3800
+ * Get a Workflow
3801
+ */
3802
+ async getWorkspaceWorkflowRaw(requestParameters, initOverrides) {
3803
+ if (requestParameters['workspaceId'] == null) {
3804
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling getWorkspaceWorkflow().');
3805
+ }
3806
+ if (requestParameters['workflowId'] == null) {
3807
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getWorkspaceWorkflow().');
3808
+ }
3809
+ const queryParameters = {};
3810
+ const headerParameters = {};
3811
+ if (requestParameters['xManagedUserId'] != null) {
3812
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
3813
+ }
3814
+ if (requestParameters['xManagedUserExternalId'] != null) {
3815
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
3816
+ }
3817
+ if (this.configuration && this.configuration.accessToken) {
3818
+ const token = this.configuration.accessToken;
3819
+ const tokenString = await token("apiKeyAuth", []);
3820
+ if (tokenString) {
3821
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3822
+ }
3823
+ }
3824
+ const response = await this.request({
3825
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
3826
+ method: 'GET',
3827
+ headers: headerParameters,
3828
+ query: queryParameters,
3829
+ }, initOverrides);
3830
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
3831
+ }
3832
+ /**
3833
+ * Reads a workflow with its draft graph and the version that is live. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
3834
+ * Get a Workflow
3835
+ */
3836
+ async getWorkspaceWorkflow(requestParameters, initOverrides) {
3837
+ const response = await this.getWorkspaceWorkflowRaw(requestParameters, initOverrides);
3838
+ return await response.value();
3839
+ }
3840
+ /**
3841
+ * Counts per block and per connection over a range of UTC days (the last 30 days when not given, up to 366), for one version or for all of them. Only counts: how many visitors reached a block, took a connection, or could not be moved on. No visitor and no value a visitor typed is ever stored. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
3842
+ * Get what Visitors Did in a Workflow
3843
+ */
3844
+ async getWorkspaceWorkflowStatsRaw(requestParameters, initOverrides) {
3845
+ if (requestParameters['workspaceId'] == null) {
3846
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling getWorkspaceWorkflowStats().');
3847
+ }
3848
+ if (requestParameters['workflowId'] == null) {
3849
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getWorkspaceWorkflowStats().');
3850
+ }
3851
+ const queryParameters = {};
3852
+ if (requestParameters['versionId'] != null) {
3853
+ queryParameters['versionId'] = requestParameters['versionId'];
3854
+ }
3855
+ if (requestParameters['from'] != null) {
3856
+ queryParameters['from'] = requestParameters['from'];
3857
+ }
3858
+ if (requestParameters['to'] != null) {
3859
+ queryParameters['to'] = requestParameters['to'];
3860
+ }
3861
+ const headerParameters = {};
3862
+ if (requestParameters['xManagedUserId'] != null) {
3863
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
3864
+ }
3865
+ if (requestParameters['xManagedUserExternalId'] != null) {
3866
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
3867
+ }
3868
+ if (this.configuration && this.configuration.accessToken) {
3869
+ const token = this.configuration.accessToken;
3870
+ const tokenString = await token("apiKeyAuth", []);
3871
+ if (tokenString) {
3872
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3873
+ }
3874
+ }
3875
+ const response = await this.request({
3876
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/stats`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
3877
+ method: 'GET',
3878
+ headers: headerParameters,
3879
+ query: queryParameters,
3880
+ }, initOverrides);
3881
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetWorkspaceWorkflowStats200ResponseFromJSON(jsonValue));
3882
+ }
3883
+ /**
3884
+ * Counts per block and per connection over a range of UTC days (the last 30 days when not given, up to 366), for one version or for all of them. Only counts: how many visitors reached a block, took a connection, or could not be moved on. No visitor and no value a visitor typed is ever stored. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
3885
+ * Get what Visitors Did in a Workflow
3886
+ */
3887
+ async getWorkspaceWorkflowStats(requestParameters, initOverrides) {
3888
+ const response = await this.getWorkspaceWorkflowStatsRaw(requestParameters, initOverrides);
3889
+ return await response.value();
3890
+ }
3891
+ /**
3892
+ * One published version with its graph, for the read-only preview and for the Runs view. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
3893
+ * Get a Published Version of a Workflow
3894
+ */
3895
+ async getWorkspaceWorkflowVersionRaw(requestParameters, initOverrides) {
3896
+ if (requestParameters['workspaceId'] == null) {
3897
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling getWorkspaceWorkflowVersion().');
3898
+ }
3899
+ if (requestParameters['workflowId'] == null) {
3900
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getWorkspaceWorkflowVersion().');
3901
+ }
3902
+ if (requestParameters['versionId'] == null) {
3903
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling getWorkspaceWorkflowVersion().');
3904
+ }
3905
+ const queryParameters = {};
3906
+ const headerParameters = {};
3907
+ if (requestParameters['xManagedUserId'] != null) {
3908
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
3909
+ }
3910
+ if (requestParameters['xManagedUserExternalId'] != null) {
3911
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
3912
+ }
3913
+ if (this.configuration && this.configuration.accessToken) {
3914
+ const token = this.configuration.accessToken;
3915
+ const tokenString = await token("apiKeyAuth", []);
3916
+ if (tokenString) {
3917
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3918
+ }
3919
+ }
3920
+ const response = await this.request({
3921
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/versions/{versionId}`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
3922
+ method: 'GET',
3923
+ headers: headerParameters,
3924
+ query: queryParameters,
3925
+ }, initOverrides);
3926
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetWorkspaceWorkflowVersion200ResponseFromJSON(jsonValue));
3927
+ }
3928
+ /**
3929
+ * One published version with its graph, for the read-only preview and for the Runs view. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
3930
+ * Get a Published Version of a Workflow
3931
+ */
3932
+ async getWorkspaceWorkflowVersion(requestParameters, initOverrides) {
3933
+ const response = await this.getWorkspaceWorkflowVersionRaw(requestParameters, initOverrides);
3934
+ return await response.value();
3935
+ }
3278
3936
  /**
3279
3937
  * Reads one widget table with cursor paging (time then id in byte order), optional since/until on the time column, and up to five context filters plus ten column filters. Rate limit 120 requests per minute. Each read batch uses a 5 s statement timeout.
3280
3938
  * List composition entry items with paging and filters
@@ -3506,6 +4164,225 @@ export class PartnerApi extends runtime.BaseAPI {
3506
4164
  const response = await this.listPartnerPresetsRaw(requestParameters, initOverrides);
3507
4165
  return await response.value();
3508
4166
  }
4167
+ /**
4168
+ * The partner\'s starting points, ordered by `position` and then by `key`: the published workflows it offers its managed users when they make a new workflow. Each says whether people can start from it now and, when they cannot, why. The list is the same for every managed user, and a managed user is shown only what is available. A starting point is one of the partner account\'s own published workflows, built from compositions the account made for itself (not for a customer or a team) and from widgets the partner already offers as presets (`setPartnerPreset`), and it uses at most 10 widgets. A partner offers up to 50. The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator.
4169
+ * List the workflows a partner offers as places to start
4170
+ */
4171
+ async listPartnerWorkflowPresetsRaw(requestParameters, initOverrides) {
4172
+ if (requestParameters['partnerId'] == null) {
4173
+ throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling listPartnerWorkflowPresets().');
4174
+ }
4175
+ const queryParameters = {};
4176
+ const headerParameters = {};
4177
+ if (this.configuration && this.configuration.accessToken) {
4178
+ const token = this.configuration.accessToken;
4179
+ const tokenString = await token("apiKeyAuth", []);
4180
+ if (tokenString) {
4181
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4182
+ }
4183
+ }
4184
+ const response = await this.request({
4185
+ path: `/partners/{partnerId}/workflow-presets`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
4186
+ method: 'GET',
4187
+ headers: headerParameters,
4188
+ query: queryParameters,
4189
+ }, initOverrides);
4190
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListPartnerWorkflowPresets200ResponseFromJSON(jsonValue));
4191
+ }
4192
+ /**
4193
+ * The partner\'s starting points, ordered by `position` and then by `key`: the published workflows it offers its managed users when they make a new workflow. Each says whether people can start from it now and, when they cannot, why. The list is the same for every managed user, and a managed user is shown only what is available. A starting point is one of the partner account\'s own published workflows, built from compositions the account made for itself (not for a customer or a team) and from widgets the partner already offers as presets (`setPartnerPreset`), and it uses at most 10 widgets. A partner offers up to 50. The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator.
4194
+ * List the workflows a partner offers as places to start
4195
+ */
4196
+ async listPartnerWorkflowPresets(requestParameters, initOverrides) {
4197
+ const response = await this.listPartnerWorkflowPresetsRaw(requestParameters, initOverrides);
4198
+ return await response.value();
4199
+ }
4200
+ /**
4201
+ * The workspace\'s compositions as the workflow editor offers them, newest first. For each one: whether it can be shown (its widget has a published version), the websites it may be embedded on, and which triggers it supports. - **Input added** (`inputs`) is enabled only for a composition that declares at least one table a visitor\'s entries can be written to. Its `tables` are all of them; its `fields` are the columns a rule may read (not `id` and `created_at`, not a column that is not text, a number or yes/no, and not one whose name says it holds a person\'s private details, such as an email or a phone number). - **Action in the widget** (`actions`) is enabled only when the published widget version declares at least one goal. Its `items` are the goals a trigger can wait for. When one of them is not enabled, `reason` says why (`widget_keeps_no_data`, `widget_reports_no_actions` or `widget_not_published`), so the editor can show the trigger disabled with an explanation. Publishing checks every reference again against what the composition can do at that moment. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
4202
+ * List the compositions a workflow can show, and what each can do
4203
+ */
4204
+ async listWorkspaceWorkflowCompositionOptionsRaw(requestParameters, initOverrides) {
4205
+ if (requestParameters['workspaceId'] == null) {
4206
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling listWorkspaceWorkflowCompositionOptions().');
4207
+ }
4208
+ const queryParameters = {};
4209
+ if (requestParameters['search'] != null) {
4210
+ queryParameters['search'] = requestParameters['search'];
4211
+ }
4212
+ if (requestParameters['ids'] != null) {
4213
+ queryParameters['ids'] = requestParameters['ids'];
4214
+ }
4215
+ if (requestParameters['limit'] != null) {
4216
+ queryParameters['limit'] = requestParameters['limit'];
4217
+ }
4218
+ if (requestParameters['offset'] != null) {
4219
+ queryParameters['offset'] = requestParameters['offset'];
4220
+ }
4221
+ const headerParameters = {};
4222
+ if (requestParameters['xManagedUserId'] != null) {
4223
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4224
+ }
4225
+ if (requestParameters['xManagedUserExternalId'] != null) {
4226
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4227
+ }
4228
+ if (this.configuration && this.configuration.accessToken) {
4229
+ const token = this.configuration.accessToken;
4230
+ const tokenString = await token("apiKeyAuth", []);
4231
+ if (tokenString) {
4232
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4233
+ }
4234
+ }
4235
+ const response = await this.request({
4236
+ path: `/workspaces/{workspaceId}/workflows/composition-options`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
4237
+ method: 'GET',
4238
+ headers: headerParameters,
4239
+ query: queryParameters,
4240
+ }, initOverrides);
4241
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListWorkspaceWorkflowCompositionOptions200ResponseFromJSON(jsonValue));
4242
+ }
4243
+ /**
4244
+ * The workspace\'s compositions as the workflow editor offers them, newest first. For each one: whether it can be shown (its widget has a published version), the websites it may be embedded on, and which triggers it supports. - **Input added** (`inputs`) is enabled only for a composition that declares at least one table a visitor\'s entries can be written to. Its `tables` are all of them; its `fields` are the columns a rule may read (not `id` and `created_at`, not a column that is not text, a number or yes/no, and not one whose name says it holds a person\'s private details, such as an email or a phone number). - **Action in the widget** (`actions`) is enabled only when the published widget version declares at least one goal. Its `items` are the goals a trigger can wait for. When one of them is not enabled, `reason` says why (`widget_keeps_no_data`, `widget_reports_no_actions` or `widget_not_published`), so the editor can show the trigger disabled with an explanation. Publishing checks every reference again against what the composition can do at that moment. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read it.
4245
+ * List the compositions a workflow can show, and what each can do
4246
+ */
4247
+ async listWorkspaceWorkflowCompositionOptions(requestParameters, initOverrides) {
4248
+ const response = await this.listWorkspaceWorkflowCompositionOptionsRaw(requestParameters, initOverrides);
4249
+ return await response.value();
4250
+ }
4251
+ /**
4252
+ * The workflows you can start from in this workspace: published workflows that Widgetic offers or, for one of a partner\'s managed users, that the partner offers (a managed user is never shown Widgetic\'s, and a person is never shown a partner\'s). Only what can be started now is listed, in the order the offerer set (smallest `position` first, then by `key`). Each shows what you would get, and none shows who made it or any id of its own. Start from one with `createWorkspaceWorkflowFromPreset`. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
4253
+ * List the starting points for a new Workflow
4254
+ */
4255
+ async listWorkspaceWorkflowPresetsRaw(requestParameters, initOverrides) {
4256
+ if (requestParameters['workspaceId'] == null) {
4257
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling listWorkspaceWorkflowPresets().');
4258
+ }
4259
+ const queryParameters = {};
4260
+ const headerParameters = {};
4261
+ if (requestParameters['xManagedUserId'] != null) {
4262
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4263
+ }
4264
+ if (requestParameters['xManagedUserExternalId'] != null) {
4265
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4266
+ }
4267
+ if (this.configuration && this.configuration.accessToken) {
4268
+ const token = this.configuration.accessToken;
4269
+ const tokenString = await token("apiKeyAuth", []);
4270
+ if (tokenString) {
4271
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4272
+ }
4273
+ }
4274
+ const response = await this.request({
4275
+ path: `/workspaces/{workspaceId}/workflows/presets`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
4276
+ method: 'GET',
4277
+ headers: headerParameters,
4278
+ query: queryParameters,
4279
+ }, initOverrides);
4280
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListWorkspaceWorkflowPresets200ResponseFromJSON(jsonValue));
4281
+ }
4282
+ /**
4283
+ * The workflows you can start from in this workspace: published workflows that Widgetic offers or, for one of a partner\'s managed users, that the partner offers (a managed user is never shown Widgetic\'s, and a person is never shown a partner\'s). Only what can be started now is listed, in the order the offerer set (smallest `position` first, then by `key`). Each shows what you would get, and none shows who made it or any id of its own. Start from one with `createWorkspaceWorkflowFromPreset`. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
4284
+ * List the starting points for a new Workflow
4285
+ */
4286
+ async listWorkspaceWorkflowPresets(requestParameters, initOverrides) {
4287
+ const response = await this.listWorkspaceWorkflowPresetsRaw(requestParameters, initOverrides);
4288
+ return await response.value();
4289
+ }
4290
+ /**
4291
+ * Every version the workflow has had, newest first, with who published it and when. The one visitors get is marked `isLive`. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
4292
+ * List the Published Versions of a Workflow
4293
+ */
4294
+ async listWorkspaceWorkflowVersionsRaw(requestParameters, initOverrides) {
4295
+ if (requestParameters['workspaceId'] == null) {
4296
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling listWorkspaceWorkflowVersions().');
4297
+ }
4298
+ if (requestParameters['workflowId'] == null) {
4299
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling listWorkspaceWorkflowVersions().');
4300
+ }
4301
+ const queryParameters = {};
4302
+ const headerParameters = {};
4303
+ if (requestParameters['xManagedUserId'] != null) {
4304
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4305
+ }
4306
+ if (requestParameters['xManagedUserExternalId'] != null) {
4307
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4308
+ }
4309
+ if (this.configuration && this.configuration.accessToken) {
4310
+ const token = this.configuration.accessToken;
4311
+ const tokenString = await token("apiKeyAuth", []);
4312
+ if (tokenString) {
4313
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4314
+ }
4315
+ }
4316
+ const response = await this.request({
4317
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/versions`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
4318
+ method: 'GET',
4319
+ headers: headerParameters,
4320
+ query: queryParameters,
4321
+ }, initOverrides);
4322
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListWorkspaceWorkflowVersions200ResponseFromJSON(jsonValue));
4323
+ }
4324
+ /**
4325
+ * Every version the workflow has had, newest first, with who published it and when. The one visitors get is marked `isLive`. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read.
4326
+ * List the Published Versions of a Workflow
4327
+ */
4328
+ async listWorkspaceWorkflowVersions(requestParameters, initOverrides) {
4329
+ const response = await this.listWorkspaceWorkflowVersionsRaw(requestParameters, initOverrides);
4330
+ return await response.value();
4331
+ }
4332
+ /**
4333
+ * Lists the workspace\'s workflows, newest first unless `sort` says otherwise. Archived workflows are left out unless `status` asks for them (`archived`, or `all`). For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
4334
+ * List the Workflows of a Workspace
4335
+ */
4336
+ async listWorkspaceWorkflowsRaw(requestParameters, initOverrides) {
4337
+ if (requestParameters['workspaceId'] == null) {
4338
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling listWorkspaceWorkflows().');
4339
+ }
4340
+ const queryParameters = {};
4341
+ if (requestParameters['search'] != null) {
4342
+ queryParameters['search'] = requestParameters['search'];
4343
+ }
4344
+ if (requestParameters['status'] != null) {
4345
+ queryParameters['status'] = requestParameters['status'];
4346
+ }
4347
+ if (requestParameters['sort'] != null) {
4348
+ queryParameters['sort'] = requestParameters['sort'];
4349
+ }
4350
+ if (requestParameters['limit'] != null) {
4351
+ queryParameters['limit'] = requestParameters['limit'];
4352
+ }
4353
+ if (requestParameters['offset'] != null) {
4354
+ queryParameters['offset'] = requestParameters['offset'];
4355
+ }
4356
+ const headerParameters = {};
4357
+ if (requestParameters['xManagedUserId'] != null) {
4358
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4359
+ }
4360
+ if (requestParameters['xManagedUserExternalId'] != null) {
4361
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4362
+ }
4363
+ if (this.configuration && this.configuration.accessToken) {
4364
+ const token = this.configuration.accessToken;
4365
+ const tokenString = await token("apiKeyAuth", []);
4366
+ if (tokenString) {
4367
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4368
+ }
4369
+ }
4370
+ const response = await this.request({
4371
+ path: `/workspaces/{workspaceId}/workflows`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
4372
+ method: 'GET',
4373
+ headers: headerParameters,
4374
+ query: queryParameters,
4375
+ }, initOverrides);
4376
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListWorkspaceWorkflows200ResponseFromJSON(jsonValue));
4377
+ }
4378
+ /**
4379
+ * Lists the workspace\'s workflows, newest first unless `sort` says otherwise. Archived workflows are left out unless `status` asks for them (`archived`, or `all`). For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can read the list.
4380
+ * List the Workflows of a Workspace
4381
+ */
4382
+ async listWorkspaceWorkflows(requestParameters, initOverrides) {
4383
+ const response = await this.listWorkspaceWorkflowsRaw(requestParameters, initOverrides);
4384
+ return await response.value();
4385
+ }
3509
4386
  /**
3510
4387
  * Follows work that carries on after the response that started it. Duplicating a composition, for one, answers 202 with an `operationId`: ask for that operation until its `status` is `completed` (or `failed`, with the reason in `error`). A finished duplication names the new composition in `metadata.newCompositionId`. An operation belongs to the user who started it. Asking for somebody else\'s operation answers 404, exactly as for one that does not exist. Administrators may read any operation.
3511
4388
  * Get operation status
@@ -3555,18 +4432,60 @@ export class PartnerApi extends runtime.BaseAPI {
3555
4432
  if (requestParameters['idempotencyKey'] == null) {
3556
4433
  throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling patchCompositionContentItem().');
3557
4434
  }
3558
- if (requestParameters['requestBody'] == null) {
3559
- throw new runtime.RequiredError('requestBody', 'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');
4435
+ if (requestParameters['requestBody'] == null) {
4436
+ throw new runtime.RequiredError('requestBody', 'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');
4437
+ }
4438
+ const queryParameters = {};
4439
+ const headerParameters = {};
4440
+ headerParameters['Content-Type'] = 'application/json';
4441
+ if (requestParameters['ifMatch'] != null) {
4442
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
4443
+ }
4444
+ if (requestParameters['idempotencyKey'] != null) {
4445
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
4446
+ }
4447
+ if (requestParameters['xManagedUserId'] != null) {
4448
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4449
+ }
4450
+ if (requestParameters['xManagedUserExternalId'] != null) {
4451
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4452
+ }
4453
+ if (this.configuration && this.configuration.accessToken) {
4454
+ const token = this.configuration.accessToken;
4455
+ const tokenString = await token("apiKeyAuth", []);
4456
+ if (tokenString) {
4457
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4458
+ }
4459
+ }
4460
+ const response = await this.request({
4461
+ path: `/compositions/{id}/content/{list}/items/{itemId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"list"}}`, encodeURIComponent(String(requestParameters['list']))).replace(`{${"itemId"}}`, encodeURIComponent(String(requestParameters['itemId']))),
4462
+ method: 'PATCH',
4463
+ headers: headerParameters,
4464
+ query: queryParameters,
4465
+ body: requestParameters['requestBody'],
4466
+ }, initOverrides);
4467
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionContentItem201ResponseFromJSON(jsonValue));
4468
+ }
4469
+ /**
4470
+ * Update a content list item
4471
+ */
4472
+ async patchCompositionContentItem(requestParameters, initOverrides) {
4473
+ const response = await this.patchCompositionContentItemRaw(requestParameters, initOverrides);
4474
+ return await response.value();
4475
+ }
4476
+ /**
4477
+ * While a workflow is paused, its embeds show only their first composition (the `composition-id` of the embed) and no visitor moves on. The live version is kept, and visitors partway through carry on from where they were when it is resumed. Only a live workflow can be paused. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can pause.
4478
+ * Pause a Workflow
4479
+ */
4480
+ async pauseWorkspaceWorkflowRaw(requestParameters, initOverrides) {
4481
+ if (requestParameters['workspaceId'] == null) {
4482
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceWorkflow().');
4483
+ }
4484
+ if (requestParameters['workflowId'] == null) {
4485
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling pauseWorkspaceWorkflow().');
3560
4486
  }
3561
4487
  const queryParameters = {};
3562
4488
  const headerParameters = {};
3563
- headerParameters['Content-Type'] = 'application/json';
3564
- if (requestParameters['ifMatch'] != null) {
3565
- headerParameters['If-Match'] = String(requestParameters['ifMatch']);
3566
- }
3567
- if (requestParameters['idempotencyKey'] != null) {
3568
- headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
3569
- }
3570
4489
  if (requestParameters['xManagedUserId'] != null) {
3571
4490
  headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
3572
4491
  }
@@ -3581,19 +4500,19 @@ export class PartnerApi extends runtime.BaseAPI {
3581
4500
  }
3582
4501
  }
3583
4502
  const response = await this.request({
3584
- path: `/compositions/{id}/content/{list}/items/{itemId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"list"}}`, encodeURIComponent(String(requestParameters['list']))).replace(`{${"itemId"}}`, encodeURIComponent(String(requestParameters['itemId']))),
3585
- method: 'PATCH',
4503
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/pause`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
4504
+ method: 'POST',
3586
4505
  headers: headerParameters,
3587
4506
  query: queryParameters,
3588
- body: requestParameters['requestBody'],
3589
4507
  }, initOverrides);
3590
- return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionContentItem201ResponseFromJSON(jsonValue));
4508
+ return new runtime.JSONApiResponse(response, (jsonValue) => SaveWorkspaceWorkflow200ResponseFromJSON(jsonValue));
3591
4509
  }
3592
4510
  /**
3593
- * Update a content list item
4511
+ * While a workflow is paused, its embeds show only their first composition (the `composition-id` of the embed) and no visitor moves on. The live version is kept, and visitors partway through carry on from where they were when it is resumed. Only a live workflow can be paused. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can pause.
4512
+ * Pause a Workflow
3594
4513
  */
3595
- async patchCompositionContentItem(requestParameters, initOverrides) {
3596
- const response = await this.patchCompositionContentItemRaw(requestParameters, initOverrides);
4514
+ async pauseWorkspaceWorkflow(requestParameters, initOverrides) {
4515
+ const response = await this.pauseWorkspaceWorkflowRaw(requestParameters, initOverrides);
3597
4516
  return await response.value();
3598
4517
  }
3599
4518
  /**
@@ -3624,6 +4543,59 @@ export class PartnerApi extends runtime.BaseAPI {
3624
4543
  const response = await this.postPublicCompositionEmbedStatusRaw(requestParameters, initOverrides);
3625
4544
  return await response.value();
3626
4545
  }
4546
+ /**
4547
+ * Checks the draft and, when nothing stops it, makes it the next version and the one new visitors get. Versions never change once published. A visitor already partway through keeps the version they started on (for up to 30 days). The check reads what each composition can do right now (a table the visitor adds to, a goal the widget reports, the websites it may be embedded on), so a workflow never goes live pointing at something that has gone. It is refused with 422 (`BUSINESS_OPERATION_INVALID`) when the draft has errors; the `issues` in the error\'s `details` name the blocks to fix: an unconnected trigger, a condition without rules, a composition that is not published, a field or action that is gone, a composition whose allowed websites exclude the site the workflow starts on. Nothing is published when the draft has no changes since the live version. The `revision` is the one the editor read, and a publish of a draft that has moved on is refused with 409. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can publish.
4548
+ * Publish the Draft of a Workflow
4549
+ */
4550
+ async publishWorkspaceWorkflowRaw(requestParameters, initOverrides) {
4551
+ if (requestParameters['workspaceId'] == null) {
4552
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling publishWorkspaceWorkflow().');
4553
+ }
4554
+ if (requestParameters['workflowId'] == null) {
4555
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling publishWorkspaceWorkflow().');
4556
+ }
4557
+ if (requestParameters['idempotencyKey'] == null) {
4558
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling publishWorkspaceWorkflow().');
4559
+ }
4560
+ if (requestParameters['publishWorkspaceWorkflowRequest'] == null) {
4561
+ throw new runtime.RequiredError('publishWorkspaceWorkflowRequest', 'Required parameter "publishWorkspaceWorkflowRequest" was null or undefined when calling publishWorkspaceWorkflow().');
4562
+ }
4563
+ const queryParameters = {};
4564
+ const headerParameters = {};
4565
+ headerParameters['Content-Type'] = 'application/json';
4566
+ if (requestParameters['idempotencyKey'] != null) {
4567
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
4568
+ }
4569
+ if (requestParameters['xManagedUserId'] != null) {
4570
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
4571
+ }
4572
+ if (requestParameters['xManagedUserExternalId'] != null) {
4573
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
4574
+ }
4575
+ if (this.configuration && this.configuration.accessToken) {
4576
+ const token = this.configuration.accessToken;
4577
+ const tokenString = await token("apiKeyAuth", []);
4578
+ if (tokenString) {
4579
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4580
+ }
4581
+ }
4582
+ const response = await this.request({
4583
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/publish`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
4584
+ method: 'POST',
4585
+ headers: headerParameters,
4586
+ query: queryParameters,
4587
+ body: PublishWorkspaceWorkflowRequestToJSON(requestParameters['publishWorkspaceWorkflowRequest']),
4588
+ }, initOverrides);
4589
+ return new runtime.JSONApiResponse(response, (jsonValue) => PublishWorkspaceWorkflow200ResponseFromJSON(jsonValue));
4590
+ }
4591
+ /**
4592
+ * Checks the draft and, when nothing stops it, makes it the next version and the one new visitors get. Versions never change once published. A visitor already partway through keeps the version they started on (for up to 30 days). The check reads what each composition can do right now (a table the visitor adds to, a goal the widget reports, the websites it may be embedded on), so a workflow never goes live pointing at something that has gone. It is refused with 422 (`BUSINESS_OPERATION_INVALID`) when the draft has errors; the `issues` in the error\'s `details` name the blocks to fix: an unconnected trigger, a condition without rules, a composition that is not published, a field or action that is gone, a composition whose allowed websites exclude the site the workflow starts on. Nothing is published when the draft has no changes since the live version. The `revision` is the one the editor read, and a publish of a draft that has moved on is refused with 409. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can publish.
4593
+ * Publish the Draft of a Workflow
4594
+ */
4595
+ async publishWorkspaceWorkflow(requestParameters, initOverrides) {
4596
+ const response = await this.publishWorkspaceWorkflowRaw(requestParameters, initOverrides);
4597
+ return await response.value();
4598
+ }
3627
4599
  /**
3628
4600
  * Counts the entries visitors left in one table, tallies them per value of a column on request, and returns the newest entries only when asked to. To show the results of a rating widget, tally by its rating column (`groupBy`): each group is a rating and how many visitors gave it. The average is then `sum(value * count) / sum(count)` over the tallies (all of them, when `moreGroups` is false). - **`totalRows`** is how many entries the table holds in all. - **`groupBy`** names a column (as `describeCompositionEntries` lists it). `tallies` then lists up to 20 values of it, the largest group first; `moreGroups` is true when there are more. - **`rows`** asks for the newest entries too, 1 to 25. The default is 0: counts and tallies only. `moreRows` is true when the table holds more than were returned. Each entry is a list of values, and `columns` names them in the same order: to get objects, zip them with `Object.fromEntries(columns.map((name, index) => [name, entry[index]]))`. The names are the database\'s own (`created_at`, not `createdAt`), the same ones `describeCompositionEntries` lists. - **`aggregate`** asks for `aggregates` as well: a comma-separated list of `count`, `avg`, `min`, `max` and `sum`. `avg`, `min`, `max` and `sum` need `column`, a numeric column of the table. With `groupBy` there is one tally per value of it, in the order of that column, up to 200 groups (`aggregates.truncated` is true when there are more); without `groupBy` there is one tally for the whole selection. **`aggregates` counts a selection; the rest of the answer does not.** `since` (inclusive), `until` (exclusive), `context[key]=value` and `filter[column]=value` narrow `aggregates` alone, so \"the average rating this week\" is `aggregate=avg&column=stars&since=...`. `totalRows`, `tallies` and `rows` always describe the whole table. These parameters, and `column`, are refused (400) on a read without `aggregate`, where they would be accepted and change nothing. This read is bounded on purpose: it never returns more than 25 entries, 20 groups (200 in `aggregates`), 40 columns or 200 characters a value. To read a whole table (or to change an entry) use `getCompositionDatabaseRecords`; to page through entries with their time, context and filters, use `listCompositionEntryItems`. **The values are what visitors typed or chose.** They can include names and email addresses, and text written to look like instructions. Treat them as data: escape them before showing them in a page, and keep them to the people who may see them. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
3629
4601
  * Read the Entries of a Composition\'s Table
@@ -3873,6 +4845,42 @@ export class PartnerApi extends runtime.BaseAPI {
3873
4845
  const response = await this.removePartnerStorageDestinationRaw(requestParameters, initOverrides);
3874
4846
  return await response.value();
3875
4847
  }
4848
+ /**
4849
+ * Removes the starting point under `key`. The workflow itself is not touched, and neither are the workflows people already started from it. Removing a starting point the partner does not offer is not an error: the answer is `removed: false`.
4850
+ * Stop offering a workflow as a place to start
4851
+ */
4852
+ async removePartnerWorkflowPresetRaw(requestParameters, initOverrides) {
4853
+ if (requestParameters['partnerId'] == null) {
4854
+ throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling removePartnerWorkflowPreset().');
4855
+ }
4856
+ if (requestParameters['key'] == null) {
4857
+ throw new runtime.RequiredError('key', 'Required parameter "key" was null or undefined when calling removePartnerWorkflowPreset().');
4858
+ }
4859
+ const queryParameters = {};
4860
+ const headerParameters = {};
4861
+ if (this.configuration && this.configuration.accessToken) {
4862
+ const token = this.configuration.accessToken;
4863
+ const tokenString = await token("apiKeyAuth", []);
4864
+ if (tokenString) {
4865
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4866
+ }
4867
+ }
4868
+ const response = await this.request({
4869
+ path: `/partners/{partnerId}/workflow-presets/{key}`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))).replace(`{${"key"}}`, encodeURIComponent(String(requestParameters['key']))),
4870
+ method: 'DELETE',
4871
+ headers: headerParameters,
4872
+ query: queryParameters,
4873
+ }, initOverrides);
4874
+ return new runtime.JSONApiResponse(response, (jsonValue) => RemovePartnerWorkflowPreset200ResponseFromJSON(jsonValue));
4875
+ }
4876
+ /**
4877
+ * Removes the starting point under `key`. The workflow itself is not touched, and neither are the workflows people already started from it. Removing a starting point the partner does not offer is not an error: the answer is `removed: false`.
4878
+ * Stop offering a workflow as a place to start
4879
+ */
4880
+ async removePartnerWorkflowPreset(requestParameters, initOverrides) {
4881
+ const response = await this.removePartnerWorkflowPresetRaw(requestParameters, initOverrides);
4882
+ return await response.value();
4883
+ }
3876
4884
  /**
3877
4885
  * Removes a key an adapter was given. The adapter stops working for the widgets that need it: their visitors are told the feature is unavailable. Nothing else of the widgets changes, and connecting a key again brings them back. Removing a key that is not connected answers 200 with `removed: false`: the state asked for is the state it is in. A key of an adapter that has since been retired from the catalog can still be removed. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator.
3878
4886
  * Remove an adapter key from an account
@@ -3954,6 +4962,129 @@ export class PartnerApi extends runtime.BaseAPI {
3954
4962
  const response = await this.replayPartnerNotificationDeliveryRaw(requestParameters, initOverrides);
3955
4963
  return await response.value();
3956
4964
  }
4965
+ /**
4966
+ * Public report of counts for a workflow, sent by the embed. No API key. Each event is one id and a number: a visitor reached a block (`n`), took a connection (`e`), or could not be moved on (`f`). Nothing else is kept: no visitor, no value a visitor typed, no address. A batch carries at most 100 events and 16 KB. The same report may carry `heights`: how tall a step settled at in the browser, which the embed code of the workflow uses to start its box at a real height (a composition, a whole number of pixels, nothing about the visitor). A report is accepted only with the `token` the workflow\'s own read handed out for that `versionId`, so a page that never read the workflow cannot raise its numbers. An expired token (`EVENT_TOKEN_EXPIRED`) is refused with 401: read the workflow again for a new one. Counts for ids that are not in that version, or for a workflow that is not live, are not recorded and the answer says so (`recorded: false`) with 200: the visitor\'s page has nothing to fix. The body is JSON, sent as `application/json` or as `text/plain` (a \"simple\" cross-origin request, which is what lets a report leave a page that is being closed). **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/events`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
4967
+ * Report what visitors did in a Workflow, as counts
4968
+ */
4969
+ async reportPublicWorkflowEventsRaw(requestParameters, initOverrides) {
4970
+ if (requestParameters['workflowId'] == null) {
4971
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling reportPublicWorkflowEvents().');
4972
+ }
4973
+ if (requestParameters['publicWorkflowEventsRequest'] == null) {
4974
+ throw new runtime.RequiredError('publicWorkflowEventsRequest', 'Required parameter "publicWorkflowEventsRequest" was null or undefined when calling reportPublicWorkflowEvents().');
4975
+ }
4976
+ const queryParameters = {};
4977
+ const headerParameters = {};
4978
+ headerParameters['Content-Type'] = 'application/json';
4979
+ const response = await this.request({
4980
+ path: `/embed/workflows/{workflowId}/events`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
4981
+ method: 'POST',
4982
+ headers: headerParameters,
4983
+ query: queryParameters,
4984
+ body: PublicWorkflowEventsRequestToJSON(requestParameters['publicWorkflowEventsRequest']),
4985
+ }, initOverrides);
4986
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReportPublicWorkflowEvents200ResponseFromJSON(jsonValue));
4987
+ }
4988
+ /**
4989
+ * Public report of counts for a workflow, sent by the embed. No API key. Each event is one id and a number: a visitor reached a block (`n`), took a connection (`e`), or could not be moved on (`f`). Nothing else is kept: no visitor, no value a visitor typed, no address. A batch carries at most 100 events and 16 KB. The same report may carry `heights`: how tall a step settled at in the browser, which the embed code of the workflow uses to start its box at a real height (a composition, a whole number of pixels, nothing about the visitor). A report is accepted only with the `token` the workflow\'s own read handed out for that `versionId`, so a page that never read the workflow cannot raise its numbers. An expired token (`EVENT_TOKEN_EXPIRED`) is refused with 401: read the workflow again for a new one. Counts for ids that are not in that version, or for a workflow that is not live, are not recorded and the answer says so (`recorded: false`) with 200: the visitor\'s page has nothing to fix. The body is JSON, sent as `application/json` or as `text/plain` (a \"simple\" cross-origin request, which is what lets a report leave a page that is being closed). **Address.** `https://api.widgetic.com/embed/workflows/{workflowId}/events`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag.
4990
+ * Report what visitors did in a Workflow, as counts
4991
+ */
4992
+ async reportPublicWorkflowEvents(requestParameters, initOverrides) {
4993
+ const response = await this.reportPublicWorkflowEventsRaw(requestParameters, initOverrides);
4994
+ return await response.value();
4995
+ }
4996
+ /**
4997
+ * Copies a published version into the draft, so it can be changed and published again. Nothing is published and nothing visitors see changes: the version stays in the history as it was. Names the `revision` the editor read. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can restore.
4998
+ * Restore a Version of a Workflow into the Draft
4999
+ */
5000
+ async restoreWorkspaceWorkflowVersionRaw(requestParameters, initOverrides) {
5001
+ if (requestParameters['workspaceId'] == null) {
5002
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling restoreWorkspaceWorkflowVersion().');
5003
+ }
5004
+ if (requestParameters['workflowId'] == null) {
5005
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling restoreWorkspaceWorkflowVersion().');
5006
+ }
5007
+ if (requestParameters['versionId'] == null) {
5008
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling restoreWorkspaceWorkflowVersion().');
5009
+ }
5010
+ if (requestParameters['publishWorkspaceWorkflowRequest'] == null) {
5011
+ throw new runtime.RequiredError('publishWorkspaceWorkflowRequest', 'Required parameter "publishWorkspaceWorkflowRequest" was null or undefined when calling restoreWorkspaceWorkflowVersion().');
5012
+ }
5013
+ const queryParameters = {};
5014
+ const headerParameters = {};
5015
+ headerParameters['Content-Type'] = 'application/json';
5016
+ if (requestParameters['xManagedUserId'] != null) {
5017
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
5018
+ }
5019
+ if (requestParameters['xManagedUserExternalId'] != null) {
5020
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
5021
+ }
5022
+ if (this.configuration && this.configuration.accessToken) {
5023
+ const token = this.configuration.accessToken;
5024
+ const tokenString = await token("apiKeyAuth", []);
5025
+ if (tokenString) {
5026
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5027
+ }
5028
+ }
5029
+ const response = await this.request({
5030
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/versions/{versionId}/restore`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
5031
+ method: 'POST',
5032
+ headers: headerParameters,
5033
+ query: queryParameters,
5034
+ body: PublishWorkspaceWorkflowRequestToJSON(requestParameters['publishWorkspaceWorkflowRequest']),
5035
+ }, initOverrides);
5036
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWorkspaceWorkflowFromPreset201ResponseFromJSON(jsonValue));
5037
+ }
5038
+ /**
5039
+ * Copies a published version into the draft, so it can be changed and published again. Nothing is published and nothing visitors see changes: the version stays in the history as it was. Names the `revision` the editor read. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can restore.
5040
+ * Restore a Version of a Workflow into the Draft
5041
+ */
5042
+ async restoreWorkspaceWorkflowVersion(requestParameters, initOverrides) {
5043
+ const response = await this.restoreWorkspaceWorkflowVersionRaw(requestParameters, initOverrides);
5044
+ return await response.value();
5045
+ }
5046
+ /**
5047
+ * Makes a paused workflow live again, on the version that was live when it was paused. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can resume.
5048
+ * Resume a Paused Workflow
5049
+ */
5050
+ async resumeWorkspaceWorkflowRaw(requestParameters, initOverrides) {
5051
+ if (requestParameters['workspaceId'] == null) {
5052
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling resumeWorkspaceWorkflow().');
5053
+ }
5054
+ if (requestParameters['workflowId'] == null) {
5055
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling resumeWorkspaceWorkflow().');
5056
+ }
5057
+ const queryParameters = {};
5058
+ const headerParameters = {};
5059
+ if (requestParameters['xManagedUserId'] != null) {
5060
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
5061
+ }
5062
+ if (requestParameters['xManagedUserExternalId'] != null) {
5063
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
5064
+ }
5065
+ if (this.configuration && this.configuration.accessToken) {
5066
+ const token = this.configuration.accessToken;
5067
+ const tokenString = await token("apiKeyAuth", []);
5068
+ if (tokenString) {
5069
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5070
+ }
5071
+ }
5072
+ const response = await this.request({
5073
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/resume`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
5074
+ method: 'POST',
5075
+ headers: headerParameters,
5076
+ query: queryParameters,
5077
+ }, initOverrides);
5078
+ return new runtime.JSONApiResponse(response, (jsonValue) => SaveWorkspaceWorkflow200ResponseFromJSON(jsonValue));
5079
+ }
5080
+ /**
5081
+ * Makes a paused workflow live again, on the version that was live when it was paused. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can resume.
5082
+ * Resume a Paused Workflow
5083
+ */
5084
+ async resumeWorkspaceWorkflow(requestParameters, initOverrides) {
5085
+ const response = await this.resumeWorkspaceWorkflowRaw(requestParameters, initOverrides);
5086
+ return await response.value();
5087
+ }
3957
5088
  /**
3958
5089
  * Ends the session at once: its token stops working on the next request (on another server of ours, within a few seconds). Ending a session that has already ended is fine.
3959
5090
  * End one editor session of a managed user
@@ -4101,6 +5232,53 @@ export class PartnerApi extends runtime.BaseAPI {
4101
5232
  const response = await this.rotatePartnerWebhookSecretRaw(requestParameters, initOverrides);
4102
5233
  return await response.value();
4103
5234
  }
5235
+ /**
5236
+ * Saves the name, the time zone and/or the graph of the draft. Send at least one. The save names the `revision` the editor started from and is refused with 409 (`BUSINESS_STATE_CONFLICT`) when the draft has moved on, so two people editing do not overwrite each other without knowing; read the workflow again and apply the change to it. A save is never refused for what is wrong with the graph (a block with no connection yet is normal in a draft): only the shape is judged here, and what stops a workflow going live is told when it is published. A graph larger than 200,000 bytes, or with more than 100 blocks or 300 connections, is refused. An archived workflow cannot be saved. Saving a live workflow changes the draft only: visitors keep getting the published version until the changes are published. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can save.
5237
+ * Save the Draft of a Workflow
5238
+ */
5239
+ async saveWorkspaceWorkflowRaw(requestParameters, initOverrides) {
5240
+ if (requestParameters['workspaceId'] == null) {
5241
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling saveWorkspaceWorkflow().');
5242
+ }
5243
+ if (requestParameters['workflowId'] == null) {
5244
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling saveWorkspaceWorkflow().');
5245
+ }
5246
+ if (requestParameters['saveWorkspaceWorkflowRequest'] == null) {
5247
+ throw new runtime.RequiredError('saveWorkspaceWorkflowRequest', 'Required parameter "saveWorkspaceWorkflowRequest" was null or undefined when calling saveWorkspaceWorkflow().');
5248
+ }
5249
+ const queryParameters = {};
5250
+ const headerParameters = {};
5251
+ headerParameters['Content-Type'] = 'application/json';
5252
+ if (requestParameters['xManagedUserId'] != null) {
5253
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
5254
+ }
5255
+ if (requestParameters['xManagedUserExternalId'] != null) {
5256
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
5257
+ }
5258
+ if (this.configuration && this.configuration.accessToken) {
5259
+ const token = this.configuration.accessToken;
5260
+ const tokenString = await token("apiKeyAuth", []);
5261
+ if (tokenString) {
5262
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5263
+ }
5264
+ }
5265
+ const response = await this.request({
5266
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
5267
+ method: 'PUT',
5268
+ headers: headerParameters,
5269
+ query: queryParameters,
5270
+ body: SaveWorkspaceWorkflowRequestToJSON(requestParameters['saveWorkspaceWorkflowRequest']),
5271
+ }, initOverrides);
5272
+ return new runtime.JSONApiResponse(response, (jsonValue) => SaveWorkspaceWorkflow200ResponseFromJSON(jsonValue));
5273
+ }
5274
+ /**
5275
+ * Saves the name, the time zone and/or the graph of the draft. Send at least one. The save names the `revision` the editor started from and is refused with 409 (`BUSINESS_STATE_CONFLICT`) when the draft has moved on, so two people editing do not overwrite each other without knowing; read the workflow again and apply the change to it. A save is never refused for what is wrong with the graph (a block with no connection yet is normal in a draft): only the shape is judged here, and what stops a workflow going live is told when it is published. A graph larger than 200,000 bytes, or with more than 100 blocks or 300 connections, is refused. An archived workflow cannot be saved. Saving a live workflow changes the draft only: visitors keep getting the published version until the changes are published. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can save.
5276
+ * Save the Draft of a Workflow
5277
+ */
5278
+ async saveWorkspaceWorkflow(requestParameters, initOverrides) {
5279
+ const response = await this.saveWorkspaceWorkflowRaw(requestParameters, initOverrides);
5280
+ return await response.value();
5281
+ }
4104
5282
  /**
4105
5283
  * Sends ONE signed call, right now, to the webhook address you saved under notification settings, with a sample of what an event of the type you name carries, and answers how it went: whether your receiver answered with a 2xx status, which status, how long it took, and why not when it did not arrive. Use it to write and try your receiver (above all the signature check) before a real event happens. The call is made like every other: it is signed with your current secret (and the previous one while a rotation overlaps), it carries the headers `webhook-id`, `webhook-timestamp`, `webhook-signature` and `x-widgetic-event` (the event type), and its body is `{ \"id\", \"type\", \"createdAt\", \"partnerId\", \"data\" }`. Three things differ. `id` starts with `evt_test_` and is new every time, so a receiver that remembers ids can tell a test from an event and drop it. `data` holds made-up values of the shape a real event of that type carries (`PartnerNotification` describes each), never anything about your account. And the call is made once: it is not tried again, nothing is stored, and it appears neither in the delivery log nor in the notification list. It is sent whatever `webhookEvents` says: a test is not filtered by what you subscribed to. The answer is 200 whether or not your receiver took the call (read `delivered`); a call that gets no answer within ten seconds is given up and reported as a `timeout`. A webhook address and a signing secret must be saved first (`updatePartnerNotificationSettings`); until then the answer is 409. This needs an API key with full access, and `Idempotency-Key` is required: a retry with the same key gets the first answer back and no second call is made. The caller must be the person who administers the partner, or a Widgetic administrator. Five tests a minute.
4106
5284
  * Send a test event to your webhook
@@ -4325,7 +5503,7 @@ export class PartnerApi extends runtime.BaseAPI {
4325
5503
  return await response.value();
4326
5504
  }
4327
5505
  /**
4328
- * Gives an adapter the key it needs to act through a service the partner has an account with, for the widgets of the customers the partner manages. Take the `adapterId` and `credentialKey` from `getPartnerAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this partner, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget or to your customers. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on the partner\'s behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that a partner may keep it (some are for an owner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it. A widget whose adapter has no key connected is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the partner is told once a day what to connect. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
5506
+ * Gives an adapter the key it needs to act through a service the partner has an account with, for the widgets of the customers the partner manages. Take the `adapterId` and `credentialKey` from `getPartnerAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this partner, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget or to your customers. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on the partner\'s behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that a partner may keep it (some are for an owner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it. **An address that has to be confirmed.** Some credentials are not a key but the email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getPartnerAdapterConnections`). Saving one checks that it is one email address and emails a six-digit code to it; the answer says `awaitingConfirmation: true`, and nothing is sent to the address until the code is given back with `confirmPartnerAdapterConnection`. Saving the same address again before it is confirmed emails a new code (not sooner than a minute after the last); saving the address that is already confirmed changes nothing. If the code cannot be emailed, nothing is saved. A widget whose adapter has no key connected, or whose address is not confirmed yet, is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the partner is told once a day what to do. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
4329
5507
  * Connect an adapter key to a partner
4330
5508
  */
4331
5509
  async setPartnerAdapterConnectionRaw(requestParameters, initOverrides) {
@@ -4361,7 +5539,7 @@ export class PartnerApi extends runtime.BaseAPI {
4361
5539
  return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
4362
5540
  }
4363
5541
  /**
4364
- * Gives an adapter the key it needs to act through a service the partner has an account with, for the widgets of the customers the partner manages. Take the `adapterId` and `credentialKey` from `getPartnerAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this partner, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget or to your customers. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on the partner\'s behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that a partner may keep it (some are for an owner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it. A widget whose adapter has no key connected is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the partner is told once a day what to connect. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
5542
+ * Gives an adapter the key it needs to act through a service the partner has an account with, for the widgets of the customers the partner manages. Take the `adapterId` and `credentialKey` from `getPartnerAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this partner, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget or to your customers. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on the partner\'s behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that a partner may keep it (some are for an owner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it. **An address that has to be confirmed.** Some credentials are not a key but the email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getPartnerAdapterConnections`). Saving one checks that it is one email address and emails a six-digit code to it; the answer says `awaitingConfirmation: true`, and nothing is sent to the address until the code is given back with `confirmPartnerAdapterConnection`. Saving the same address again before it is confirmed emails a new code (not sooner than a minute after the last); saving the address that is already confirmed changes nothing. If the code cannot be emailed, nothing is saved. A widget whose adapter has no key connected, or whose address is not confirmed yet, is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the partner is told once a day what to do. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
4365
5543
  * Connect an adapter key to a partner
4366
5544
  */
4367
5545
  async setPartnerAdapterConnection(requestParameters, initOverrides) {
@@ -4524,7 +5702,48 @@ export class PartnerApi extends runtime.BaseAPI {
4524
5702
  return await response.value();
4525
5703
  }
4526
5704
  /**
4527
- * Gives an adapter the key it needs to act through a service you have an account with, for the widgets you made. Take the `adapterId` and `credentialKey` from `getUserAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this account, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on your behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that an owner may keep it (some are for a partner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it, and the widget tells its owner. A widget whose adapter has no key connected is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the owner is told once a day what to connect. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
5705
+ * Offers one of the partner account\'s own published workflows to its managed users under `key`. If the partner already offers something under that key it is replaced, so sending the same request twice is safe. Saving replaces the whole starting point: a `title`, `description` or `position` you leave out goes back to its default. Keys are 1 to 64 characters: lowercase letters, digits, hyphens and underscores, the first a letter or a digit. A workflow is offered once. What people get is the workflow\'s live version as it is when they start, so publishing the workflow changes what new starts get; workflows people already started are never touched. The offer is refused, and `error.details.reason` says why, when the workflow: - is not the partner account\'s own (a workflow of a team or of a customer, or of somebody else), or does not exist: 404, the same for both; - is archived (409 `workflow_archived`), or was never published (409 `workflow_not_published`); - shows no composition (422 `workflow_empty`), or a block shows a composition made for a customer or a team (422 `composition_not_own`); - chains more than 10 widgets (422 `too_many_widgets`), or a widget that the partner does not offer as a preset (422 `widget_not_preset`; `error.details.widgets` lists them, each with its `id` and `name`, so they can be offered first with `setPartnerPreset`); - is already offered under another key (409 `workflow_already_offered`; `error.details.key` says which), or the partner already offers 50 (409 `too_many_presets`). The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator, who offers the partner\'s workflow on its behalf.
5706
+ * Offer a workflow as a place to start, or replace what a key offers
5707
+ */
5708
+ async setPartnerWorkflowPresetRaw(requestParameters, initOverrides) {
5709
+ if (requestParameters['partnerId'] == null) {
5710
+ throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling setPartnerWorkflowPreset().');
5711
+ }
5712
+ if (requestParameters['key'] == null) {
5713
+ throw new runtime.RequiredError('key', 'Required parameter "key" was null or undefined when calling setPartnerWorkflowPreset().');
5714
+ }
5715
+ if (requestParameters['offerWorkflowPresetRequest'] == null) {
5716
+ throw new runtime.RequiredError('offerWorkflowPresetRequest', 'Required parameter "offerWorkflowPresetRequest" was null or undefined when calling setPartnerWorkflowPreset().');
5717
+ }
5718
+ const queryParameters = {};
5719
+ const headerParameters = {};
5720
+ headerParameters['Content-Type'] = 'application/json';
5721
+ if (this.configuration && this.configuration.accessToken) {
5722
+ const token = this.configuration.accessToken;
5723
+ const tokenString = await token("apiKeyAuth", []);
5724
+ if (tokenString) {
5725
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5726
+ }
5727
+ }
5728
+ const response = await this.request({
5729
+ path: `/partners/{partnerId}/workflow-presets/{key}`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))).replace(`{${"key"}}`, encodeURIComponent(String(requestParameters['key']))),
5730
+ method: 'PUT',
5731
+ headers: headerParameters,
5732
+ query: queryParameters,
5733
+ body: OfferWorkflowPresetRequestToJSON(requestParameters['offerWorkflowPresetRequest']),
5734
+ }, initOverrides);
5735
+ return new runtime.JSONApiResponse(response, (jsonValue) => SetPartnerWorkflowPreset200ResponseFromJSON(jsonValue));
5736
+ }
5737
+ /**
5738
+ * Offers one of the partner account\'s own published workflows to its managed users under `key`. If the partner already offers something under that key it is replaced, so sending the same request twice is safe. Saving replaces the whole starting point: a `title`, `description` or `position` you leave out goes back to its default. Keys are 1 to 64 characters: lowercase letters, digits, hyphens and underscores, the first a letter or a digit. A workflow is offered once. What people get is the workflow\'s live version as it is when they start, so publishing the workflow changes what new starts get; workflows people already started are never touched. The offer is refused, and `error.details.reason` says why, when the workflow: - is not the partner account\'s own (a workflow of a team or of a customer, or of somebody else), or does not exist: 404, the same for both; - is archived (409 `workflow_archived`), or was never published (409 `workflow_not_published`); - shows no composition (422 `workflow_empty`), or a block shows a composition made for a customer or a team (422 `composition_not_own`); - chains more than 10 widgets (422 `too_many_widgets`), or a widget that the partner does not offer as a preset (422 `widget_not_preset`; `error.details.widgets` lists them, each with its `id` and `name`, so they can be offered first with `setPartnerPreset`); - is already offered under another key (409 `workflow_already_offered`; `error.details.key` says which), or the partner already offers 50 (409 `too_many_presets`). The caller must be the person who administers the partner (an API key of that account works), or a Widgetic administrator, who offers the partner\'s workflow on its behalf.
5739
+ * Offer a workflow as a place to start, or replace what a key offers
5740
+ */
5741
+ async setPartnerWorkflowPreset(requestParameters, initOverrides) {
5742
+ const response = await this.setPartnerWorkflowPresetRaw(requestParameters, initOverrides);
5743
+ return await response.value();
5744
+ }
5745
+ /**
5746
+ * Gives an adapter the key it needs to act through a service you have an account with, for the widgets you made. Take the `adapterId` and `credentialKey` from `getUserAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this account, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on your behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that an owner may keep it (some are for a partner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it, and the widget tells its owner. **An address that has to be confirmed.** Some credentials are not a key but the email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getUserAdapterConnections`). Saving one checks that it is one email address and emails a six-digit code to it; the answer says `awaitingConfirmation: true`, and nothing is sent to the address until the code is given back with `confirmUserAdapterConnection`. Saving the same address again before it is confirmed emails a new code (not sooner than a minute after the last); saving the address that is already confirmed changes nothing. If the code cannot be emailed, nothing is saved. A widget whose adapter has no key connected, or whose address is not confirmed yet, is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the owner is told once a day what to do. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
4528
5747
  * Connect an adapter key to an account
4529
5748
  */
4530
5749
  async setUserAdapterConnectionRaw(requestParameters, initOverrides) {
@@ -4560,13 +5779,55 @@ export class PartnerApi extends runtime.BaseAPI {
4560
5779
  return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
4561
5780
  }
4562
5781
  /**
4563
- * Gives an adapter the key it needs to act through a service you have an account with, for the widgets you made. Take the `adapterId` and `credentialKey` from `getUserAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this account, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on your behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that an owner may keep it (some are for a partner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it, and the widget tells its owner. A widget whose adapter has no key connected is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the owner is told once a day what to connect. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
5782
+ * Gives an adapter the key it needs to act through a service you have an account with, for the widgets you made. Take the `adapterId` and `credentialKey` from `getUserAdapterConnections`. Saving a key that is already connected replaces it. **What Widgetic does with it.** The key is stored encrypted, bound to this account, this adapter and this credential, so that a stored value cannot be moved to another. It is never returned, never logged and never shown to a visitor of a widget. A server of Widgetic opens it for the one call a widget makes through the adapter, uses it to call the provider on your behalf, and discards it. To cut that off, remove the key here, or revoke it with the provider. **What is checked.** That the adapter exists and takes this credential, that an owner may keep it (some are for a partner only) and that the text is one line of at most 2048 characters. Whether the provider accepts the key is not checked here: it shows the first time a widget uses it, and the widget tells its owner. **An address that has to be confirmed.** Some credentials are not a key but the email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getUserAdapterConnections`). Saving one checks that it is one email address and emails a six-digit code to it; the answer says `awaitingConfirmation: true`, and nothing is sent to the address until the code is given back with `confirmUserAdapterConnection`. Saving the same address again before it is confirmed emails a new code (not sooner than a minute after the last); saving the address that is already confirmed changes nothing. If the code cannot be emailed, nothing is saved. A widget whose adapter has no key connected, or whose address is not confirmed yet, is not charged and does not run that adapter: its visitors are told the feature is unavailable, and the owner is told once a day what to do. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator. A retry is harmless: saving the same key twice only refreshes when it was set.
4564
5783
  * Connect an adapter key to an account
4565
5784
  */
4566
5785
  async setUserAdapterConnection(requestParameters, initOverrides) {
4567
5786
  const response = await this.setUserAdapterConnectionRaw(requestParameters, initOverrides);
4568
5787
  return await response.value();
4569
5788
  }
5789
+ /**
5790
+ * Brings an archived workflow back into the list: as paused when it was ever published (resume it to serve visitors again), as a draft when it never was. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can unarchive.
5791
+ * Unarchive a Workflow
5792
+ */
5793
+ async unarchiveWorkspaceWorkflowRaw(requestParameters, initOverrides) {
5794
+ if (requestParameters['workspaceId'] == null) {
5795
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling unarchiveWorkspaceWorkflow().');
5796
+ }
5797
+ if (requestParameters['workflowId'] == null) {
5798
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling unarchiveWorkspaceWorkflow().');
5799
+ }
5800
+ const queryParameters = {};
5801
+ const headerParameters = {};
5802
+ if (requestParameters['xManagedUserId'] != null) {
5803
+ headerParameters['X-Managed-User-Id'] = String(requestParameters['xManagedUserId']);
5804
+ }
5805
+ if (requestParameters['xManagedUserExternalId'] != null) {
5806
+ headerParameters['X-Managed-User-External-Id'] = String(requestParameters['xManagedUserExternalId']);
5807
+ }
5808
+ if (this.configuration && this.configuration.accessToken) {
5809
+ const token = this.configuration.accessToken;
5810
+ const tokenString = await token("apiKeyAuth", []);
5811
+ if (tokenString) {
5812
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5813
+ }
5814
+ }
5815
+ const response = await this.request({
5816
+ path: `/workspaces/{workspaceId}/workflows/{workflowId}/unarchive`.replace(`{${"workspaceId"}}`, encodeURIComponent(String(requestParameters['workspaceId']))).replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
5817
+ method: 'POST',
5818
+ headers: headerParameters,
5819
+ query: queryParameters,
5820
+ }, initOverrides);
5821
+ return new runtime.JSONApiResponse(response, (jsonValue) => SaveWorkspaceWorkflow200ResponseFromJSON(jsonValue));
5822
+ }
5823
+ /**
5824
+ * Brings an archived workflow back into the list: as paused when it was ever published (resume it to serve visitors again), as a draft when it never was. For personal workspace, use \'personal\' as workspaceId. For organization workspace, use the organization UUID as workspaceId. Any active member can unarchive.
5825
+ * Unarchive a Workflow
5826
+ */
5827
+ async unarchiveWorkspaceWorkflow(requestParameters, initOverrides) {
5828
+ const response = await this.unarchiveWorkspaceWorkflowRaw(requestParameters, initOverrides);
5829
+ return await response.value();
5830
+ }
4570
5831
  /**
4571
5832
  * Updates an existing canvas with the specified properties.
4572
5833
  * Update Canvas
@@ -4606,7 +5867,7 @@ export class PartnerApi extends runtime.BaseAPI {
4606
5867
  return await response.value();
4607
5868
  }
4608
5869
  /**
4609
- * 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.
5870
+ * 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.
4610
5871
  * Update Composition
4611
5872
  */
4612
5873
  async updateCompositionRaw(requestParameters, initOverrides) {
@@ -4622,6 +5883,9 @@ export class PartnerApi extends runtime.BaseAPI {
4622
5883
  const queryParameters = {};
4623
5884
  const headerParameters = {};
4624
5885
  headerParameters['Content-Type'] = 'application/json';
5886
+ if (requestParameters['ifMatch'] != null) {
5887
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
5888
+ }
4625
5889
  if (requestParameters['idempotencyKey'] != null) {
4626
5890
  headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
4627
5891
  }
@@ -4648,7 +5912,7 @@ export class PartnerApi extends runtime.BaseAPI {
4648
5912
  return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionFromWidget201ResponseFromJSON(jsonValue));
4649
5913
  }
4650
5914
  /**
4651
- * 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.
5915
+ * 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.
4652
5916
  * Update Composition
4653
5917
  */
4654
5918
  async updateComposition(requestParameters, initOverrides) {
@@ -4970,7 +6234,7 @@ export class PartnerApi extends runtime.BaseAPI {
4970
6234
  return await response.value();
4971
6235
  }
4972
6236
  /**
4973
- * The second of the two calls the `upload` adapter\'s module makes from the visitor\'s browser (the first, the `begin-upload` operation of `callPublicCompositionAdapter`, answers with the ticket this route takes). The module sends the file itself, as the body, with its media type as the `Content-Type`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/upload/files/{ticket}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **The ticket.** Single-use and valid for ten minutes, given for one file: its name, its media type and its exact size are what the visitor said when the ticket was asked for, after the widget\'s owner\'s settings (the kinds of file they take, the largest size) were applied. The `Content-Type` and the `Content-Length` of this request must be those, and the body must be exactly that many bytes (400 `UPLOAD_FILE_CHANGED` otherwise). The gateway never believes the type it was told: the first bytes of the file must be a file of that type and one the owner accepts (422 otherwise). A ticket whose file was stored and is sent again is answered with the same file, so a visitor whose connection dropped after the file landed does not store it twice; a ticket whose attempt failed is spent, and the module asks for a new one. **What it stores.** The file goes to the widget owner\'s storage: Widgetic\'s, or the partner\'s own bucket for a widget of a customer a partner manages. It counts against the owner\'s storage allowance and is filed in the folder the owner chose, as a file sent by a visitor, which the owner\'s own file list leaves out. A full allowance, a partner\'s storage that cannot be used and a stopped feature are all the same 503 `UPLOAD_UNAVAILABLE` to a visitor, and the owner is told through a notice. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or a website the owner allowed (or the owner\'s own platform). A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. **Limits.** 30 requests a minute for each visitor address and composition and 240 a minute for a composition (429 `RATE_LIMITED`, with a `Retry-After` header); at most 10 MB for a file, and only so many files held in memory at once on each gateway process (503 `UPLOAD_BUSY`, with a `Retry-After`). A file that does not arrive within two minutes is 408 `UPLOAD_TIMEOUT`. Every answer but a success closes the connection, so a client that is refused before it has sent the file reads the answer and stops.
6237
+ * The second of the two calls the `upload` adapter\'s module makes from the visitor\'s browser (the first, the `begin-upload` operation of `callPublicCompositionAdapter`, answers with the ticket this route takes). The module sends the file itself, as the body, with its media type as the `Content-Type`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/upload/files/{ticket}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **The ticket.** Single-use and valid for ten minutes, given for one file: its name, its media type and its exact size are what the visitor said when the ticket was asked for, after the widget\'s owner\'s settings (the kinds of file they take, the largest size) were applied. The `Content-Type` and the `Content-Length` of this request must be those, and the body must be exactly that many bytes (400 `UPLOAD_FILE_CHANGED` otherwise). The gateway never believes the type it was told: the first bytes of the file must be a file of that type and one the owner accepts (422 otherwise). A ticket whose file was stored and is sent again is answered with the same file, so a visitor whose connection dropped after the file landed does not store it twice; a ticket whose attempt failed is spent, and the module asks for a new one. **The virus check.** Before anything is stored, the file is checked for viruses, wherever it would be kept (Widgetic\'s storage or a partner\'s own bucket). A file that fails the check is refused with 422 `UPLOAD_FILE_UNSAFE` and nothing is stored. When the check cannot be done, nothing is stored either, and the answer is the same neutral 503 `UPLOAD_UNAVAILABLE` as for any other cause the visitor is not told. The ticket of a refused file is spent. **What it stores.** The file goes to the widget owner\'s storage: Widgetic\'s, or the partner\'s own bucket for a widget of a customer a partner manages. It counts against the owner\'s storage allowance and is filed in the folder the owner chose, as a file sent by a visitor, which the owner\'s own file list leaves out. A full allowance, a partner\'s storage that cannot be used and a stopped feature are all the same 503 `UPLOAD_UNAVAILABLE` to a visitor, and the owner is told through a notice. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. **Limits.** 30 requests a minute for each visitor address and composition and 240 a minute for a composition (429 `RATE_LIMITED`, with a `Retry-After` header); at most 10 MB for a file, and only so many files held in memory at once on each gateway process (503 `UPLOAD_BUSY`, with a `Retry-After`). A file that does not arrive within two minutes is 408 `UPLOAD_TIMEOUT`. Every answer but a success closes the connection, so a client that is refused before it has sent the file reads the answer and stops.
4974
6238
  * Send the file a visitor chose through the upload adapter of a published widget
4975
6239
  */
4976
6240
  async uploadPublicCompositionAdapterFileRaw(requestParameters, initOverrides) {
@@ -4996,7 +6260,7 @@ export class PartnerApi extends runtime.BaseAPI {
4996
6260
  return new runtime.JSONApiResponse(response, (jsonValue) => PublicAdapterFileResultFromJSON(jsonValue));
4997
6261
  }
4998
6262
  /**
4999
- * The second of the two calls the `upload` adapter\'s module makes from the visitor\'s browser (the first, the `begin-upload` operation of `callPublicCompositionAdapter`, answers with the ticket this route takes). The module sends the file itself, as the body, with its media type as the `Content-Type`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/upload/files/{ticket}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **The ticket.** Single-use and valid for ten minutes, given for one file: its name, its media type and its exact size are what the visitor said when the ticket was asked for, after the widget\'s owner\'s settings (the kinds of file they take, the largest size) were applied. The `Content-Type` and the `Content-Length` of this request must be those, and the body must be exactly that many bytes (400 `UPLOAD_FILE_CHANGED` otherwise). The gateway never believes the type it was told: the first bytes of the file must be a file of that type and one the owner accepts (422 otherwise). A ticket whose file was stored and is sent again is answered with the same file, so a visitor whose connection dropped after the file landed does not store it twice; a ticket whose attempt failed is spent, and the module asks for a new one. **What it stores.** The file goes to the widget owner\'s storage: Widgetic\'s, or the partner\'s own bucket for a widget of a customer a partner manages. It counts against the owner\'s storage allowance and is filed in the folder the owner chose, as a file sent by a visitor, which the owner\'s own file list leaves out. A full allowance, a partner\'s storage that cannot be used and a stopped feature are all the same 503 `UPLOAD_UNAVAILABLE` to a visitor, and the owner is told through a notice. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or a website the owner allowed (or the owner\'s own platform). A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. **Limits.** 30 requests a minute for each visitor address and composition and 240 a minute for a composition (429 `RATE_LIMITED`, with a `Retry-After` header); at most 10 MB for a file, and only so many files held in memory at once on each gateway process (503 `UPLOAD_BUSY`, with a `Retry-After`). A file that does not arrive within two minutes is 408 `UPLOAD_TIMEOUT`. Every answer but a success closes the connection, so a client that is refused before it has sent the file reads the answer and stops.
6263
+ * The second of the two calls the `upload` adapter\'s module makes from the visitor\'s browser (the first, the `begin-upload` operation of `callPublicCompositionAdapter`, answers with the ticket this route takes). The module sends the file itself, as the body, with its media type as the `Content-Type`. It is not meant to be called by hand, and it takes no API key. **Address.** `https://api.widgetic.com/embed/compositions/{compositionId}/adapters/upload/files/{ticket}`: the root of the API host, NOT under `/v1`. A client generated from this description for `https://api.widgetic.com/v1` must be given the base address `https://api.widgetic.com` for the calls of the `Public Embed` tag. **The ticket.** Single-use and valid for ten minutes, given for one file: its name, its media type and its exact size are what the visitor said when the ticket was asked for, after the widget\'s owner\'s settings (the kinds of file they take, the largest size) were applied. The `Content-Type` and the `Content-Length` of this request must be those, and the body must be exactly that many bytes (400 `UPLOAD_FILE_CHANGED` otherwise). The gateway never believes the type it was told: the first bytes of the file must be a file of that type and one the owner accepts (422 otherwise). A ticket whose file was stored and is sent again is answered with the same file, so a visitor whose connection dropped after the file landed does not store it twice; a ticket whose attempt failed is spent, and the module asks for a new one. **The virus check.** Before anything is stored, the file is checked for viruses, wherever it would be kept (Widgetic\'s storage or a partner\'s own bucket). A file that fails the check is refused with 422 `UPLOAD_FILE_UNSAFE` and nothing is stored. When the check cannot be done, nothing is stored either, and the answer is the same neutral 503 `UPLOAD_UNAVAILABLE` as for any other cause the visitor is not told. The ticket of a refused file is spent. **What it stores.** The file goes to the widget owner\'s storage: Widgetic\'s, or the partner\'s own bucket for a widget of a customer a partner manages. It counts against the owner\'s storage allowance and is filed in the folder the owner chose, as a file sent by a visitor, which the owner\'s own file list leaves out. A full allowance, a partner\'s storage that cannot be used and a stopped feature are all the same 503 `UPLOAD_UNAVAILABLE` to a visitor, and the owner is told through a notice. **Who may call.** The same rule as the entry route: a permitted `Origin` header, which is the artifact origin the widget runs from or any website when the owner has not restricted the allowed websites (when the owner has, one of the websites the owner listed, Widgetic\'s own sites, the visitor\'s own machine or the owner\'s own platform). A request without a permitted `Origin` is 403 `ORIGIN_NOT_ALLOWED`. A composition that is not served (unpublished, or its owner\'s plan does not serve it) is 404, with the codes of the other public embed routes. **Limits.** 30 requests a minute for each visitor address and composition and 240 a minute for a composition (429 `RATE_LIMITED`, with a `Retry-After` header); at most 10 MB for a file, and only so many files held in memory at once on each gateway process (503 `UPLOAD_BUSY`, with a `Retry-After`). A file that does not arrive within two minutes is 408 `UPLOAD_TIMEOUT`. Every answer but a success closes the connection, so a client that is refused before it has sent the file reads the answer and stops.
5000
6264
  * Send the file a visitor chose through the upload adapter of a published widget
5001
6265
  */
5002
6266
  async uploadPublicCompositionAdapterFile(requestParameters, initOverrides) {
@@ -5410,6 +6674,16 @@ export const ListManagedUserEntriesOrderEnum = {
5410
6674
  Asc: 'asc',
5411
6675
  Desc: 'desc'
5412
6676
  };
6677
+ /**
6678
+ * @export
6679
+ */
6680
+ export const ListWorkspaceWorkflowsStatusEnum = {
6681
+ Draft: 'draft',
6682
+ Live: 'live',
6683
+ Paused: 'paused',
6684
+ Archived: 'archived',
6685
+ All: 'all'
6686
+ };
5413
6687
  /**
5414
6688
  * @export
5415
6689
  */