@widgetic/api-sdk-ts 1.11.111 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/BrandKitApi.d.ts +40 -40
  3. package/dist/apis/BrandKitApi.js +40 -40
  4. package/dist/apis/CanvasesApi.d.ts +15 -15
  5. package/dist/apis/CompositionsApi.d.ts +255 -155
  6. package/dist/apis/CompositionsApi.js +333 -133
  7. package/dist/apis/CreditsApi.d.ts +7 -7
  8. package/dist/apis/CreditsApi.js +1 -1
  9. package/dist/apis/EntitlementsApi.d.ts +6 -6
  10. package/dist/apis/InvoicesApi.d.ts +6 -6
  11. package/dist/apis/InvoicesApi.js +2 -2
  12. package/dist/apis/ManagedUsersApi.d.ts +97 -63
  13. package/dist/apis/ManagedUsersApi.js +106 -39
  14. package/dist/apis/OperationsApi.d.ts +4 -4
  15. package/dist/apis/OperationsApi.js +5 -5
  16. package/dist/apis/PartnersApi.d.ts +125 -125
  17. package/dist/apis/PartnersApi.js +11 -11
  18. package/dist/apis/PublicEmbedApi.d.ts +42 -42
  19. package/dist/apis/PublicEmbedApi.js +29 -29
  20. package/dist/apis/TokensApi.d.ts +2 -0
  21. package/dist/apis/TokensApi.js +2 -0
  22. package/dist/apis/UploadsApi.d.ts +38 -38
  23. package/dist/apis/UploadsApi.js +60 -60
  24. package/dist/apis/UsersApi.d.ts +40 -40
  25. package/dist/apis/UsersApi.js +4 -4
  26. package/dist/apis/WidgetsApi.d.ts +23 -23
  27. package/dist/apis/WidgetsApi.js +36 -36
  28. package/dist/apis/WorkflowsApi.d.ts +85 -127
  29. package/dist/apis/WorkflowsApi.js +82 -192
  30. package/dist/apis/index.d.ts +0 -2
  31. package/dist/apis/index.js +0 -2
  32. package/dist/esm/apis/BrandKitApi.js +39 -39
  33. package/dist/esm/apis/CompositionsApi.js +333 -133
  34. package/dist/esm/apis/CreditsApi.js +2 -2
  35. package/dist/esm/apis/InvoicesApi.js +1 -1
  36. package/dist/esm/apis/ManagedUsersApi.js +106 -39
  37. package/dist/esm/apis/OperationsApi.js +6 -6
  38. package/dist/esm/apis/PartnersApi.js +12 -12
  39. package/dist/esm/apis/PublicEmbedApi.js +30 -30
  40. package/dist/esm/apis/TokensApi.js +2 -0
  41. package/dist/esm/apis/UploadsApi.js +60 -60
  42. package/dist/esm/apis/UsersApi.js +5 -5
  43. package/dist/esm/apis/WidgetsApi.js +37 -37
  44. package/dist/esm/apis/WorkflowsApi.js +82 -192
  45. package/dist/esm/apis/index.js +0 -2
  46. package/dist/esm/models/{GetPartnerCreditTransactions200Response.js → AccountCreditTransactionListResponse.js} +8 -8
  47. package/dist/esm/models/{GetUserAdapterConnections200Response.js → AdapterConnectionListResponse.js} +8 -8
  48. package/dist/esm/models/{RemoveUserAdapterConnection200Response.js → AdapterConnectionRemovalResponse.js} +8 -8
  49. package/dist/esm/models/{SetUserAdapterConnection200Response.js → AdapterConnectionResponse.js} +8 -8
  50. package/dist/esm/models/{AddAiAnswersKnowledgeDocument201Response.js → AiAnswersKnowledgeDocumentResponse.js} +8 -8
  51. package/dist/esm/models/{CreateCompositionDatabaseRecord201Response.js → CompositionDatabaseRecordResponse.js} +8 -8
  52. package/dist/esm/models/{CreateCompositionContentItem201Response.js → ContentItemWriteResultResponse.js} +8 -8
  53. package/dist/esm/models/{OperationsIdGetResponse.js → DeleteUpload200Response.js} +11 -11
  54. package/dist/esm/models/{UploadsIdDelete200ResponseData.js → DeleteUpload200ResponseData.js} +8 -8
  55. package/dist/esm/models/{GetPartnerDesignDefaults200Response.js → DesignDefaultsResponse.js} +8 -8
  56. package/dist/esm/models/GetOperationResponse.js +51 -0
  57. package/dist/esm/models/{OperationsIdGetResponseData.js → GetOperationResponseData.js} +12 -11
  58. package/dist/esm/models/GetOperationResponseDataMetadata.js +58 -0
  59. package/dist/esm/models/{UploadsGet200Response.js → ListUploads200Response.js} +8 -8
  60. package/dist/esm/models/{GetManagedUserLimits200Response.js → ManagedUserLimitsResponse.js} +8 -8
  61. package/dist/esm/models/{DeleteManagedUser200Response.js → ManagedUserRemovalResponse.js} +8 -8
  62. package/dist/esm/models/PublicWorkflowEventsRequestEventsInner.js +11 -0
  63. package/dist/esm/models/{GetPublicWorkflow200Response.js → PublicWorkflowResponse.js} +8 -8
  64. package/dist/esm/models/WidgetClarification.js +52 -0
  65. package/dist/esm/models/WidgetClarificationOption.js +51 -0
  66. package/dist/esm/models/WidgetClarificationQuestion.js +60 -0
  67. package/dist/esm/models/WidgetNextStep.js +67 -0
  68. package/dist/esm/models/WidgetPlan.js +61 -0
  69. package/dist/esm/models/WidgetPlanDecisions.js +68 -0
  70. package/dist/esm/models/WidgetPlanDecisionsAdaptersInner.js +47 -0
  71. package/dist/esm/models/WidgetPlanDecisionsLibrariesInner.js +51 -0
  72. package/dist/esm/models/WidgetPlanDecisionsResponsive.js +51 -0
  73. package/dist/esm/models/WidgetPlanTask.js +80 -0
  74. package/dist/esm/models/{CreateWorkspaceWorkflowFromPreset201Response.js → WorkflowDetailResponse.js} +8 -8
  75. package/dist/esm/models/WorkflowFailureReason.js +49 -0
  76. package/dist/esm/models/WorkflowFailureReasonCounter.js +52 -0
  77. package/dist/esm/models/{SaveWorkspaceWorkflow200Response.js → WorkflowResponse.js} +8 -8
  78. package/dist/esm/models/WorkflowStats.js +3 -0
  79. package/dist/esm/models/index.js +31 -19
  80. package/dist/esm/runtime.js +1 -1
  81. package/dist/models/AccountCreditTransactionListResponse.d.ts +46 -0
  82. package/dist/models/{GetPartnerCreditTransactions200Response.js → AccountCreditTransactionListResponse.js} +13 -13
  83. package/dist/models/AdapterConnectionListResponse.d.ts +46 -0
  84. package/dist/models/{GetUserAdapterConnections200Response.js → AdapterConnectionListResponse.js} +13 -13
  85. package/dist/models/AdapterConnectionRemovalResponse.d.ts +46 -0
  86. package/dist/models/{RemoveUserAdapterConnection200Response.js → AdapterConnectionRemovalResponse.js} +13 -13
  87. package/dist/models/AdapterConnectionResponse.d.ts +46 -0
  88. package/dist/models/{SetUserAdapterConnection200Response.js → AdapterConnectionResponse.js} +13 -13
  89. package/dist/models/AiAnswersKnowledgeDocumentResponse.d.ts +46 -0
  90. package/dist/models/{AddAiAnswersKnowledgeDocument201Response.js → AiAnswersKnowledgeDocumentResponse.js} +13 -13
  91. package/dist/models/CompositionDatabaseRecordResponse.d.ts +48 -0
  92. package/dist/models/CompositionDatabaseRecordResponse.js +57 -0
  93. package/dist/models/ContentItemWriteResultResponse.d.ts +46 -0
  94. package/dist/models/{CreateCompositionContentItem201Response.js → ContentItemWriteResultResponse.js} +13 -13
  95. package/dist/models/DeleteUpload200Response.d.ts +46 -0
  96. package/dist/models/{OperationsIdGetResponse.js → DeleteUpload200Response.js} +16 -16
  97. package/dist/models/DeleteUpload200ResponseData.d.ts +32 -0
  98. package/dist/models/DeleteUpload200ResponseData.js +48 -0
  99. package/dist/models/DesignDefaultsResponse.d.ts +46 -0
  100. package/dist/models/{GetPartnerDesignDefaults200Response.js → DesignDefaultsResponse.js} +13 -13
  101. package/dist/models/GetOperationResponse.d.ts +46 -0
  102. package/dist/models/GetOperationResponse.js +58 -0
  103. package/dist/models/GetOperationResponseData.d.ts +86 -0
  104. package/dist/models/{OperationsIdGetResponseData.js → GetOperationResponseData.js} +18 -17
  105. package/dist/models/GetOperationResponseDataMetadata.d.ts +65 -0
  106. package/dist/models/GetOperationResponseDataMetadata.js +66 -0
  107. package/dist/models/ListUploads200Response.d.ts +46 -0
  108. package/dist/models/{UploadsGet200Response.js → ListUploads200Response.js} +13 -13
  109. package/dist/models/ManagedUserLimitsResponse.d.ts +46 -0
  110. package/dist/models/{GetManagedUserLimits200Response.js → ManagedUserLimitsResponse.js} +13 -13
  111. package/dist/models/ManagedUserRemovalResponse.d.ts +46 -0
  112. package/dist/models/{DeleteManagedUser200Response.js → ManagedUserRemovalResponse.js} +13 -13
  113. package/dist/models/PublicWorkflowEventsRequestEventsInner.d.ts +21 -0
  114. package/dist/models/PublicWorkflowEventsRequestEventsInner.js +12 -1
  115. package/dist/models/PublicWorkflowResponse.d.ts +46 -0
  116. package/dist/models/{GetPublicWorkflow200Response.js → PublicWorkflowResponse.js} +13 -13
  117. package/dist/models/Upload.d.ts +1 -1
  118. package/dist/models/UploadLimits.d.ts +3 -3
  119. package/dist/models/WidgetClarification.d.ts +45 -0
  120. package/dist/models/WidgetClarification.js +59 -0
  121. package/dist/models/WidgetClarificationOption.d.ts +44 -0
  122. package/dist/models/WidgetClarificationOption.js +58 -0
  123. package/dist/models/WidgetClarificationQuestion.d.ts +57 -0
  124. package/dist/models/WidgetClarificationQuestion.js +67 -0
  125. package/dist/models/WidgetNextStep.d.ts +63 -0
  126. package/dist/models/WidgetNextStep.js +75 -0
  127. package/dist/models/WidgetPlan.d.ts +58 -0
  128. package/dist/models/WidgetPlan.js +68 -0
  129. package/dist/models/WidgetPlanDecisions.d.ts +71 -0
  130. package/dist/models/WidgetPlanDecisions.js +75 -0
  131. package/dist/models/WidgetPlanDecisionsAdaptersInner.d.ts +38 -0
  132. package/dist/models/WidgetPlanDecisionsAdaptersInner.js +54 -0
  133. package/dist/models/WidgetPlanDecisionsLibrariesInner.d.ts +44 -0
  134. package/dist/models/WidgetPlanDecisionsLibrariesInner.js +58 -0
  135. package/dist/models/WidgetPlanDecisionsResponsive.d.ts +44 -0
  136. package/dist/models/WidgetPlanDecisionsResponsive.js +58 -0
  137. package/dist/models/WidgetPlanTask.d.ts +77 -0
  138. package/dist/models/WidgetPlanTask.js +88 -0
  139. package/dist/models/WorkflowDetailResponse.d.ts +46 -0
  140. package/dist/models/WorkflowDetailResponse.js +58 -0
  141. package/dist/models/WorkflowFailureReason.d.ts +31 -0
  142. package/dist/models/WorkflowFailureReason.js +57 -0
  143. package/dist/models/WorkflowFailureReasonCounter.d.ts +45 -0
  144. package/dist/models/WorkflowFailureReasonCounter.js +59 -0
  145. package/dist/models/WorkflowResponse.d.ts +46 -0
  146. package/dist/models/{SaveWorkspaceWorkflow200Response.js → WorkflowResponse.js} +13 -13
  147. package/dist/models/WorkflowStats.d.ts +16 -1
  148. package/dist/models/WorkflowStats.js +3 -0
  149. package/dist/models/index.d.ts +31 -19
  150. package/dist/models/index.js +31 -19
  151. package/dist/runtime.d.ts +2 -2
  152. package/dist/runtime.js +1 -1
  153. package/package.json +1 -1
  154. package/dist/apis/PartnerApi.d.ts +0 -2707
  155. package/dist/apis/PartnerApi.js +0 -7073
  156. package/dist/apis/WorkspacesApi.d.ts +0 -352
  157. package/dist/apis/WorkspacesApi.js +0 -946
  158. package/dist/esm/apis/PartnerApi.js +0 -7036
  159. package/dist/esm/apis/WorkspacesApi.js +0 -909
  160. package/dist/esm/models/CreateCompositionFromWidget201Response.js +0 -51
  161. package/dist/esm/models/UploadsIdDelete200Response.js +0 -51
  162. package/dist/models/AddAiAnswersKnowledgeDocument201Response.d.ts +0 -46
  163. package/dist/models/CreateCompositionContentItem201Response.d.ts +0 -46
  164. package/dist/models/CreateCompositionDatabaseRecord201Response.d.ts +0 -48
  165. package/dist/models/CreateCompositionDatabaseRecord201Response.js +0 -57
  166. package/dist/models/CreateCompositionFromWidget201Response.d.ts +0 -46
  167. package/dist/models/CreateCompositionFromWidget201Response.js +0 -58
  168. package/dist/models/CreateWorkspaceWorkflowFromPreset201Response.d.ts +0 -46
  169. package/dist/models/CreateWorkspaceWorkflowFromPreset201Response.js +0 -58
  170. package/dist/models/DeleteManagedUser200Response.d.ts +0 -46
  171. package/dist/models/GetManagedUserLimits200Response.d.ts +0 -46
  172. package/dist/models/GetPartnerCreditTransactions200Response.d.ts +0 -46
  173. package/dist/models/GetPartnerDesignDefaults200Response.d.ts +0 -46
  174. package/dist/models/GetPublicWorkflow200Response.d.ts +0 -46
  175. package/dist/models/GetUserAdapterConnections200Response.d.ts +0 -46
  176. package/dist/models/OperationsIdGetResponse.d.ts +0 -46
  177. package/dist/models/OperationsIdGetResponseData.d.ts +0 -88
  178. package/dist/models/RemoveUserAdapterConnection200Response.d.ts +0 -46
  179. package/dist/models/SaveWorkspaceWorkflow200Response.d.ts +0 -46
  180. package/dist/models/SetUserAdapterConnection200Response.d.ts +0 -46
  181. package/dist/models/UploadsGet200Response.d.ts +0 -46
  182. package/dist/models/UploadsIdDelete200Response.d.ts +0 -46
  183. package/dist/models/UploadsIdDelete200Response.js +0 -58
  184. package/dist/models/UploadsIdDelete200ResponseData.d.ts +0 -32
  185. package/dist/models/UploadsIdDelete200ResponseData.js +0 -48
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { GetPublicCompositionEmbed200ResponseFromJSON, GetPublicWorkflow200ResponseFromJSON, PostPublicCompositionEmbedStatus200ResponseFromJSON, PostPublicCompositionEmbedStatusRequestToJSON, PublicAdapterCallRequestToJSON, PublicAdapterCallResultFromJSON, PublicAdapterFileResultFromJSON, PublicCompositionEntryCreatedFromJSON, PublicCompositionEntryRequestToJSON, PublicWorkflowEventsRequestToJSON, ReportPublicWorkflowEvents200ResponseFromJSON, } from '../models/index.js';
15
+ import { GetPublicCompositionEmbed200ResponseFromJSON, PostPublicCompositionEmbedStatus200ResponseFromJSON, PostPublicCompositionEmbedStatusRequestToJSON, PublicAdapterCallRequestToJSON, PublicAdapterCallResultFromJSON, PublicAdapterFileResultFromJSON, PublicCompositionEntryCreatedFromJSON, PublicCompositionEntryRequestToJSON, PublicWorkflowEventsRequestToJSON, PublicWorkflowResponseFromJSON, ReportPublicWorkflowEvents200ResponseFromJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
@@ -152,7 +152,33 @@ export class PublicEmbedApi extends runtime.BaseAPI {
152
152
  return await response.value();
153
153
  }
154
154
  /**
155
- * 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.
155
+ * 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.
156
+ * Read the published Workflow of an embed
157
+ */
158
+ async getPublicWorkflowRaw(requestParameters, initOverrides) {
159
+ if (requestParameters['workflowId'] == null) {
160
+ throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getPublicWorkflow().');
161
+ }
162
+ const queryParameters = {};
163
+ const headerParameters = {};
164
+ const response = await this.request({
165
+ path: `/embed/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
166
+ method: 'GET',
167
+ headers: headerParameters,
168
+ query: queryParameters,
169
+ }, initOverrides);
170
+ return new runtime.JSONApiResponse(response, (jsonValue) => PublicWorkflowResponseFromJSON(jsonValue));
171
+ }
172
+ /**
173
+ * 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.
174
+ * Read the published Workflow of an embed
175
+ */
176
+ async getPublicWorkflow(requestParameters, initOverrides) {
177
+ const response = await this.getPublicWorkflowRaw(requestParameters, initOverrides);
178
+ return await response.value();
179
+ }
180
+ /**
181
+ * 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, and the website where the partner the owner administers integrates Widgetic, with its subdomains), 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.
156
182
  * Show a published Workflow in a page of its own
157
183
  */
158
184
  async getPublicWorkflowFrameRaw(requestParameters, initOverrides) {
@@ -175,7 +201,7 @@ export class PublicEmbedApi extends runtime.BaseAPI {
175
201
  }
176
202
  }
177
203
  /**
178
- * 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.
204
+ * 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, and the website where the partner the owner administers integrates Widgetic, with its subdomains), 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.
179
205
  * Show a published Workflow in a page of its own
180
206
  */
181
207
  async getPublicWorkflowFrame(requestParameters, initOverrides) {
@@ -201,7 +227,7 @@ export class PublicEmbedApi extends runtime.BaseAPI {
201
227
  headers: headerParameters,
202
228
  query: queryParameters,
203
229
  }, initOverrides);
204
- return new runtime.JSONApiResponse(response, (jsonValue) => GetPublicWorkflow200ResponseFromJSON(jsonValue));
230
+ return new runtime.JSONApiResponse(response, (jsonValue) => PublicWorkflowResponseFromJSON(jsonValue));
205
231
  }
206
232
  /**
207
233
  * 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.
@@ -211,32 +237,6 @@ export class PublicEmbedApi extends runtime.BaseAPI {
211
237
  const response = await this.getPublicWorkflowVersionRaw(requestParameters, initOverrides);
212
238
  return await response.value();
213
239
  }
214
- /**
215
- * 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.
216
- * Read the published Workflow of an embed
217
- */
218
- async getPublicWorkflowRaw(requestParameters, initOverrides) {
219
- if (requestParameters['workflowId'] == null) {
220
- throw new runtime.RequiredError('workflowId', 'Required parameter "workflowId" was null or undefined when calling getPublicWorkflow().');
221
- }
222
- const queryParameters = {};
223
- const headerParameters = {};
224
- const response = await this.request({
225
- path: `/embed/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(requestParameters['workflowId']))),
226
- method: 'GET',
227
- headers: headerParameters,
228
- query: queryParameters,
229
- }, initOverrides);
230
- return new runtime.JSONApiResponse(response, (jsonValue) => GetPublicWorkflow200ResponseFromJSON(jsonValue));
231
- }
232
- /**
233
- * 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.
234
- * Read the published Workflow of an embed
235
- */
236
- async getPublicWorkflow(requestParameters, initOverrides) {
237
- const response = await this.getPublicWorkflowRaw(requestParameters, initOverrides);
238
- return await response.value();
239
- }
240
240
  /**
241
241
  * Public batch health check for embed-sdk.js. No API key. Uses the same serving gate and domain policy as `GET /embed/compositions/{compositionId}`: the caller\'s website is read from `Origin`, or the host of `Referer` when there is no `Origin`. A request that names neither (a server or tool) is not refused for domain reasons. **Address.** `https://api.widgetic.com/embed/compositions/status`: 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. **Limit.** The route counts against the same limit as the lookup and the frame routes: 500 calls for each visitor address and browser in one counting window. A call is ONE hit whatever the number of `ids` it carries (up to 100), so a server that checks many compositions spends one call for each hundred of them. A visitor who is over the limit gets 429 `RATE_LIMITED` for the WHOLE call, with a `Retry-After` header and no state for any id: there is no per-composition rate-limit state in the answer.
242
242
  * Batch-check whether compositions are currently served for embed
@@ -18,6 +18,7 @@ import { ValidateToken200ResponseFromJSON, } from '../models/index.js';
18
18
  */
