@smarter.sh/api 0.0.0-stage → 1.0.2-alpha.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 (251) hide show
  1. package/LICENSE.txt +671 -0
  2. package/README.md +193 -2
  3. package/dist/client.d.ts +146 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +178 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/core/config.d.ts +148 -0
  8. package/dist/core/config.d.ts.map +1 -0
  9. package/dist/core/config.js +212 -0
  10. package/dist/core/config.js.map +1 -0
  11. package/dist/core/errors.d.ts +189 -0
  12. package/dist/core/errors.d.ts.map +1 -0
  13. package/dist/core/errors.js +187 -0
  14. package/dist/core/errors.js.map +1 -0
  15. package/dist/core/http.d.ts +207 -0
  16. package/dist/core/http.d.ts.map +1 -0
  17. package/dist/core/http.js +456 -0
  18. package/dist/core/http.js.map +1 -0
  19. package/dist/core/log.d.ts +62 -0
  20. package/dist/core/log.d.ts.map +1 -0
  21. package/dist/core/log.js +68 -0
  22. package/dist/core/log.js.map +1 -0
  23. package/dist/core/sse.d.ts +38 -0
  24. package/dist/core/sse.d.ts.map +1 -0
  25. package/dist/core/sse.js +79 -0
  26. package/dist/core/sse.js.map +1 -0
  27. package/dist/core/typing.d.ts +21 -0
  28. package/dist/core/typing.d.ts.map +1 -0
  29. package/dist/core/typing.js +13 -0
  30. package/dist/core/typing.js.map +1 -0
  31. package/dist/index.d.ts +51 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +51 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/models/account.d.ts +112 -0
  36. package/dist/models/account.d.ts.map +1 -0
  37. package/dist/models/account.js +55 -0
  38. package/dist/models/account.js.map +1 -0
  39. package/dist/models/base.d.ts +99 -0
  40. package/dist/models/base.d.ts.map +1 -0
  41. package/dist/models/base.js +111 -0
  42. package/dist/models/base.js.map +1 -0
  43. package/dist/models/chat.d.ts +2243 -0
  44. package/dist/models/chat.d.ts.map +1 -0
  45. package/dist/models/chat.js +451 -0
  46. package/dist/models/chat.js.map +1 -0
  47. package/dist/models/guardrail.d.ts +109 -0
  48. package/dist/models/guardrail.d.ts.map +1 -0
  49. package/dist/models/guardrail.js +68 -0
  50. package/dist/models/guardrail.js.map +1 -0
  51. package/dist/models/journal.d.ts +159 -0
  52. package/dist/models/journal.d.ts.map +1 -0
  53. package/dist/models/journal.js +115 -0
  54. package/dist/models/journal.js.map +1 -0
  55. package/dist/models/llmclient.d.ts +183 -0
  56. package/dist/models/llmclient.d.ts.map +1 -0
  57. package/dist/models/llmclient.js +105 -0
  58. package/dist/models/llmclient.js.map +1 -0
  59. package/dist/models/llmhost.d.ts +121 -0
  60. package/dist/models/llmhost.d.ts.map +1 -0
  61. package/dist/models/llmhost.js +79 -0
  62. package/dist/models/llmhost.js.map +1 -0
  63. package/dist/models/manifest.d.ts +211 -0
  64. package/dist/models/manifest.d.ts.map +1 -0
  65. package/dist/models/manifest.js +290 -0
  66. package/dist/models/manifest.js.map +1 -0
  67. package/dist/models/mcpclient.d.ts +99 -0
  68. package/dist/models/mcpclient.d.ts.map +1 -0
  69. package/dist/models/mcpclient.js +65 -0
  70. package/dist/models/mcpclient.js.map +1 -0
  71. package/dist/models/misc.d.ts +232 -0
  72. package/dist/models/misc.d.ts.map +1 -0
  73. package/dist/models/misc.js +110 -0
  74. package/dist/models/misc.js.map +1 -0
  75. package/dist/models/platform.d.ts +88 -0
  76. package/dist/models/platform.d.ts.map +1 -0
  77. package/dist/models/platform.js +35 -0
  78. package/dist/models/platform.js.map +1 -0
  79. package/dist/models/plugin.d.ts +36 -0
  80. package/dist/models/plugin.d.ts.map +1 -0
  81. package/dist/models/plugin.js +16 -0
  82. package/dist/models/plugin.js.map +1 -0
  83. package/dist/models/react.d.ts +104 -0
  84. package/dist/models/react.d.ts.map +1 -0
  85. package/dist/models/react.js +136 -0
  86. package/dist/models/react.js.map +1 -0
  87. package/dist/models/sam/account.d.ts +155 -0
  88. package/dist/models/sam/account.d.ts.map +1 -0
  89. package/dist/models/sam/account.js +7 -0
  90. package/dist/models/sam/account.js.map +1 -0
  91. package/dist/models/sam/apiconnection.d.ts +147 -0
  92. package/dist/models/sam/apiconnection.d.ts.map +1 -0
  93. package/dist/models/sam/apiconnection.js +7 -0
  94. package/dist/models/sam/apiconnection.js.map +1 -0
  95. package/dist/models/sam/apiplugin.d.ts +278 -0
  96. package/dist/models/sam/apiplugin.d.ts.map +1 -0
  97. package/dist/models/sam/apiplugin.js +7 -0
  98. package/dist/models/sam/apiplugin.js.map +1 -0
  99. package/dist/models/sam/budget.d.ts +219 -0
  100. package/dist/models/sam/budget.d.ts.map +1 -0
  101. package/dist/models/sam/budget.js +7 -0
  102. package/dist/models/sam/budget.js.map +1 -0
  103. package/dist/models/sam/customdomain.d.ts +139 -0
  104. package/dist/models/sam/customdomain.d.ts.map +1 -0
  105. package/dist/models/sam/customdomain.js +7 -0
  106. package/dist/models/sam/customdomain.js.map +1 -0
  107. package/dist/models/sam/guardrail.d.ts +222 -0
  108. package/dist/models/sam/guardrail.d.ts.map +1 -0
  109. package/dist/models/sam/guardrail.js +7 -0
  110. package/dist/models/sam/guardrail.js.map +1 -0
  111. package/dist/models/sam/imagesearchplugin.d.ts +235 -0
  112. package/dist/models/sam/imagesearchplugin.d.ts.map +1 -0
  113. package/dist/models/sam/imagesearchplugin.js +7 -0
  114. package/dist/models/sam/imagesearchplugin.js.map +1 -0
  115. package/dist/models/sam/index.d.ts +104 -0
  116. package/dist/models/sam/index.d.ts.map +1 -0
  117. package/dist/models/sam/index.js +50 -0
  118. package/dist/models/sam/index.js.map +1 -0
  119. package/dist/models/sam/llmclient.d.ts +490 -0
  120. package/dist/models/sam/llmclient.d.ts.map +1 -0
  121. package/dist/models/sam/llmclient.js +7 -0
  122. package/dist/models/sam/llmclient.js.map +1 -0
  123. package/dist/models/sam/llmhost.d.ts +429 -0
  124. package/dist/models/sam/llmhost.d.ts.map +1 -0
  125. package/dist/models/sam/llmhost.js +7 -0
  126. package/dist/models/sam/llmhost.js.map +1 -0
  127. package/dist/models/sam/llmhostcompute.d.ts +221 -0
  128. package/dist/models/sam/llmhostcompute.d.ts.map +1 -0
  129. package/dist/models/sam/llmhostcompute.js +7 -0
  130. package/dist/models/sam/llmhostcompute.js.map +1 -0
  131. package/dist/models/sam/mcpclient.d.ts +195 -0
  132. package/dist/models/sam/mcpclient.d.ts.map +1 -0
  133. package/dist/models/sam/mcpclient.js +7 -0
  134. package/dist/models/sam/mcpclient.js.map +1 -0
  135. package/dist/models/sam/orchestrator.d.ts +163 -0
  136. package/dist/models/sam/orchestrator.d.ts.map +1 -0
  137. package/dist/models/sam/orchestrator.js +7 -0
  138. package/dist/models/sam/orchestrator.js.map +1 -0
  139. package/dist/models/sam/plugin.d.ts +163 -0
  140. package/dist/models/sam/plugin.d.ts.map +1 -0
  141. package/dist/models/sam/plugin.js +7 -0
  142. package/dist/models/sam/plugin.js.map +1 -0
  143. package/dist/models/sam/prompt.d.ts +116 -0
  144. package/dist/models/sam/prompt.d.ts.map +1 -0
  145. package/dist/models/sam/prompt.js +7 -0
  146. package/dist/models/sam/prompt.js.map +1 -0
  147. package/dist/models/sam/provider.d.ts +195 -0
  148. package/dist/models/sam/provider.d.ts.map +1 -0
  149. package/dist/models/sam/provider.js +7 -0
  150. package/dist/models/sam/provider.js.map +1 -0
  151. package/dist/models/sam/proxy.d.ts +163 -0
  152. package/dist/models/sam/proxy.d.ts.map +1 -0
  153. package/dist/models/sam/proxy.js +7 -0
  154. package/dist/models/sam/proxy.js.map +1 -0
  155. package/dist/models/sam/schemas.d.ts +8 -0
  156. package/dist/models/sam/schemas.d.ts.map +1 -0
  157. package/dist/models/sam/schemas.js +6059 -0
  158. package/dist/models/sam/schemas.js.map +1 -0
  159. package/dist/models/sam/secret.d.ts +123 -0
  160. package/dist/models/sam/secret.d.ts.map +1 -0
  161. package/dist/models/sam/secret.js +7 -0
  162. package/dist/models/sam/secret.js.map +1 -0
  163. package/dist/models/sam/skillplugin.d.ts +181 -0
  164. package/dist/models/sam/skillplugin.d.ts.map +1 -0
  165. package/dist/models/sam/skillplugin.js +7 -0
  166. package/dist/models/sam/skillplugin.js.map +1 -0
  167. package/dist/models/sam/smarterauthtoken.d.ts +115 -0
  168. package/dist/models/sam/smarterauthtoken.d.ts.map +1 -0
  169. package/dist/models/sam/smarterauthtoken.js +7 -0
  170. package/dist/models/sam/smarterauthtoken.js.map +1 -0
  171. package/dist/models/sam/sqlconnection.d.ts +187 -0
  172. package/dist/models/sam/sqlconnection.d.ts.map +1 -0
  173. package/dist/models/sam/sqlconnection.js +7 -0
  174. package/dist/models/sam/sqlconnection.js.map +1 -0
  175. package/dist/models/sam/sqlplugin.d.ts +232 -0
  176. package/dist/models/sam/sqlplugin.d.ts.map +1 -0
  177. package/dist/models/sam/sqlplugin.js +7 -0
  178. package/dist/models/sam/sqlplugin.js.map +1 -0
  179. package/dist/models/sam/user.d.ts +135 -0
  180. package/dist/models/sam/user.d.ts.map +1 -0
  181. package/dist/models/sam/user.js +7 -0
  182. package/dist/models/sam/user.js.map +1 -0
  183. package/dist/models/sam/vectorsearch.d.ts +150 -0
  184. package/dist/models/sam/vectorsearch.d.ts.map +1 -0
  185. package/dist/models/sam/vectorsearch.js +7 -0
  186. package/dist/models/sam/vectorsearch.js.map +1 -0
  187. package/dist/models/sam/vectorstore.d.ts +291 -0
  188. package/dist/models/sam/vectorstore.d.ts.map +1 -0
  189. package/dist/models/sam/vectorstore.js +7 -0
  190. package/dist/models/sam/vectorstore.js.map +1 -0
  191. package/dist/models/sam/websearchplugin.d.ts +229 -0
  192. package/dist/models/sam/websearchplugin.d.ts.map +1 -0
  193. package/dist/models/sam/websearchplugin.js +7 -0
  194. package/dist/models/sam/websearchplugin.js.map +1 -0
  195. package/dist/models/vectorstore.d.ts +165 -0
  196. package/dist/models/vectorstore.d.ts.map +1 -0
  197. package/dist/models/vectorstore.js +90 -0
  198. package/dist/models/vectorstore.js.map +1 -0
  199. package/dist/resources/accounts.d.ts +107 -0
  200. package/dist/resources/accounts.d.ts.map +1 -0
  201. package/dist/resources/accounts.js +84 -0
  202. package/dist/resources/accounts.js.map +1 -0
  203. package/dist/resources/base.d.ts +127 -0
  204. package/dist/resources/base.d.ts.map +1 -0
  205. package/dist/resources/base.js +139 -0
  206. package/dist/resources/base.js.map +1 -0
  207. package/dist/resources/catalog.d.ts +209 -0
  208. package/dist/resources/catalog.d.ts.map +1 -0
  209. package/dist/resources/catalog.js +124 -0
  210. package/dist/resources/catalog.js.map +1 -0
  211. package/dist/resources/guardrails.d.ts +82 -0
  212. package/dist/resources/guardrails.d.ts.map +1 -0
  213. package/dist/resources/guardrails.js +46 -0
  214. package/dist/resources/guardrails.js.map +1 -0
  215. package/dist/resources/history.d.ts +97 -0
  216. package/dist/resources/history.d.ts.map +1 -0
  217. package/dist/resources/history.js +109 -0
  218. package/dist/resources/history.js.map +1 -0
  219. package/dist/resources/llmclients.d.ts +348 -0
  220. package/dist/resources/llmclients.d.ts.map +1 -0
  221. package/dist/resources/llmclients.js +367 -0
  222. package/dist/resources/llmclients.js.map +1 -0
  223. package/dist/resources/llmhosts.d.ts +146 -0
  224. package/dist/resources/llmhosts.d.ts.map +1 -0
  225. package/dist/resources/llmhosts.js +128 -0
  226. package/dist/resources/llmhosts.js.map +1 -0
  227. package/dist/resources/manifests.d.ts +153 -0
  228. package/dist/resources/manifests.d.ts.map +1 -0
  229. package/dist/resources/manifests.js +203 -0
  230. package/dist/resources/manifests.js.map +1 -0
  231. package/dist/resources/mcpclients.d.ts +90 -0
  232. package/dist/resources/mcpclients.d.ts.map +1 -0
  233. package/dist/resources/mcpclients.js +57 -0
  234. package/dist/resources/mcpclients.js.map +1 -0
  235. package/dist/resources/providers.d.ts +33 -0
  236. package/dist/resources/providers.d.ts.map +1 -0
  237. package/dist/resources/providers.js +39 -0
  238. package/dist/resources/providers.js.map +1 -0
  239. package/dist/resources/proxies.d.ts +61 -0
  240. package/dist/resources/proxies.d.ts.map +1 -0
  241. package/dist/resources/proxies.js +57 -0
  242. package/dist/resources/proxies.js.map +1 -0
  243. package/dist/resources/vectorstores.d.ts +194 -0
  244. package/dist/resources/vectorstores.d.ts.map +1 -0
  245. package/dist/resources/vectorstores.js +200 -0
  246. package/dist/resources/vectorstores.js.map +1 -0
  247. package/dist/version.d.ts +3 -0
  248. package/dist/version.d.ts.map +1 -0
  249. package/dist/version.js +5 -0
  250. package/dist/version.js.map +1 -0
  251. package/package.json +81 -4
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Models of the Smarter platform's Django-React integration: a React app's Vite manifest, and the assets that a template includes.
3
+ *
4
+ * The platform's web console pages are React apps that Django hosts. These schemas are a copy of the
5
+ * platform's `smarter.lib.django.templatetags.smarter_react_contract`, as the Python SDK's
6
+ * `smarter.models.react` is, so that tools that build or check React apps for a Smarter platform can
7
+ * use them without the platform.
8
+ *
9
+ * - {@link ViteManifest} reads a Vite-generated React `manifest.json`: its chunks keyed by source
10
+ * path, and Smarter's own `_custom` build information.
11
+ * - {@link ReactAppAssets} is what every `<app>_react_assets` template tag returns: the ordered JS
12
+ * and CSS files that a Django template includes for a React app.
13
+ *
14
+ * The manifest is a third-party shape: {@link ViteManifestChunk} declares the fields that Vite
15
+ * documents, and keeps the others, which newer Vite (or Rolldown) versions add.
16
+ */
17
+ import { z } from "zod";
18
+ /** The kinds of asset that a React app's entry point loads. */
19
+ export type ReactAssetType = "js" | "css";
20
+ /** The key of the build information that each React package's `vite.config.ts` adds to its manifest.json. */
21
+ export declare const BUILD_INFO_KEY = "_custom";
22
+ /** One entry of a Vite-generated `manifest.json`: a chunk, or a static asset. See https://vite.dev/guide/backend-integration. */
23
+ export declare const ViteManifestChunk: z.ZodObject<{
24
+ file: z.ZodString;
25
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ names: z.ZodDefault<z.ZodArray<z.ZodString>>;
27
+ src: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ isEntry: z.ZodDefault<z.ZodBoolean>;
29
+ isDynamicEntry: z.ZodDefault<z.ZodBoolean>;
30
+ imports: z.ZodDefault<z.ZodArray<z.ZodString>>;
31
+ dynamicImports: z.ZodDefault<z.ZodArray<z.ZodString>>;
32
+ css: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
+ assets: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
+ }, z.core.$loose>;
35
+ export type ViteManifestChunk = z.infer<typeof ViteManifestChunk>;
36
+ /** The build information that each React package's `vite.config.ts` adds to its manifest.json, as `_custom`. */
37
+ export declare const ReactAppBuildInfo: z.ZodObject<{
38
+ buildTime: z.ZodString;
39
+ version: z.ZodString;
40
+ buildEnv: z.ZodString;
41
+ }, z.core.$strict>;
42
+ export type ReactAppBuildInfo = z.infer<typeof ReactAppBuildInfo>;
43
+ /** The ordered JS and CSS files of a React app's entry point, which a Django template includes. */
44
+ export declare const ReactAppAssets: z.ZodObject<{
45
+ js: z.ZodDefault<z.ZodArray<z.ZodString>>;
46
+ css: z.ZodDefault<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$strict>;
48
+ export type ReactAppAssets = z.infer<typeof ReactAppAssets>;
49
+ /**
50
+ * A React app's Vite-generated `manifest.json`: its chunks, keyed by source path, and Smarter's build information.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const manifest = ViteManifest.parse(JSON.parse(readFileSync("manifest.json", "utf-8")));
55
+ * const entry = manifest.entryKey();
56
+ * if (entry) console.log(manifest.collectAssets(entry, "js"));
57
+ * ```
58
+ */
59
+ export declare class ViteManifest {
60
+ /** The manifest's chunks, keyed by source path. */
61
+ readonly chunks: Record<string, ViteManifestChunk>;
62
+ /** The `_custom` build information, if the package's vite.config.ts adds it. */
63
+ readonly buildInfo: ReactAppBuildInfo | null;
64
+ /**
65
+ * @param chunks - The chunks, keyed by source path.
66
+ * @param buildInfo - The build information.
67
+ */
68
+ constructor(chunks: Record<string, ViteManifestChunk>, buildInfo?: ReactAppBuildInfo | null);
69
+ /**
70
+ * Validate a manifest.json's content, and split its `_custom` entry from its chunks.
71
+ *
72
+ * @param data - The parsed manifest.json.
73
+ * @returns The manifest.
74
+ * @throws `ZodError` If an entry is not a chunk.
75
+ */
76
+ static parse(data: unknown): ViteManifest;
77
+ /**
78
+ * The manifest in the shape of manifest.json, with the build information as its `_custom` entry.
79
+ *
80
+ * @returns The chunks, keyed by source path, and `_custom`.
81
+ */
82
+ toJSON(): Record<string, ViteManifestChunk | ReactAppBuildInfo>;
83
+ /** Whether the manifest has any chunks. */
84
+ get isEmpty(): boolean;
85
+ /**
86
+ * The key of the manifest's entry point, the first chunk with `"isEntry": true`.
87
+ *
88
+ * @returns The entry point's key, or null if the manifest has no entry point.
89
+ */
90
+ entryKey(): string | null;
91
+ /**
92
+ * Recursively collect the JS or CSS files of a chunk and of its static imports.
93
+ *
94
+ * A chunk's own files come first, followed by those of each of its `imports`, depth first, in the
95
+ * order they are listed. Each chunk is visited once, so circular imports terminate.
96
+ *
97
+ * @param key - The manifest key of the chunk to collect assets for.
98
+ * @param assetType - `js` for the chunks' `file`, `css` for their `css` files.
99
+ * @param seen - The keys already visited, used by the recursion.
100
+ * @returns The asset file paths, relative to the app's static directory.
101
+ */
102
+ collectAssets(key: string, assetType: ReactAssetType, seen?: Set<string>): string[];
103
+ }
104
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/models/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,KAAK,CAAC;AAE1C,6GAA6G;AAC7G,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,iIAAiI;AACjI,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAqB5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,gHAAgH;AAChH,eAAO,MAAM,iBAAiB;;;;kBAO5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,mGAAmG;AACnG,eAAO,MAAM,cAAc;;;kBAKzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;;;;GASG;AACH,qBAAa,YAAY;IACvB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACnD,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE7C;;;OAGG;gBACS,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,SAAS,GAAE,iBAAiB,GAAG,IAAW;IAKjG;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY;IASzC;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;IAI/D,2CAA2C;IAC3C,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;OAIG;IACH,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;;;;;;;;;OAUG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,cAAoB,GAAG,MAAM,EAAE;CAQ1F"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Models of the Smarter platform's Django-React integration: a React app's Vite manifest, and the assets that a template includes.
3
+ *
4
+ * The platform's web console pages are React apps that Django hosts. These schemas are a copy of the
5
+ * platform's `smarter.lib.django.templatetags.smarter_react_contract`, as the Python SDK's
6
+ * `smarter.models.react` is, so that tools that build or check React apps for a Smarter platform can
7
+ * use them without the platform.
8
+ *
9
+ * - {@link ViteManifest} reads a Vite-generated React `manifest.json`: its chunks keyed by source
10
+ * path, and Smarter's own `_custom` build information.
11
+ * - {@link ReactAppAssets} is what every `<app>_react_assets` template tag returns: the ordered JS
12
+ * and CSS files that a Django template includes for a React app.
13
+ *
14
+ * The manifest is a third-party shape: {@link ViteManifestChunk} declares the fields that Vite
15
+ * documents, and keeps the others, which newer Vite (or Rolldown) versions add.
16
+ */
17
+ import { z } from "zod";
18
+ /** The key of the build information that each React package's `vite.config.ts` adds to its manifest.json. */
19
+ export const BUILD_INFO_KEY = "_custom";
20
+ /** One entry of a Vite-generated `manifest.json`: a chunk, or a static asset. See https://vite.dev/guide/backend-integration. */
21
+ export const ViteManifestChunk = z.looseObject({
22
+ /** The output file of this chunk, relative to the app's static directory. */
23
+ file: z.string(),
24
+ /** The chunk's name. */
25
+ name: z.string().nullish(),
26
+ /** The names of a static asset. */
27
+ names: z.array(z.string()).default([]),
28
+ /** The chunk's source path. */
29
+ src: z.string().nullish(),
30
+ /** Whether this chunk is an entry point. */
31
+ isEntry: z.boolean().default(false),
32
+ /** Whether this chunk is a dynamic entry point. */
33
+ isDynamicEntry: z.boolean().default(false),
34
+ /** The manifest keys of statically imported chunks. */
35
+ imports: z.array(z.string()).default([]),
36
+ /** The manifest keys of dynamically imported chunks. */
37
+ dynamicImports: z.array(z.string()).default([]),
38
+ /** The CSS files that this chunk loads. */
39
+ css: z.array(z.string()).default([]),
40
+ /** The other static files that this chunk references. */
41
+ assets: z.array(z.string()).default([]),
42
+ });
43
+ /** The build information that each React package's `vite.config.ts` adds to its manifest.json, as `_custom`. */
44
+ export const ReactAppBuildInfo = z.strictObject({
45
+ /** When the app was built. */
46
+ buildTime: z.string(),
47
+ /** The version of the app's npm package. */
48
+ version: z.string(),
49
+ /** The build's NODE_ENV, e.g. production. */
50
+ buildEnv: z.string(),
51
+ });
52
+ /** The ordered JS and CSS files of a React app's entry point, which a Django template includes. */
53
+ export const ReactAppAssets = z.strictObject({
54
+ /** The JS files, the entry point's first. */
55
+ js: z.array(z.string()).default([]),
56
+ /** The CSS files, the entry point's first. */
57
+ css: z.array(z.string()).default([]),
58
+ });
59
+ /**
60
+ * A React app's Vite-generated `manifest.json`: its chunks, keyed by source path, and Smarter's build information.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const manifest = ViteManifest.parse(JSON.parse(readFileSync("manifest.json", "utf-8")));
65
+ * const entry = manifest.entryKey();
66
+ * if (entry) console.log(manifest.collectAssets(entry, "js"));
67
+ * ```
68
+ */
69
+ export class ViteManifest {
70
+ /** The manifest's chunks, keyed by source path. */
71
+ chunks;
72
+ /** The `_custom` build information, if the package's vite.config.ts adds it. */
73
+ buildInfo;
74
+ /**
75
+ * @param chunks - The chunks, keyed by source path.
76
+ * @param buildInfo - The build information.
77
+ */
78
+ constructor(chunks, buildInfo = null) {
79
+ this.chunks = chunks;
80
+ this.buildInfo = buildInfo;
81
+ }
82
+ /**
83
+ * Validate a manifest.json's content, and split its `_custom` entry from its chunks.
84
+ *
85
+ * @param data - The parsed manifest.json.
86
+ * @returns The manifest.
87
+ * @throws `ZodError` If an entry is not a chunk.
88
+ */
89
+ static parse(data) {
90
+ const entries = z.record(z.string(), z.unknown()).parse(data);
91
+ const { [BUILD_INFO_KEY]: buildInfo, ...chunks } = entries;
92
+ return new ViteManifest(z.record(z.string(), ViteManifestChunk).parse(chunks), buildInfo === undefined || buildInfo === null ? null : ReactAppBuildInfo.parse(buildInfo));
93
+ }
94
+ /**
95
+ * The manifest in the shape of manifest.json, with the build information as its `_custom` entry.
96
+ *
97
+ * @returns The chunks, keyed by source path, and `_custom`.
98
+ */
99
+ toJSON() {
100
+ return this.buildInfo === null ? { ...this.chunks } : { ...this.chunks, [BUILD_INFO_KEY]: this.buildInfo };
101
+ }
102
+ /** Whether the manifest has any chunks. */
103
+ get isEmpty() {
104
+ return Object.keys(this.chunks).length === 0;
105
+ }
106
+ /**
107
+ * The key of the manifest's entry point, the first chunk with `"isEntry": true`.
108
+ *
109
+ * @returns The entry point's key, or null if the manifest has no entry point.
110
+ */
111
+ entryKey() {
112
+ return Object.entries(this.chunks).find(([, chunk]) => chunk.isEntry)?.[0] ?? null;
113
+ }
114
+ /**
115
+ * Recursively collect the JS or CSS files of a chunk and of its static imports.
116
+ *
117
+ * A chunk's own files come first, followed by those of each of its `imports`, depth first, in the
118
+ * order they are listed. Each chunk is visited once, so circular imports terminate.
119
+ *
120
+ * @param key - The manifest key of the chunk to collect assets for.
121
+ * @param assetType - `js` for the chunks' `file`, `css` for their `css` files.
122
+ * @param seen - The keys already visited, used by the recursion.
123
+ * @returns The asset file paths, relative to the app's static directory.
124
+ */
125
+ collectAssets(key, assetType, seen = new Set()) {
126
+ const chunk = this.chunks[key];
127
+ if (seen.has(key) || chunk === undefined)
128
+ return [];
129
+ seen.add(key);
130
+ const assets = assetType === "js" ? [chunk.file] : [...chunk.css];
131
+ for (const imported of chunk.imports)
132
+ assets.push(...this.collectAssets(imported, assetType, seen));
133
+ return assets;
134
+ }
135
+ }
136
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/models/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6GAA6G;AAC7G,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC,iIAAiI;AACjI,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC7C,6EAA6E;IAC7E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,wBAAwB;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC1B,mCAAmC;IACnC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,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AI,OAAO;QACT,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACN,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACrF,CAAC;IAED;;;;;;;;;;OAUG;IACH,aAAa,CAAC,GAAW,EAAE,SAAyB,EAAE,OAAO,IAAI,GAAG,EAAU;QAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAClE,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,OAAO;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;QACpG,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * The SAM type of the `Account` kind, generated from the Smarter platform's JSON Schema.
3
+ *
4
+ * Do not edit: run `make sam-models`. See `src/models/sam/index.ts`.
5
+ */
6
+ /**
7
+ * Smarter API Manifest - Account
8
+ */
9
+ export interface SAMAccount {
10
+ /**
11
+ * apiVersion[String]: Required. The API version of the AbstractSAMBase.
12
+ */
13
+ apiVersion: string;
14
+ /**
15
+ * kind[String]: Required. The kind of resource described by the manifest.
16
+ */
17
+ kind: string;
18
+ metadata: SAMAccountMetadata;
19
+ spec: SAMAccountSpec;
20
+ /**
21
+ * Account.status[obj]: Optional, Read-only. Stateful status information about the Account.
22
+ */
23
+ status?: SAMAccountStatus | null;
24
+ [k: string]: unknown | undefined;
25
+ }
26
+ /**
27
+ * Account.metadata[obj]: Required, the Account metadata.
28
+ */
29
+ export interface SAMAccountMetadata {
30
+ /**
31
+ * Account.metadata.accountNumber[str]. Your preassigned 12-digit account number for your Smarter Account in the format '####-####-####'. Read only.
32
+ */
33
+ accountNumber?: string | null;
34
+ /**
35
+ * Annotations, as in Kubernetes: a map of keys to string values that clients and integrations attach to a resource for their own purposes, e.g. to associate it with a resource in another system. A key is an optional DNS-subdomain prefix that names its owner, then a slash and a name of one or more slash-separated segments, e.g. 'acme.com/crm-account-id'. The prefix 'smarter.sh' and its subdomains are reserved for the Smarter platform. Values are strings: unquoted YAML scalars such as true, 42 or dates are converted to strings, and structured data belongs in a JSON string. All annotations together are limited to 256 KiB. The list of one-key maps of older manifests, e.g. [{'acme.com/crm-account-id': 'A-10042'}], is also accepted.
36
+ */
37
+ annotations?: {
38
+ [k: string]: string | undefined;
39
+ } | null;
40
+ /**
41
+ * The description for this resource. Be brief. Keep it under 255 characters.
42
+ */
43
+ description: string | null;
44
+ /**
45
+ * The camelCase name of the manifest resource
46
+ */
47
+ name: string;
48
+ /**
49
+ * The tags of the manifest. Used for generic resource categorization and search. Example: ['tag1', 'tag2']
50
+ */
51
+ tags?: string[] | null;
52
+ /**
53
+ * The semantic version of the manifest. Example: 0.1.0
54
+ */
55
+ version: string | null;
56
+ [k: string]: unknown | undefined;
57
+ }
58
+ /**
59
+ * Account.spec[obj]: Required, the Account specification.
60
+ */
61
+ export interface SAMAccountSpec {
62
+ config: SAMAccountSpecConfig;
63
+ [k: string]: unknown | undefined;
64
+ }
65
+ /**
66
+ * Account.spec.config[object]. The configuration for the Account.
67
+ */
68
+ export interface SAMAccountSpecConfig {
69
+ /**
70
+ * Account.spec.configuration.address1[str]. The primary address for the Account.
71
+ */
72
+ address1?: string | null;
73
+ /**
74
+ * Account.spec.configuration.address2[str]. Optional. The secondary address for the Account.
75
+ */
76
+ address2?: string | null;
77
+ /**
78
+ * Account.spec.configuration.city[str]. The city for the Account.
79
+ */
80
+ city?: string | null;
81
+ /**
82
+ * Account.spec.configuration.companyName[str]. The legal entity of your Smarter Account for invoicing and legal correspondence.
83
+ */
84
+ companyName: string;
85
+ /**
86
+ * Account.spec.configuration.country[str]. The ISO 3166 country code for the Account. Default: USA.
87
+ */
88
+ country?: string;
89
+ /**
90
+ * Account.spec.configuration.currency[str]. The primary ISO 4217 currency for the Account. Default: USD.
91
+ */
92
+ currency?: string;
93
+ /**
94
+ * Account.spec.configuration.language[str]. The primary BCP 47 language tag for the Account. Default: en-US.
95
+ */
96
+ language?: string;
97
+ /**
98
+ * Account.spec.configuration.phoneNumber[str]. The primary phone number for the Account.
99
+ */
100
+ phoneNumber?: string | null;
101
+ /**
102
+ * Account.spec.configuration.postalCode[str]. The postal code for the Account.
103
+ */
104
+ postalCode?: string | null;
105
+ /**
106
+ * Account.spec.configuration.state[str]. The state for the Account.
107
+ */
108
+ state?: string | null;
109
+ /**
110
+ * Account.spec.configuration.timezone[str]. The primary IANA timezone for the Account. Default: America/New_York.
111
+ */
112
+ timezone?: string;
113
+ [k: string]: unknown | undefined;
114
+ }
115
+ /**
116
+ * Smarter API Account Manifest - Status class.
117
+ */
118
+ export interface SAMAccountStatus {
119
+ /**
120
+ * Account.status.adminAccount: The designated Smarter admin user for this Account. Read only.
121
+ */
122
+ adminAccount: string;
123
+ /**
124
+ * The date in which this resource was created. Read only.
125
+ */
126
+ created: string;
127
+ /**
128
+ * dependencies[List]: The resources that depend on this resource, and that must be deleted, or stop referring to it, before it can be deleted. Lists only the resources that you can read. Read only.
129
+ */
130
+ dependencies?: SAMDependency[] | null;
131
+ /**
132
+ * The date in which this resource was most recently changed. Read only.
133
+ */
134
+ modified: string;
135
+ /**
136
+ * recordLocator[String]: An optional identifier used to locate the resource record associated with this manifest. Read only.
137
+ */
138
+ recordLocator: string;
139
+ [k: string]: unknown | undefined;
140
+ }
141
+ /**
142
+ * A resource that depends on the resource that a manifest describes.
143
+ */
144
+ export interface SAMDependency {
145
+ /**
146
+ * kind[String]: The SAM kind of the resource that depends on this resource, e.g. LLMClient. Read only.
147
+ */
148
+ kind: string;
149
+ /**
150
+ * name[String]: The name of the resource that depends on this resource. Read only.
151
+ */
152
+ name: string;
153
+ [k: string]: unknown | undefined;
154
+ }
155
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/models/sam/account.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACjC,GAAG,IAAI,CAAC;IACT;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB;;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ACtB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The SAM type of the `Account` kind, generated from the Smarter platform's JSON Schema.
3
+ *
4
+ * Do not edit: run `make sam-models`. See `src/models/sam/index.ts`.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/models/sam/account.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * The SAM type of the `ApiConnection` kind, generated from the Smarter platform's JSON Schema.
3
+ *
4
+ * Do not edit: run `make sam-models`. See `src/models/sam/index.ts`.
5
+ */
6
+ /**
7
+ * Smarter API Connection Manifest - ApiConnection Model
8
+ */
9
+ export interface SAMApiConnection {
10
+ /**
11
+ * apiVersion[String]: Required. The API version of the AbstractSAMBase.
12
+ */
13
+ apiVersion: string;
14
+ /**
15
+ * kind[String]: Required. The kind of resource described by the manifest.
16
+ */
17
+ kind: string;
18
+ metadata: SAMConnectionCommonMetadata;
19
+ spec: SAMApiConnectionSpec;
20
+ /**
21
+ * Connection.status[obj]: Optional, Read-only. Stateful status information about the Connection.
22
+ */
23
+ status?: SAMConnectionCommonStatus | null;
24
+ [k: string]: unknown | undefined;
25
+ }
26
+ /**
27
+ * Connection.metadata[obj]: Required, the Connection metadata.
28
+ */
29
+ export interface SAMConnectionCommonMetadata {
30
+ /**
31
+ * Annotations, as in Kubernetes: a map of keys to string values that clients and integrations attach to a resource for their own purposes, e.g. to associate it with a resource in another system. A key is an optional DNS-subdomain prefix that names its owner, then a slash and a name of one or more slash-separated segments, e.g. 'acme.com/crm-account-id'. The prefix 'smarter.sh' and its subdomains are reserved for the Smarter platform. Values are strings: unquoted YAML scalars such as true, 42 or dates are converted to strings, and structured data belongs in a JSON string. All annotations together are limited to 256 KiB. The list of one-key maps of older manifests, e.g. [{'acme.com/crm-account-id': 'A-10042'}], is also accepted.
32
+ */
33
+ annotations?: {
34
+ [k: string]: string | undefined;
35
+ } | null;
36
+ /**
37
+ * The description for this resource. Be brief. Keep it under 255 characters.
38
+ */
39
+ description: string | null;
40
+ /**
41
+ * The camelCase name of the manifest resource
42
+ */
43
+ name: string;
44
+ /**
45
+ * The tags of the manifest. Used for generic resource categorization and search. Example: ['tag1', 'tag2']
46
+ */
47
+ tags?: string[] | null;
48
+ /**
49
+ * The semantic version of the manifest. Example: 0.1.0
50
+ */
51
+ version: string | null;
52
+ [k: string]: unknown | undefined;
53
+ }
54
+ /**
55
+ * ApiConnection.spec[obj]: Required, the ApiConnection specification.
56
+ */
57
+ export interface SAMApiConnectionSpec {
58
+ connection: ApiConnection;
59
+ [k: string]: unknown | undefined;
60
+ }
61
+ /**
62
+ * ApiConnection.spec.selector[obj]: the selector logic to use for the ApiConnection
63
+ */
64
+ export interface ApiConnection {
65
+ /**
66
+ * The API key for authentication, if required.
67
+ */
68
+ apiKey?: string | null;
69
+ /**
70
+ * The authentication method to use. Example: 'Basic Auth', 'Token Auth'.
71
+ */
72
+ authMethod?: string;
73
+ /**
74
+ * The root domain of the API. Example: 'https://api.example.com'.
75
+ */
76
+ baseUrl: string;
77
+ /**
78
+ * The remote host of the proxy connection.
79
+ */
80
+ proxyHost?: string | null;
81
+ /**
82
+ * The password for the proxy connection.
83
+ */
84
+ proxyPassword?: string | null;
85
+ /**
86
+ * The port of the proxy connection.
87
+ */
88
+ proxyPort?: number | null;
89
+ /**
90
+ * The protocol of the proxy connection. Example: 'http', 'https'.
91
+ */
92
+ proxyProtocol?: string | null;
93
+ /**
94
+ * The username for the proxy connection.
95
+ */
96
+ proxyUsername?: string | null;
97
+ /**
98
+ * The timeout for the API request in seconds. Default is 30 seconds.
99
+ */
100
+ timeout?: number;
101
+ [k: string]: unknown | undefined;
102
+ }
103
+ /**
104
+ * Smarter API Connection Manifest - Status class.
105
+ */
106
+ export interface SAMConnectionCommonStatus {
107
+ /**
108
+ * Connection.status.account_number: The account owner of this Connection. Read only.
109
+ */
110
+ account_number: string;
111
+ /**
112
+ * The date in which this resource was created. Read only.
113
+ */
114
+ created: string;
115
+ /**
116
+ * dependencies[List]: The resources that depend on this resource, and that must be deleted, or stop referring to it, before it can be deleted. Lists only the resources that you can read. Read only.
117
+ */
118
+ dependencies?: SAMDependency[] | null;
119
+ /**
120
+ * The date in which this resource was most recently changed. Read only.
121
+ */
122
+ modified: string;
123
+ /**
124
+ * recordLocator[String]: An optional identifier used to locate the resource record associated with this manifest. Read only.
125
+ */
126
+ recordLocator: string;
127
+ /**
128
+ * Connection.status.username: The Smarter user who created this Connection. Read only.
129
+ */
130
+ username: string;
131
+ [k: string]: unknown | undefined;
132
+ }
133
+ /**
134
+ * A resource that depends on the resource that a manifest describes.
135
+ */
136
+ export interface SAMDependency {
137
+ /**
138
+ * kind[String]: The SAM kind of the resource that depends on this resource, e.g. LLMClient. Read only.
139
+ */
140
+ kind: string;
141
+ /**
142
+ * name[String]: The name of the resource that depends on this resource. Read only.
143
+ */
144
+ name: string;
145
+ [k: string]: unknown | undefined;
146
+ }
147
+ //# sourceMappingURL=apiconnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiconnection.d.ts","sourceRoot":"","sources":["../../../src/models/sam/apiconnection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,2BAA2B,CAAC;IACtC,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;OAEG;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;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The SAM type of the `ApiConnection` kind, generated from the Smarter platform's JSON Schema.
3
+ *
4
+ * Do not edit: run `make sam-models`. See `src/models/sam/index.ts`.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=apiconnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiconnection.js","sourceRoot":"","sources":["../../../src/models/sam/apiconnection.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}