@supernova-studio/client 1.96.6 → 1.96.7

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 (349) hide show
  1. package/dist/index.d.mts +101177 -143251
  2. package/dist/index.d.ts +101177 -143251
  3. package/dist/index.js +408 -105
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +5542 -5239
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +20 -9
  8. package/src/api/client.ts +62 -0
  9. package/src/api/conversion/analytics/index.ts +3 -0
  10. package/src/api/conversion/analytics/page-visits-to-comparison-dto.ts +65 -0
  11. package/src/api/conversion/analytics/page-visits-to-dto.ts +68 -0
  12. package/src/api/conversion/analytics/page-visits-to-heatmap-dto.ts +49 -0
  13. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +114 -0
  14. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +91 -0
  15. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +52 -0
  16. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +34 -0
  17. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +134 -0
  18. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +69 -0
  19. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +84 -0
  20. package/src/api/conversion/documentation/documentation-settings-to-dto.ts +14 -0
  21. package/src/api/conversion/documentation/index.ts +8 -0
  22. package/src/api/conversion/export/index.ts +1 -0
  23. package/src/api/conversion/export/pipeline.ts +27 -0
  24. package/src/api/conversion/index.ts +4 -0
  25. package/src/api/conversion/integrations/git.ts +37 -0
  26. package/src/api/conversion/integrations/index.ts +2 -0
  27. package/src/api/conversion/integrations/integration.ts +37 -0
  28. package/src/api/dto/access-tokens/access-token.ts +45 -0
  29. package/src/api/dto/access-tokens/index.ts +1 -0
  30. package/src/api/dto/aux/color.ts +7 -0
  31. package/src/api/dto/aux/index.ts +4 -0
  32. package/src/api/dto/aux/meta.ts +8 -0
  33. package/src/api/dto/aux/object-metadata.ts +29 -0
  34. package/src/api/dto/aux/pagination.ts +8 -0
  35. package/src/api/dto/bff/app-bootstrap-data.ts +20 -0
  36. package/src/api/dto/bff/index.ts +1 -0
  37. package/src/api/dto/collections/index.ts +1 -0
  38. package/src/api/dto/collections/token-collection.ts +32 -0
  39. package/src/api/dto/design-systems/brand.ts +44 -0
  40. package/src/api/dto/design-systems/code-component-usage.ts +52 -0
  41. package/src/api/dto/design-systems/code-component.ts +101 -0
  42. package/src/api/dto/design-systems/code-history.ts +43 -0
  43. package/src/api/dto/design-systems/code-scan.ts +29 -0
  44. package/src/api/dto/design-systems/code-snapshots.ts +46 -0
  45. package/src/api/dto/design-systems/component.ts +40 -0
  46. package/src/api/dto/design-systems/contact.ts +11 -0
  47. package/src/api/dto/design-systems/data-source.ts +216 -0
  48. package/src/api/dto/design-systems/design-system.ts +75 -0
  49. package/src/api/dto/design-systems/documentation-search.ts +31 -0
  50. package/src/api/dto/design-systems/elements-diff.ts +14 -0
  51. package/src/api/dto/design-systems/figma-variables.ts +122 -0
  52. package/src/api/dto/design-systems/file.ts +71 -0
  53. package/src/api/dto/design-systems/import-job.ts +62 -0
  54. package/src/api/dto/design-systems/index.ts +24 -0
  55. package/src/api/dto/design-systems/members.ts +52 -0
  56. package/src/api/dto/design-systems/redirects.ts +33 -0
  57. package/src/api/dto/design-systems/role.ts +11 -0
  58. package/src/api/dto/design-systems/stats.ts +20 -0
  59. package/src/api/dto/design-systems/storybook.ts +45 -0
  60. package/src/api/dto/design-systems/user-design-systems.ts +10 -0
  61. package/src/api/dto/design-systems/version-room.ts +12 -0
  62. package/src/api/dto/design-systems/version.ts +56 -0
  63. package/src/api/dto/design-systems/view.ts +45 -0
  64. package/src/api/dto/design-tokens/design-token.ts +78 -0
  65. package/src/api/dto/design-tokens/index.ts +1 -0
  66. package/src/api/dto/documentation/analytics-v2.ts +80 -0
  67. package/src/api/dto/documentation/analytics.ts +32 -0
  68. package/src/api/dto/documentation/anchor.ts +15 -0
  69. package/src/api/dto/documentation/approvals.ts +21 -0
  70. package/src/api/dto/documentation/block-definition.ts +28 -0
  71. package/src/api/dto/documentation/block.ts +6 -0
  72. package/src/api/dto/documentation/documentation-page-snapshot.ts +18 -0
  73. package/src/api/dto/documentation/documentation.ts +34 -0
  74. package/src/api/dto/documentation/index.ts +11 -0
  75. package/src/api/dto/documentation/link-preview.ts +23 -0
  76. package/src/api/dto/documentation/publish.ts +23 -0
  77. package/src/api/dto/documentation/room.ts +12 -0
  78. package/src/api/dto/elements/components/figma-component-group.ts +19 -0
  79. package/src/api/dto/elements/components/figma-component.ts +56 -0
  80. package/src/api/dto/elements/components/index.ts +2 -0
  81. package/src/api/dto/elements/documentation/configuration.ts +20 -0
  82. package/src/api/dto/elements/documentation/draft-state.ts +37 -0
  83. package/src/api/dto/elements/documentation/group-action.ts +108 -0
  84. package/src/api/dto/elements/documentation/group-v1.ts +35 -0
  85. package/src/api/dto/elements/documentation/group-v2.ts +117 -0
  86. package/src/api/dto/elements/documentation/hierarchy.ts +25 -0
  87. package/src/api/dto/elements/documentation/index.ts +16 -0
  88. package/src/api/dto/elements/documentation/item-configuration-v1.ts +24 -0
  89. package/src/api/dto/elements/documentation/item-configuration-v2.ts +14 -0
  90. package/src/api/dto/elements/documentation/metadata.ts +8 -0
  91. package/src/api/dto/elements/documentation/page-actions-v2.ts +138 -0
  92. package/src/api/dto/elements/documentation/page-content.ts +15 -0
  93. package/src/api/dto/elements/documentation/page-dependencies.ts +30 -0
  94. package/src/api/dto/elements/documentation/page-v1.ts +21 -0
  95. package/src/api/dto/elements/documentation/page-v2.ts +132 -0
  96. package/src/api/dto/elements/documentation/settings.ts +9 -0
  97. package/src/api/dto/elements/documentation/structure.ts +37 -0
  98. package/src/api/dto/elements/elements-action-v2.ts +125 -0
  99. package/src/api/dto/elements/figma-nodes/figma-node-structure.ts +27 -0
  100. package/src/api/dto/elements/figma-nodes/figma-node-v1.ts +32 -0
  101. package/src/api/dto/elements/figma-nodes/figma-node-v2.ts +32 -0
  102. package/src/api/dto/elements/figma-nodes/figma-node.ts +103 -0
  103. package/src/api/dto/elements/figma-nodes/index.ts +5 -0
  104. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +25 -0
  105. package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +17 -0
  106. package/src/api/dto/elements/frame-node-structures/index.ts +1 -0
  107. package/src/api/dto/elements/get-elements-v2.ts +27 -0
  108. package/src/api/dto/elements/index.ts +7 -0
  109. package/src/api/dto/elements/properties/index.ts +2 -0
  110. package/src/api/dto/elements/properties/property-definitions.ts +75 -0
  111. package/src/api/dto/elements/properties/property-values.ts +50 -0
  112. package/src/api/dto/events/forge-project.ts +51 -0
  113. package/src/api/dto/events/index.ts +2 -0
  114. package/src/api/dto/events/workspace.ts +81 -0
  115. package/src/api/dto/export/exporter-property.ts +114 -0
  116. package/src/api/dto/export/exporter.ts +115 -0
  117. package/src/api/dto/export/filter.ts +20 -0
  118. package/src/api/dto/export/index.ts +5 -0
  119. package/src/api/dto/export/job.ts +114 -0
  120. package/src/api/dto/export/pipeline.ts +60 -0
  121. package/src/api/dto/figma-components/assets/download.ts +30 -0
  122. package/src/api/dto/figma-components/assets/index.ts +1 -0
  123. package/src/api/dto/figma-components/index.ts +1 -0
  124. package/src/api/dto/figma-exporter/figma-node.ts +11 -0
  125. package/src/api/dto/figma-exporter/index.ts +1 -0
  126. package/src/api/dto/files/files.ts +94 -0
  127. package/src/api/dto/files/index.ts +1 -0
  128. package/src/api/dto/forge/agent.ts +38 -0
  129. package/src/api/dto/forge/artifact.ts +94 -0
  130. package/src/api/dto/forge/feature-messages.ts +551 -0
  131. package/src/api/dto/forge/feature-room.ts +12 -0
  132. package/src/api/dto/forge/figma-node.ts +117 -0
  133. package/src/api/dto/forge/index.ts +28 -0
  134. package/src/api/dto/forge/iteration-message-old.ts +43 -0
  135. package/src/api/dto/forge/knowledge-item.ts +67 -0
  136. package/src/api/dto/forge/memory.ts +67 -0
  137. package/src/api/dto/forge/participant.ts +44 -0
  138. package/src/api/dto/forge/project-action.ts +123 -0
  139. package/src/api/dto/forge/project-artifact-room.ts +12 -0
  140. package/src/api/dto/forge/project-artifact.ts +85 -0
  141. package/src/api/dto/forge/project-context-feedback.ts +141 -0
  142. package/src/api/dto/forge/project-context-override.ts +41 -0
  143. package/src/api/dto/forge/project-context-scope.ts +23 -0
  144. package/src/api/dto/forge/project-context-v2.ts +228 -0
  145. package/src/api/dto/forge/project-context.ts +72 -0
  146. package/src/api/dto/forge/project-feature.ts +86 -0
  147. package/src/api/dto/forge/project-figma-node.ts +9 -0
  148. package/src/api/dto/forge/project-file.ts +48 -0
  149. package/src/api/dto/forge/project-invitation.ts +46 -0
  150. package/src/api/dto/forge/project-iteration-old.ts +54 -0
  151. package/src/api/dto/forge/project-member.ts +67 -0
  152. package/src/api/dto/forge/project-room.ts +12 -0
  153. package/src/api/dto/forge/project-section.ts +37 -0
  154. package/src/api/dto/forge/project.ts +105 -0
  155. package/src/api/dto/forge/relation.ts +34 -0
  156. package/src/api/dto/forge/threads.ts +153 -0
  157. package/src/api/dto/index.ts +25 -0
  158. package/src/api/dto/liveblocks/auth-response.ts +7 -0
  159. package/src/api/dto/liveblocks/index.ts +1 -0
  160. package/src/api/dto/mcp/index.ts +1 -0
  161. package/src/api/dto/mcp/stream.ts +17 -0
  162. package/src/api/dto/notifications/index.ts +2 -0
  163. package/src/api/dto/notifications/notifications.ts +65 -0
  164. package/src/api/dto/notifications/settings.ts +10 -0
  165. package/src/api/dto/portal/index.ts +1 -0
  166. package/src/api/dto/portal/portal-settings.ts +45 -0
  167. package/src/api/dto/sandboxes/index.ts +1 -0
  168. package/src/api/dto/sandboxes/template.ts +143 -0
  169. package/src/api/dto/storybook-sites/index.ts +1 -0
  170. package/src/api/dto/storybook-sites/storybook-sites.ts +60 -0
  171. package/src/api/dto/themes/index.ts +2 -0
  172. package/src/api/dto/themes/override.ts +27 -0
  173. package/src/api/dto/themes/theme.ts +53 -0
  174. package/src/api/dto/threads/index.ts +1 -0
  175. package/src/api/dto/threads/threads.ts +280 -0
  176. package/src/api/dto/trail-events/index.ts +1 -0
  177. package/src/api/dto/trail-events/trail-events.ts +172 -0
  178. package/src/api/dto/users/authenticated-user.ts +92 -0
  179. package/src/api/dto/users/index.ts +2 -0
  180. package/src/api/dto/users/user.ts +27 -0
  181. package/src/api/dto/workspaces/billing.ts +156 -0
  182. package/src/api/dto/workspaces/enums.ts +13 -0
  183. package/src/api/dto/workspaces/git.ts +32 -0
  184. package/src/api/dto/workspaces/index.ts +15 -0
  185. package/src/api/dto/workspaces/integrations.ts +34 -0
  186. package/src/api/dto/workspaces/invitations.ts +47 -0
  187. package/src/api/dto/workspaces/ip-whitelist.ts +33 -0
  188. package/src/api/dto/workspaces/knowledge-items-search.ts +37 -0
  189. package/src/api/dto/workspaces/login-screen.ts +42 -0
  190. package/src/api/dto/workspaces/membership.ts +55 -0
  191. package/src/api/dto/workspaces/npm-registry.ts +62 -0
  192. package/src/api/dto/workspaces/products.ts +45 -0
  193. package/src/api/dto/workspaces/subscription.ts +170 -0
  194. package/src/api/dto/workspaces/transfer-ownership.ts +7 -0
  195. package/src/api/dto/workspaces/untyped-data.ts +35 -0
  196. package/src/api/dto/workspaces/workspace.ts +49 -0
  197. package/src/api/endpoints/auth-tokens.ts +28 -0
  198. package/src/api/endpoints/codegen/codegen.ts +16 -0
  199. package/src/api/endpoints/codegen/ds-pipelines.ts +37 -0
  200. package/src/api/endpoints/codegen/exporters.ts +54 -0
  201. package/src/api/endpoints/codegen/index.ts +5 -0
  202. package/src/api/endpoints/codegen/jobs.ts +15 -0
  203. package/src/api/endpoints/codegen/pipelines.ts +55 -0
  204. package/src/api/endpoints/design-system/analytics.ts +14 -0
  205. package/src/api/endpoints/design-system/bff.ts +13 -0
  206. package/src/api/endpoints/design-system/code-snapshots.ts +47 -0
  207. package/src/api/endpoints/design-system/contact.ts +12 -0
  208. package/src/api/endpoints/design-system/design-systems.ts +90 -0
  209. package/src/api/endpoints/design-system/figma-node-structures.ts +20 -0
  210. package/src/api/endpoints/design-system/index.ts +11 -0
  211. package/src/api/endpoints/design-system/members.ts +24 -0
  212. package/src/api/endpoints/design-system/redirects.ts +46 -0
  213. package/src/api/endpoints/design-system/sources.ts +80 -0
  214. package/src/api/endpoints/design-system/storybook.ts +28 -0
  215. package/src/api/endpoints/design-system/versions/brands.ts +45 -0
  216. package/src/api/endpoints/design-system/versions/documentation.ts +107 -0
  217. package/src/api/endpoints/design-system/versions/ds-components.ts +30 -0
  218. package/src/api/endpoints/design-system/versions/elements-action.ts +65 -0
  219. package/src/api/endpoints/design-system/versions/elements.ts +27 -0
  220. package/src/api/endpoints/design-system/versions/figma-component-groups.ts +13 -0
  221. package/src/api/endpoints/design-system/versions/figma-components.ts +15 -0
  222. package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +13 -0
  223. package/src/api/endpoints/design-system/versions/files.ts +43 -0
  224. package/src/api/endpoints/design-system/versions/import-jobs.ts +13 -0
  225. package/src/api/endpoints/design-system/versions/index.ts +19 -0
  226. package/src/api/endpoints/design-system/versions/overrides.ts +17 -0
  227. package/src/api/endpoints/design-system/versions/property-definitions.ts +43 -0
  228. package/src/api/endpoints/design-system/versions/property-values.ts +25 -0
  229. package/src/api/endpoints/design-system/versions/stats.ts +12 -0
  230. package/src/api/endpoints/design-system/versions/themes.ts +35 -0
  231. package/src/api/endpoints/design-system/versions/token-collections.ts +13 -0
  232. package/src/api/endpoints/design-system/versions/token-groups.ts +30 -0
  233. package/src/api/endpoints/design-system/versions/tokens.ts +29 -0
  234. package/src/api/endpoints/design-system/versions/versions.ts +90 -0
  235. package/src/api/endpoints/feedback.ts +60 -0
  236. package/src/api/endpoints/files.ts +25 -0
  237. package/src/api/endpoints/forge/agents.ts +54 -0
  238. package/src/api/endpoints/forge/artifacts.ts +54 -0
  239. package/src/api/endpoints/forge/documents.ts +18 -0
  240. package/src/api/endpoints/forge/feature-artifacts.ts +39 -0
  241. package/src/api/endpoints/forge/feature-iterations.ts +49 -0
  242. package/src/api/endpoints/forge/feature-messages.ts +68 -0
  243. package/src/api/endpoints/forge/features.ts +63 -0
  244. package/src/api/endpoints/forge/forge.ts +38 -0
  245. package/src/api/endpoints/forge/index.ts +16 -0
  246. package/src/api/endpoints/forge/iteration-tags.ts +13 -0
  247. package/src/api/endpoints/forge/memory.ts +41 -0
  248. package/src/api/endpoints/forge/project-contexts.ts +49 -0
  249. package/src/api/endpoints/forge/project-files.ts +41 -0
  250. package/src/api/endpoints/forge/project-invitations.ts +39 -0
  251. package/src/api/endpoints/forge/project-iterations.ts +65 -0
  252. package/src/api/endpoints/forge/project-members.ts +55 -0
  253. package/src/api/endpoints/forge/projects.ts +56 -0
  254. package/src/api/endpoints/index.ts +13 -0
  255. package/src/api/endpoints/liveblocks.ts +14 -0
  256. package/src/api/endpoints/mcp/index.ts +1 -0
  257. package/src/api/endpoints/mcp/streams.ts +21 -0
  258. package/src/api/endpoints/sandboxes/builds.ts +30 -0
  259. package/src/api/endpoints/sandboxes/index.ts +3 -0
  260. package/src/api/endpoints/sandboxes/sandboxes.ts +13 -0
  261. package/src/api/endpoints/sandboxes/templates.ts +16 -0
  262. package/src/api/endpoints/storybook-sites.ts +42 -0
  263. package/src/api/endpoints/threads.ts +38 -0
  264. package/src/api/endpoints/users.ts +26 -0
  265. package/src/api/endpoints/workspaces/billing.ts +24 -0
  266. package/src/api/endpoints/workspaces/chat-threads.ts +95 -0
  267. package/src/api/endpoints/workspaces/index.ts +9 -0
  268. package/src/api/endpoints/workspaces/integrations.ts +15 -0
  269. package/src/api/endpoints/workspaces/invites.ts +34 -0
  270. package/src/api/endpoints/workspaces/knowledge-items.ts +59 -0
  271. package/src/api/endpoints/workspaces/members.ts +31 -0
  272. package/src/api/endpoints/workspaces/npm-register.ts +20 -0
  273. package/src/api/endpoints/workspaces/subscription.ts +31 -0
  274. package/src/api/endpoints/workspaces/workspaces.ts +84 -0
  275. package/src/api/index.ts +6 -0
  276. package/src/api/payloads/design-systems/code-snapshots.ts +27 -0
  277. package/src/api/payloads/design-systems/index.ts +3 -0
  278. package/src/api/payloads/design-systems/update-design-system.ts +42 -0
  279. package/src/api/payloads/design-systems/version.ts +29 -0
  280. package/src/api/payloads/documentation/analytics.ts +36 -0
  281. package/src/api/payloads/documentation/block-definitions.ts +18 -0
  282. package/src/api/payloads/documentation/design-data-doc-diff.ts +7 -0
  283. package/src/api/payloads/documentation/index.ts +3 -0
  284. package/src/api/payloads/export/index.ts +1 -0
  285. package/src/api/payloads/export/pipeline.ts +111 -0
  286. package/src/api/payloads/index.ts +6 -0
  287. package/src/api/payloads/liveblocks/auth.ts +7 -0
  288. package/src/api/payloads/liveblocks/index.ts +1 -0
  289. package/src/api/payloads/users/index.ts +1 -0
  290. package/src/api/payloads/users/notifications/index.ts +1 -0
  291. package/src/api/payloads/users/notifications/notification-settings.ts +17 -0
  292. package/src/api/payloads/workspaces/index.ts +2 -0
  293. package/src/api/payloads/workspaces/workspace-configuration.ts +62 -0
  294. package/src/api/payloads/workspaces/workspace-integrations.ts +35 -0
  295. package/src/api/transport/index.ts +2 -0
  296. package/src/api/transport/request-executor-error.ts +60 -0
  297. package/src/api/transport/request-executor.ts +94 -0
  298. package/src/events/design-system.ts +21 -0
  299. package/src/events/event.ts +6 -0
  300. package/src/events/index.ts +2 -0
  301. package/src/index.ts +5 -0
  302. package/src/sync/docs-local-action-executor.ts +412 -0
  303. package/src/sync/docs-structure-repo.ts +283 -0
  304. package/src/sync/index.ts +5 -0
  305. package/src/sync/project-content-repo.ts +215 -0
  306. package/src/sync/project-local-action-executor.ts +415 -0
  307. package/src/sync/types.ts +37 -0
  308. package/src/utils/figma.ts +72 -0
  309. package/src/utils/hash.ts +62 -0
  310. package/src/utils/index.ts +4 -0
  311. package/src/utils/query.ts +41 -0
  312. package/src/utils/redirect-validation.ts +76 -0
  313. package/src/yjs/design-system-content/documentation-hierarchy.ts +35 -0
  314. package/src/yjs/design-system-content/index.ts +2 -0
  315. package/src/yjs/design-system-content/item-configuration.ts +62 -0
  316. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +764 -0
  317. package/src/yjs/docs-editor/index.ts +7 -0
  318. package/src/yjs/docs-editor/list-tree-builder.ts +127 -0
  319. package/src/yjs/docs-editor/mock.ts +2271 -0
  320. package/src/yjs/docs-editor/model/block.ts +8 -0
  321. package/src/yjs/docs-editor/model/index.ts +2 -0
  322. package/src/yjs/docs-editor/model/page.ts +8 -0
  323. package/src/yjs/docs-editor/prosemirror/index.ts +3 -0
  324. package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +145 -0
  325. package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +577 -0
  326. package/src/yjs/docs-editor/prosemirror/types.ts +19 -0
  327. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +986 -0
  328. package/src/yjs/docs-editor/utils.ts +115 -0
  329. package/src/yjs/feature-room/backend.ts +36 -0
  330. package/src/yjs/feature-room/base.ts +109 -0
  331. package/src/yjs/feature-room/frontend.ts +53 -0
  332. package/src/yjs/feature-room/index.ts +3 -0
  333. package/src/yjs/forge-project-room/backend.ts +59 -0
  334. package/src/yjs/forge-project-room/base.ts +190 -0
  335. package/src/yjs/forge-project-room/index.ts +2 -0
  336. package/src/yjs/index.ts +7 -0
  337. package/src/yjs/thread-room/backend.ts +32 -0
  338. package/src/yjs/thread-room/base.ts +71 -0
  339. package/src/yjs/thread-room/frontend.ts +39 -0
  340. package/src/yjs/thread-room/index.ts +3 -0
  341. package/src/yjs/utils/index.ts +1 -0
  342. package/src/yjs/utils/key-value-storage.ts +57 -0
  343. package/src/yjs/version-room/backend.ts +101 -0
  344. package/src/yjs/version-room/base.ts +323 -0
  345. package/src/yjs/version-room/compute-dto.ts +387 -0
  346. package/src/yjs/version-room/frontend.ts +76 -0
  347. package/src/yjs/version-room/index.ts +6 -0
  348. package/src/yjs/version-room/types.ts +31 -0
  349. package/src/yjs/version-room/utils.ts +109 -0
