@ekanos/cli 0.15.0 → 0.17.0

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 (287) hide show
  1. package/README.md +103 -8
  2. package/dist/auth/ekanos-api.d.ts +23 -0
  3. package/dist/auth/ekanos-api.js +33 -6
  4. package/dist/auth/ekanos-api.js.map +1 -1
  5. package/dist/commands/add.d.ts +2 -0
  6. package/dist/commands/add.js +118 -0
  7. package/dist/commands/add.js.map +1 -0
  8. package/dist/commands/agents.js +3 -2
  9. package/dist/commands/agents.js.map +1 -1
  10. package/dist/commands/apps.d.ts +11 -3
  11. package/dist/commands/apps.js +86 -28
  12. package/dist/commands/apps.js.map +1 -1
  13. package/dist/commands/audiences.d.ts +31 -0
  14. package/dist/commands/audiences.js +239 -0
  15. package/dist/commands/audiences.js.map +1 -0
  16. package/dist/commands/build.d.ts +2 -0
  17. package/dist/commands/build.js +41 -0
  18. package/dist/commands/build.js.map +1 -0
  19. package/dist/commands/catalog.d.ts +4 -2
  20. package/dist/commands/catalog.js +166 -35
  21. package/dist/commands/catalog.js.map +1 -1
  22. package/dist/commands/check.d.ts +2 -0
  23. package/dist/commands/check.js +43 -0
  24. package/dist/commands/check.js.map +1 -0
  25. package/dist/commands/codegen.d.ts +2 -0
  26. package/dist/commands/codegen.js +49 -0
  27. package/dist/commands/codegen.js.map +1 -0
  28. package/dist/commands/contract.d.ts +52 -0
  29. package/dist/commands/contract.js +300 -0
  30. package/dist/commands/contract.js.map +1 -0
  31. package/dist/commands/dev.d.ts +7 -0
  32. package/dist/commands/dev.js +186 -12
  33. package/dist/commands/dev.js.map +1 -1
  34. package/dist/commands/index-experience.d.ts +31 -0
  35. package/dist/commands/index-experience.js +21 -0
  36. package/dist/commands/index-experience.js.map +1 -0
  37. package/dist/commands/init.d.ts +7 -0
  38. package/dist/commands/init.js +12 -0
  39. package/dist/commands/init.js.map +1 -1
  40. package/dist/commands/login.d.ts +2 -0
  41. package/dist/commands/login.js +17 -0
  42. package/dist/commands/login.js.map +1 -1
  43. package/dist/commands/new.d.ts +2 -0
  44. package/dist/commands/new.js +39 -0
  45. package/dist/commands/new.js.map +1 -0
  46. package/dist/commands/publish.d.ts +59 -0
  47. package/dist/commands/publish.js +118 -65
  48. package/dist/commands/publish.js.map +1 -1
  49. package/dist/commands/runs.d.ts +7 -3
  50. package/dist/commands/runs.js +21 -5
  51. package/dist/commands/runs.js.map +1 -1
  52. package/dist/commands/scope-notice.d.ts +13 -0
  53. package/dist/commands/scope-notice.js +12 -4
  54. package/dist/commands/scope-notice.js.map +1 -1
  55. package/dist/commands/sources-roles.d.ts +5 -0
  56. package/dist/commands/sources-roles.js +235 -0
  57. package/dist/commands/sources-roles.js.map +1 -0
  58. package/dist/commands/sources.d.ts +5 -0
  59. package/dist/commands/sources.js +8 -1
  60. package/dist/commands/sources.js.map +1 -1
  61. package/dist/commands/sync.d.ts +2 -0
  62. package/dist/commands/sync.js +150 -0
  63. package/dist/commands/sync.js.map +1 -0
  64. package/dist/commands/team-agent-readiness.d.ts +18 -2
  65. package/dist/commands/team-agent-readiness.js +39 -39
  66. package/dist/commands/team-agent-readiness.js.map +1 -1
  67. package/dist/commands/team-agents-agents.d.ts +5 -2
  68. package/dist/commands/team-agents-agents.js +152 -15
  69. package/dist/commands/team-agents-agents.js.map +1 -1
  70. package/dist/commands/team-agents-define.d.ts +31 -0
  71. package/dist/commands/team-agents-define.js +176 -0
  72. package/dist/commands/team-agents-define.js.map +1 -0
  73. package/dist/commands/team-agents-mcp.js +112 -10
  74. package/dist/commands/team-agents-mcp.js.map +1 -1
  75. package/dist/commands/team-agents-triggers.d.ts +1 -1
  76. package/dist/commands/team-agents-triggers.js +137 -5
  77. package/dist/commands/team-agents-triggers.js.map +1 -1
  78. package/dist/commands/team-agents.d.ts +4 -1
  79. package/dist/commands/team-agents.js +17 -4
  80. package/dist/commands/team-agents.js.map +1 -1
  81. package/dist/commands/team-llm-key.d.ts +14 -0
  82. package/dist/commands/team-llm-key.js +122 -0
  83. package/dist/commands/team-llm-key.js.map +1 -0
  84. package/dist/commands/teams-audience.d.ts +12 -0
  85. package/dist/commands/teams-audience.js +144 -0
  86. package/dist/commands/teams-audience.js.map +1 -0
  87. package/dist/commands/teams-connect.js +123 -31
  88. package/dist/commands/teams-connect.js.map +1 -1
  89. package/dist/commands/teams-lifecycle.d.ts +90 -0
  90. package/dist/commands/teams-lifecycle.js +457 -0
  91. package/dist/commands/teams-lifecycle.js.map +1 -0
  92. package/dist/commands/teams-onboard.d.ts +14 -0
  93. package/dist/commands/teams-onboard.js +62 -13
  94. package/dist/commands/teams-onboard.js.map +1 -1
  95. package/dist/commands/teams-overview.js +6 -2
  96. package/dist/commands/teams-overview.js.map +1 -1
  97. package/dist/commands/teams-scope.js +4 -0
  98. package/dist/commands/teams-scope.js.map +1 -1
  99. package/dist/commands/teams.d.ts +25 -5
  100. package/dist/commands/teams.js +106 -39
  101. package/dist/commands/teams.js.map +1 -1
  102. package/dist/commands/workflows.d.ts +37 -0
  103. package/dist/commands/workflows.js +589 -0
  104. package/dist/commands/workflows.js.map +1 -0
  105. package/dist/compatibility.d.ts +10 -1
  106. package/dist/compatibility.js +10 -1
  107. package/dist/compatibility.js.map +1 -1
  108. package/dist/connect-fields.d.ts +22 -0
  109. package/dist/connect-fields.js +115 -0
  110. package/dist/connect-fields.js.map +1 -0
  111. package/dist/context.d.ts +12 -0
  112. package/dist/context.js +32 -9
  113. package/dist/context.js.map +1 -1
  114. package/dist/dev-experience.d.ts +125 -0
  115. package/dist/dev-experience.js +128 -0
  116. package/dist/dev-experience.js.map +1 -0
  117. package/dist/experience/boundary.d.ts +12 -0
  118. package/dist/experience/boundary.js +260 -0
  119. package/dist/experience/boundary.js.map +1 -0
  120. package/dist/experience/build.d.ts +16 -0
  121. package/dist/experience/build.js +90 -0
  122. package/dist/experience/build.js.map +1 -0
  123. package/dist/experience/checks.d.ts +29 -0
  124. package/dist/experience/checks.js +133 -0
  125. package/dist/experience/checks.js.map +1 -0
  126. package/dist/experience/contract-sources.d.ts +36 -0
  127. package/dist/experience/contract-sources.js +111 -0
  128. package/dist/experience/contract-sources.js.map +1 -0
  129. package/dist/experience/definition-checks.d.ts +26 -0
  130. package/dist/experience/definition-checks.js +201 -0
  131. package/dist/experience/definition-checks.js.map +1 -0
  132. package/dist/experience/definition-shape.d.ts +60 -0
  133. package/dist/experience/definition-shape.js +2 -0
  134. package/dist/experience/definition-shape.js.map +1 -0
  135. package/dist/experience/init.d.ts +10 -0
  136. package/dist/experience/init.js +64 -0
  137. package/dist/experience/init.js.map +1 -0
  138. package/dist/experience/integrations-codegen.d.ts +17 -0
  139. package/dist/experience/integrations-codegen.js +51 -0
  140. package/dist/experience/integrations-codegen.js.map +1 -0
  141. package/dist/experience/json-schema-to-ts.d.ts +1 -0
  142. package/dist/experience/json-schema-to-ts.js +90 -0
  143. package/dist/experience/json-schema-to-ts.js.map +1 -0
  144. package/dist/experience/load-experience.d.ts +23 -0
  145. package/dist/experience/load-experience.js +115 -0
  146. package/dist/experience/load-experience.js.map +1 -0
  147. package/dist/experience/overrides.d.ts +8 -0
  148. package/dist/experience/overrides.js +21 -0
  149. package/dist/experience/overrides.js.map +1 -0
  150. package/dist/experience/pin-integration.d.ts +8 -0
  151. package/dist/experience/pin-integration.js +17 -0
  152. package/dist/experience/pin-integration.js.map +1 -0
  153. package/dist/experience/pin-ops.d.ts +12 -0
  154. package/dist/experience/pin-ops.js +36 -0
  155. package/dist/experience/pin-ops.js.map +1 -0
  156. package/dist/experience/pins.d.ts +35 -0
  157. package/dist/experience/pins.js +91 -0
  158. package/dist/experience/pins.js.map +1 -0
  159. package/dist/experience/project.d.ts +52 -0
  160. package/dist/experience/project.js +149 -0
  161. package/dist/experience/project.js.map +1 -0
  162. package/dist/experience/publish.d.ts +51 -0
  163. package/dist/experience/publish.js +144 -0
  164. package/dist/experience/publish.js.map +1 -0
  165. package/dist/experience/regenerate.d.ts +10 -0
  166. package/dist/experience/regenerate.js +33 -0
  167. package/dist/experience/regenerate.js.map +1 -0
  168. package/dist/experience/report.d.ts +9 -0
  169. package/dist/experience/report.js +23 -0
  170. package/dist/experience/report.js.map +1 -0
  171. package/dist/harness-scaffold.d.ts +52 -18
  172. package/dist/harness-scaffold.js +189 -9
  173. package/dist/harness-scaffold.js.map +1 -1
  174. package/dist/index.d.ts +13 -0
  175. package/dist/index.js +494 -127
  176. package/dist/index.js.map +1 -1
  177. package/dist/invocation.d.ts +31 -0
  178. package/dist/invocation.js +58 -0
  179. package/dist/invocation.js.map +1 -0
  180. package/dist/project-checks.d.ts +12 -0
  181. package/dist/project-checks.js +46 -0
  182. package/dist/project-checks.js.map +1 -1
  183. package/dist/project.d.ts +14 -0
  184. package/dist/project.js +10 -0
  185. package/dist/project.js.map +1 -1
  186. package/dist/repo/publish.d.ts +42 -0
  187. package/dist/repo/publish.js +225 -0
  188. package/dist/repo/publish.js.map +1 -0
  189. package/dist/repo/scaffold.d.ts +30 -0
  190. package/dist/repo/scaffold.js +165 -0
  191. package/dist/repo/scaffold.js.map +1 -0
  192. package/dist/runs-api.js +8 -3
  193. package/dist/runs-api.js.map +1 -1
  194. package/dist/safe-fs.d.ts +18 -0
  195. package/dist/safe-fs.js +57 -0
  196. package/dist/safe-fs.js.map +1 -1
  197. package/dist/secret-form.d.ts +48 -0
  198. package/dist/secret-form.js +212 -0
  199. package/dist/secret-form.js.map +1 -0
  200. package/dist/secret-input.d.ts +96 -0
  201. package/dist/secret-input.js +299 -0
  202. package/dist/secret-input.js.map +1 -0
  203. package/dist/team-connect-api.d.ts +78 -3
  204. package/dist/team-connect-api.js +17 -2
  205. package/dist/team-connect-api.js.map +1 -1
  206. package/dist/team-lifecycle-api.d.ts +435 -0
  207. package/dist/team-lifecycle-api.js +301 -0
  208. package/dist/team-lifecycle-api.js.map +1 -0
  209. package/dist/teams-api.d.ts +49 -1
  210. package/dist/teams-api.js +149 -27
  211. package/dist/teams-api.js.map +1 -1
  212. package/dist/unknown-command.d.ts +18 -0
  213. package/dist/unknown-command.js +50 -0
  214. package/dist/unknown-command.js.map +1 -0
  215. package/dist/validate-findings.js +2 -1
  216. package/dist/validate-findings.js.map +1 -1
  217. package/dist/workflows-api.d.ts +69 -0
  218. package/dist/workflows-api.js +182 -0
  219. package/dist/workflows-api.js.map +1 -0
  220. package/package.json +3 -3
  221. package/templates/AGENTS.md.tmpl +6 -4
  222. package/templates/claude-skill.md.tmpl +4 -1
  223. package/templates/ekanos.json.tmpl +1 -0
  224. package/templates/experience/AGENTS.md.tmpl +22 -0
  225. package/templates/experience/ekanos.json.tmpl +7 -0
  226. package/templates/experience/ekanos.lock.json.tmpl +4 -0
  227. package/templates/experience/eslint.config.mjs.tmpl +25 -0
  228. package/templates/experience/gitignore.tmpl +17 -0
  229. package/templates/experience/package.json.tmpl +41 -0
  230. package/templates/experience/src/.ekanos/integrations.d.ts.tmpl +3 -0
  231. package/templates/experience/src/experience.ts.tmpl +30 -0
  232. package/templates/experience/src/widgets/hello-widget.tsx.tmpl +40 -0
  233. package/templates/experience/tsconfig.json.tmpl +20 -0
  234. package/templates/harness/app/%5F%5Fekanos/api/[...path]/route.ts.tmpl +9 -0
  235. package/templates/harness/app/[slug]/activation/page.tsx.tmpl +1 -1
  236. package/templates/harness/app/[slug]/page.tsx.tmpl +1 -1
  237. package/templates/harness/app/[slug]/tile/page.tsx.tmpl +1 -1
  238. package/templates/harness/app/[slug]/triggers/page.tsx.tmpl +1 -1
  239. package/templates/harness/app/[slug]/widgets/[widgetId]/page.tsx.tmpl +1 -1
  240. package/templates/harness/app/[slug]/widgets/page.tsx.tmpl +1 -1
  241. package/templates/harness/app/experience/layout.tsx.tmpl +17 -0
  242. package/templates/harness/app/experience/page.tsx.tmpl +1 -0
  243. package/templates/harness/app/experience/pages/[id]/page.tsx.tmpl +1 -0
  244. package/templates/harness/app/experience/review-queue/page.tsx.tmpl +1 -0
  245. package/templates/harness/app/experience/runs/page.tsx.tmpl +1 -0
  246. package/templates/harness/app/experience/widgets/[id]/page.tsx.tmpl +1 -0
  247. package/templates/harness/app/experience/widgets/page.tsx.tmpl +1 -0
  248. package/templates/harness/app/experience/workflows/[id]/page.tsx.tmpl +1 -0
  249. package/templates/harness/app/experience/workflows/page.tsx.tmpl +1 -0
  250. package/templates/harness/app/integrations/[slug]/connect/page.tsx.tmpl +1 -0
  251. package/templates/harness/app/integrations/[slug]/events/page.tsx.tmpl +1 -0
  252. package/templates/harness/app/integrations/[slug]/health/page.tsx.tmpl +1 -0
  253. package/templates/harness/app/integrations/[slug]/operations/[kind]/[name]/page.tsx.tmpl +1 -0
  254. package/templates/harness/app/integrations/[slug]/operations/page.tsx.tmpl +1 -0
  255. package/templates/harness/app/integrations/[slug]/page.tsx.tmpl +1 -0
  256. package/templates/harness/app/integrations/[slug]/preview/activation/page.tsx.tmpl +1 -0
  257. package/templates/harness/app/integrations/[slug]/preview/layout.tsx.tmpl +1 -0
  258. package/templates/harness/app/integrations/[slug]/preview/page.tsx.tmpl +1 -0
  259. package/templates/harness/app/integrations/[slug]/preview/tile/page.tsx.tmpl +1 -0
  260. package/templates/harness/app/integrations/[slug]/preview/triggers/page.tsx.tmpl +1 -0
  261. package/templates/harness/app/integrations/[slug]/preview/widgets/[widgetId]/page.tsx.tmpl +1 -0
  262. package/templates/harness/app/integrations/[slug]/preview/widgets/page.tsx.tmpl +1 -0
  263. package/templates/harness/app/integrations/[slug]/runs/page.tsx.tmpl +1 -0
  264. package/templates/harness/app/integrations/layout.tsx.tmpl +1 -0
  265. package/templates/harness/app/integrations/page.tsx.tmpl +1 -0
  266. package/templates/harness/app/page.experience.tsx.tmpl +5 -0
  267. package/templates/harness/repo/app/%5F%5Fekanos/api/[...path]/route.ts.tmpl +11 -0
  268. package/templates/harness/repo/app/(repo)/connections/page.tsx.tmpl +1 -0
  269. package/templates/harness/repo/app/(repo)/layout.tsx.tmpl +1 -0
  270. package/templates/harness/repo/app/(repo)/page.tsx.tmpl +1 -0
  271. package/templates/harness/repo/app/experiences/[name]/connect/page.tsx.tmpl +1 -0
  272. package/templates/harness/repo/app/experiences/[name]/layout.tsx.tmpl +9 -0
  273. package/templates/harness/repo/app/experiences/page.tsx.tmpl +5 -0
  274. package/templates/harness/repo/app/harness-shell.tsx.tmpl +9 -0
  275. package/templates/harness/repo/app/integrations/[slug]/layout.tsx.tmpl +1 -0
  276. package/templates/harness/repo/app/integrations/page.tsx.tmpl +5 -0
  277. package/templates/harness/repo/app/repo-experiences.ts.tmpl +5 -0
  278. package/templates/harness/styles/globals.css.tmpl +15 -1
  279. package/templates/package.json.tmpl +4 -4
  280. package/templates/skills/build-agent/SKILL.md +43 -10
  281. package/templates/skills/build-agent/references/agent-json.md +4 -1
  282. package/templates/skills/build-agent/references/app-setup.md +14 -7
  283. package/templates/skills/build-agent/references/rollout.md +26 -2
  284. package/templates/skills/build-agent/references/set-up-an-integration.md +46 -29
  285. package/templates/skills/build-integration/references/widget-design.md +1 -1
  286. package/templates/skills/ekanos-platform/SKILL.md +66 -14
  287. package/templates/skills/polish-widgets/references/patterns.md +3 -3
