@sendbird/cli 0.0.0-stage → 0.4.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 (182) hide show
  1. package/.claude-plugin/plugin.json +11 -0
  2. package/.codex-plugin/plugin.json +39 -0
  3. package/LICENSE +13 -0
  4. package/NOTICE.md +1105 -0
  5. package/PROVENANCE.md +15 -0
  6. package/README.md +44 -2
  7. package/dist/acl.d.ts +2 -0
  8. package/dist/acl.js +12 -0
  9. package/dist/acl.js.map +1 -0
  10. package/dist/billing-plan.d.ts +68 -0
  11. package/dist/billing-plan.js +235 -0
  12. package/dist/billing-plan.js.map +1 -0
  13. package/dist/browser.d.ts +1 -0
  14. package/dist/browser.js +20 -0
  15. package/dist/browser.js.map +1 -0
  16. package/dist/calls-catalog.d.ts +79 -0
  17. package/dist/calls-catalog.js +322 -0
  18. package/dist/calls-catalog.js.map +1 -0
  19. package/dist/calls-credits.d.ts +31 -0
  20. package/dist/calls-credits.js +224 -0
  21. package/dist/calls-credits.js.map +1 -0
  22. package/dist/calls-trial.d.ts +45 -0
  23. package/dist/calls-trial.js +77 -0
  24. package/dist/calls-trial.js.map +1 -0
  25. package/dist/calls.d.ts +10 -0
  26. package/dist/calls.js +470 -0
  27. package/dist/calls.js.map +1 -0
  28. package/dist/catalog.d.ts +67 -0
  29. package/dist/catalog.js +784 -0
  30. package/dist/catalog.js.map +1 -0
  31. package/dist/cli.d.ts +6 -0
  32. package/dist/cli.js +502 -0
  33. package/dist/cli.js.map +1 -0
  34. package/dist/core.d.ts +86 -0
  35. package/dist/core.js +531 -0
  36. package/dist/core.js.map +1 -0
  37. package/dist/diagnostics.d.ts +206 -0
  38. package/dist/diagnostics.js +664 -0
  39. package/dist/diagnostics.js.map +1 -0
  40. package/dist/discovery.d.ts +703 -0
  41. package/dist/discovery.js +846 -0
  42. package/dist/discovery.js.map +1 -0
  43. package/dist/docs.d.ts +31 -0
  44. package/dist/docs.js +139 -0
  45. package/dist/docs.js.map +1 -0
  46. package/dist/features.d.ts +131 -0
  47. package/dist/features.js +227 -0
  48. package/dist/features.js.map +1 -0
  49. package/dist/generated-api.d.ts +116 -0
  50. package/dist/generated-api.js +118 -0
  51. package/dist/generated-api.js.map +1 -0
  52. package/dist/human-format.d.ts +40 -0
  53. package/dist/human-format.js +205 -0
  54. package/dist/human-format.js.map +1 -0
  55. package/dist/human-list.d.ts +2 -0
  56. package/dist/human-list.js +368 -0
  57. package/dist/human-list.js.map +1 -0
  58. package/dist/human-output.d.ts +10 -0
  59. package/dist/human-output.js +1351 -0
  60. package/dist/human-output.js.map +1 -0
  61. package/dist/human-pro.d.ts +3 -0
  62. package/dist/human-pro.js +201 -0
  63. package/dist/human-pro.js.map +1 -0
  64. package/dist/human-progress.d.ts +5 -0
  65. package/dist/human-progress.js +49 -0
  66. package/dist/human-progress.js.map +1 -0
  67. package/dist/local.d.ts +42 -0
  68. package/dist/local.js +707 -0
  69. package/dist/local.js.map +1 -0
  70. package/dist/oauth-callback.d.ts +3 -0
  71. package/dist/oauth-callback.js +66 -0
  72. package/dist/oauth-callback.js.map +1 -0
  73. package/dist/oauth-lock.d.ts +6 -0
  74. package/dist/oauth-lock.js +212 -0
  75. package/dist/oauth-lock.js.map +1 -0
  76. package/dist/oauth.d.ts +32 -0
  77. package/dist/oauth.js +493 -0
  78. package/dist/oauth.js.map +1 -0
  79. package/dist/presentation.d.ts +208 -0
  80. package/dist/presentation.js +156 -0
  81. package/dist/presentation.js.map +1 -0
  82. package/dist/pro-api-catalog.d.ts +24 -0
  83. package/dist/pro-api-catalog.js +619 -0
  84. package/dist/pro-api-catalog.js.map +1 -0
  85. package/dist/pro-api.d.ts +10 -0
  86. package/dist/pro-api.js +338 -0
  87. package/dist/pro-api.js.map +1 -0
  88. package/dist/project.d.ts +34 -0
  89. package/dist/project.js +62 -0
  90. package/dist/project.js.map +1 -0
  91. package/dist/recovery.d.ts +41 -0
  92. package/dist/recovery.js +417 -0
  93. package/dist/recovery.js.map +1 -0
  94. package/dist/runner.d.ts +47 -0
  95. package/dist/runner.js +603 -0
  96. package/dist/runner.js.map +1 -0
  97. package/dist/sdk-catalog.d.ts +69 -0
  98. package/dist/sdk-catalog.js +527 -0
  99. package/dist/sdk-catalog.js.map +1 -0
  100. package/dist/sdk-config.d.ts +19 -0
  101. package/dist/sdk-config.js +85 -0
  102. package/dist/sdk-config.js.map +1 -0
  103. package/dist/sdk-dto.d.ts +244 -0
  104. package/dist/sdk-dto.js +98 -0
  105. package/dist/sdk-dto.js.map +1 -0
  106. package/dist/sdk-limits.d.ts +2 -0
  107. package/dist/sdk-limits.js +3 -0
  108. package/dist/sdk-limits.js.map +1 -0
  109. package/dist/sdk-node-file-reader.d.ts +6 -0
  110. package/dist/sdk-node-file-reader.js +38 -0
  111. package/dist/sdk-node-file-reader.js.map +1 -0
  112. package/dist/sdk-pro-catalog.d.ts +22 -0
  113. package/dist/sdk-pro-catalog.js +234 -0
  114. package/dist/sdk-pro-catalog.js.map +1 -0
  115. package/dist/sdk-pro-runtime.d.ts +31 -0
  116. package/dist/sdk-pro-runtime.js +293 -0
  117. package/dist/sdk-pro-runtime.js.map +1 -0
  118. package/dist/sdk-query.d.ts +10 -0
  119. package/dist/sdk-query.js +29 -0
  120. package/dist/sdk-query.js.map +1 -0
  121. package/dist/sdk-runtime.d.ts +15 -0
  122. package/dist/sdk-runtime.js +685 -0
  123. package/dist/sdk-runtime.js.map +1 -0
  124. package/dist/sdk-worker.d.ts +1 -0
  125. package/dist/sdk-worker.js +26 -0
  126. package/dist/sdk-worker.js.map +1 -0
  127. package/dist/sdk.d.ts +29 -0
  128. package/dist/sdk.js +346 -0
  129. package/dist/sdk.js.map +1 -0
  130. package/dist/search-engine.d.ts +17 -0
  131. package/dist/search-engine.js +54 -0
  132. package/dist/search-engine.js.map +1 -0
  133. package/dist/search-intents.d.ts +2 -0
  134. package/dist/search-intents.js +106 -0
  135. package/dist/search-intents.js.map +1 -0
  136. package/dist/search.d.ts +7 -0
  137. package/dist/search.js +58 -0
  138. package/dist/search.js.map +1 -0
  139. package/dist/secret-output.d.ts +2 -0
  140. package/dist/secret-output.js +108 -0
  141. package/dist/secret-output.js.map +1 -0
  142. package/dist/shell.d.ts +3 -0
  143. package/dist/shell.js +14 -0
  144. package/dist/shell.js.map +1 -0
  145. package/dist/skills.d.ts +210 -0
  146. package/dist/skills.js +374 -0
  147. package/dist/skills.js.map +1 -0
  148. package/dist/value-semantics.d.ts +70 -0
  149. package/dist/value-semantics.js +173 -0
  150. package/dist/value-semantics.js.map +1 -0
  151. package/dist/version.d.ts +1 -0
  152. package/dist/version.js +3 -0
  153. package/dist/version.js.map +1 -0
  154. package/dist/windows.d.ts +4 -0
  155. package/dist/windows.js +136 -0
  156. package/dist/windows.js.map +1 -0
  157. package/dist/workflows.d.ts +228 -0
  158. package/dist/workflows.js +1207 -0
  159. package/dist/workflows.js.map +1 -0
  160. package/package.json +90 -4
  161. package/plugin.json +25 -0
  162. package/references/agent-guide.json +199 -0
  163. package/references/commands.md +247 -0
  164. package/references/dashboard-inventory.json +14796 -0
  165. package/references/docs-index.json +5329 -0
  166. package/references/sdk-commands.json +15065 -0
  167. package/references/workflows.json +1246 -0
  168. package/skills/sendbird/SKILL.md +96 -0
  169. package/skills/sendbird/agents/openai.yaml +4 -0
  170. package/skills/sendbird/references/build-chat-app.md +50 -0
  171. package/skills/sendbird/references/client-guide.md +34 -0
  172. package/skills/sendbird/references/client-plugin-bridge.md +77 -0
  173. package/skills/sendbird/references/client-plugin-install.md +39 -0
  174. package/skills/sendbird/references/operational-checks.md +35 -0
  175. package/skills/sendbird/references/pro-capabilities.md +52 -0
  176. package/skills/sendbird/scripts/client-guide.mjs +283 -0
  177. package/skills/sendbird/scripts/client-plugin-bridge.mjs +703 -0
  178. package/skills/sendbird-setup/SKILL.md +18 -0
  179. package/skills/sendbird-setup/agents/openai.yaml +4 -0
  180. package/skills/sendbird-setup/references/onboarding.md +73 -0
  181. package/skills/sendbird-setup/scripts/install-cli.mjs +447 -0
  182. package/skills/sendbird-setup/scripts/npm-run.mjs +34 -0