@@ -0,0 +1,42 @@
1
+ import z from "zod";
2
+
3
+ //
4
+ // Entity
5
+ //
6
+
7
+ export const DTOLoginScreenSettings = z.object({
8
+ isEnabled: z.boolean(), // Flag to enable/disable the login screen
9
+ title: z.string().optional(),
10
+ color: z.string().optional(),
11
+ logoUrl: z.string().optional(),
12
+ isGoogleEnabled: z.boolean(), // Flag for Google login
13
+ isEmailEnabled: z.boolean(), // Flag for email login
14
+ isSsoEnabled: z.boolean(), // Flag for SSO login
15
+ });
16
+
17
+ export type DTOLoginScreenSettings = z.infer<typeof DTOLoginScreenSettings>;
18
+
19
+ //
20
+ // Payloads
21
+ //
22
+
23
+ export const DTOLoginScreenSettingsUpdate = DTOLoginScreenSettings.extend({
24
+ logoFileId: z.string().nullish(),
25
+ title: z.string().max(160, "Custom Login page title is too long. Maximum length is 160 characters.").nullish(),
26
+ color: z
27
+ .string()
28
+ .refine(
29
+ val => val === null || /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(val),
30
+ "Must be a valid hex color (e.g. #FF0000 or #FF000080) or null"
31
+ )
32
+ .nullish(),
33
+ })
34
+ .omit({ logoUrl: true })
35
+ .partial();
36
+
37
+ export const DTOLoginScreenSettingsResponse = z.object({
38
+ loginScreenSettings: DTOLoginScreenSettings,
39
+ });
40
+
41
+ export type DTOLoginScreenSettingsUpdate = z.infer<typeof DTOLoginScreenSettingsUpdate>;
42
+ export type DTOLoginScreenSettingsResponse = z.infer<typeof DTOLoginScreenSettingsResponse>;
@@ -0,0 +1,55 @@
1
+ import { User } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+ import { DTOWorkspaceRole, DTOWorkspaceSeatType } from "./enums";
4
+ import { DTOWorkspace } from "./workspace";
5
+ import { DTOUserNotificationSettings } from "../notifications/settings";
6
+
7
+ //
8
+ // Read
9
+ //
10
+
11
+ export const DTOUserWorkspaceMembership = z.object({
12
+ /** Workspace the user is a member of */
13
+ workspace: DTOWorkspace,
14
+
15
+ /** Assigned and stored role the user has in the workspace */
16
+ role: DTOWorkspaceRole,
17
+
18
+ /** Role that determines actual permissions the user has in the workspace
19
+ * E.g. this is different from the default role when editors are downgraded to viewers
20
+ * when a workspace's subscription is downgraded to free tier
21
+ */
22
+ effectiveRole: DTOWorkspaceRole,
23
+
24
+ /** Assigned and stored seat type the user has in the workspace */
25
+ seatType: DTOWorkspaceSeatType,
26
+
27
+ /** Seat type that determines actual permissions the user has in the workspace. */
28
+ effectiveSeatType: DTOWorkspaceSeatType,
29
+
30
+ isDeactivated: z.boolean(),
31
+ });
32
+
33
+ export const DTOWorkspaceMember = z.object({
34
+ membershipId: z.string(),
35
+ user: User,
36
+ role: DTOWorkspaceRole,
37
+ effectiveRole: DTOWorkspaceRole,
38
+ seatType: DTOWorkspaceSeatType,
39
+ effectiveSeatType: DTOWorkspaceSeatType,
40
+ isDeactivated: z.boolean(),
41
+ notificationSettings: DTOUserNotificationSettings,
42
+ });
43
+
44
+ export const DTOUserWorkspaceMembershipsResponse = z.object({
45
+ membership: z.array(DTOUserWorkspaceMembership),
46
+ });
47
+
48
+ export const DTOWorkspaceMembersListResponse = z.object({
49
+ members: z.array(DTOWorkspaceMember),
50
+ });
51
+
52
+ export type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;
53
+ export type DTOWorkspaceMember = z.infer<typeof DTOWorkspaceMember>;
54
+ export type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;
55
+ export type DTOWorkspaceMembersListResponse = z.infer<typeof DTOWorkspaceMembersListResponse>;
@@ -0,0 +1,62 @@
1
+ import { NpmRegistryAuthType, NpmRegistryType, nullishToOptional } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+
4
+ //
5
+ // Read
6
+ //
7
+
8
+ export const DTONpmRegistryConfigConstants = {
9
+ passwordPlaceholder: "redacted",
10
+ };
11
+
12
+ export const DTONpmRegistryConfig = z.object({
13
+ // Registry basic configuration
14
+ registryType: NpmRegistryType,
15
+ registryUrl: z.string(),
16
+ customRegistryUrl: z.string().optional(),
17
+
18
+ // URL of Supernova NPM packages proxy
19
+ proxyUrl: z.string(),
20
+
21
+ // Auth configuration
22
+ authType: NpmRegistryAuthType,
23
+ accessToken: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
24
+ username: z.string().optional(),
25
+ password: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
26
+
27
+ // NPM package scopes for whih the proxy should be enabled
28
+ enabledScopes: z.array(z.string()),
29
+
30
+ // True if client should bypass Supernova proxy and connect directly to the registry
31
+ // (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)
32
+ bypassProxy: z.boolean(),
33
+ });
34
+
35
+ export const DTONpmRegistryAccessTokenResponse = z.object({
36
+ version: z.number(),
37
+ accessToken: z.string().optional(),
38
+ registryUrl: z.string(),
39
+ });
40
+
41
+ export const DTOUpdateRegistryInput = z.object({
42
+ registryType: nullishToOptional(NpmRegistryType),
43
+ authType: nullishToOptional(NpmRegistryAuthType),
44
+ enabledScopes: nullishToOptional(z.array(z.string())),
45
+ customRegistryUrl: nullishToOptional(z.string()),
46
+ bypassProxy: nullishToOptional(z.boolean()),
47
+ npmProxyVersion: nullishToOptional(z.number()),
48
+ authHeaderName: nullishToOptional(z.string()),
49
+ authHeaderValue: nullishToOptional(z.string()),
50
+ accessToken: nullishToOptional(z.string()),
51
+ username: nullishToOptional(z.string()),
52
+ password: nullishToOptional(z.string()),
53
+ });
54
+
55
+ export const DTOUpdateRegistryOutput = z.object({
56
+ npmRegistrySettings: DTONpmRegistryConfig,
57
+ });
58
+
59
+ export type DTONpmRegistryConfig = z.infer<typeof DTONpmRegistryConfig>;
60
+ export type DTONpmRegistryAccessTokenResponse = z.infer<typeof DTONpmRegistryAccessTokenResponse>;
61
+ export type DTOUpdateRegistryInput = z.infer<typeof DTOUpdateRegistryInput>;
62
+ export type DTOUpdateRegistryOutput = z.infer<typeof DTOUpdateRegistryOutput>;
@@ -0,0 +1,45 @@
1
+ import z from "zod";
2
+ import { DTOBillingInterval, DTOProductCode, DTOWorkspaceBilledSeatType, DTOWorkspaceRole } from "./enums";
3
+
4
+ //
5
+ // Entities
6
+ //
7
+
8
+ export const DTOProductPrice = z.object({
9
+ isActive: z.boolean(),
10
+
11
+ /** @deprecated use `isActive` */
12
+ active: z.boolean(),
13
+ amount: z.number(),
14
+ interval: DTOBillingInterval,
15
+ isPricePerCreator: z.boolean(),
16
+ isTrial: z.boolean(),
17
+ isHidden: z.boolean(),
18
+ legacyVersion: z.string().optional(),
19
+ seatType: DTOWorkspaceBilledSeatType,
20
+ monthlyCreditGrant: z.number(),
21
+ stripePriceId: z.string(),
22
+ stripeProductId: z.string(),
23
+ stripeProductDescription: z.string().optional(),
24
+ stripeProductFeatures: z.string().array().optional(),
25
+ stripeProductAdditionalFeatures: z.string().array().optional(),
26
+ });
27
+
28
+ export const DTOProduct = z.object({
29
+ code: DTOProductCode,
30
+ allowedInviteRoles: DTOWorkspaceRole.array(),
31
+ prices: DTOProductPrice.array(),
32
+ });
33
+
34
+ export type DTOProductPrice = z.infer<typeof DTOProductPrice>;
35
+ export type DTOProduct = z.infer<typeof DTOProduct>;
36
+
37
+ //
38
+ // Responses
39
+ //
40
+
41
+ export const DTOAvailableProductListResponse = z.object({
42
+ availablePlans: DTOProduct.array(),
43
+ });
44
+
45
+ export type DTOAvailableProductListResponse = z.infer<typeof DTOAvailableProductListResponse>;
@@ -0,0 +1,170 @@
1
+ import {
2
+ BillingTypeSchema,
3
+ CardSchema,
4
+ FeaturesSummary,
5
+ InternalStatusSchema,
6
+ ProductCodeSchema,
7
+ StripeSubscriptionStatusSchema,
8
+ } from "@supernova-studio/model";
9
+ import z from "zod";
10
+ import { DTOBillingInterval, DTOWorkspaceRole } from "./enums";
11
+
12
+ export const DTOCreditBalance = z.object({
13
+ paidTopUp: z
14
+ .object({
15
+ total: z.number(),
16
+ used: z.number(),
17
+ balance: z.number(),
18
+ })
19
+ .optional(),
20
+ paidRecurring: z
21
+ .object({
22
+ total: z.number(),
23
+ used: z.number(),
24
+ balance: z.number(),
25
+ resetAt: z.string().optional(),
26
+ })
27
+ .optional(),
28
+ free: z
29
+ .object({
30
+ credits: z.object({
31
+ total: z.number(),
32
+ used: z.number(),
33
+ balance: z.number(),
34
+ resetAt: z.string().optional(),
35
+ }),
36
+ spendingLimit: z.object({
37
+ total: z.number(),
38
+ used: z.number(),
39
+ balance: z.number(),
40
+ resetAt: z.string().optional(),
41
+ }),
42
+ })
43
+ .optional(),
44
+ });
45
+
46
+ export const DTOCreditsPrices = z.object({
47
+ creditsToCentsConversionRate: z.number(),
48
+ purchaseTopUpCreditsToCentsConversionRate: z.number(),
49
+ });
50
+
51
+ export const DTOSubscription = z.object({
52
+ stripeSubscriptionId: z.string().optional(),
53
+ stripeCustomerId: z.string().optional(),
54
+ stripeScheduleId: z.string().optional(),
55
+
56
+ status: InternalStatusSchema.optional(),
57
+ subscriptionStatus: StripeSubscriptionStatusSchema.optional(),
58
+ internalStatus: InternalStatusSchema.optional(),
59
+
60
+ product: ProductCodeSchema,
61
+ featuresSummary: FeaturesSummary.optional(),
62
+ allowedRoles: DTOWorkspaceRole.array(),
63
+
64
+ /**
65
+ * @deprecated get available-products for this information
66
+ */
67
+ stripeProductDescription: z.string().optional(),
68
+
69
+ /**
70
+ * @deprecated get available-products for this information
71
+ */
72
+ stripeProductFeatures: z.array(z.string()).optional(),
73
+
74
+ /**
75
+ * @deprecated get available-products for this information
76
+ */
77
+ stripeProductAdditionalFeatures: z.array(z.string()).optional(),
78
+
79
+ /**
80
+ * @deprecated always undefined
81
+ */
82
+ stripeSubscriptionMainItemId: z.string().optional(),
83
+
84
+ /**
85
+ * @deprecated use `fullSeatPriceId` or `builderSeatPriceId`
86
+ */
87
+ planPriceId: z.string(),
88
+ planInterval: DTOBillingInterval,
89
+
90
+ /**
91
+ * @deprecated All subscriptions were migrated to work as "price per creator"
92
+ */
93
+ isPricePerCreator: z.boolean().optional(),
94
+ legacyVersion: z.string().optional(),
95
+
96
+ seats: z.number(),
97
+ seatLimit: z.number(),
98
+
99
+ fullSeats: z.number(),
100
+ fullSeatLimit: z.number(),
101
+
102
+ builderSeats: z.number(),
103
+ builderSeatLimit: z.number(),
104
+
105
+ additionalCredits: z.number(),
106
+
107
+ currentPeriodStart: z.string().optional(),
108
+ currentPeriodEnd: z.string().optional(),
109
+ subscriptionStatusUpdatedAt: z.string().optional(),
110
+ cancelAt: z.string().nullish(),
111
+
112
+ card: CardSchema.optional(),
113
+
114
+ // New
115
+ amount: z.number(),
116
+ isTrial: z.boolean(),
117
+ billingType: BillingTypeSchema.optional(),
118
+ daysUntilDue: z.number().optional(),
119
+
120
+ fullSeatPriceId: z.string(),
121
+ builderSeatPriceId: z.string().optional(),
122
+ additionalCreditsPriceId: z.string().optional(),
123
+ });
124
+
125
+ export const DTOSubscriptionUpcomingChange = z.object({
126
+ effectiveAt: z.string(),
127
+ fullSeatLimit: z.number().optional(),
128
+ builderSeatLimit: z.number().optional(),
129
+ additionalCredits: z.number().optional(),
130
+ });
131
+
132
+ export const DTOSubscriptionResponse = z.object({
133
+ subscription: DTOSubscription,
134
+ subscriptionUpcomingChange: DTOSubscriptionUpcomingChange.optional(),
135
+ creditBalance: DTOCreditBalance.optional(),
136
+ creditsPrices: DTOCreditsPrices,
137
+ });
138
+
139
+ export const DTOSubscriptionUpdatePreview = z.object({
140
+ proration: z.object({
141
+ amount: z.number(),
142
+ }),
143
+ nextBillingCycle: z.object({
144
+ amount: z.number(),
145
+ }),
146
+ });
147
+
148
+ export const DTOSubscriptionUpdatePreviewResponse = z.object({
149
+ preview: DTOSubscriptionUpdatePreview,
150
+ });
151
+
152
+ export type DTOCreditBalance = z.infer<typeof DTOCreditBalance>;
153
+ export type DTOSubscription = z.infer<typeof DTOSubscription>;
154
+ export type DTOSubscriptionResponse = z.infer<typeof DTOSubscriptionResponse>;
155
+ export type DTOCreditsPrices = z.infer<typeof DTOCreditsPrices>;
156
+ export type DTOSubscriptionUpdatePreview = z.infer<typeof DTOSubscriptionUpdatePreview>;
157
+ export type DTOSubscriptionUpdatePreviewResponse = z.infer<typeof DTOSubscriptionUpdatePreviewResponse>;
158
+ export type DTOSubscriptionUpcomingChange = z.infer<typeof DTOSubscriptionUpcomingChange>;
159
+
160
+ //
161
+ // Inputs
162
+ //
163
+
164
+ export const DTOSubscriptionUpdateInput = z.object({
165
+ additionalCredits: z.number(),
166
+ builderSeats: z.number(),
167
+ fullSeats: z.number(),
168
+ });
169
+
170
+ export type DTOSubscriptionUpdateInput = z.infer<typeof DTOSubscriptionUpdateInput>;
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+
3
+ export const DTOTransferOwnershipPayload = z.object({
4
+ newOwnerId: z.string(),
5
+ });
6
+
7
+ export type DTOTransferOwnershipPayload = z.infer<typeof DTOTransferOwnershipPayload>;
@@ -0,0 +1,35 @@
1
+ import { WorkspaceUntypedData } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+
4
+ //
5
+ // Read
6
+ //
7
+
8
+ export const DTOWorkspaceUntypedData = WorkspaceUntypedData;
9
+
10
+ export const DTOWorkspaceUntypedDataListResponse = z.object({
11
+ data: DTOWorkspaceUntypedData.array(),
12
+ });
13
+
14
+ export const DTOWorkspaceUntypedDataResponse = z.object({
15
+ data: DTOWorkspaceUntypedData,
16
+ });
17
+
18
+ export type DTOWorkspaceUntypedData = z.infer<typeof DTOWorkspaceUntypedData>;
19
+ export type DTOWorkspaceUntypedDataListResponse = z.infer<typeof DTOWorkspaceUntypedDataListResponse>;
20
+ export type DTOWorkspaceUntypedDataResponse = z.infer<typeof DTOWorkspaceUntypedDataResponse>;
21
+
22
+ //
23
+ // Write
24
+ //
25
+
26
+ export const DTOWorkspaceUntypedDataCreatePayload = z.object({
27
+ value: z.unknown(),
28
+ });
29
+
30
+ export const DTOWorkspaceUntypedDataUpdatePayload = z.object({
31
+ value: z.unknown(),
32
+ });
33
+
34
+ export type DTOWorkspaceUntypedDataCreatePayload = z.infer<typeof DTOWorkspaceUntypedDataCreatePayload>;
35
+ export type DTOWorkspaceUntypedDataUpdatePayload = z.infer<typeof DTOWorkspaceUntypedDataUpdatePayload>;
@@ -0,0 +1,49 @@
1
+ import {
2
+ Subscription,
3
+ WorkspaceDefaultProjectAccessMode,
4
+ WorkspaceDefaultProjectRole,
5
+ WorkspaceProfile,
6
+ } from "@supernova-studio/model";
7
+ import { z } from "zod";
8
+ import { DTONpmRegistryConfig } from "./npm-registry";
9
+
10
+ //
11
+ // Read
12
+ //
13
+
14
+ export const DTOWorkspaceProfile = WorkspaceProfile;
15
+ export const DTOWorkspaceDefaultProjectAccessMode = WorkspaceDefaultProjectAccessMode;
16
+ export const DTOWorkspaceDefaultProjectRole = WorkspaceDefaultProjectRole;
17
+
18
+ export const DTOWorkspace = z.object({
19
+ id: z.string(),
20
+ profile: DTOWorkspaceProfile,
21
+ subscription: Subscription,
22
+ npmRegistry: DTONpmRegistryConfig.optional(),
23
+ aiFeaturesEnabled: z.boolean().default(false),
24
+ projectsEnabled: z.boolean().default(false),
25
+ defaultProjectAccessMode: DTOWorkspaceDefaultProjectAccessMode,
26
+ defaultProjectRole: DTOWorkspaceDefaultProjectRole,
27
+ aiAskFeaturesEnabled: z.boolean().default(false),
28
+ aiCustomInstruction: z.string().optional(),
29
+ });
30
+
31
+ export type DTOWorkspaceProfile = z.infer<typeof DTOWorkspaceProfile>;
32
+ export type DTOWorkspaceDefaultProjectAccessMode = z.infer<typeof DTOWorkspaceDefaultProjectAccessMode>;
33
+ export type DTOWorkspaceDefaultProjectRole = z.infer<typeof DTOWorkspaceDefaultProjectRole>;
34
+ export type DTOWorkspace = z.infer<typeof DTOWorkspace>;
35
+
36
+ //
37
+ // Write
38
+ //
39
+
40
+ export const DTOWorkspaceCreateInput = z.object({
41
+ name: z.string(),
42
+ });
43
+
44
+ export const DTOWorkspaceResponse = z.object({
45
+ workspace: DTOWorkspace,
46
+ });
47
+
48
+ export type DTOWorkspaceCreateInput = z.infer<typeof DTOWorkspaceCreateInput>;
49
+ export type DTOWorkspaceResponse = z.infer<typeof DTOWorkspaceResponse>;
@@ -0,0 +1,28 @@
1
+ import {
2
+ DTOAccessTokenCreatePayload,
3
+ DTOAccessTokenFullResponse,
4
+ DTOAccessTokenListResponse,
5
+ DTOAccessTokenResponse,
6
+ } from "../dto";
7
+ import { RequestExecutor } from "../transport/request-executor";
8
+
9
+ export class AuthTokensEndpoint {
10
+ constructor(private readonly requestExecutor: RequestExecutor) {}
11
+
12
+ list() {
13
+ return this.requestExecutor.json("/auth/tokens", DTOAccessTokenListResponse);
14
+ }
15
+
16
+ create(body: DTOAccessTokenCreatePayload) {
17
+ return this.requestExecutor.json("/auth/tokens", DTOAccessTokenFullResponse, {
18
+ method: "POST",
19
+ body,
20
+ });
21
+ }
22
+
23
+ delete(id: string) {
24
+ return this.requestExecutor.json(`/auth/tokens/${id}`, DTOAccessTokenResponse, {
25
+ method: "DELETE",
26
+ });
27
+ }
28
+ }
@@ -0,0 +1,16 @@
1
+ import { RequestExecutor } from "../../transport";
2
+ import { ExportersEndpoint } from "./exporters";
3
+ import { ExporterJobsEndpoint } from "./jobs";
4
+ import { PipelinesEndpoint } from "./pipelines";
5
+
6
+ export class CodegenEndpoint {
7
+ readonly exporters: ExportersEndpoint;
8
+ readonly pipelines: PipelinesEndpoint;
9
+ readonly jobs: ExporterJobsEndpoint;
10
+
11
+ constructor(private readonly requestExecutor: RequestExecutor) {
12
+ this.pipelines = new PipelinesEndpoint(requestExecutor);
13
+ this.exporters = new ExportersEndpoint(requestExecutor);
14
+ this.jobs = new ExporterJobsEndpoint(requestExecutor);
15
+ }
16
+ }
@@ -0,0 +1,37 @@
1
+ import { DTOExportJobResponse, DTOPipelineListQuery, DTOPipelineListResponse, DTOPipelineResponse } from "../../dto";
2
+ import { DTOPipelineCreateBody, DTOPipelineTriggerBody } from "../../payloads";
3
+ import { RequestExecutor } from "../../transport";
4
+
5
+ export class DesignSystemPipelinesEndpoint {
6
+ constructor(private readonly requestExecutor: RequestExecutor) {}
7
+
8
+ list(designSystemId: string, query: DTOPipelineListQuery) {
9
+ const queryWithStrings = Object.fromEntries(
10
+ Object.entries(query)
11
+ .filter(e => !!e[1])
12
+ .map(([k, v]) => [k, v.toString()])
13
+ );
14
+
15
+ return this.requestExecutor.json(`/design-systems/${designSystemId}/pipelines`, DTOPipelineListResponse, {
16
+ query: new URLSearchParams(queryWithStrings),
17
+ });
18
+ }
19
+
20
+ create(designSystemId: string, payload: DTOPipelineCreateBody) {
21
+ return this.requestExecutor.json(`/design-systems/${designSystemId}/pipelines`, DTOPipelineResponse, {
22
+ body: payload,
23
+ method: "POST",
24
+ });
25
+ }
26
+
27
+ trigger(designSystemId: string, pipelineId: string, payload: DTOPipelineTriggerBody) {
28
+ return this.requestExecutor.json(
29
+ `/design-systems/${designSystemId}/pipelines/${pipelineId}/trigger`,
30
+ DTOExportJobResponse,
31
+ {
32
+ body: payload,
33
+ method: "POST",
34
+ }
35
+ );
36
+ }
37
+ }
@@ -0,0 +1,54 @@
1
+ import { serializeQuery } from "../../../utils";
2
+ import { z } from "zod";
3
+ import {
4
+ DTOExporterCreateInput,
5
+ DTOExporterResponse,
6
+ DTOExporterListQuery,
7
+ DTOExporterListResponse,
8
+ DTOExporterDeprecationInput,
9
+ DTOExporter,
10
+ } from "../../dto";
11
+ import { RequestExecutor } from "../../transport";
12
+
13
+ export class ExportersEndpoint {
14
+ constructor(private readonly requestExecutor: RequestExecutor) {}
15
+
16
+ add(workspaceId: string, body: DTOExporterCreateInput) {
17
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterResponse, {
18
+ body,
19
+ method: "POST",
20
+ });
21
+ }
22
+
23
+ list(workspaceId: string, query?: DTOExporterListQuery) {
24
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterListResponse, {
25
+ query: query ? serializeQuery(query) : undefined,
26
+ });
27
+ }
28
+
29
+ get(workspaceId: string, exporterId: string) {
30
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters/${exporterId}`, DTOExporterResponse);
31
+ }
32
+
33
+ deprecate(workspaceId: string, exporterId: string, body: DTOExporterDeprecationInput) {
34
+ return this.requestExecutor.json(
35
+ `/codegen/workspaces/${workspaceId}/exporters/${exporterId}/deprecation`,
36
+ DTOExporter,
37
+ {
38
+ body,
39
+ method: "PUT",
40
+ }
41
+ );
42
+ }
43
+
44
+ pullChanges(workspaceId: string, exporterId: string) {
45
+ return this.requestExecutor.json(
46
+ `/codegen/workspaces/${workspaceId}/exporters/${exporterId}`,
47
+ DTOExporterResponse,
48
+ {
49
+ body: {},
50
+ method: "PUT",
51
+ }
52
+ );
53
+ }
54
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./codegen";
2
+ export * from "./ds-pipelines";
3
+ export * from "./exporters";
4
+ export * from "./jobs";
5
+ export * from "./pipelines";
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { DTOExportJobResponseLegacy } from "../../dto";
3
+ import { RequestExecutor } from "../../transport";
4
+
5
+ export class ExporterJobsEndpoint {
6
+ constructor(private readonly requestExecutor: RequestExecutor) {}
7
+
8
+ list(workspaceId: string) {
9
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z.any());
10
+ }
11
+
12
+ get(workspaceId: string, jobId: string) {
13
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);
14
+ }
15
+ }
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ import {
3
+ DTOExportJobResponse,
4
+ DTOPipelineListQuery,
5
+ DTOPipelineListResponse,
6
+ DTOPipelineResponse,
7
+ DTOWorkspaceStats,
8
+ } from "../../dto";
9
+ import { DTOPipelineCreateBody, DTOPipelineTriggerBody, DTOPipelineUpdateBody } from "../../payloads";
10
+ import { RequestExecutor } from "../../transport";
11
+
12
+ export class PipelinesEndpoint {
13
+ constructor(private readonly requestExecutor: RequestExecutor) {}
14
+
15
+ list(workspaceId: string, query: DTOPipelineListQuery) {
16
+ const queryWithStrings = Object.fromEntries(
17
+ Object.entries(query)
18
+ .filter(e => !!e[1])
19
+ .map(([k, v]) => [k, v.toString()])
20
+ );
21
+
22
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineListResponse, {
23
+ query: new URLSearchParams(queryWithStrings),
24
+ });
25
+ }
26
+
27
+ create(workspaceId: string, payload: DTOPipelineCreateBody) {
28
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineResponse, {
29
+ body: payload,
30
+ method: "POST",
31
+ });
32
+ }
33
+
34
+ update(designSystemId: string, pipelineId: string, payload: DTOPipelineUpdateBody) {
35
+ return this.requestExecutor.json(`/design-systems/${designSystemId}/pipelines/${pipelineId}`, DTOPipelineResponse, {
36
+ body: payload,
37
+ method: "PUT",
38
+ });
39
+ }
40
+
41
+ trigger(workspaceId: string, pipelineId: string, payload: DTOPipelineTriggerBody) {
42
+ return this.requestExecutor.json(
43
+ `/codegen/workspaces/${workspaceId}/pipelines/${pipelineId}/trigger`,
44
+ DTOExportJobResponse,
45
+ {
46
+ body: payload,
47
+ method: "POST",
48
+ }
49
+ );
50
+ }
51
+
52
+ stats(workspaceId: string) {
53
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/stats`, DTOWorkspaceStats);
54
+ }
55
+ }