@@ -0,0 +1,301 @@
1
+ import { z } from 'zod';
2
+ import { call } from './teams-api.js';
3
+ /**
4
+ * The CLI's client for a team's lifecycle and a Source's roles and people —
5
+ * every call a Source admin's, through `call` (`teams-api.ts`) for its
6
+ * refresh and refusals.
7
+ *
8
+ * POST /api/partner/teams/<team>/members/<email>/resend → resend | renew
9
+ * POST /api/partner/teams/<team>/leave → the caller leaves
10
+ * GET|POST /api/partner/teams/<team>/groups
11
+ * PATCH|DELETE /api/partner/teams/<team>/groups/<group>
12
+ * PUT|DELETE /api/partner/teams/<team>/groups/<group>/members/<email>
13
+ * GET /api/partner/teams/<team>/health
14
+ * POST /api/partner/teams/<team>/health/<product> → run now
15
+ * GET /api/partner/teams/<team>/workspaces
16
+ * PUT /api/partner/teams/<team>/workspaces/default { workspace }
17
+ * GET|POST /api/partner/sources/roles
18
+ * PATCH|DELETE /api/partner/sources/roles/<role>
19
+ * GET /api/partner/sources/people[?search=&page=]
20
+ *
21
+ * The shapes are read here rather than from `@ekanos/integration-schema`, so
22
+ * this CLI works against a host without a schema release.
23
+ */
24
+ const SourceRefSchema = z.object({
25
+ id: z.string(),
26
+ slug: z.string(),
27
+ name: z.string().nullable(),
28
+ });
29
+ const TeamRefSchema = z.object({ slug: z.string(), name: z.string() });
30
+ const PersonSchema = z.object({
31
+ userId: z.string(),
32
+ email: z.string().nullable(),
33
+ name: z.string().nullable(),
34
+ });
35
+ export const InvitationResendSchema = z.object({
36
+ team: TeamRefSchema,
37
+ email: z.string(),
38
+ role: z.string(),
39
+ action: z.enum(['renewed', 'resent']),
40
+ expiresAt: z.string(),
41
+ });
42
+ export const TeamLeaveSchema = z.object({
43
+ team: TeamRefSchema,
44
+ role: z.string(),
45
+ });
46
+ export const TeamGroupSchema = z.object({
47
+ id: z.string(),
48
+ name: z.string(),
49
+ description: z.string().nullable(),
50
+ members: z.array(PersonSchema),
51
+ products: z.array(z.object({ slug: z.string(), name: z.string() })),
52
+ widgetCount: z.number(),
53
+ mcpToolCount: z.number(),
54
+ });
55
+ const GroupListSchema = z.object({
56
+ source: SourceRefSchema,
57
+ team: TeamRefSchema,
58
+ groups: z.array(TeamGroupSchema),
59
+ });
60
+ const GroupResultSchema = z.object({
61
+ team: TeamRefSchema,
62
+ group: TeamGroupSchema,
63
+ });
64
+ const GroupUpdateSchema = GroupResultSchema.extend({
65
+ previous: TeamGroupSchema,
66
+ });
67
+ const GroupMemberSchema = GroupResultSchema.extend({
68
+ email: z.string(),
69
+ changed: z.boolean(),
70
+ });
71
+ const HealthStatusSchema = z.enum([
72
+ 'healthy',
73
+ 'degraded',
74
+ 'unhealthy',
75
+ 'unknown',
76
+ ]);
77
+ export const TeamHealthRowSchema = z.object({
78
+ productId: z.string(),
79
+ productName: z.string(),
80
+ slug: z.string(),
81
+ status: HealthStatusSchema,
82
+ lastCheckedAt: z.string().nullable(),
83
+ lastSuccessAt: z.string().nullable(),
84
+ lastFailureAt: z.string().nullable(),
85
+ lastErrorMessage: z.string().nullable(),
86
+ errorRatePct: z.number().nullable(),
87
+ tokenExpiresAt: z.string().nullable(),
88
+ statusReason: z.string().nullable(),
89
+ });
90
+ const HealthListSchema = z.object({
91
+ source: SourceRefSchema,
92
+ team: TeamRefSchema,
93
+ integrations: z.array(TeamHealthRowSchema),
94
+ });
95
+ const HealthRunSchema = z.object({
96
+ team: TeamRefSchema,
97
+ integration: TeamHealthRowSchema,
98
+ });
99
+ const WorkspaceSchema = z.object({
100
+ slug: z.string(),
101
+ name: z.string(),
102
+ label: z.string().nullable(),
103
+ visible: z.boolean(),
104
+ isDefault: z.boolean(),
105
+ });
106
+ const WorkspaceListSchema = z.object({
107
+ source: SourceRefSchema,
108
+ team: TeamRefSchema,
109
+ workspaces: z.array(WorkspaceSchema),
110
+ });
111
+ const WorkspaceDefaultSchema = z.object({
112
+ team: TeamRefSchema,
113
+ workspace: WorkspaceSchema,
114
+ previous: WorkspaceSchema.nullable(),
115
+ changed: z.boolean(),
116
+ });
117
+ export const SourceRoleSchema = z.object({
118
+ name: z.string(),
119
+ displayName: z.string(),
120
+ description: z.string().nullable(),
121
+ hierarchyLevel: z.number(),
122
+ isSystem: z.boolean(),
123
+ permissions: z.array(z.string()),
124
+ memberCount: z.number(),
125
+ });
126
+ const RoleListSchema = z.object({
127
+ source: SourceRefSchema,
128
+ roles: z.array(SourceRoleSchema),
129
+ permissions: z.array(z.object({
130
+ permission: z.string(),
131
+ label: z.string(),
132
+ category: z.string(),
133
+ })),
134
+ });
135
+ const RoleResultSchema = z.object({
136
+ source: SourceRefSchema,
137
+ role: SourceRoleSchema,
138
+ });
139
+ const RoleUpdateSchema = RoleResultSchema.extend({
140
+ previous: SourceRoleSchema,
141
+ });
142
+ const PersonStateSchema = z.enum([
143
+ 'active',
144
+ 'suspended',
145
+ 'invited',
146
+ 'left',
147
+ 'removed',
148
+ ]);
149
+ const PeopleSchema = z.object({
150
+ source: SourceRefSchema,
151
+ people: z.array(z.object({
152
+ userId: z.string(),
153
+ name: z.string().nullable(),
154
+ email: z.string().nullable(),
155
+ joinedAt: z.string().nullable(),
156
+ status: PersonStateSchema,
157
+ teams: z.array(z.object({
158
+ accountName: z.string(),
159
+ roleLabel: z.string(),
160
+ status: PersonStateSchema,
161
+ })),
162
+ })),
163
+ total: z.number(),
164
+ page: z.number(),
165
+ pageSize: z.number(),
166
+ });
167
+ const teamPath = (team) => `/api/partner/teams/${encodeURIComponent(team)}`;
168
+ const memberPath = (team, email) => `${teamPath(team)}/members/${encodeURIComponent(email)}`;
169
+ const groupPath = (team, group) => `${teamPath(team)}/groups/${encodeURIComponent(group)}`;
170
+ export function resendTeamInvitation(host, token, target) {
171
+ return call(host, token, InvitationResendSchema, {
172
+ method: 'POST',
173
+ path: `${memberPath(target.team, target.email)}/resend`,
174
+ source: target.source,
175
+ });
176
+ }
177
+ export function leaveTeam(host, token, target) {
178
+ return call(host, token, TeamLeaveSchema, {
179
+ method: 'POST',
180
+ path: `${teamPath(target.team)}/leave`,
181
+ source: target.source,
182
+ });
183
+ }
184
+ export function listTeamGroups(host, token, target) {
185
+ return call(host, token, GroupListSchema, {
186
+ method: 'GET',
187
+ path: `${teamPath(target.team)}/groups`,
188
+ source: target.source,
189
+ });
190
+ }
191
+ export function createTeamGroup(host, token, target, body) {
192
+ return call(host, token, GroupResultSchema, {
193
+ method: 'POST',
194
+ path: `${teamPath(target.team)}/groups`,
195
+ source: target.source,
196
+ body,
197
+ });
198
+ }
199
+ export function updateTeamGroup(host, token, target, body) {
200
+ return call(host, token, GroupUpdateSchema, {
201
+ method: 'PATCH',
202
+ path: groupPath(target.team, target.group),
203
+ source: target.source,
204
+ body,
205
+ });
206
+ }
207
+ export function deleteTeamGroup(host, token, target) {
208
+ return call(host, token, GroupResultSchema, {
209
+ method: 'DELETE',
210
+ path: groupPath(target.team, target.group),
211
+ source: target.source,
212
+ });
213
+ }
214
+ export function setTeamGroupMember(host, token, target, member) {
215
+ return call(host, token, GroupMemberSchema, {
216
+ method: member ? 'PUT' : 'DELETE',
217
+ path: `${groupPath(target.team, target.group)}/members/${encodeURIComponent(target.email)}`,
218
+ source: target.source,
219
+ });
220
+ }
221
+ export function listTeamHealth(host, token, target) {
222
+ return call(host, token, HealthListSchema, {
223
+ method: 'GET',
224
+ path: `${teamPath(target.team)}/health`,
225
+ source: target.source,
226
+ });
227
+ }
228
+ /** The caller's own personal connection's health; `run` checks it now. */
229
+ export function ownTeamHealth(host, token, target, run) {
230
+ return call(host, token, HealthRunSchema, {
231
+ method: run ? 'POST' : 'GET',
232
+ path: `${teamPath(target.team)}/health/${encodeURIComponent(target.product)}/mine`,
233
+ source: target.source,
234
+ });
235
+ }
236
+ export function runTeamHealthCheck(host, token, target) {
237
+ return call(host, token, HealthRunSchema, {
238
+ method: 'POST',
239
+ path: `${teamPath(target.team)}/health/${encodeURIComponent(target.product)}`,
240
+ source: target.source,
241
+ });
242
+ }
243
+ export function listTeamWorkspaces(host, token, target) {
244
+ return call(host, token, WorkspaceListSchema, {
245
+ method: 'GET',
246
+ path: `${teamPath(target.team)}/workspaces`,
247
+ source: target.source,
248
+ });
249
+ }
250
+ export function setTeamDefaultWorkspace(host, token, target, workspace) {
251
+ return call(host, token, WorkspaceDefaultSchema, {
252
+ method: 'PUT',
253
+ path: `${teamPath(target.team)}/workspaces/default`,
254
+ source: target.source,
255
+ body: { workspace },
256
+ });
257
+ }
258
+ export function listSourceRoles(host, token, source) {
259
+ return call(host, token, RoleListSchema, {
260
+ method: 'GET',
261
+ path: '/api/partner/sources/roles',
262
+ source,
263
+ });
264
+ }
265
+ export function createSourceRole(host, token, source, body) {
266
+ return call(host, token, RoleResultSchema, {
267
+ method: 'POST',
268
+ path: '/api/partner/sources/roles',
269
+ source,
270
+ body,
271
+ });
272
+ }
273
+ export function updateSourceRole(host, token, target, body) {
274
+ return call(host, token, RoleUpdateSchema, {
275
+ method: 'PATCH',
276
+ path: `/api/partner/sources/roles/${encodeURIComponent(target.role)}`,
277
+ source: target.source,
278
+ body,
279
+ });
280
+ }
281
+ export function deleteSourceRole(host, token, target) {
282
+ return call(host, token, RoleResultSchema, {
283
+ method: 'DELETE',
284
+ path: `/api/partner/sources/roles/${encodeURIComponent(target.role)}`,
285
+ source: target.source,
286
+ });
287
+ }
288
+ export function listSourcePeople(host, token, source, query) {
289
+ const params = new URLSearchParams();
290
+ if (query.search)
291
+ params.set('search', query.search);
292
+ if (query.page !== undefined)
293
+ params.set('page', String(query.page));
294
+ const encoded = params.toString();
295
+ return call(host, token, PeopleSchema, {
296
+ method: 'GET',
297
+ path: `/api/partner/sources/people${encoded ? `?${encoded}` : ''}`,
298
+ source,
299
+ });
300
+ }
301
+ //# sourceMappingURL=team-lifecycle-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-lifecycle-api.js","sourceRoot":"","sources":["../src/team-lifecycle-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACvE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,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api';\n\n/**\n * The CLI's client for a team's lifecycle and a Source's roles and people —\n * every call a Source admin's, through `call` (`teams-api.ts`) for its\n * refresh and refusals.\n *\n * POST /api/partner/teams/<team>/members/<email>/resend → resend | renew\n * POST /api/partner/teams/<team>/leave → the caller leaves\n * GET|POST /api/partner/teams/<team>/groups\n * PATCH|DELETE /api/partner/teams/<team>/groups/<group>\n * PUT|DELETE /api/partner/teams/<team>/groups/<group>/members/<email>\n * GET /api/partner/teams/<team>/health\n * POST /api/partner/teams/<team>/health/<product> → run now\n * GET /api/partner/teams/<team>/workspaces\n * PUT /api/partner/teams/<team>/workspaces/default { workspace }\n * GET|POST /api/partner/sources/roles\n * PATCH|DELETE /api/partner/sources/roles/<role>\n * GET /api/partner/sources/people[?search=&page=]\n *\n * The shapes are read here rather than from `@ekanos/integration-schema`, so\n * this CLI works against a host without a schema release.\n */\n\nconst SourceRefSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string().nullable(),\n});\nconst TeamRefSchema = z.object({ slug: z.string(), name: z.string() });\nconst PersonSchema = z.object({\n userId: z.string(),\n email: z.string().nullable(),\n name: z.string().nullable(),\n});\n\nexport const InvitationResendSchema = z.object({\n team: TeamRefSchema,\n email: z.string(),\n role: z.string(),\n action: z.enum(['renewed', 'resent']),\n expiresAt: z.string(),\n});\n\nexport const TeamLeaveSchema = z.object({\n team: TeamRefSchema,\n role: z.string(),\n});\n\nexport const TeamGroupSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().nullable(),\n members: z.array(PersonSchema),\n products: z.array(z.object({ slug: z.string(), name: z.string() })),\n widgetCount: z.number(),\n mcpToolCount: z.number(),\n});\nexport type TeamGroup = z.infer<typeof TeamGroupSchema>;\n\nconst GroupListSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n groups: z.array(TeamGroupSchema),\n});\nconst GroupResultSchema = z.object({\n team: TeamRefSchema,\n group: TeamGroupSchema,\n});\nconst GroupUpdateSchema = GroupResultSchema.extend({\n previous: TeamGroupSchema,\n});\nconst GroupMemberSchema = GroupResultSchema.extend({\n email: z.string(),\n changed: z.boolean(),\n});\n\nconst HealthStatusSchema = z.enum([\n 'healthy',\n 'degraded',\n 'unhealthy',\n 'unknown',\n]);\nexport const TeamHealthRowSchema = z.object({\n productId: z.string(),\n productName: z.string(),\n slug: z.string(),\n status: HealthStatusSchema,\n lastCheckedAt: z.string().nullable(),\n lastSuccessAt: z.string().nullable(),\n lastFailureAt: z.string().nullable(),\n lastErrorMessage: z.string().nullable(),\n errorRatePct: z.number().nullable(),\n tokenExpiresAt: z.string().nullable(),\n statusReason: z.string().nullable(),\n});\nexport type TeamHealthRow = z.infer<typeof TeamHealthRowSchema>;\n\nconst HealthListSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n integrations: z.array(TeamHealthRowSchema),\n});\nconst HealthRunSchema = z.object({\n team: TeamRefSchema,\n integration: TeamHealthRowSchema,\n});\n\nconst WorkspaceSchema = z.object({\n slug: z.string(),\n name: z.string(),\n label: z.string().nullable(),\n visible: z.boolean(),\n isDefault: z.boolean(),\n});\nconst WorkspaceListSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n workspaces: z.array(WorkspaceSchema),\n});\nconst WorkspaceDefaultSchema = z.object({\n team: TeamRefSchema,\n workspace: WorkspaceSchema,\n previous: WorkspaceSchema.nullable(),\n changed: z.boolean(),\n});\n\nexport const SourceRoleSchema = z.object({\n name: z.string(),\n displayName: z.string(),\n description: z.string().nullable(),\n hierarchyLevel: z.number(),\n isSystem: z.boolean(),\n permissions: z.array(z.string()),\n memberCount: z.number(),\n});\nexport type SourceRole = z.infer<typeof SourceRoleSchema>;\n\nconst RoleListSchema = z.object({\n source: SourceRefSchema,\n roles: z.array(SourceRoleSchema),\n permissions: z.array(\n z.object({\n permission: z.string(),\n label: z.string(),\n category: z.string(),\n }),\n ),\n});\nconst RoleResultSchema = z.object({\n source: SourceRefSchema,\n role: SourceRoleSchema,\n});\nconst RoleUpdateSchema = RoleResultSchema.extend({\n previous: SourceRoleSchema,\n});\n\nconst PersonStateSchema = z.enum([\n 'active',\n 'suspended',\n 'invited',\n 'left',\n 'removed',\n]);\nconst PeopleSchema = z.object({\n source: SourceRefSchema,\n people: z.array(\n z.object({\n userId: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable(),\n joinedAt: z.string().nullable(),\n status: PersonStateSchema,\n teams: z.array(\n z.object({\n accountName: z.string(),\n roleLabel: z.string(),\n status: PersonStateSchema,\n }),\n ),\n }),\n ),\n total: z.number(),\n page: z.number(),\n pageSize: z.number(),\n});\nexport type SourcePeople = z.infer<typeof PeopleSchema>;\n\ntype TeamTarget = { source: string; team: string };\ntype Api<T> = Promise<TeamsApiResult<T>>;\n\nconst teamPath = (team: string) =>\n `/api/partner/teams/${encodeURIComponent(team)}`;\nconst memberPath = (team: string, email: string) =>\n `${teamPath(team)}/members/${encodeURIComponent(email)}`;\nconst groupPath = (team: string, group: string) =>\n `${teamPath(team)}/groups/${encodeURIComponent(group)}`;\n\nexport function resendTeamInvitation(\n host: string,\n token: string,\n target: TeamTarget & { email: string },\n): Api<z.infer<typeof InvitationResendSchema>> {\n return call(host, token, InvitationResendSchema, {\n method: 'POST',\n path: `${memberPath(target.team, target.email)}/resend`,\n source: target.source,\n });\n}\n\nexport function leaveTeam(\n host: string,\n token: string,\n target: TeamTarget,\n): Api<z.infer<typeof TeamLeaveSchema>> {\n return call(host, token, TeamLeaveSchema, {\n method: 'POST',\n path: `${teamPath(target.team)}/leave`,\n source: target.source,\n });\n}\n\nexport function listTeamGroups(\n host: string,\n token: string,\n target: TeamTarget,\n): Api<z.infer<typeof GroupListSchema>> {\n return call(host, token, GroupListSchema, {\n method: 'GET',\n path: `${teamPath(target.team)}/groups`,\n source: target.source,\n });\n}\n\nexport function createTeamGroup(\n host: string,\n token: string,\n target: TeamTarget,\n body: { name: string; description?: string; products?: string[] },\n): Api<z.infer<typeof GroupResultSchema>> {\n return call(host, token, GroupResultSchema, {\n method: 'POST',\n path: `${teamPath(target.team)}/groups`,\n source: target.source,\n body,\n });\n}\n\nexport function updateTeamGroup(\n host: string,\n token: string,\n target: TeamTarget & { group: string },\n body: { name?: string; description?: string | null; products?: string[] },\n): Api<z.infer<typeof GroupUpdateSchema>> {\n return call(host, token, GroupUpdateSchema, {\n method: 'PATCH',\n path: groupPath(target.team, target.group),\n source: target.source,\n body,\n });\n}\n\nexport function deleteTeamGroup(\n host: string,\n token: string,\n target: TeamTarget & { group: string },\n): Api<z.infer<typeof GroupResultSchema>> {\n return call(host, token, GroupResultSchema, {\n method: 'DELETE',\n path: groupPath(target.team, target.group),\n source: target.source,\n });\n}\n\nexport function setTeamGroupMember(\n host: string,\n token: string,\n target: TeamTarget & { group: string; email: string },\n member: boolean,\n): Api<z.infer<typeof GroupMemberSchema>> {\n return call(host, token, GroupMemberSchema, {\n method: member ? 'PUT' : 'DELETE',\n path: `${groupPath(target.team, target.group)}/members/${encodeURIComponent(target.email)}`,\n source: target.source,\n });\n}\n\nexport function listTeamHealth(\n host: string,\n token: string,\n target: TeamTarget,\n): Api<z.infer<typeof HealthListSchema>> {\n return call(host, token, HealthListSchema, {\n method: 'GET',\n path: `${teamPath(target.team)}/health`,\n source: target.source,\n });\n}\n\n/** The caller's own personal connection's health; `run` checks it now. */\nexport function ownTeamHealth(\n host: string,\n token: string,\n target: TeamTarget & { product: string },\n run: boolean,\n): Api<z.infer<typeof HealthRunSchema>> {\n return call(host, token, HealthRunSchema, {\n method: run ? 'POST' : 'GET',\n path: `${teamPath(target.team)}/health/${encodeURIComponent(target.product)}/mine`,\n source: target.source,\n });\n}\n\nexport function runTeamHealthCheck(\n host: string,\n token: string,\n target: TeamTarget & { product: string },\n): Api<z.infer<typeof HealthRunSchema>> {\n return call(host, token, HealthRunSchema, {\n method: 'POST',\n path: `${teamPath(target.team)}/health/${encodeURIComponent(target.product)}`,\n source: target.source,\n });\n}\n\nexport function listTeamWorkspaces(\n host: string,\n token: string,\n target: TeamTarget,\n): Api<z.infer<typeof WorkspaceListSchema>> {\n return call(host, token, WorkspaceListSchema, {\n method: 'GET',\n path: `${teamPath(target.team)}/workspaces`,\n source: target.source,\n });\n}\n\nexport function setTeamDefaultWorkspace(\n host: string,\n token: string,\n target: TeamTarget,\n workspace: string,\n): Api<z.infer<typeof WorkspaceDefaultSchema>> {\n return call(host, token, WorkspaceDefaultSchema, {\n method: 'PUT',\n path: `${teamPath(target.team)}/workspaces/default`,\n source: target.source,\n body: { workspace },\n });\n}\n\nexport function listSourceRoles(\n host: string,\n token: string,\n source: string,\n): Api<z.infer<typeof RoleListSchema>> {\n return call(host, token, RoleListSchema, {\n method: 'GET',\n path: '/api/partner/sources/roles',\n source,\n });\n}\n\nexport function createSourceRole(\n host: string,\n token: string,\n source: string,\n body: {\n name: string;\n displayName: string;\n description?: string;\n hierarchyLevel: number;\n permissions: string[];\n },\n): Api<z.infer<typeof RoleResultSchema>> {\n return call(host, token, RoleResultSchema, {\n method: 'POST',\n path: '/api/partner/sources/roles',\n source,\n body,\n });\n}\n\nexport function updateSourceRole(\n host: string,\n token: string,\n target: { source: string; role: string },\n body: {\n displayName?: string;\n description?: string;\n hierarchyLevel?: number;\n permissions?: string[];\n grant?: string[];\n revoke?: string[];\n },\n): Api<z.infer<typeof RoleUpdateSchema>> {\n return call(host, token, RoleUpdateSchema, {\n method: 'PATCH',\n path: `/api/partner/sources/roles/${encodeURIComponent(target.role)}`,\n source: target.source,\n body,\n });\n}\n\nexport function deleteSourceRole(\n host: string,\n token: string,\n target: { source: string; role: string },\n): Api<z.infer<typeof RoleResultSchema>> {\n return call(host, token, RoleResultSchema, {\n method: 'DELETE',\n path: `/api/partner/sources/roles/${encodeURIComponent(target.role)}`,\n source: target.source,\n });\n}\n\nexport function listSourcePeople(\n host: string,\n token: string,\n source: string,\n query: { search?: string; page?: number },\n): Api<SourcePeople> {\n const params = new URLSearchParams();\n if (query.search) params.set('search', query.search);\n if (query.page !== undefined) params.set('page', String(query.page));\n const encoded = params.toString();\n return call(host, token, PeopleSchema, {\n method: 'GET',\n path: `/api/partner/sources/people${encoded ? `?${encoded}` : ''}`,\n source,\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { type ProductScopeList, type ProductScopeProductChange, type TeamScopes, type TeamScopesSetResult, type TeamAppSetResult, type TeamCreateRequest, type TeamCreateResult, type TeamDisconnectResult, type TeamMemberChangeResult, type TeamMemberInviteResult, type TeamMemberList, type TeamRenameResult, type TeamRoles, type TeamIntegrationStatus, type TeamIntegrationEventList, type TeamList, type TeamWebhookMintResult } from '@ekanos/integration-schema';
1
+ import { type AudienceCreateRequest, type AudienceListResponse, type AudienceResponse, type AudienceUpdateRequest, type MemberAudience, type MemberAudienceSetResult, type TeamAudience, type TeamAudienceSetResult, type ProductScopeList, type ProductScopeProductChange, type TeamScopes, type TeamScopesSetResult, type TeamAppSetResult, type TeamCreateRequest, type TeamCreateResult, type TeamDisconnectResult, type TeamMemberChangeResult, type TeamMemberAddResult, type TeamMemberInviteResult, type TeamMemberList, type TeamRenameResult, type TeamRoles, type TeamIntegrationStatus, type TeamIntegrationEventList, type TeamList, type TeamWebhookMintResult } from '@ekanos/integration-schema';
2
2
  import type { z } from 'zod';