@@ -0,0 +1,619 @@
1
+ import { pushBody, pushRecord, callsPushListSchema } from "./calls-catalog.js";
2
+ /** Dashboard-backed Pro operations. All traffic uses Gate OAuth and App-Id. */
3
+ import { z } from "zod";
4
+ const text = z.string().min(1), optional = z.string().optional(), bool = z.boolean().optional();
5
+ const object = z.object({}).passthrough(), empty = z.object({}).strict();
6
+ const page = {
7
+ limit: z.number().int().min(1).max(100).default(20),
8
+ token: optional,
9
+ };
10
+ const settings = "app/core/api/settings.ts", chatSettings = "app/chat/api/settings.ts", announcements = "app/chat/api/announcements.ts";
11
+ const keywordSettings = z
12
+ .object({
13
+ type: z.number().int().min(0).max(3).optional(),
14
+ keywords: z.string().optional(),
15
+ regex_filters: z
16
+ .array(z.object({ regex: text }).strict())
17
+ .max(100)
18
+ .optional(),
19
+ regex_filters_case_sensitive: bool,
20
+ should_check_global: bool,
21
+ })
22
+ .strict();
23
+ const likelihood = z.number().int().min(0).max(5).optional();
24
+ const image = z
25
+ .object({
26
+ type: z.number().int().min(0).max(2).optional(),
27
+ soft_block: bool,
28
+ check_urls: bool,
29
+ limits: z
30
+ .object({
31
+ adult: likelihood,
32
+ spoof: likelihood,
33
+ medical: likelihood,
34
+ violence: likelihood,
35
+ racy: likelihood,
36
+ })
37
+ .strict()
38
+ .optional(),
39
+ })
40
+ .strict();
41
+ const channelSettings = {
42
+ profanity_filter: keywordSettings.optional(),
43
+ image_moderation: image.optional(),
44
+ display_past_message: bool,
45
+ max_message_length: z
46
+ .union([
47
+ z.literal(-1),
48
+ z.literal(50),
49
+ z.literal(100),
50
+ z.literal(200),
51
+ z.literal(500),
52
+ z.literal(1000),
53
+ z.literal(5000),
54
+ ])
55
+ .optional(),
56
+ // -1 delegates to the service's system limit; it is not unlimited.
57
+ user_messages_per_channel: z.number().int().min(-1).optional(),
58
+ user_messages_per_channel_duration: z.number().int().nonnegative().optional(),
59
+ allow_links: bool,
60
+ };
61
+ const definitions = [];
62
+ function add(name, method, path, source, body, response = object, params, query, extra = {}) {
63
+ definitions.push({
64
+ name,
65
+ description: name,
66
+ method,
67
+ path,
68
+ scope: "app",
69
+ requiresOrg: method !== "GET",
70
+ source: [
71
+ source.startsWith("announcement:")
72
+ ? announcements
73
+ : source.startsWith("chat:")
74
+ ? chatSettings
75
+ : settings,
76
+ source.replace(/^(announcement|chat):/, ""),
77
+ ],
78
+ body,
79
+ response,
80
+ params,
81
+ query,
82
+ ...(method !== "GET" ? { danger: true } : {}),
83
+ ...extra,
84
+ });
85
+ }
86
+ add("chat settings get", "GET", "/platform/v3/applications/settings_global", "fetchSettingsGlobal");
87
+ add("chat settings update", "PUT", "/platform/v3/applications/settings_global", "updateSettingsGlobal", z.object(channelSettings).strict(), object, undefined, undefined, {
88
+ description: "Update global moderation and channel defaults; read and preserve current settings first",
89
+ example: { display_past_message: true },
90
+ });
91
+ add("chat settings custom list", "GET", "/platform/v3/applications/settings_by_channel_custom_type", "fetchSettingsForCustomChannelTypes", undefined, z.object({
92
+ channel_custom_type_settings: z.array(object),
93
+ next: z.string().nullable(),
94
+ }), undefined, z.object(page));
95
+ add("chat settings custom get", "GET", "/platform/v3/applications/settings_by_channel_custom_type/{custom_type}", "fetchSettingsForCustomChannelType", undefined, object, z.object({ custom_type: text }));
96
+ add("chat settings custom create", "POST", "/platform/v3/applications/settings_by_channel_custom_type", "createSettingsForCustomChannelType", z.object({ custom_type: text, ...channelSettings }).strict());
97
+ add("chat settings custom update", "PUT", "/platform/v3/applications/settings_by_channel_custom_type/{custom_type}", "updateSettingsForCustomChannelType", z.object(channelSettings).strict(), object, z.object({ custom_type: text }), undefined, { example: { display_past_message: true } });
98
+ for (const scope of ["global", "custom"]) {
99
+ const path = scope === "global"
100
+ ? "/platform/v3/applications/settings_global/profanity_keyword"
101
+ : "/platform/v3/applications/settings_by_channel_custom_type/{custom_type}/profanity_keyword";
102
+ const stem = scope === "global" ? "Default" : "CustomType";
103
+ for (const [verb, method, source] of [
104
+ ["list", "GET", `fetch${stem}ProfanityKeywords`],
105
+ ["add", "PATCH", `add${stem}ProfanityKeyword`],
106
+ ["delete", "DELETE", `delete${stem}ProfanityKeyword`],
107
+ ])
108
+ add(`chat moderation keywords ${scope} ${verb}`, method, path + (verb === "list" ? "" : "/{keyword}"), `chat:${source}`, method === "PATCH" ? empty : undefined, object, z.object({
109
+ ...(scope === "custom" ? { custom_type: text } : {}),
110
+ ...(verb !== "list" ? { keyword: text } : {}),
111
+ }));
112
+ }
113
+ add("chat webhook get", "GET", "/platform/v3/applications/settings/webhook", "getWebhooksInformation", undefined, z.object({ webhook: object }), undefined, undefined, { description: "Read Chat webhook settings with the callback URL masked" });
114
+ add("chat webhook categories", "GET", "/platform/v3/applications/settings/webhook", "getWebhooksAllCategories", undefined, object, undefined, z.object({ display_all_webhook_categories: z.literal(true).default(true) }));
115
+ add("chat webhook update", "PUT", "/platform/v3/applications/settings/webhook", "updateWebhookInformation", z
116
+ .object({
117
+ enabled: z.boolean(),
118
+ url: z.union([z.literal(""), z.url()]),
119
+ enabled_events: z.array(text).max(100).optional(),
120
+ include_members: z.boolean(),
121
+ include_unread_count: z.boolean(),
122
+ events_to_include_channel_metadata: z.array(text).max(100).optional(),
123
+ })
124
+ .strict(), z.object({ webhook: object }), undefined, undefined, {
125
+ description: "Update Chat event webhook; URL is accepted only in a private body file",
126
+ privateFields: ["url"],
127
+ });
128
+ const dimension = z.enum(["daily", "monthly"]);
129
+ add("chat analytics metric get", "GET", "/platform/v3/statistics/metric", "fetchStatistics", undefined, z
130
+ .object({
131
+ values: z.array(z.unknown()),
132
+ next: z.string().nullable().optional(),
133
+ })
134
+ .passthrough(), undefined, z
135
+ .object({
136
+ metric_type: z.enum([
137
+ "created_users",
138
+ "deactivated_users",
139
+ "deleted_users",
140
+ "created_channels",
141
+ "active_channels",
142
+ "messages",
143
+ "messages_per_user",
144
+ "message_viewers",
145
+ "message_senders",
146
+ ]),
147
+ time_dimension: dimension,
148
+ start_year: z.number().int().min(2000).max(2100),
149
+ end_year: z.number().int().min(2000).max(2100),
150
+ start_month: z.number().int().min(1).max(12),
151
+ end_month: z.number().int().min(1).max(12),
152
+ start_day: z.number().int().min(1).max(31).optional(),
153
+ end_day: z.number().int().min(1).max(31).optional(),
154
+ segments: optional,
155
+ token: optional,
156
+ })
157
+ .strict(), {
158
+ source: ["app/chat/api/analytics.ts", "fetchStatistics"],
159
+ description: "Read one bounded analytics metric page; follow next with --token, not a data export",
160
+ });
161
+ const announcementMessage = z
162
+ .object({
163
+ type: z.enum(["MESG", "ADMM"]),
164
+ user_id: text.nullable(),
165
+ content: text,
166
+ custom_type: optional,
167
+ data: optional,
168
+ })
169
+ .strict();
170
+ const creation = {
171
+ message: announcementMessage,
172
+ target_at: z.enum([
173
+ "target_channels",
174
+ "target_users_included_channels",
175
+ "target_users_only_channels",
176
+ ]),
177
+ target_list: z.array(text).min(1).max(100),
178
+ target_channel_type: z
179
+ .enum(["non_distinct", "distinct", "all"])
180
+ .default("all"),
181
+ create_channel: z.boolean().default(false),
182
+ enable_push: z.boolean().default(false),
183
+ scheduled_at: z.number().int().nonnegative(),
184
+ announcement_group: optional,
185
+ };
186
+ const announcementId = z.object({ id: text });
187
+ add("chat announcement create", "POST", "/platform/v3/announcements", "announcement:createAnnouncement", z.object(creation).strict(), object, undefined, undefined, {
188
+ description: "Send or schedule a bounded announcement to explicit targets; requires --yes",
189
+ example: {
190
+ message: { type: "MESG", user_id: "SENDER_ID", content: "Announcement" },
191
+ target_at: "target_channels",
192
+ target_list: ["CHANNEL_URL"],
193
+ scheduled_at: 1893456000,
194
+ },
195
+ });
196
+ add("chat announcement list", "GET", "/platform/v3/announcements", "announcement:fetchAnnouncements", undefined, z.object({
197
+ announcements: z.array(object),
198
+ next: z.string().nullable().optional(),
199
+ }), undefined, z.object({
200
+ ...page,
201
+ status: z
202
+ .enum([
203
+ "scheduled",
204
+ "ready",
205
+ "running",
206
+ "canceled",
207
+ "stopped",
208
+ "paused",
209
+ "completed",
210
+ "incompleted",
211
+ "on-hold",
212
+ ])
213
+ .optional(),
214
+ }));
215
+ add("chat announcement get", "GET", "/platform/v3/announcements/{id}", "announcement:fetchAnnouncement", undefined, object, announcementId);
216
+ add("chat announcement update", "PUT", "/platform/v3/announcements/{id}", "announcement:updateAnnouncement", z
217
+ .object({
218
+ message: announcementMessage.optional(),
219
+ enable_push: bool,
220
+ scheduled_at: z.number().int().nonnegative().optional(),
221
+ end_at: z.number().int().nonnegative().nullable().optional(),
222
+ cease_at: z
223
+ .string()
224
+ .regex(/^([01]\d|2[0-3])[0-5]\d$/)
225
+ .nullable()
226
+ .optional(),
227
+ resume_at: z
228
+ .string()
229
+ .regex(/^([01]\d|2[0-3])[0-5]\d$/)
230
+ .nullable()
231
+ .optional(),
232
+ announcement_group: optional,
233
+ })
234
+ .strict(), object, announcementId, undefined, {
235
+ example: { enable_push: false },
236
+ description: "Update announcement fields; legacy version differences may be rejected by the server",
237
+ });
238
+ add("chat announcement action", "PUT", "/platform/v3/announcements/{id}", "announcement:updateAnnouncement", z.object({ action: z.enum(["cancel", "pause", "resume", "stop"]) }).strict(), object, announcementId, undefined, {
239
+ description: "Pause, resume, cancel or stop a current-version announcement; never retry an uncertain action",
240
+ });
241
+ add("chat announcement groups list", "GET", "/platform/v3/announcement_group", "announcement:fetchAnnouncementGroups", undefined, z.object({
242
+ announcement_groups: z.array(z.string()),
243
+ next: z.string().nullable(),
244
+ }), undefined, z.object(page));
245
+ add("chat announcement open-status", "GET", "/platform/v3/announcement_open_status/{id}", "announcement:getAnnouncementOpenStatus", undefined, z.object({ open_status: z.array(object), next: z.string().nullable() }), announcementId, z.object(page));
246
+ add("chat announcement open-rate", "GET", "/platform/v3/announcement_open_rate/{id}", "announcement:fetchAnnouncementOpenRate", undefined, z.object({ event_id: text }).passthrough(), announcementId);
247
+ add("chat push settings update", "PUT", "/platform/v3/applications/push/settings", "updatePushSettings", z.object({ always_push: bool, include_channel_unread_count: bool }).strict(), object, undefined, undefined, { example: { always_push: false } });
248
+ const template = z.union([
249
+ z.string(),
250
+ z.object({ title: z.string(), body: z.string() }).strict(),
251
+ ]);
252
+ add("chat push template set", "POST", "/platform/v3/applications/push/message_templates/{template_name}", "updatePushMessageTemplates", z
253
+ .object({
254
+ template: z
255
+ .object({ MESG: template, FILE: template, ADMM: template })
256
+ .strict(),
257
+ })
258
+ .strict(), z.object({ push_message_templates: z.array(object) }), z.object({ template_name: z.enum(["default", "alternative"]) }));
259
+ add("chat push test send", "POST", "/platform/dapi/push/test", "chat:postPushTest", z
260
+ .object({
261
+ channel_url: text,
262
+ user_id: text,
263
+ device_token: text,
264
+ message: text,
265
+ provider_id: text,
266
+ use_fcm_v1_api: bool,
267
+ })
268
+ .strict(), z.object({ channel_url: text, msg_id: z.number().int(), msg_ts: z.number() }), undefined, undefined, {
269
+ privateFields: ["device_token"],
270
+ description: "Submit a real Chat Push test to an authorized device; acceptance does not prove receipt",
271
+ });
272
+ add("chat push test get", "GET", "/platform/dapi/push/test", "chat:getPushTestResult", undefined, z.object({
273
+ push_logged: z.boolean(),
274
+ push_results: z.array(object).optional(),
275
+ msg_ts: z.number().optional(),
276
+ }), undefined, z.object({
277
+ channel_url: text,
278
+ msg_id: z.number().int().positive(),
279
+ provider_id: text,
280
+ }));
281
+ add("app ip-allowlist get", "GET", "/platform/v3/applications/settings/ip_whitelist", "getIPWhitelist", undefined, z.object({ ip_whitelist_addresses: z.array(z.string()) }));
282
+ add("app partition set", "PUT", "/platform/dapi/settings/open_channels_dynamic_partitioning/", "updateOpenChannelDynamicPartitioningOption", z
283
+ .object({
284
+ option_type: z.enum([
285
+ "single_subchannel",
286
+ "multiple_subchannels",
287
+ "custom",
288
+ ]),
289
+ })
290
+ .strict(), object, undefined, undefined, {
291
+ description: "Change Open-channel partitioning mode; needs an authorized app and readback",
292
+ });
293
+ for (const [action, method, symbol] of [
294
+ ["list", "GET", "fetchPushConfiguration"],
295
+ ["create", "POST", "createPushConfiguration"],
296
+ ["update", "PUT", "updatePushConfiguration"],
297
+ ["delete", "DELETE", "deletePushConfiguration"],
298
+ ]) {
299
+ add(`chat push ${action}`, method, "/platform/v3/applications/push/{push_type}" +
300
+ (["update", "delete"].includes(action) ? "/{id}" : ""), symbol, ["create", "update"].includes(action) ? pushBody : undefined, action === "list" || action === "create"
301
+ ? callsPushListSchema
302
+ : action === "update"
303
+ ? z.object({
304
+ push_configurations: z.union([z.string(), z.array(pushRecord)]),
305
+ })
306
+ : z.object({}).nullable(), z.object({
307
+ push_type: z.enum(["apns", "fcm", "huawei"]),
308
+ ...(["update", "delete"].includes(action) ? { id: text } : {}),
309
+ }), action === "list"
310
+ ? z.object({ ...page, paginated: z.literal(true).default(true) })
311
+ : undefined, {
312
+ description: `${action} Chat push provider credentials; separate from Calls VoIP providers`,
313
+ privateFields: ["apns_cert_password", "huawei_app_secret"],
314
+ });
315
+ }
316
+ add("app delete", "DELETE", "/platform/v3/applications", "deleteApplication", undefined, object, z.object({ confirm_app_name: text }), undefined, {
317
+ description: "Delete the selected application and its data; exact app name and --yes are required",
318
+ });
319
+ for (const [action, method, source] of [
320
+ ["add", "PUT", "putIPWhitelist"],
321
+ ["remove", "DELETE", "deleteIPWhitelist"],
322
+ ])
323
+ add(`app ip-allowlist ${action}`, method, "/platform/v3/applications/settings/ip_whitelist", source, z
324
+ .object({ ip_whitelist_addresses: z.array(text).min(1).max(100) })
325
+ .strict(), z.object({ ip_whitelist_addresses: z.array(z.string()) }), z.object({ confirm_app_name: text, confirm_source_ip: text }), undefined, {
326
+ description: `${action} IP/CIDR entries; confirm the current source IP and exact application name first`,
327
+ });
328
+ const organizationSource = "app/common/api/organizations.ts";
329
+ const ssoResponse = z.object({
330
+ uid: text,
331
+ sso_entity_id: z.string().nullable().optional(),
332
+ sso_idp_url: z.string().nullable().optional(),
333
+ sso_idp_cert: z.string().nullable().optional(),
334
+ sso_enforcing: z.boolean().optional(),
335
+ sso_jit_provisioning: z.boolean().optional(),
336
+ });
337
+ add("org sso get", "GET", "/dashboard_api/organizations/{orgId}/", "fetchOrganization", undefined, ssoResponse, undefined, undefined, {
338
+ scope: "org",
339
+ source: [organizationSource, "fetchOrganization"],
340
+ description: "Read the authenticated organization's SAML configuration; public certificate is masked",
341
+ });
342
+ add("org sso set", "POST", "/dashboard_api/organizations/{orgId}/sso_profile/", "updateSamlConfiguration", z
343
+ .object({
344
+ entity_id: text,
345
+ idp_url: z.url(),
346
+ idp_cert: text,
347
+ sso_enforcing: z.boolean(),
348
+ jit_provisioning: z.boolean(),
349
+ sso_default_role: text,
350
+ slug_name: text.optional(),
351
+ })
352
+ .strict(), ssoResponse, z.object({ confirm_org_name: text, login_tested: z.boolean().optional() }), undefined, {
353
+ scope: "org",
354
+ source: [organizationSource, "updateSamlConfiguration"],
355
+ privateFields: ["idp_cert", "idp_url"],
356
+ description: "Configure SAML with explicit organization confirmation; enforcement requires --login-tested true",
357
+ });
358
+ add("org sso delete", "DELETE", "/dashboard_api/organizations/{orgId}/sso_profile/", "deleteSamlConfiguration", undefined, ssoResponse, z.object({ confirm_org_name: text }), undefined, {
359
+ scope: "org",
360
+ source: [organizationSource, "deleteSamlConfiguration"],
361
+ description: "Remove SAML configuration; confirm the organization and --yes. Review member login recovery first",
362
+ });
363
+ const modSource = "app/chat/api/channelModeration.ts";
364
+ const modParams = { type: z.enum(["open", "group", "supergroup"]), id: text };
365
+ const modBody = z
366
+ .object({
367
+ user_id: text,
368
+ seconds: z
369
+ .number()
370
+ .int()
371
+ .min(-1)
372
+ .max(31536000)
373
+ .refine((n) => n !== 0),
374
+ description: z.string().max(4000).default(""),
375
+ })
376
+ .strict();
377
+ for (const [noun, wire, listSymbol, addSymbol, removeSymbol, getSymbol] of [
378
+ [
379
+ "banned",
380
+ "ban",
381
+ "fetchChannelBannedUsers",
382
+ "banUser",
383
+ "unbanUser",
384
+ "getBanDetail",
385
+ ],
386
+ [
387
+ "muted",
388
+ "mute",
389
+ "fetchChannelMutedUsers",
390
+ "muteUser",
391
+ "unmuteUser",
392
+ "getMuteDetail",
393
+ ],
394
+ ]) {
395
+ const path = `/platform/v3/{kind}/{id}/${wire}`;
396
+ add(`chat moderation channel ${noun} list`, "GET", path, listSymbol, undefined, z.object({
397
+ [`${noun}_list`]: z.array(object),
398
+ next: z.string().nullable().optional(),
399
+ }), z.object(modParams), z.object(page), {
400
+ source: [modSource, listSymbol],
401
+ description: `List ${noun} users with Dashboard moderation permission; no SDK user token required`,
402
+ });
403
+ add(`chat moderation channel ${wire}`, "POST", path, addSymbol, modBody, object, z.object(modParams), undefined, {
404
+ source: [modSource, addSymbol],
405
+ description: `${wire} one user with an explicit duration in seconds (-1 means indefinite)`,
406
+ });
407
+ add(`chat moderation channel un${wire}`, "DELETE", path + "/{user_id}", removeSymbol, undefined, z.object({}).nullable(), z.object({ ...modParams, user_id: text }), undefined, { source: [modSource, removeSymbol] });
408
+ add(`chat moderation channel ${noun} get`, "GET", path + "/{user_id}", getSymbol, undefined, object, z.object({ ...modParams, user_id: text }), undefined, {
409
+ source: [modSource, getSymbol],
410
+ description: `Read one ${wire} record; a missing record does not establish other restrictions`,
411
+ });
412
+ }
413
+ add("chat moderation channel freeze", "PUT", "/platform/v3/{kind}/{id}/freeze", "freezeChannel", z.object({ freeze: z.boolean() }).strict(), z.object({ channel_url: text }).passthrough(), z.object(modParams), undefined, {
414
+ source: [modSource, "freezeChannel"],
415
+ description: "Freeze or unfreeze a channel under Dashboard moderation permission",
416
+ });
417
+ add("chat moderation channel operators add", "POST", "/platform/v3/{kind}/{id}/operators", "updateOperators", z.object({ operator_ids: z.array(text).min(1).max(100) }).strict(), object, z.object(modParams), undefined, {
418
+ source: [modSource, "updateOperators"],
419
+ description: "Register channel operators using the Dashboard endpoint; review current operators first",
420
+ });
421
+ add("chat moderation message search", "GET", "/platform/dapi/messages/", "searchMessages", undefined, z.object({
422
+ messages: z.array(object),
423
+ page: z.number().int(),
424
+ last: z.number().int(),
425
+ total: z.number().int(),
426
+ }), undefined, z
427
+ .object({
428
+ keyword: text,
429
+ channel_url: z.string().optional(),
430
+ user_id: z.string().optional(),
431
+ start_timestamp: z.number().int().nonnegative(),
432
+ end_timestamp: z.number().int().nonnegative(),
433
+ exclude_removed: z.boolean().default(true),
434
+ page: z.number().int().min(1).max(100).default(1),
435
+ limit: z.number().int().min(1).max(100).default(20),
436
+ })
437
+ .strict(), {
438
+ source: ["app/chat/api/messages.ts", "searchMessages"],
439
+ description: "Search app messages with Dashboard messageSearch permission, separate from SDK member-visible search",
440
+ });
441
+ add("chat push enabled get", "GET", "/dashboard/applications/{appId}/get_detail/", "fetchApplicationGetDetail", undefined, z
442
+ .object({ app_id: text, push_enabled: z.boolean().optional() })
443
+ .passthrough(), undefined, undefined, {
444
+ source: ["app/core/api/application.ts", "fetchApplicationGetDetail"],
445
+ description: "Read the shared Push switch used by Chat and Calls",
446
+ });
447
+ add("chat push enabled set", "PUT", "/platform/dapi/applications/detail/", "togglePushEnabled", z.object({ push_enabled: z.boolean() }).strict(), z.object({
448
+ application: z
449
+ .object({ app_id: text, push_enabled: z.boolean() })
450
+ .passthrough(),
451
+ }), z.object({ confirm_shared_push: z.literal(true) }), undefined, {
452
+ description: "Change the shared Chat/Calls Push switch; requires --confirm-shared-push true and --yes",
453
+ });
454
+ add("app partition get", "GET", "/dashboard/applications/{appId}/get_detail/", "fetchApplicationGetDetail", undefined, z.object({ app_id: text, attrs: object.optional() }), undefined, undefined, {
455
+ source: ["app/core/api/application.ts", "fetchApplicationGetDetail"],
456
+ description: "Read Open-channel partitioning defaults and participant limits; snapshots do not prove scale",
457
+ });
458
+ for (const d of definitions) {
459
+ if (d.name === "chat webhook update")
460
+ d.example = { url: "https://example.com/chat-webhook" };
461
+ if (d.name === "chat analytics metric get")
462
+ d.exampleQuery = {
463
+ start_year: 2026,
464
+ end_year: 2026,
465
+ start_month: 10,
466
+ end_month: 10,
467
+ start_day: 1,
468
+ end_day: 14,
469
+ time_dimension: "daily",
470
+ };
471
+ if (d.name === "chat moderation message search")
472
+ d.exampleQuery = {
473
+ start_timestamp: 1790812800000,
474
+ end_timestamp: 1790899200000,
475
+ };
476
+ if (/^chat push (create|update)$/.test(d.name))
477
+ d.example = {
478
+ format: "p8",
479
+ environment: "development",
480
+ apns_bundle_id: "com.example.chat",
481
+ apns_key_id: "KEY_ID",
482
+ apns_team_id: "TEAM_ID",
483
+ };
484
+ if (/^app ip-allowlist (add|remove)$/.test(d.name)) {
485
+ d.example = { ip_whitelist_addresses: ["203.0.113.0/24"] };
486
+ d.exampleParams = {
487
+ confirm_source_ip: "203.0.113.1",
488
+ confirm_app_name: "APP_NAME",
489
+ };
490
+ }
491
+ if (d.name === "org sso set")
492
+ d.example = {
493
+ entity_id: "IDP_ENTITY_ID",
494
+ idp_url: "https://idp.example.com/saml",
495
+ idp_cert: "PUBLIC_IDP_CERT_PEM",
496
+ sso_enforcing: false,
497
+ jit_provisioning: false,
498
+ sso_default_role: "MEMBER_ROLE_NAME",
499
+ };
500
+ if (/^chat moderation channel (ban|mute)$/.test(d.name))
501
+ d.example = { seconds: 60, description: "Authorized test" };
502
+ }
503
+ const settingsResponse = z
504
+ .object({
505
+ profanity_filter: z.object({ type: z.number().int() }).passthrough(),
506
+ })
507
+ .passthrough();
508
+ const announcementResponse = z
509
+ .object({ unique_id: optional, event_id: optional, status: optional })
510
+ .passthrough()
511
+ .refine((v) => Boolean(v.unique_id || v.event_id), "Missing announcement identity");
512
+ export const proApiDefinitions = definitions.map((d) => {
513
+ let response = d.response;
514
+ if (d.name === "chat settings get" || d.name === "chat settings update")
515
+ response = settingsResponse;
516
+ if ([
517
+ "chat settings custom get",
518
+ "chat settings custom create",
519
+ "chat settings custom update",
520
+ ].includes(d.name))
521
+ response = z.object({ custom_type: text }).passthrough();
522
+ if (d.name.startsWith("chat moderation keywords "))
523
+ response = z.object({ profanity_filter: object });
524
+ if (d.name === "chat webhook get" || d.name === "chat webhook update")
525
+ response = z.object({
526
+ webhook: z
527
+ .object({
528
+ enabled: z.boolean(),
529
+ url: z.string(),
530
+ enabled_events: z.array(z.string()).optional(),
531
+ })
532
+ .passthrough(),
533
+ });
534
+ if ([
535
+ "chat announcement create",
536
+ "chat announcement get",
537
+ "chat announcement update",
538
+ "chat announcement action",
539
+ ].includes(d.name))
540
+ response = announcementResponse;
541
+ if (d.name === "chat announcement list")
542
+ response = z.object({
543
+ announcements: z.array(announcementResponse),
544
+ next: z.string().nullable().optional(),
545
+ });
546
+ if (d.name === "chat push test get")
547
+ response = z.discriminatedUnion("push_logged", [
548
+ z.object({ push_logged: z.literal(false), msg_ts: z.number() }),
549
+ z.object({ push_logged: z.literal(true), push_results: z.array(object) }),
550
+ ]);
551
+ const words = d.name.split(" "), verb = words.at(-1), subject = words.slice(0, -1).join(" ");
552
+ const description = d.description === d.name
553
+ ? `${verb[0].toUpperCase() + verb.slice(1)} ${subject} using the authenticated Dashboard role`
554
+ : d.description;
555
+ if (d.name.startsWith("chat push enabled "))
556
+ return {
557
+ ...d,
558
+ response,
559
+ resultSchema: z.object({
560
+ app_id: text,
561
+ push_enabled: z.boolean().nullable(),
562
+ shared_with_calls: z.literal(true),
563
+ }),
564
+ description,
565
+ };
566
+ if (d.name === "app partition get")
567
+ return {
568
+ ...d,
569
+ response,
570
+ resultSchema: z.object({
571
+ app_id: text,
572
+ dynamic_partitioning_enabled: z.boolean().nullable(),
573
+ max_participants_per_subchannel: z.number().nullable(),
574
+ max_total_participants: z.number().nullable(),
575
+ }),
576
+ description,
577
+ };
578
+ const resultSchema = d.name === "chat push test get"
579
+ ? z.discriminatedUnion("push_logged", [
580
+ z.object({
581
+ push_logged: z.literal(false),
582
+ msg_ts: z.number(),
583
+ delivery_verified: z.literal(false),
584
+ }),
585
+ z.object({
586
+ push_logged: z.literal(true),
587
+ delivery_verified: z.literal(false),
588
+ push_results: z.array(z.object({
589
+ result_code: z.number(),
590
+ push_type: z.string(),
591
+ ts: z.number(),
592
+ device_token_count: z.number().int().nonnegative(),
593
+ })),
594
+ }),
595
+ ])
596
+ : d.name === "chat push test send"
597
+ ? z.object({
598
+ channel_url: text,
599
+ msg_id: z.number(),
600
+ msg_ts: z.number(),
601
+ delivery_verified: z.literal(false),
602
+ })
603
+ : d.name === "chat push update"
604
+ ? z.union([
605
+ z.object({ push_configurations: z.array(pushRecord) }),
606
+ z.object({
607
+ acknowledged: z.literal(true),
608
+ metadata_available: z.literal(false),
609
+ }),
610
+ ])
611
+ : undefined;
612
+ return {
613
+ ...d,
614
+ response,
615
+ description,
616
+ ...(resultSchema ? { resultSchema } : {}),
617
+ };
618
+ });
619
+ //# sourceMappingURL=pro-api-catalog.js.map