@vibesdotdev/integrations 0.0.0-stage → 1.0.0-rc.3

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 (242) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +100 -2
  3. package/dist/ai/ai.cloud.plugin.d.ts +5 -0
  4. package/dist/ai/ai.cloud.plugin.d.ts.map +1 -0
  5. package/dist/ai/ai.cloud.plugin.js +67 -0
  6. package/dist/ai/ai.cloud.plugin.js.map +1 -0
  7. package/dist/ai/ai.plugin.d.ts +5 -0
  8. package/dist/ai/ai.plugin.d.ts.map +1 -0
  9. package/dist/ai/ai.plugin.js +97 -0
  10. package/dist/ai/ai.plugin.js.map +1 -0
  11. package/dist/base/base.plugin.d.ts +10 -0
  12. package/dist/base/base.plugin.d.ts.map +1 -0
  13. package/dist/base/base.plugin.js +23 -0
  14. package/dist/base/base.plugin.js.map +1 -0
  15. package/dist/base/index.d.ts +13 -0
  16. package/dist/base/index.d.ts.map +1 -0
  17. package/dist/base/index.js +15 -0
  18. package/dist/base/index.js.map +1 -0
  19. package/dist/base/resolver.d.ts +13 -0
  20. package/dist/base/resolver.d.ts.map +1 -0
  21. package/dist/base/resolver.js +30 -0
  22. package/dist/base/resolver.js.map +1 -0
  23. package/dist/base/schemas.d.ts +167 -0
  24. package/dist/base/schemas.d.ts.map +1 -0
  25. package/dist/base/schemas.js +48 -0
  26. package/dist/base/schemas.js.map +1 -0
  27. package/dist/catalog/index.d.ts +6 -0
  28. package/dist/catalog/index.d.ts.map +1 -0
  29. package/dist/catalog/index.js +6 -0
  30. package/dist/catalog/index.js.map +1 -0
  31. package/dist/catalog/integration-catalog.capability.d.ts +14 -0
  32. package/dist/catalog/integration-catalog.capability.d.ts.map +1 -0
  33. package/dist/catalog/integration-catalog.capability.js +23 -0
  34. package/dist/catalog/integration-catalog.capability.js.map +1 -0
  35. package/dist/catalog/integration-catalog.descriptor.d.ts +6 -0
  36. package/dist/catalog/integration-catalog.descriptor.d.ts.map +1 -0
  37. package/dist/catalog/integration-catalog.descriptor.js +11 -0
  38. package/dist/catalog/integration-catalog.descriptor.js.map +1 -0
  39. package/dist/catalog/integration-catalog.exposure.d.ts +62 -0
  40. package/dist/catalog/integration-catalog.exposure.d.ts.map +1 -0
  41. package/dist/catalog/integration-catalog.exposure.js +101 -0
  42. package/dist/catalog/integration-catalog.exposure.js.map +1 -0
  43. package/dist/catalog/integration-catalog.http.d.ts +9 -0
  44. package/dist/catalog/integration-catalog.http.d.ts.map +1 -0
  45. package/dist/catalog/integration-catalog.http.js +58 -0
  46. package/dist/catalog/integration-catalog.http.js.map +1 -0
  47. package/dist/catalog/integration-catalog.kind.d.ts +36 -0
  48. package/dist/catalog/integration-catalog.kind.d.ts.map +1 -0
  49. package/dist/catalog/integration-catalog.kind.js +14 -0
  50. package/dist/catalog/integration-catalog.kind.js.map +1 -0
  51. package/dist/catalog/queries.d.ts +6 -0
  52. package/dist/catalog/queries.d.ts.map +1 -0
  53. package/dist/catalog/queries.js +29 -0
  54. package/dist/catalog/queries.js.map +1 -0
  55. package/dist/client/helper.d.ts +5 -0
  56. package/dist/client/helper.d.ts.map +1 -0
  57. package/dist/client/helper.js +6 -0
  58. package/dist/client/helper.js.map +1 -0
  59. package/dist/client/index.d.ts +4 -0
  60. package/dist/client/index.d.ts.map +1 -0
  61. package/dist/client/index.js +3 -0
  62. package/dist/client/index.js.map +1 -0
  63. package/dist/client/integrations.runtime-client.browser.d.ts +10 -0
  64. package/dist/client/integrations.runtime-client.browser.d.ts.map +1 -0
  65. package/dist/client/integrations.runtime-client.browser.js +13 -0
  66. package/dist/client/integrations.runtime-client.browser.js.map +1 -0
  67. package/dist/client/integrations.runtime-client.d.ts +25 -0
  68. package/dist/client/integrations.runtime-client.d.ts.map +1 -0
  69. package/dist/client/integrations.runtime-client.descriptor.d.ts +4 -0
  70. package/dist/client/integrations.runtime-client.descriptor.d.ts.map +1 -0
  71. package/dist/client/integrations.runtime-client.descriptor.js +13 -0
  72. package/dist/client/integrations.runtime-client.descriptor.js.map +1 -0
  73. package/dist/client/integrations.runtime-client.js +41 -0
  74. package/dist/client/integrations.runtime-client.js.map +1 -0
  75. package/dist/docs/integrations.docs.descriptor.d.ts +4 -0
  76. package/dist/docs/integrations.docs.descriptor.d.ts.map +1 -0
  77. package/dist/docs/integrations.docs.descriptor.js +43 -0
  78. package/dist/docs/integrations.docs.descriptor.js.map +1 -0
  79. package/dist/docs/integrations.providers.docs.descriptor.d.ts +4 -0
  80. package/dist/docs/integrations.providers.docs.descriptor.d.ts.map +1 -0
  81. package/dist/docs/integrations.providers.docs.descriptor.js +32 -0
  82. package/dist/docs/integrations.providers.docs.descriptor.js.map +1 -0
  83. package/dist/http/fetch-with-retry.d.ts +27 -0
  84. package/dist/http/fetch-with-retry.d.ts.map +1 -0
  85. package/dist/http/fetch-with-retry.js +76 -0
  86. package/dist/http/fetch-with-retry.js.map +1 -0
  87. package/dist/index.d.ts +24 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +16 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/integrations.browser.plugin.d.ts +11 -0
  92. package/dist/integrations.browser.plugin.d.ts.map +1 -0
  93. package/dist/integrations.browser.plugin.js +26 -0
  94. package/dist/integrations.browser.plugin.js.map +1 -0
  95. package/dist/integrations.consumer.plugin.d.ts +3 -0
  96. package/dist/integrations.consumer.plugin.d.ts.map +1 -0
  97. package/dist/integrations.consumer.plugin.js +12 -0
  98. package/dist/integrations.consumer.plugin.js.map +1 -0
  99. package/dist/integrations.plugin.d.ts +10 -0
  100. package/dist/integrations.plugin.d.ts.map +1 -0
  101. package/dist/integrations.plugin.js +67 -0
  102. package/dist/integrations.plugin.js.map +1 -0
  103. package/dist/kinds/integration-store.context.descriptor.d.ts +31 -0
  104. package/dist/kinds/integration-store.context.descriptor.d.ts.map +1 -0
  105. package/dist/kinds/integration-store.context.descriptor.js +8 -0
  106. package/dist/kinds/integration-store.context.descriptor.js.map +1 -0
  107. package/dist/kinds/integration.kind.d.ts +74 -0
  108. package/dist/kinds/integration.kind.d.ts.map +1 -0
  109. package/dist/kinds/integration.kind.js +542 -0
  110. package/dist/kinds/integration.kind.js.map +1 -0
  111. package/dist/kinds/integration.store.d.ts +30 -0
  112. package/dist/kinds/integration.store.d.ts.map +1 -0
  113. package/dist/kinds/integration.store.js +295 -0
  114. package/dist/kinds/integration.store.js.map +1 -0
  115. package/dist/schemas/boundary.d.ts +7 -0
  116. package/dist/schemas/boundary.d.ts.map +1 -0
  117. package/dist/schemas/boundary.js +16 -0
  118. package/dist/schemas/boundary.js.map +1 -0
  119. package/dist/schemas/catalog.d.ts +135 -0
  120. package/dist/schemas/catalog.d.ts.map +1 -0
  121. package/dist/schemas/catalog.js +13 -0
  122. package/dist/schemas/catalog.js.map +1 -0
  123. package/dist/schemas/credential-resolution.d.ts +35 -0
  124. package/dist/schemas/credential-resolution.d.ts.map +1 -0
  125. package/dist/schemas/credential-resolution.js +14 -0
  126. package/dist/schemas/credential-resolution.js.map +1 -0
  127. package/dist/schemas/http-retry.d.ts +9 -0
  128. package/dist/schemas/http-retry.d.ts.map +1 -0
  129. package/dist/schemas/http-retry.js +8 -0
  130. package/dist/schemas/http-retry.js.map +1 -0
  131. package/dist/schemas/integration-connection.d.ts +79 -0
  132. package/dist/schemas/integration-connection.d.ts.map +1 -0
  133. package/dist/schemas/integration-connection.js +55 -0
  134. package/dist/schemas/integration-connection.js.map +1 -0
  135. package/dist/schemas/integration-descriptor.d.ts +358 -0
  136. package/dist/schemas/integration-descriptor.d.ts.map +1 -0
  137. package/dist/schemas/integration-descriptor.js +153 -0
  138. package/dist/schemas/integration-descriptor.js.map +1 -0
  139. package/dist/schemas/oauth-state.d.ts +30 -0
  140. package/dist/schemas/oauth-state.d.ts.map +1 -0
  141. package/dist/schemas/oauth-state.js +26 -0
  142. package/dist/schemas/oauth-state.js.map +1 -0
  143. package/dist/schemas/settings.d.ts +9 -0
  144. package/dist/schemas/settings.d.ts.map +1 -0
  145. package/dist/schemas/settings.js +8 -0
  146. package/dist/schemas/settings.js.map +1 -0
  147. package/dist/schemas/store.d.ts +68 -0
  148. package/dist/schemas/store.d.ts.map +1 -0
  149. package/dist/schemas/store.js +31 -0
  150. package/dist/schemas/store.js.map +1 -0
  151. package/dist/server/defaults/system-defaults.kind.d.ts +8 -0
  152. package/dist/server/defaults/system-defaults.kind.d.ts.map +1 -0
  153. package/dist/server/defaults/system-defaults.kind.js +13 -0
  154. package/dist/server/defaults/system-defaults.kind.js.map +1 -0
  155. package/dist/server/integration-oauth.d.ts +44 -0
  156. package/dist/server/integration-oauth.d.ts.map +1 -0
  157. package/dist/server/integration-oauth.js +56 -0
  158. package/dist/server/integration-oauth.js.map +1 -0
  159. package/dist/server/integration-secrets.d.ts +11 -0
  160. package/dist/server/integration-secrets.d.ts.map +1 -0
  161. package/dist/server/integration-secrets.js +98 -0
  162. package/dist/server/integration-secrets.js.map +1 -0
  163. package/dist/server/oauth-state.d.ts +74 -0
  164. package/dist/server/oauth-state.d.ts.map +1 -0
  165. package/dist/server/oauth-state.js +208 -0
  166. package/dist/server/oauth-state.js.map +1 -0
  167. package/dist/server/schemas/integration-oauth.d.ts +32 -0
  168. package/dist/server/schemas/integration-oauth.d.ts.map +1 -0
  169. package/dist/server/schemas/integration-oauth.js +20 -0
  170. package/dist/server/schemas/integration-oauth.js.map +1 -0
  171. package/dist/server/schemas/integration-secrets.d.ts +165 -0
  172. package/dist/server/schemas/integration-secrets.d.ts.map +1 -0
  173. package/dist/server/schemas/integration-secrets.js +72 -0
  174. package/dist/server/schemas/integration-secrets.js.map +1 -0
  175. package/dist/server/schemas/system-defaults.d.ts +124 -0
  176. package/dist/server/schemas/system-defaults.d.ts.map +1 -0
  177. package/dist/server/schemas/system-defaults.js +48 -0
  178. package/dist/server/schemas/system-defaults.js.map +1 -0
  179. package/dist/server/system-defaults.d.ts +20 -0
  180. package/dist/server/system-defaults.d.ts.map +1 -0
  181. package/dist/server/system-defaults.js +58 -0
  182. package/dist/server/system-defaults.js.map +1 -0
  183. package/dist/settings/context.d.ts +11 -0
  184. package/dist/settings/context.d.ts.map +1 -0
  185. package/dist/settings/context.js +19 -0
  186. package/dist/settings/context.js.map +1 -0
  187. package/dist/settings/system-settings-reader.context.descriptor.d.ts +43 -0
  188. package/dist/settings/system-settings-reader.context.descriptor.d.ts.map +1 -0
  189. package/dist/settings/system-settings-reader.context.descriptor.js +23 -0
  190. package/dist/settings/system-settings-reader.context.descriptor.js.map +1 -0
  191. package/dist/status/integration-connect.availability.d.ts +16 -0
  192. package/dist/status/integration-connect.availability.d.ts.map +1 -0
  193. package/dist/status/integration-connect.availability.js +14 -0
  194. package/dist/status/integration-connect.availability.js.map +1 -0
  195. package/dist/status/integration-connection-status.d.ts +18 -0
  196. package/dist/status/integration-connection-status.d.ts.map +1 -0
  197. package/dist/status/integration-connection-status.js +17 -0
  198. package/dist/status/integration-connection-status.js.map +1 -0
  199. package/dist/status/integration-connection.capability.d.ts +19 -0
  200. package/dist/status/integration-connection.capability.d.ts.map +1 -0
  201. package/dist/status/integration-connection.capability.js +15 -0
  202. package/dist/status/integration-connection.capability.js.map +1 -0
  203. package/dist/status/integration-connection.kind.d.ts +55 -0
  204. package/dist/status/integration-connection.kind.d.ts.map +1 -0
  205. package/dist/status/integration-connection.kind.js +31 -0
  206. package/dist/status/integration-connection.kind.js.map +1 -0
  207. package/dist/status/integration-connection.queries.d.ts +25 -0
  208. package/dist/status/integration-connection.queries.d.ts.map +1 -0
  209. package/dist/status/integration-connection.queries.js +65 -0
  210. package/dist/status/integration-connection.queries.js.map +1 -0
  211. package/dist/svelte/components/IntegrationsCatalog.svelte +201 -0
  212. package/dist/svelte/components/IntegrationsCatalog.svelte.d.ts +5 -0
  213. package/dist/svelte/components/IntegrationsCatalog.svelte.d.ts.map +1 -0
  214. package/dist/svelte/components/IntegrationsLoader.svelte +46 -0
  215. package/dist/svelte/components/IntegrationsLoader.svelte.d.ts +12 -0
  216. package/dist/svelte/components/IntegrationsLoader.svelte.d.ts.map +1 -0
  217. package/dist/svelte/connect-action.d.ts +20 -0
  218. package/dist/svelte/connect-action.d.ts.map +1 -0
  219. package/dist/svelte/connect-action.js +40 -0
  220. package/dist/svelte/docs/integrations-svelte.catalog.docs.descriptor.d.ts +4 -0
  221. package/dist/svelte/docs/integrations-svelte.catalog.docs.descriptor.d.ts.map +1 -0
  222. package/dist/svelte/docs/integrations-svelte.catalog.docs.descriptor.js +30 -0
  223. package/dist/svelte/index.d.ts +12 -0
  224. package/dist/svelte/index.d.ts.map +1 -0
  225. package/dist/svelte/index.js +7 -0
  226. package/dist/svelte/integrations-svelte.plugin.d.ts +10 -0
  227. package/dist/svelte/integrations-svelte.plugin.d.ts.map +1 -0
  228. package/dist/svelte/integrations-svelte.plugin.js +16 -0
  229. package/dist/svelte/loaders.d.ts +17 -0
  230. package/dist/svelte/loaders.d.ts.map +1 -0
  231. package/dist/svelte/loaders.js +17 -0
  232. package/dist/svelte/runtime.d.ts +12 -0
  233. package/dist/svelte/runtime.d.ts.map +1 -0
  234. package/dist/svelte/runtime.js +11 -0
  235. package/dist/svelte/state.svelte.d.ts +30 -0
  236. package/dist/svelte/state.svelte.d.ts.map +1 -0
  237. package/dist/svelte/state.svelte.js +133 -0
  238. package/dist/svelte/styles.css +2 -0
  239. package/dist/svelte/types.d.ts +13 -0
  240. package/dist/svelte/types.d.ts.map +1 -0
  241. package/dist/svelte/types.js +1 -0
  242. package/package.json +223 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-resolution.d.ts","sourceRoot":"","sources":["../../src/schemas/credential-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAOpE,eAAO,MAAM,uBAAuB;;kBAIzB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;;;gCAAmD,CAAC;AAClF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;KAGtC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import * as z from 'zod/v4';