3
3
  /**
4
4
  * The CLI's client for a Source's teams and their integration setup — the
@@ -22,6 +22,13 @@ import type { z } from 'zod';
22
22
  * GET /api/partner/scopes?source=<slug> → ProductScopeList
23
23
  * PUT | DELETE /api/partner/scopes/<scope>/products/<product>?source=<slug>
24
24
  * → ProductScopeProductChange
25
+ * GET /api/partner/audiences?source=<slug> → AudienceListResponse
26
+ * GET | PATCH /api/partner/audiences/<audience>?source=<slug> → AudienceResponse
27
+ * POST /api/partner/audiences?source=<slug> { name, … } → AudienceResponse
28
+ * GET | PUT /api/partner/teams/<team>/audience?source=<slug> { audienceId }
29
+ * → TeamAudience | TeamAudienceSetResult
30
+ * GET | PUT …/<team>/members/<email>/audience?source=<slug> { audienceId | null }
31
+ * → MemberAudience | MemberAudienceSetResult
25
32
  * GET /api/partner/teams/<team>/scopes?source=<slug> → TeamScopes
26
33
  * PUT /api/partner/teams/<team>/scopes?source=<slug> { scopes } → TeamScopesSetResult
27
34
  *
@@ -64,6 +71,7 @@ export declare function disconnectTeamIntegration(host: string, accessToken: str
64
71
  source: string;
65
72
  team: string;
66
73
  product: string;
74
+ mine?: boolean;
67
75
  }): Promise<TeamsApiResult<TeamDisconnectResult>>;
68
76
  export declare function createTeam(host: string, accessToken: string, source: string, body: TeamCreateRequest): Promise<TeamsApiResult<TeamCreateResult>>;
69
77
  export declare function renameTeam(host: string, accessToken: string, target: {
@@ -81,6 +89,17 @@ export declare function inviteTeamMember(host: string, accessToken: string, targ
81
89
  email: string;
82
90
  role: string;
83
91
  }): Promise<TeamsApiResult<TeamMemberInviteResult>>;
92
+ /** `teams members add`: a member now, no invitation email (`PUT`). */
93
+ export declare function addTeamMember(host: string, accessToken: string, target: {
94
+ source: string;
95
+ team: string;
96
+ }, body: {
97
+ self: true;
98
+ role?: string;
99
+ } | {
100
+ email: string;
101
+ role?: string;
102
+ }): Promise<TeamsApiResult<TeamMemberAddResult>>;
84
103
  export declare function setTeamMemberRole(host: string, accessToken: string, target: {
85
104
  source: string;
86
105
  team: string;
@@ -105,6 +124,35 @@ export declare function setTeamScopes(host: string, accessToken: string, target:
105
124
  source: string;
106
125
  team: string;
107
126
  }, scopes: string[]): Promise<TeamsApiResult<TeamScopesSetResult>>;
127
+ export declare function listAudiences(host: string, accessToken: string, source: string): Promise<TeamsApiResult<AudienceListResponse>>;
128
+ export declare function showAudience(host: string, accessToken: string, target: {
129
+ source: string;
130
+ audience: string;
131
+ }): Promise<TeamsApiResult<AudienceResponse>>;
132
+ export declare function createAudience(host: string, accessToken: string, source: string, body: AudienceCreateRequest): Promise<TeamsApiResult<AudienceResponse>>;
133
+ export declare function updateAudience(host: string, accessToken: string, target: {
134
+ source: string;
135
+ audience: string;
136
+ }, body: AudienceUpdateRequest): Promise<TeamsApiResult<AudienceResponse>>;
137
+ export declare function showTeamAudience(host: string, accessToken: string, target: {
138
+ source: string;
139
+ team: string;
140
+ }): Promise<TeamsApiResult<TeamAudience>>;
141
+ export declare function setTeamAudience(host: string, accessToken: string, target: {
142
+ source: string;
143
+ team: string;
144
+ }, audienceId: string): Promise<TeamsApiResult<TeamAudienceSetResult>>;
145
+ export declare function showMemberAudience(host: string, accessToken: string, target: {
146
+ source: string;
147
+ team: string;
148
+ email: string;
149
+ }): Promise<TeamsApiResult<MemberAudience>>;
150
+ /** `audienceId: null` clears the member's own audience. */
151
+ export declare function setMemberAudience(host: string, accessToken: string, target: {
152
+ source: string;
153
+ team: string;
154
+ email: string;
155
+ }, audienceId: string | null): Promise<TeamsApiResult<MemberAudienceSetResult>>;
108
156
  export declare function listTeamRoles(host: string, accessToken: string, target: {
109
157
  source: string;
110
158
  team: string;