19
19
  export class TokensApi extends runtime.BaseAPI {
20
20
  /**
21
+ * Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`) and the account it belongs to (`userId`). A credential that belongs to the platform itself, and not to a customer\'s account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]` and no `userId`.
21
22
  * Validate current authentication token
22
23
  */
23
24
  async validateTokenRaw(initOverrides) {
@@ -42,6 +43,7 @@ export class TokensApi extends runtime.BaseAPI {
42
43
  return new runtime.JSONApiResponse(response, (jsonValue) => ValidateToken200ResponseFromJSON(jsonValue));
43
44
  }
44
45
  /**
46
+ * Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`) and the account it belongs to (`userId`). A credential that belongs to the platform itself, and not to a customer\'s account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]` and no `userId`.
45
47
  * Validate current authentication token
46
48
  */
47
49
  async validateToken(initOverrides) {
@@ -12,26 +12,20 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { UploadLimitsResponseFromJSON, UploadResponseFromJSON, UploadsGet200ResponseFromJSON, UploadsIdDelete200ResponseFromJSON, } from '../models/index.js';
15
+ import { DeleteUpload200ResponseFromJSON, ListUploads200ResponseFromJSON, UploadLimitsResponseFromJSON, UploadResponseFromJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
19
19
  export class UploadsApi extends runtime.BaseAPI {
20
20
  /**
21
- * The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
22
- * List the account\'s uploads
21
+ * Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
22
+ * Delete an upload
23
23
  */
24
- async uploadsGetRaw(requestParameters, initOverrides) {
25
- const queryParameters = {};
26
- if (requestParameters['limit'] != null) {
27
- queryParameters['limit'] = requestParameters['limit'];
28
- }
29
- if (requestParameters['managedUserId'] != null) {
30
- queryParameters['managedUserId'] = requestParameters['managedUserId'];
31
- }
32
- if (requestParameters['managedUserExternalId'] != null) {
33
- queryParameters['managedUserExternalId'] = requestParameters['managedUserExternalId'];
24
+ async deleteUploadRaw(requestParameters, initOverrides) {
25
+ if (requestParameters['id'] == null) {
26
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteUpload().');
34
27
  }
28
+ const queryParameters = {};
35
29
  const headerParameters = {};
36
30
  if (this.configuration && this.configuration.accessToken) {
37
31
  const token = this.configuration.accessToken;
@@ -41,28 +35,28 @@ export class UploadsApi extends runtime.BaseAPI {
41
35
  }
42
36
  }
43
37
  const response = await this.request({
44
- path: `/uploads`,
45
- method: 'GET',
38
+ path: `/uploads/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
39
+ method: 'DELETE',
46
40
  headers: headerParameters,
47
41
  query: queryParameters,
48
42
  }, initOverrides);
49
- return new runtime.JSONApiResponse(response, (jsonValue) => UploadsGet200ResponseFromJSON(jsonValue));
43
+ return new runtime.JSONApiResponse(response, (jsonValue) => DeleteUpload200ResponseFromJSON(jsonValue));
50
44
  }
51
45
  /**
52
- * The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
53
- * List the account\'s uploads
46
+ * Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
47
+ * Delete an upload
54
48
  */
55
- async uploadsGet(requestParameters = {}, initOverrides) {
56
- const response = await this.uploadsGetRaw(requestParameters, initOverrides);
49
+ async deleteUpload(requestParameters, initOverrides) {
50
+ const response = await this.deleteUploadRaw(requestParameters, initOverrides);
57
51
  return await response.value();
58
52
  }
59
53
  /**
60
- * Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
61
- * Delete an upload
54
+ * The details of one of the account\'s uploads. An upload that belongs to another account is not found.
55
+ * Get an upload by id
62
56
  */
63
- async uploadsIdDeleteRaw(requestParameters, initOverrides) {
57
+ async getUploadRaw(requestParameters, initOverrides) {
64
58
  if (requestParameters['id'] == null) {
65
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling uploadsIdDelete().');
59
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getUpload().');
66
60
  }
67
61
  const queryParameters = {};
68
62
  const headerParameters = {};
@@ -75,28 +69,25 @@ export class UploadsApi extends runtime.BaseAPI {
75
69
  }
76
70
  const response = await this.request({
77
71
  path: `/uploads/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
78
- method: 'DELETE',
72
+ method: 'GET',
79
73
  headers: headerParameters,
80
74
  query: queryParameters,
81
75
  }, initOverrides);
82
- return new runtime.JSONApiResponse(response, (jsonValue) => UploadsIdDelete200ResponseFromJSON(jsonValue));
76
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadResponseFromJSON(jsonValue));
83
77
  }
84
78
  /**
85
- * Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
86
- * Delete an upload
79
+ * The details of one of the account\'s uploads. An upload that belongs to another account is not found.
80
+ * Get an upload by id
87
81
  */
88
- async uploadsIdDelete(requestParameters, initOverrides) {
89
- const response = await this.uploadsIdDeleteRaw(requestParameters, initOverrides);
82
+ async getUpload(requestParameters, initOverrides) {
83
+ const response = await this.getUploadRaw(requestParameters, initOverrides);
90
84
  return await response.value();
91
85
  }
92
86
  /**
93
- * The details of one of the account\'s uploads. An upload that belongs to another account is not found.
94
- * Get an upload by id
87
+ * The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
88
+ * Upload size limits and accepted file types
95
89
  */
96
- async uploadsIdGetRaw(requestParameters, initOverrides) {
97
- if (requestParameters['id'] == null) {
98
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling uploadsIdGet().');
99
- }
90
+ async getUploadLimitsRaw(initOverrides) {
100
91
  const queryParameters = {};
101
92
  const headerParameters = {};
102
93
  if (this.configuration && this.configuration.accessToken) {
@@ -107,27 +98,36 @@ export class UploadsApi extends runtime.BaseAPI {
107
98
  }
108
99
  }
109
100
  const response = await this.request({
110
- path: `/uploads/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
101
+ path: `/uploads/limits`,
111
102
  method: 'GET',
112
103
  headers: headerParameters,
113
104
  query: queryParameters,
114
105
  }, initOverrides);
115
- return new runtime.JSONApiResponse(response, (jsonValue) => UploadResponseFromJSON(jsonValue));
106
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadLimitsResponseFromJSON(jsonValue));
116
107
  }
117
108
  /**
118
- * The details of one of the account\'s uploads. An upload that belongs to another account is not found.
119
- * Get an upload by id
109
+ * The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
110
+ * Upload size limits and accepted file types
120
111
  */
121
- async uploadsIdGet(requestParameters, initOverrides) {
122
- const response = await this.uploadsIdGetRaw(requestParameters, initOverrides);
112
+ async getUploadLimits(initOverrides) {
113
+ const response = await this.getUploadLimitsRaw(initOverrides);
123
114
  return await response.value();
124
115
  }
125
116
  /**
126
- * The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
127
- * Upload size limits and accepted file types
117
+ * The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
118
+ * List the account\'s uploads
128
119
  */
129
- async uploadsLimitsGetRaw(initOverrides) {
120
+ async listUploadsRaw(requestParameters, initOverrides) {
130
121
  const queryParameters = {};
122
+ if (requestParameters['limit'] != null) {
123
+ queryParameters['limit'] = requestParameters['limit'];
124
+ }
125
+ if (requestParameters['managedUserId'] != null) {
126
+ queryParameters['managedUserId'] = requestParameters['managedUserId'];
127
+ }
128
+ if (requestParameters['managedUserExternalId'] != null) {
129
+ queryParameters['managedUserExternalId'] = requestParameters['managedUserExternalId'];
130
+ }
131
131
  const headerParameters = {};
132
132
  if (this.configuration && this.configuration.accessToken) {
133
133
  const token = this.configuration.accessToken;
@@ -137,28 +137,28 @@ export class UploadsApi extends runtime.BaseAPI {
137
137
  }
138
138
  }
139
139
  const response = await this.request({
140
- path: `/uploads/limits`,
140
+ path: `/uploads`,
141
141
  method: 'GET',
142
142
  headers: headerParameters,
143
143
  query: queryParameters,
144
144
  }, initOverrides);
145
- return new runtime.JSONApiResponse(response, (jsonValue) => UploadLimitsResponseFromJSON(jsonValue));
145
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListUploads200ResponseFromJSON(jsonValue));
146
146
  }
147
147
  /**
148
- * The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
149
- * Upload size limits and accepted file types
148
+ * The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
149
+ * List the account\'s uploads
150
150
  */
151
- async uploadsLimitsGet(initOverrides) {
152
- const response = await this.uploadsLimitsGetRaw(initOverrides);
151
+ async listUploads(requestParameters = {}, initOverrides) {
152
+ const response = await this.listUploadsRaw(requestParameters, initOverrides);
153
153
  return await response.value();
154
154
  }
155
155
  /**
156
- * Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic\'s id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
156
+ * Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `getUploadLimits` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic\'s id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `listUploads`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
157
157
  * Upload a file
158
158
  */
159
- async uploadsPostRaw(requestParameters, initOverrides) {
159
+ async uploadFileRaw(requestParameters, initOverrides) {
160
160
  if (requestParameters['file'] == null) {
161
- throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling uploadsPost().');
161
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling uploadFile().');
162
162
  }
163
163
  const queryParameters = {};
164
164
  const headerParameters = {};
@@ -212,18 +212,18 @@ export class UploadsApi extends runtime.BaseAPI {
212
212
  return new runtime.JSONApiResponse(response, (jsonValue) => UploadResponseFromJSON(jsonValue));
213
213
  }
214
214
  /**
215
- * Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic\'s id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
215
+ * Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `getUploadLimits` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic\'s id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `listUploads`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
216
216
  * Upload a file
217
217
  */
218
- async uploadsPost(requestParameters, initOverrides) {
219
- const response = await this.uploadsPostRaw(requestParameters, initOverrides);
218
+ async uploadFile(requestParameters, initOverrides) {
219
+ const response = await this.uploadFileRaw(requestParameters, initOverrides);
220
220
  return await response.value();
221
221
  }
222
222
  }
223
223
  /**
224
224
  * @export
225
225
  */
226
- export const UploadsPost0ContextTypeEnum = {
226
+ export const UploadFileContextTypeEnum = {
227
227
  WidgetCodegen: 'widget-codegen',
228
228
  BrowserIc: 'browser-ic',
229
229
  ContentProperty: 'content-property'
@@ -231,7 +231,7 @@ export const UploadsPost0ContextTypeEnum = {
231
231
  /**
232
232
  * @export
233
233
  */
234
- export const UploadsPost0SourceEnum = {
234
+ export const UploadFileSourceEnum = {
235
235
  ChatUpload: 'chat-upload',
236
236
  ChatScreenshot: 'chat-screenshot',
237
237
  BrowserIcScreenshot: 'browser-ic-screenshot',
@@ -241,7 +241,7 @@ export const UploadsPost0SourceEnum = {
241
241
  /**
242
242
  * @export
243
243
  */
244
- export const UploadsPost0PurposeEnum = {
244
+ export const UploadFilePurposeEnum = {
245
245
  Canvas: 'canvas',
246
246
  Chat: 'chat',
247
247
  Field: 'field'
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { AddDomainRequestToJSON, ConfirmAdapterConnectionRequestToJSON, CreateUserApiKeyRequestToJSON, CreatedUserApiKeyResponseFromJSON, DeletePersonalWorkspaceDomainResponseFromJSON, DeleteUserApiKeyResponseFromJSON, GetPersonalWorkspaceDomains200ResponseFromJSON, GetUserAdapterConnections200ResponseFromJSON, GetUserApiKeyUsageLogsResponseFromJSON, GetUserApiKeys200ResponseFromJSON, PersonalWorkspaceDomainResultResponseFromJSON, RemoveUserAdapterConnection200ResponseFromJSON, SetAdapterConnectionRequestToJSON, SetUserAdapterConnection200ResponseFromJSON, UpdateDomainRequestToJSON, UpdateUserApiKeyRequestToJSON, UserApiKeyResponseFromJSON, } from '../models/index.js';
15
+ import { AdapterConnectionListResponseFromJSON, AdapterConnectionRemovalResponseFromJSON, AdapterConnectionResponseFromJSON, AddDomainRequestToJSON, ConfirmAdapterConnectionRequestToJSON, CreateUserApiKeyRequestToJSON, CreatedUserApiKeyResponseFromJSON, DeletePersonalWorkspaceDomainResponseFromJSON, DeleteUserApiKeyResponseFromJSON, GetPersonalWorkspaceDomains200ResponseFromJSON, GetUserApiKeyUsageLogsResponseFromJSON, GetUserApiKeys200ResponseFromJSON, PersonalWorkspaceDomainResultResponseFromJSON, SetAdapterConnectionRequestToJSON, UpdateDomainRequestToJSON, UpdateUserApiKeyRequestToJSON, UserApiKeyResponseFromJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
@@ -89,7 +89,7 @@ export class UsersApi extends runtime.BaseAPI {
89
89
  query: queryParameters,
90
90
  body: ConfirmAdapterConnectionRequestToJSON(requestParameters['confirmAdapterConnectionRequest']),
91
91
  }, initOverrides);
92
- return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
92
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdapterConnectionResponseFromJSON(jsonValue));
93
93
  }
94
94
  /**
95
95
  * 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.
@@ -271,7 +271,7 @@ export class UsersApi extends runtime.BaseAPI {
271
271
  headers: headerParameters,
272
272
  query: queryParameters,
273
273
  }, initOverrides);
274
- return new runtime.JSONApiResponse(response, (jsonValue) => GetUserAdapterConnections200ResponseFromJSON(jsonValue));
274
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdapterConnectionListResponseFromJSON(jsonValue));
275
275
  }
276
276
  /**
277
277
  * 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.
@@ -382,7 +382,7 @@ export class UsersApi extends runtime.BaseAPI {
382
382
  headers: headerParameters,
383
383
  query: queryParameters,
384
384
  }, initOverrides);
385
- return new runtime.JSONApiResponse(response, (jsonValue) => RemoveUserAdapterConnection200ResponseFromJSON(jsonValue));
385
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdapterConnectionRemovalResponseFromJSON(jsonValue));
386
386
  }
387
387
  /**
388
388
  * 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.
@@ -426,7 +426,7 @@ export class UsersApi extends runtime.BaseAPI {
426
426
  query: queryParameters,
427
427
  body: SetAdapterConnectionRequestToJSON(requestParameters['setAdapterConnectionRequest']),
428
428
  }, initOverrides);
429
- return new runtime.JSONApiResponse(response, (jsonValue) => SetUserAdapterConnection200ResponseFromJSON(jsonValue));
429
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdapterConnectionResponseFromJSON(jsonValue));
430
430
  }
431
431
  /**
432
432
  * 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.
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { CreateCompositionFromWidget201ResponseFromJSON, CreateCompositionFromWidgetRequestToJSON, CreateWidget201ResponseFromJSON, GetWidgets200ResponseFromJSON, GetWidgetsBatchRequestToJSON, GetWidgetsBatchResponseFromJSON, NewWidgetToJSON, } from '../models/index.js';
15
+ import { CompositionResponseFromJSON, CreateCompositionFromWidgetRequestToJSON, CreateWidget201ResponseFromJSON, GetWidgets200ResponseFromJSON, GetWidgetsBatchRequestToJSON, GetWidgetsBatchResponseFromJSON, NewWidgetToJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
@@ -51,7 +51,7 @@ export class WidgetsApi extends runtime.BaseAPI {
51
51
  query: queryParameters,
52
52
  body: CreateCompositionFromWidgetRequestToJSON(requestParameters['createCompositionFromWidgetRequest']),
53
53
  }, initOverrides);
54
- return new runtime.JSONApiResponse(response, (jsonValue) => CreateCompositionFromWidget201ResponseFromJSON(jsonValue));
54
+ return new runtime.JSONApiResponse(response, (jsonValue) => CompositionResponseFromJSON(jsonValue));
55
55
  }
56
56
  /**
57
57
  * After a managed user publishes a widget from the creator, call this with the widget id, the customer\'s managed user (when the widget is not already filed under one), and optional content, design, embed settings and locale. Every input is validated before a single insert; a failure never leaves a half-made composition. When the widget is already tagged with a managed user, you may omit `managedUserId`. When you send it, it must match that tag. A widget that keeps what visitors send (a form, a vote, a rating) declares its tables in its own source (`src/lib/meta/database.json`); they are made for the composition here, in a schema of its own, as the widget was when it was last published. A widget that keeps nothing leaves the composition without tables. If the tables cannot be made just now, or the widget\'s file cannot be used, the composition is still created (`201`) and `meta.warnings` says why; the tables are made the next time the widget is generated. The widget must be published. The `Idempotency-Key` header is required.
@@ -102,41 +102,6 @@ export class WidgetsApi extends runtime.BaseAPI {
102
102
  const response = await this.createWidgetRaw(requestParameters, initOverrides);
103
103
  return await response.value();
104
104
  }
105
- /**
106
- * Retrieves multiple widgets by their IDs in a single request. An id that is not found, or that is not yours, is reported in `errors` exactly like one that does not exist. Called with an editor session, only the widgets made for the session\'s managed user are returned.
107
- * Get Widgets Batch
108
- */
109
- async getWidgetsBatchRaw(requestParameters, initOverrides) {
110
- if (requestParameters['getWidgetsBatchRequest'] == null) {
111
- throw new runtime.RequiredError('getWidgetsBatchRequest', 'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');
112
- }
113
- const queryParameters = {};
114
- const headerParameters = {};
115
- headerParameters['Content-Type'] = 'application/json';
116
- if (this.configuration && this.configuration.accessToken) {
117
- const token = this.configuration.accessToken;
118
- const tokenString = await token("apiKeyAuth", []);
119
- if (tokenString) {
120
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
121
- }
122
- }
123
- const response = await this.request({
124
- path: `/widgets/batch`,
125
- method: 'POST',
126
- headers: headerParameters,
127
- query: queryParameters,
128
- body: GetWidgetsBatchRequestToJSON(requestParameters['getWidgetsBatchRequest']),
129
- }, initOverrides);
130
- return new runtime.JSONApiResponse(response, (jsonValue) => GetWidgetsBatchResponseFromJSON(jsonValue));
131
- }
132
- /**
133
- * Retrieves multiple widgets by their IDs in a single request. An id that is not found, or that is not yours, is reported in `errors` exactly like one that does not exist. Called with an editor session, only the widgets made for the session\'s managed user are returned.
134
- * Get Widgets Batch
135
- */
136
- async getWidgetsBatch(requestParameters, initOverrides) {
137
- const response = await this.getWidgetsBatchRaw(requestParameters, initOverrides);
138
- return await response.value();
139
- }
140
105
  /**
141
106
  * Lists the widgets your account owns, newest first. A widget is the reusable piece a composition is made from; this is your own library, not a catalogue of Widgetic\'s widgets. Pass `page` (counting from 1) and `size` (1 to 100, 20 when left out) to read the list one page at a time. `meta` then carries `total`, `hasNextPage` and `hasPreviousPage`, so a client can walk the list to its end. A page past the end is an empty list. Without `page` and `size` the call returns the whole list in one response, which only suits an account with a few widgets. Pass `canvasId` to list only the widgets on one of your canvases. That list is always returned whole, whatever `page` and `size` say. Pass `managedUserId` (Widgetic\'s id for one of your managed users) or `managedUserExternalId` (your own identifier for the user) to list only the widgets made for that managed user. The widgets of your other managed users, and your own, are left out. It combines with `page`, `size` and `canvasId`. A managed user that is not yours, or does not exist, is answered with 404 and `MANAGED_USER_NOT_FOUND`.
142
107
  * List Widgets
@@ -182,4 +147,39 @@ export class WidgetsApi extends runtime.BaseAPI {
182
147
  const response = await this.getWidgetsRaw(requestParameters, initOverrides);
183
148
  return await response.value();
184
149
  }
150
+ /**
151
+ * Retrieves multiple widgets by their IDs in a single request. An id that is not found, or that is not yours, is reported in `errors` exactly like one that does not exist. Called with an editor session, only the widgets made for the session\'s managed user are returned.
152
+ * Get Widgets Batch
153
+ */
154
+ async getWidgetsBatchRaw(requestParameters, initOverrides) {
155
+ if (requestParameters['getWidgetsBatchRequest'] == null) {
156
+ throw new runtime.RequiredError('getWidgetsBatchRequest', 'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');
157
+ }
158
+ const queryParameters = {};
159
+ const headerParameters = {};
160
+ headerParameters['Content-Type'] = 'application/json';
161
+ if (this.configuration && this.configuration.accessToken) {
162
+ const token = this.configuration.accessToken;
163
+ const tokenString = await token("apiKeyAuth", []);
164
+ if (tokenString) {
165
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
166
+ }
167
+ }
168
+ const response = await this.request({
169
+ path: `/widgets/batch`,
170
+ method: 'POST',
171
+ headers: headerParameters,
172
+ query: queryParameters,
173
+ body: GetWidgetsBatchRequestToJSON(requestParameters['getWidgetsBatchRequest']),
174
+ }, initOverrides);
175
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetWidgetsBatchResponseFromJSON(jsonValue));
176
+ }
177
+ /**
178
+ * Retrieves multiple widgets by their IDs in a single request. An id that is not found, or that is not yours, is reported in `errors` exactly like one that does not exist. Called with an editor session, only the widgets made for the session\'s managed user are returned.
179
+ * Get Widgets Batch
180
+ */
181
+ async getWidgetsBatch(requestParameters, initOverrides) {
182
+ const response = await this.getWidgetsBatchRaw(requestParameters, initOverrides);
183
+ return await response.value();
184
+ }
185
185
  }