2
+ import { CredentialReferenceSchema } from '@vibesdotdev/kernel/credentials';
3
+ const CredentialResolverRuntimeSchema = z.object({
4
+ resolveCredential: z.function()
5
+ }).passthrough();
6
+ export const ResolutionOptionsSchema = z.object({
7
+ runtime: z.custom((value) => CredentialResolverRuntimeSchema.safeParse(value).success)
8
+ }).strict();
9
+ export const ConfigValueSchema = z.union([z.string(), CredentialReferenceSchema]);
10
+ export const ResolvableConfigValueSchema = z.union([
11
+ z.string().transform((value) => ({ kind: 'inline', value })),
12
+ CredentialReferenceSchema.transform((reference) => ({ kind: 'reference', reference }))
13
+ ]);
14
+ //# sourceMappingURL=credential-resolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-resolution.js","sourceRoot":"","sources":["../../src/schemas/credential-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,iBAAiB,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC,WAAW,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAe,CAAC,KAAK,EAAE,EAAE,CACzC,+BAA+B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CACxD;CACD,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAClF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC;IAClD,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,KAAK,EAAE,CAAC,CAAC;IACrE,yBAAyB,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAoB,EAAE,SAAS,EAAE,CAAC,CAAC;CAC/F,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const RetryOptionsSchema: z.ZodObject<{
3
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
4
+ baseDelayMs: z.ZodDefault<z.ZodNumber>;
5
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
6
+ retryStatuses: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
7
+ }, z.core.$strip>;
8
+ export type RetryOptions = z.input<typeof RetryOptionsSchema>;
9
+ //# sourceMappingURL=http-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-retry.d.ts","sourceRoot":"","sources":["../../src/schemas/http-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as z from 'zod/v4';
2
+ export const RetryOptionsSchema = z.object({
3
+ maxAttempts: z.number().int().positive().default(4),
4
+ baseDelayMs: z.number().finite().nonnegative().default(250),
5
+ maxDelayMs: z.number().finite().nonnegative().default(8000),
6
+ retryStatuses: z.array(z.number().int().min(100).max(599)).default([429, 500, 502, 503, 504])
7
+ });
8
+ //# sourceMappingURL=http-retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-retry.js","sourceRoot":"","sources":["../../src/schemas/http-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3D,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CAC7F,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import * as z from 'zod/v4';
2
+ /**
3
+ * How a provider authenticates, as the provider declares it. The vocabulary
4
+ * describes behavior; it never admits or excludes a provider by identity.
5
+ *
6
+ * - `'oauth'` — a platform-driven or manual connect flow produces a
7
+ * tenant-scoped saved credential; "connected" is answerable for the caller.
8
+ * - `'delegated'` — the provider acts as the signed-in user through the
9
+ * host's identity accounts; this package's credential store holds nothing.
10
+ * - `'system-config'` — only an operator with deploy/env access configures
11
+ * it; no end-user action connects it.
12
+ * - `'webhook'` — delivery-oriented; no persistent connect relationship.
13
+ */
14
+ export declare const IntegrationAuthModeSchema: z.ZodEnum<{
15
+ oauth: "oauth";
16
+ delegated: "delegated";
17
+ "system-config": "system-config";
18
+ webhook: "webhook";
19
+ }>;
20
+ export type IntegrationAuthMode = z.infer<typeof IntegrationAuthModeSchema>;
21
+ /**
22
+ * Explicit authentication/connection metadata a provider descriptor declares.
23
+ * The provider descriptor composes this schema; nothing infers it from an id
24
+ * suffix, a provider admission list or a credential-value shape. A host
25
+ * reference credential alone never implies tenant connection support: only
26
+ * this declaration does.
27
+ */
28
+ export declare const IntegrationConnectionMetadataSchema: z.ZodObject<{
29
+ authMode: z.ZodOptional<z.ZodEnum<{
30
+ oauth: "oauth";
31
+ delegated: "delegated";
32
+ "system-config": "system-config";
33
+ webhook: "webhook";
34
+ }>>;
35
+ connectable: z.ZodDefault<z.ZodBoolean>;
36
+ checkable: z.ZodDefault<z.ZodBoolean>;
37
+ requiresProviderAdmin: z.ZodDefault<z.ZodBoolean>;
38
+ }, z.core.$strip>;
39
+ export type IntegrationConnectionMetadata = z.infer<typeof IntegrationConnectionMetadataSchema>;
40
+ /** One provider's connection state, scoped to the calling user/org. */
41
+ export declare const IntegrationConnectionStatusSchema: z.ZodObject<{
42
+ integrationId: z.ZodString;
43
+ authMode: z.ZodEnum<{
44
+ oauth: "oauth";
45
+ delegated: "delegated";
46
+ "system-config": "system-config";
47
+ webhook: "webhook";
48
+ }>;
49
+ connected: z.ZodBoolean;
50
+ connectionCount: z.ZodNumber;
51
+ canCheck: z.ZodBoolean;
52
+ requiresProviderAdmin: z.ZodOptional<z.ZodBoolean>;
53
+ }, z.core.$strip>;
54
+ export type IntegrationConnectionStatus = z.infer<typeof IntegrationConnectionStatusSchema>;
55
+ /** A connection request the capability refuses; the code/reason are typed. */
56
+ export declare const IntegrationConnectionRefusalSchema: z.ZodObject<{
57
+ refused: z.ZodLiteral<true>;
58
+ code: z.ZodEnum<{
59
+ UNAVAILABLE: "UNAVAILABLE";
60
+ PERMISSION_DENIED: "PERMISSION_DENIED";
61
+ INVALID_INPUT: "INVALID_INPUT";
62
+ }>;
63
+ reason: z.ZodString;
64
+ }, z.core.$strip>;
65
+ export type IntegrationConnectionRefusal = z.infer<typeof IntegrationConnectionRefusalSchema>;
66
+ /** Outcome of a connect request: the host owns authorization and the flow. */
67
+ export declare const IntegrationConnectRequestResultSchema: z.ZodUnion<readonly [z.ZodObject<{
68
+ accepted: z.ZodLiteral<true>;
69
+ }, z.core.$strip>, z.ZodObject<{
70
+ refused: z.ZodLiteral<true>;
71
+ code: z.ZodEnum<{
72
+ UNAVAILABLE: "UNAVAILABLE";
73
+ PERMISSION_DENIED: "PERMISSION_DENIED";
74
+ INVALID_INPUT: "INVALID_INPUT";
75
+ }>;
76
+ reason: z.ZodString;
77
+ }, z.core.$strip>]>;
78
+ export type IntegrationConnectRequestResult = z.infer<typeof IntegrationConnectRequestResultSchema>;
79
+ //# sourceMappingURL=integration-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-connection.d.ts","sourceRoot":"","sources":["../../src/schemas/integration-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB;;;;;EAA6D,CAAC;AACpG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;iBAS9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,uEAAuE;AACvE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAU5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC;;;;;;;;iBAI7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,8EAA8E;AAC9E,eAAO,MAAM,qCAAqC;;;;;;;;;;mBAGhD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import * as z from 'zod/v4';
2
+ /**
3
+ * How a provider authenticates, as the provider declares it. The vocabulary
4
+ * describes behavior; it never admits or excludes a provider by identity.
5
+ *
6
+ * - `'oauth'` — a platform-driven or manual connect flow produces a
7
+ * tenant-scoped saved credential; "connected" is answerable for the caller.
8
+ * - `'delegated'` — the provider acts as the signed-in user through the
9
+ * host's identity accounts; this package's credential store holds nothing.
10
+ * - `'system-config'` — only an operator with deploy/env access configures
11
+ * it; no end-user action connects it.
12
+ * - `'webhook'` — delivery-oriented; no persistent connect relationship.
13
+ */
14
+ export const IntegrationAuthModeSchema = z.enum(['oauth', 'delegated', 'system-config', 'webhook']);
15
+ /**
16
+ * Explicit authentication/connection metadata a provider descriptor declares.
17
+ * The provider descriptor composes this schema; nothing infers it from an id
18
+ * suffix, a provider admission list or a credential-value shape. A host
19
+ * reference credential alone never implies tenant connection support: only
20
+ * this declaration does.
21
+ */
22
+ export const IntegrationConnectionMetadataSchema = z.object({
23
+ /** How the provider authenticates. Absent means undeclared, not inferred. */
24
+ authMode: IntegrationAuthModeSchema.optional(),
25
+ /** The provider supports a tenant connect flow this host can drive. */
26
+ connectable: z.boolean().default(false),
27
+ /** A meaningful connected/not-connected answer exists for this provider. */
28
+ checkable: z.boolean().default(false),
29
+ /** Connecting requires organization-admin authority, not any member. */
30
+ requiresProviderAdmin: z.boolean().default(false)
31
+ });
32
+ /** One provider's connection state, scoped to the calling user/org. */
33
+ export const IntegrationConnectionStatusSchema = z.object({
34
+ integrationId: z.string().min(1),
35
+ authMode: IntegrationAuthModeSchema,
36
+ /** True only when the CALLING user/org has a live connection. */
37
+ connected: z.boolean(),
38
+ /** Number of org/user-scoped credentials backing the connection. */
39
+ connectionCount: z.number().int().nonnegative(),
40
+ /** Whether a meaningful connected/not-connected answer exists at all. */
41
+ canCheck: z.boolean(),
42
+ requiresProviderAdmin: z.boolean().optional()
43
+ });
44
+ /** A connection request the capability refuses; the code/reason are typed. */
45
+ export const IntegrationConnectionRefusalSchema = z.object({
46
+ refused: z.literal(true),
47
+ code: z.enum(['UNAVAILABLE', 'PERMISSION_DENIED', 'INVALID_INPUT']),
48
+ reason: z.string().min(1)
49
+ });
50
+ /** Outcome of a connect request: the host owns authorization and the flow. */
51
+ export const IntegrationConnectRequestResultSchema = z.union([
52
+ z.object({ accepted: z.literal(true) }),
53
+ IntegrationConnectionRefusalSchema
54
+ ]);
55
+ //# sourceMappingURL=integration-connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-connection.js","sourceRoot":"","sources":["../../src/schemas/integration-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;AAGpG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,6EAA6E;IAC7E,QAAQ,EAAE,yBAAyB,CAAC,QAAQ,EAAE;IAC9C,uEAAuE;IACvE,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACvC,4EAA4E;IAC5E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACrC,wEAAwE;IACxE,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACjD,CAAC,CAAC;AAGH,uEAAuE;AACvE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,QAAQ,EAAE,yBAAyB;IACnC,iEAAiE;IACjE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,oEAAoE;IACpE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC/C,yEAAyE;IACzE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAGH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC;IACnE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC;AAGH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5D,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;IACvC,kCAAkC;CAClC,CAAC,CAAC"}
@@ -0,0 +1,358 @@
1
+ import * as z from 'zod/v4';
2
+ import { type CredentialCandidates } from '@vibesdotdev/secrets/schemas';
3
+ export declare const IntegrationConfigValueSchema: z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>;
4
+ export type IntegrationConfigValue = z.infer<typeof IntegrationConfigValueSchema>;
5
+ export declare const IntegrationConfigSchema: z.ZodRecord<z.ZodString, z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
6
+ export declare const IntegrationOperationInputSchema: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
7
+ export declare const IntegrationCredentialKeySchema: z.ZodString;
8
+ export declare const IntegrationCredentialReferenceCandidatesSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
9
+ source: z.ZodLiteral<"secret">;
10
+ key: z.ZodString;
11
+ store: z.ZodOptional<z.ZodString>;
12
+ operation: z.ZodOptional<z.ZodCustom<object, object>>;
13
+ }, z.core.$strict>], "source">, z.ZodObject<{
14
+ source: z.ZodLiteral<"oauth-account">;
15
+ providerId: z.ZodString;
16
+ token: z.ZodDefault<z.ZodEnum<{
17
+ accessToken: "accessToken";
18
+ refreshToken: "refreshToken";
19
+ }>>;
20
+ }, z.core.$strict>]>>;
21
+ export type IntegrationCredentialReferenceCandidates = CredentialCandidates;
22
+ export declare const IntegrationCredentialSourceSchema: z.ZodObject<{
23
+ key: z.ZodString;
24
+ source: z.ZodEnum<{
25
+ secret: "secret";
26
+ setting: "setting";
27
+ }>;
28
+ reference: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ source: z.ZodLiteral<"secret">;
30
+ key: z.ZodString;
31
+ store: z.ZodOptional<z.ZodString>;
32
+ operation: z.ZodOptional<z.ZodCustom<object, object>>;
33
+ }, z.core.$strict>], "source">>;
34
+ providerType: z.ZodOptional<z.ZodString>;
35
+ scope: z.ZodOptional<z.ZodEnum<{
36
+ user: "user";
37
+ platform: "platform";
38
+ project: "project";
39
+ org: "org";
40
+ }>>;
41
+ scopeId: z.ZodOptional<z.ZodString>;
42
+ settingKey: z.ZodOptional<z.ZodString>;
43
+ required: z.ZodDefault<z.ZodBoolean>;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * OAuth 2.0 endpoint metadata. When present, the runtime's generic
47
+ * `/api/integrations/[id]/connect` + `/[id]/callback` routes can drive the
48
+ * authorization-code flow without provider-specific wiring. Per-provider
49
+ * quirks (e.g. QuickBooks `realmId`, Microsoft `tenant`) are forwarded
50
+ * through `IntegrationOAuthCompletion.params` and handled by the
51
+ * implementation override of `completeAuthorization`.
52
+ */
53
+ export declare const IntegrationOAuthMetadataSchema: z.ZodObject<{
54
+ authorizationEndpoint: z.ZodURL;
55
+ tokenEndpoint: z.ZodURL;
56
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
57
+ authorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
58
+ configFromCallback: z.ZodDefault<z.ZodArray<z.ZodString>>;
59
+ clientAuthentication: z.ZodDefault<z.ZodEnum<{
60
+ form: "form";
61
+ basic: "basic";
62
+ }>>;
63
+ bodyEncoding: z.ZodDefault<z.ZodEnum<{
64
+ json: "json";
65
+ form: "form";
66
+ }>>;
67
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
68
+ scopeIdCallbackParam: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>;
70
+ /**
71
+ * Declarative operation registry on an integration descriptor. Each
72
+ * operation is a named verb (e.g. `'sync'`, `'invalidate-cache'`) that the
73
+ * provider implementation handles via `invokeOperation(id, args)`. The
74
+ * runtime exposes operations through generic
75
+ * `POST /api/integrations/[id]/operations/[opId]` routes, so apps never
76
+ * need provider-specific endpoints.
77
+ */
78
+ export declare const IntegrationOperationSchema: z.ZodObject<{
79
+ id: z.ZodString;
80
+ name: z.ZodString;
81
+ description: z.ZodOptional<z.ZodString>;
82
+ requiresOrg: z.ZodDefault<z.ZodBoolean>;
83
+ }, z.core.$strip>;
84
+ /**
85
+ * Functional category of an integration provider. Filters the catalog by
86
+ * the *kind of work* a provider does (email delivery vs accounting sync vs
87
+ * vcs hosting), independent of the vendor identity. Higher-level features
88
+ * (e.g. `packages/email`) query `integration/provider` by category to
89
+ * discover all eligible vendors at dispatch time.
90
+ *
91
+ * The enum is closed on purpose — vendors can't typo a category, and
92
+ * higher-level features can pattern-match exhaustively. Grow it as new
93
+ * categories appear in the codebase; passthrough strings are not allowed.
94
+ */
95
+ export declare const IntegrationCategorySchema: z.ZodEnum<{
96
+ webhook: "webhook";
97
+ accounting: "accounting";
98
+ vcs: "vcs";
99
+ "issue-tracker": "issue-tracker";
100
+ productivity: "productivity";
101
+ ocr: "ocr";
102
+ email: "email";
103
+ messaging: "messaging";
104
+ sms: "sms";
105
+ push: "push";
106
+ storage: "storage";
107
+ analytics: "analytics";
108
+ observability: "observability";
109
+ crm: "crm";
110
+ calendar: "calendar";
111
+ other: "other";
112
+ }>;
113
+ export type IntegrationCategory = z.infer<typeof IntegrationCategorySchema>;
114
+ export declare const IntegrationProviderDescriptorSchema: z.ZodObject<{
115
+ id: z.ZodString;
116
+ name: z.ZodOptional<z.ZodString>;
117
+ description: z.ZodOptional<z.ZodString>;
118
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
+ enabled: z.ZodOptional<z.ZodBoolean>;
121
+ capabilityId: z.ZodOptional<z.ZodString>;
122
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
123
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
124
+ maxEntries: z.ZodOptional<z.ZodNumber>;
125
+ maxBytes: z.ZodOptional<z.ZodNumber>;
126
+ cascadeFrom: z.ZodOptional<z.ZodString>;
127
+ ageField: z.ZodOptional<z.ZodString>;
128
+ reason: z.ZodString;
129
+ enforcedBy: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>]>>;
131
+ kind: z.ZodLiteral<"integration/provider">;
132
+ requiredContext: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
133
+ optionalContext: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
134
+ provider: z.ZodDefault<z.ZodString>;
135
+ category: z.ZodDefault<z.ZodEnum<{
136
+ webhook: "webhook";
137
+ accounting: "accounting";
138
+ vcs: "vcs";
139
+ "issue-tracker": "issue-tracker";
140
+ productivity: "productivity";
141
+ ocr: "ocr";
142
+ email: "email";
143
+ messaging: "messaging";
144
+ sms: "sms";
145
+ push: "push";
146
+ storage: "storage";
147
+ analytics: "analytics";
148
+ observability: "observability";
149
+ crm: "crm";
150
+ calendar: "calendar";
151
+ other: "other";
152
+ }>>;
153
+ priority: z.ZodDefault<z.ZodNumber>;
154
+ baseUrl: z.ZodOptional<z.ZodURL>;
155
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
156
+ protectedConfigKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
157
+ configurationSource: z.ZodOptional<z.ZodEnum<{
158
+ account: "account";
159
+ host: "host";
160
+ }>>;
161
+ configSettingKey: z.ZodOptional<z.ZodString>;
162
+ credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
163
+ key: z.ZodString;
164
+ source: z.ZodEnum<{
165
+ secret: "secret";
166
+ setting: "setting";
167
+ }>;
168
+ reference: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
169
+ source: z.ZodLiteral<"secret">;
170
+ key: z.ZodString;
171
+ store: z.ZodOptional<z.ZodString>;
172
+ operation: z.ZodOptional<z.ZodCustom<object, object>>;
173
+ }, z.core.$strict>], "source">>;
174
+ providerType: z.ZodOptional<z.ZodString>;
175
+ scope: z.ZodOptional<z.ZodEnum<{
176
+ user: "user";
177
+ platform: "platform";
178
+ project: "project";
179
+ org: "org";
180
+ }>>;
181
+ scopeId: z.ZodOptional<z.ZodString>;
182
+ settingKey: z.ZodOptional<z.ZodString>;
183
+ required: z.ZodDefault<z.ZodBoolean>;
184
+ }, z.core.$strip>>>;
185
+ oauth: z.ZodOptional<z.ZodObject<{
186
+ authorizationEndpoint: z.ZodURL;
187
+ tokenEndpoint: z.ZodURL;
188
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
189
+ authorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
190
+ configFromCallback: z.ZodDefault<z.ZodArray<z.ZodString>>;
191
+ clientAuthentication: z.ZodDefault<z.ZodEnum<{
192
+ form: "form";
193
+ basic: "basic";
194
+ }>>;
195
+ bodyEncoding: z.ZodDefault<z.ZodEnum<{
196
+ json: "json";
197
+ form: "form";
198
+ }>>;
199
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
200
+ scopeIdCallbackParam: z.ZodOptional<z.ZodString>;
201
+ }, z.core.$strip>>;
202
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
203
+ id: z.ZodString;
204
+ name: z.ZodString;
205
+ description: z.ZodOptional<z.ZodString>;
206
+ requiresOrg: z.ZodDefault<z.ZodBoolean>;
207
+ }, z.core.$strip>>>;
208
+ connection: z.ZodOptional<z.ZodObject<{
209
+ authMode: z.ZodOptional<z.ZodEnum<{
210
+ oauth: "oauth";
211
+ delegated: "delegated";
212
+ "system-config": "system-config";
213
+ webhook: "webhook";
214
+ }>>;
215
+ connectable: z.ZodDefault<z.ZodBoolean>;
216
+ checkable: z.ZodDefault<z.ZodBoolean>;
217
+ requiresProviderAdmin: z.ZodDefault<z.ZodBoolean>;
218
+ }, z.core.$strip>>;
219
+ }, z.core.$strip>;
220
+ export type IntegrationCredentialSource = z.infer<typeof IntegrationCredentialSourceSchema>;
221
+ export type IntegrationOAuthMetadata = z.infer<typeof IntegrationOAuthMetadataSchema>;
222
+ export type IntegrationOperation = z.infer<typeof IntegrationOperationSchema>;
223
+ export type IntegrationProviderDescriptorInput = z.input<typeof IntegrationProviderDescriptorSchema>;
224
+ export type IntegrationProviderDescriptor = z.infer<typeof IntegrationProviderDescriptorSchema>;
225
+ export type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;
226
+ /**
227
+ * Result of invoking a provider operation. Generic shape so providers can
228
+ * return arbitrary data; route handlers cast to provider-specific types
229
+ * when consuming. `errors` is non-empty when the operation partially
230
+ * succeeded — implementations should still throw for hard failures.
231
+ */
232
+ export interface IntegrationOperationResult<T = unknown> {
233
+ ok: boolean;
234
+ data?: T;
235
+ errors?: string[];
236
+ }
237
+ export declare const IntegrationOAuthStartSchema: z.ZodObject<{
238
+ redirectUri: z.ZodURL;
239
+ state: z.ZodString;
240
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
241
+ }, z.core.$strip>;
242
+ export type IntegrationOAuthStart = z.infer<typeof IntegrationOAuthStartSchema>;
243
+ export declare const IntegrationOAuthAuthorizationSchema: z.ZodObject<{
244
+ authorizationUrl: z.ZodURL;
245
+ }, z.core.$strip>;
246
+ export type IntegrationOAuthAuthorization = z.infer<typeof IntegrationOAuthAuthorizationSchema>;
247
+ export declare const IntegrationOAuthCompletionSchema: z.ZodObject<{
248
+ code: z.ZodString;
249
+ redirectUri: z.ZodURL;
250
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
251
+ }, z.core.$strip>;
252
+ export type IntegrationOAuthCompletion = z.infer<typeof IntegrationOAuthCompletionSchema>;
253
+ export declare const IntegrationProviderResolvedConfigurationSchema: z.ZodObject<{
254
+ config: z.ZodRecord<z.ZodString, z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
255
+ credentials: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
256
+ credentialReferences: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
257
+ source: z.ZodLiteral<"secret">;
258
+ key: z.ZodString;
259
+ store: z.ZodOptional<z.ZodString>;
260
+ operation: z.ZodOptional<z.ZodCustom<object, object>>;
261
+ }, z.core.$strict>], "source">, z.ZodObject<{
262
+ source: z.ZodLiteral<"oauth-account">;
263
+ providerId: z.ZodString;
264
+ token: z.ZodDefault<z.ZodEnum<{
265
+ accessToken: "accessToken";
266
+ refreshToken: "refreshToken";
267
+ }>>;
268
+ }, z.core.$strict>]>>>>;
269
+ }, z.core.$strip>;
270
+ export type IntegrationProviderResolvedConfiguration = z.infer<typeof IntegrationProviderResolvedConfigurationSchema>;
271
+ export type IntegrationResolvedConfigurationInput = z.input<typeof IntegrationProviderResolvedConfigurationSchema>;
272
+ export declare const IntegrationConnectionSelectorSchema: z.ZodObject<{
273
+ connectionId: z.ZodString;
274
+ }, z.core.$strip>;
275
+ export type IntegrationConnectionSelector = z.infer<typeof IntegrationConnectionSelectorSchema>;
276
+ export declare const IntegrationConnectionActorSchema: z.ZodObject<{
277
+ userId: z.ZodString;
278
+ organizationId: z.ZodOptional<z.ZodString>;
279
+ }, z.core.$strip>;
280
+ export type IntegrationConnectionActor = z.infer<typeof IntegrationConnectionActorSchema>;
281
+ export declare const IntegrationCredentialWriteMetadataSchema: z.ZodObject<{
282
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
283
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
284
+ }, z.core.$strip>;
285
+ export type IntegrationCredentialWriteMetadata = z.infer<typeof IntegrationCredentialWriteMetadataSchema>;
286
+ export declare const IntegrationCredentialWriteRequestSchema: z.ZodObject<{
287
+ key: z.ZodString;
288
+ value: z.ZodString;
289
+ metadata: z.ZodOptional<z.ZodObject<{
290
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
291
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
292
+ }, z.core.$strip>>;
293
+ }, z.core.$strict>;
294
+ export type IntegrationCredentialWriteRequest = z.infer<typeof IntegrationCredentialWriteRequestSchema>;
295
+ export declare const IntegrationOAuthTokensSchema: z.ZodObject<{
296
+ access_token: z.ZodString;
297
+ refresh_token: z.ZodOptional<z.ZodString>;
298
+ expires_in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
299
+ x_refresh_token_expires_in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
300
+ refresh_token_expires_in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
301
+ }, z.core.$catchall<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
302
+ export type IntegrationOAuthTokens = z.infer<typeof IntegrationOAuthTokensSchema>;
303
+ export interface IntegrationProviderImplementation {
304
+ readonly descriptor: IntegrationProviderDescriptor;
305
+ getConfig(): Promise<IntegrationConfig>;
306
+ getCredentials(): Promise<Record<string, string>>;
307
+ getCredential(key: string): Promise<string | undefined>;
308
+ getCredentialCandidates?(key: string): Promise<CredentialCandidates>;
309
+ /** Reference-only request configuration; legacy implementations may not support it. */
310
+ getCredentialUseConfiguration?(selector?: Readonly<IntegrationConnectionSelector>): Promise<IntegrationProviderResolvedConfiguration>;
311
+ getResolvedConfiguration(selector?: Readonly<IntegrationConnectionSelector>): Promise<IntegrationProviderResolvedConfiguration>;
312
+ /** A bound invocation requires explicit provider support, with no legacy fallback. */
313
+ invokeOperationForConnection?<T = unknown>(selector: Readonly<IntegrationConnectionSelector>, opId: string, args?: IntegrationConfigValue): Promise<IntegrationOperationResult<T>>;
314
+ /**
315
+ * Persist a credential value. The descriptor's matching credential source
316
+ * determines storage backend: `source: 'secret'` writes to the integration
317
+ * secret store with org-scoped composite scopeId; `'setting'` / `'inline'` are read-only and throw on write.
318
+ *
319
+ * OAuth flows call this after exchange/refresh to persist access and
320
+ * refresh tokens. Provider implementations override when scopeId
321
+ * composition needs extra inputs (e.g. realmId / tenant); the base
322
+ * implementation handles the common case.
323
+ */
324
+ setCredential(key: string, value: string, metadata?: IntegrationCredentialWriteMetadata): Promise<void>;
325
+ /**
326
+ * Remove a credential value. Used by OAuth disconnect / revoke flows.
327
+ * Symmetric to `setCredential`.
328
+ */
329
+ unsetCredential(key: string): Promise<void>;
330
+ /**
331
+ * Build the provider's OAuth 2.0 authorization URL. Generic dispatch
332
+ * routes (e.g. `/api/integrations/[id]/connect`) call this with the
333
+ * caller-controlled `redirectUri` and a fresh `state` token. The default
334
+ * implementation reads `descriptor.oauth` and `clientId` from
335
+ * credentials; providers without `descriptor.oauth` set must override
336
+ * this method or throw.
337
+ */
338
+ startAuthorization(input: IntegrationOAuthStart): Promise<IntegrationOAuthAuthorization>;
339
+ /**
340
+ * Exchange an authorization code for tokens and persist them through the
341
+ * secret store (`setCredential('accessToken' | 'refreshToken')`). The
342
+ * default implementation handles the standard OAuth 2.0
343
+ * authorization-code grant; provider-specific callback params (e.g.
344
+ * QuickBooks `realmId`) are persisted via the descriptor's
345
+ * `oauth.configFromCallback` list.
346
+ */
347
+ completeAuthorization(input: IntegrationOAuthCompletion): Promise<void>;
348
+ /**
349
+ * Invoke a declarative operation defined on the descriptor's
350
+ * `operations[]` list. Generic dispatch routes (e.g.
351
+ * `/api/integrations/[id]/operations/[opId]`) call this so apps never
352
+ * have to know provider-specific URL shapes. The default implementation
353
+ * throws for any opId — provider impls override to handle their
354
+ * declared verbs (e.g. QuickBooks `'sync'` returns items + customers).
355
+ */
356
+ invokeOperation<T = unknown>(opId: string, args?: IntegrationConfigValue): Promise<IntegrationOperationResult<T>>;
357
+ }
358
+ //# sourceMappingURL=integration-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-descriptor.d.ts","sourceRoot":"","sources":["../../src/schemas/integration-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B,OAAO,EAAkM,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzQ,eAAO,MAAM,4BAA4B,iPAAkB,CAAC;AAC5D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,eAAO,MAAM,uBAAuB,2QAAqD,CAAC;AAC1F,eAAO,MAAM,+BAA+B,gQAA0C,CAAC;AACvF,eAAO,MAAM,8BAA8B,aAAoC,CAAC;AAChF,eAAO,MAAM,8CAA8C;;;;;;;;;;;;qBAA6B,CAAC;AACzF,MAAM,MAAM,wCAAwC,GAAG,oBAAoB,CAAC;AAE5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;iBAqB5C,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;iBAczC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;iBAKrC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;EAiBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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