@microsoft/app-manifest 1.0.4-alpha.a07b01479.0 → 1.0.4-alpha.a791ca4b9.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 (56) hide show
  1. package/build/ManifestCommonProperties.d.ts +4 -0
  2. package/build/declarativeCopilotManifest.d.ts +43 -0
  3. package/build/declarativeCopilotManifest.js +3 -0
  4. package/build/declarativeCopilotManifest.js.map +1 -1
  5. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D6.d.ts +69 -6
  6. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D6.js +19 -1
  7. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D6.js.map +1 -1
  8. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.d.ts +5 -5
  9. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.js +2 -2
  10. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.js.map +1 -1
  11. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D3.d.ts +1 -5
  12. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D3.js +1 -1
  13. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D3.js.map +1 -1
  14. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D4.d.ts +527 -0
  15. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D4.js +320 -0
  16. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D4.js.map +1 -0
  17. package/build/generated-types/index.d.ts +7 -4
  18. package/build/generated-types/index.js +33 -5
  19. package/build/generated-types/index.js.map +1 -1
  20. package/build/generated-types/teams/TeamsManifestV1D17.d.ts +1 -1
  21. package/build/generated-types/teams/TeamsManifestV1D19.d.ts +1 -1
  22. package/build/generated-types/teams/TeamsManifestV1D20.d.ts +1 -1
  23. package/build/generated-types/teams/TeamsManifestV1D21.d.ts +1 -1
  24. package/build/generated-types/teams/TeamsManifestV1D22.d.ts +1 -1
  25. package/build/generated-types/teams/TeamsManifestV1D23.d.ts +1941 -0
  26. package/build/generated-types/teams/TeamsManifestV1D23.js +1108 -0
  27. package/build/generated-types/teams/TeamsManifestV1D23.js.map +1 -0
  28. package/build/generated-types/teams/TeamsManifestV1D24.d.ts +2027 -0
  29. package/build/generated-types/teams/TeamsManifestV1D24.js +1141 -0
  30. package/build/generated-types/teams/TeamsManifestV1D24.js.map +1 -0
  31. package/build/index.d.ts +1 -0
  32. package/build/index.js +1 -0
  33. package/build/index.js.map +1 -1
  34. package/build/manifest.d.ts +78 -2
  35. package/build/manifest.js +2 -2
  36. package/build/manifest.js.map +1 -1
  37. package/build/pluginManifest.d.ts +56 -0
  38. package/build/pluginManifest.js +2 -0
  39. package/build/pluginManifest.js.map +1 -1
  40. package/build/tsconfig.tsbuildinfo +1 -1
  41. package/build/wrappers/APIPluginManifestWrapper.d.ts +185 -0
  42. package/build/wrappers/APIPluginManifestWrapper.js +309 -0
  43. package/build/wrappers/APIPluginManifestWrapper.js.map +1 -0
  44. package/build/wrappers/BaseManifest.d.ts +57 -0
  45. package/build/wrappers/BaseManifest.js +84 -0
  46. package/build/wrappers/BaseManifest.js.map +1 -0
  47. package/build/wrappers/DeclarativeAgentManifestWrapper.d.ts +245 -0
  48. package/build/wrappers/DeclarativeAgentManifestWrapper.js +403 -0
  49. package/build/wrappers/DeclarativeAgentManifestWrapper.js.map +1 -0
  50. package/build/wrappers/TeamsManifestWrapper.d.ts +436 -0
  51. package/build/wrappers/TeamsManifestWrapper.js +709 -0
  52. package/build/wrappers/TeamsManifestWrapper.js.map +1 -0
  53. package/build/wrappers/index.d.ts +15 -0
  54. package/build/wrappers/index.js +28 -0
  55. package/build/wrappers/index.js.map +1 -0
  56. package/package.json +5 -3
@@ -0,0 +1,436 @@
1
+ import { TeamsManifest, TeamsManifestLatest } from "../generated-types";
2
+ type LatestManifestType = TeamsManifestLatest;
3
+ type BotType = NonNullable<LatestManifestType["bots"]>[number];
4
+ type StaticTabType = NonNullable<LatestManifestType["staticTabs"]>[number];
5
+ type ConfigurableTabType = NonNullable<LatestManifestType["configurableTabs"]>[number];
6
+ type ComposeExtensionType = NonNullable<LatestManifestType["composeExtensions"]>[number];
7
+ type ConnectorType = NonNullable<LatestManifestType["connectors"]>[number];
8
+ type DeclarativeAgentRefType = NonNullable<NonNullable<LatestManifestType["copilotAgents"]>["declarativeAgents"]>[number];
9
+ type CustomEngineAgentType = NonNullable<NonNullable<LatestManifestType["copilotAgents"]>["customEngineAgents"]>[number];
10
+ export type Bot = BotType;
11
+ export type StaticTab = StaticTabType;
12
+ export type ConfigurableTab = ConfigurableTabType;
13
+ export type ComposeExtension = ComposeExtensionType;
14
+ export type Connector = ConnectorType;
15
+ export type DeclarativeAgentRef = DeclarativeAgentRefType;
16
+ export type CustomEngineAgent = CustomEngineAgentType;
17
+ export type Developer = LatestManifestType["developer"];
18
+ export type WebApplicationInfo = LatestManifestType["webApplicationInfo"];
19
+ /**
20
+ * Default install scope values derived from the manifest schema.
21
+ */
22
+ export type DefaultInstallScopeValue = NonNullable<LatestManifestType["defaultInstallScope"]>;
23
+ /**
24
+ * Default install scope enum for Teams manifests.
25
+ */
26
+ export declare const DefaultInstallScope: {
27
+ readonly [K in DefaultInstallScopeValue]: K;
28
+ };
29
+ /**
30
+ * Static tab scope values derived from the manifest schema.
31
+ */
32
+ export type StaticTabScopeValue = NonNullable<StaticTabType["scopes"]>[number];
33
+ /**
34
+ * Static tab scope enum for Teams manifests.
35
+ */
36
+ export declare const StaticTabScope: {
37
+ readonly [K in StaticTabScopeValue]: K;
38
+ };
39
+ /**
40
+ * Configurable tab scope values derived from the manifest schema.
41
+ */
42
+ export type ConfigurableTabScopeValue = NonNullable<ConfigurableTabType["scopes"]>[number];
43
+ /**
44
+ * Configurable tab scope enum for Teams manifests.
45
+ */
46
+ export declare const ConfigurableTabScope: {
47
+ readonly [K in ConfigurableTabScopeValue]: K;
48
+ };
49
+ /**
50
+ * Compose extension type values derived from the manifest schema.
51
+ */
52
+ export type ComposeExtensionTypeValue = NonNullable<ComposeExtensionType["composeExtensionType"]>;
53
+ /**
54
+ * Compose extension type enum for Teams manifests.
55
+ */
56
+ export declare const ComposeExtensionTypeEnum: {
57
+ readonly [K in ComposeExtensionTypeValue]: K;
58
+ };
59
+ /**
60
+ * OOP wrapper for Teams App Manifest.
61
+ *
62
+ * Provides a fluent API for manipulating Teams app manifests with
63
+ * type safety, state tracking, and convenient operations.
64
+ *
65
+ * Note: This class does not extend BaseManifest due to TeamsManifest union type
66
+ * constraints, but provides the same interface and functionality.
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * // Read existing manifest
71
+ * const manifest = await TeamsManifestWrapper.read("manifest.json");
72
+ *
73
+ * // Modify with fluent API
74
+ * manifest
75
+ * .setName("My App", "My Full App Name")
76
+ * .setDescription("Short desc", "Full description")
77
+ * .addBot("bot-id", ["personal", "team"])
78
+ * .addStaticTab("home", "Home", "https://example.com/tab")
79
+ * .addDeclarativeAgent("agent1", "declarativeAgent.json");
80
+ *
81
+ * // Save changes
82
+ * await manifest.save();
83
+ * ```
84
+ */
85
+ export declare class TeamsManifestWrapper {
86
+ protected _data: TeamsManifest;
87
+ protected _filePath?: string;
88
+ protected _isDirty: boolean;
89
+ private constructor();
90
+ /**
91
+ * Returns the raw manifest data.
92
+ */
93
+ get data(): Readonly<TeamsManifest>;
94
+ /**
95
+ * Returns the file path if the manifest was loaded from a file.
96
+ */
97
+ get filePath(): string | undefined;
98
+ /**
99
+ * Indicates whether the manifest has unsaved changes.
100
+ */
101
+ get isDirty(): boolean;
102
+ /**
103
+ * Marks the manifest as having unsaved changes.
104
+ */
105
+ protected markDirty(): void;
106
+ /**
107
+ * Saves the manifest to the specified file path or the original file path.
108
+ * @param filePath - Optional path to save to. If not provided, uses the original file path.
109
+ * @throws Error if no file path is available.
110
+ */
111
+ save(filePath?: string): Promise<void>;
112
+ /**
113
+ * Reads a JSON file synchronously and returns the parsed object.
114
+ * @param filePath - Path to the JSON file
115
+ */
116
+ private static readJsonFileSync;
117
+ /**
118
+ * Reads a Teams manifest from a file.
119
+ * @param filePath - Path to the manifest JSON file.
120
+ * @returns A new TeamsManifestWrapper instance.
121
+ */
122
+ static read(filePath: string): Promise<TeamsManifestWrapper>;
123
+ /**
124
+ * Reads a Teams manifest from a file synchronously.
125
+ * @param filePath - Path to the manifest JSON file.
126
+ * @returns A new TeamsManifestWrapper instance.
127
+ */
128
+ static readSync(filePath: string): TeamsManifestWrapper;
129
+ /**
130
+ * Creates a TeamsManifestWrapper from a JSON string.
131
+ * @param json - JSON string representing the manifest.
132
+ * @returns A new TeamsManifestWrapper instance.
133
+ */
134
+ static fromJSON(json: string): TeamsManifestWrapper;
135
+ /**
136
+ * Creates a new Teams manifest with required fields.
137
+ * @param init - Initial manifest data with required fields.
138
+ * @returns A new TeamsManifestWrapper instance.
139
+ */
140
+ static create(init: {
141
+ manifestVersion: TeamsManifest["manifestVersion"];
142
+ id: string;
143
+ version: string;
144
+ name: {
145
+ short: string;
146
+ full?: string;
147
+ };
148
+ description: {
149
+ short: string;
150
+ full: string;
151
+ };
152
+ developer: {
153
+ name: string;
154
+ websiteUrl: string;
155
+ privacyUrl: string;
156
+ termsOfUseUrl: string;
157
+ mpnId?: string;
158
+ };
159
+ accentColor?: string;
160
+ }): TeamsManifestWrapper;
161
+ /**
162
+ * Returns the manifest version.
163
+ */
164
+ get manifestVersion(): string;
165
+ /**
166
+ * Returns the app ID.
167
+ */
168
+ get id(): string;
169
+ /**
170
+ * Returns the app version.
171
+ */
172
+ get version(): string;
173
+ /**
174
+ * Returns the app name.
175
+ */
176
+ get name(): {
177
+ short: string;
178
+ full?: string;
179
+ };
180
+ /**
181
+ * Returns the app description.
182
+ */
183
+ get description(): {
184
+ short: string;
185
+ full: string;
186
+ };
187
+ /**
188
+ * Returns the developer information.
189
+ */
190
+ get developer(): Developer;
191
+ /**
192
+ * Returns the icons configuration.
193
+ */
194
+ get icons(): {
195
+ color: string;
196
+ outline: string;
197
+ };
198
+ /**
199
+ * Returns a readonly array of bots.
200
+ */
201
+ get bots(): readonly BotType[];
202
+ /**
203
+ * Returns a readonly array of static tabs.
204
+ */
205
+ get staticTabs(): readonly StaticTabType[];
206
+ /**
207
+ * Returns a readonly array of configurable tabs.
208
+ */
209
+ get configurableTabs(): readonly ConfigurableTabType[];
210
+ /**
211
+ * Returns a readonly array of compose extensions (message extensions).
212
+ */
213
+ get composeExtensions(): readonly ComposeExtensionType[];
214
+ /**
215
+ * Returns a readonly array of connectors.
216
+ */
217
+ get connectors(): readonly ConnectorType[];
218
+ /**
219
+ * Returns the valid domains.
220
+ */
221
+ get validDomains(): readonly string[];
222
+ /**
223
+ * Returns the web application info for SSO.
224
+ */
225
+ get webApplicationInfo(): WebApplicationInfo | undefined;
226
+ /**
227
+ * Returns the copilot agents configuration.
228
+ */
229
+ get copilotAgents(): LatestManifestType["copilotAgents"] | undefined;
230
+ /**
231
+ * Returns a readonly array of declarative agents.
232
+ */
233
+ get declarativeAgents(): readonly DeclarativeAgentRefType[];
234
+ /**
235
+ * Returns a readonly array of custom engine agents.
236
+ */
237
+ get customEngineAgents(): readonly CustomEngineAgentType[];
238
+ /**
239
+ * Sets the app ID.
240
+ */
241
+ setId(id: string): this;
242
+ /**
243
+ * Sets the app version.
244
+ */
245
+ setVersion(version: string): this;
246
+ /**
247
+ * Sets the app name.
248
+ */
249
+ setName(short: string, full?: string): this;
250
+ /**
251
+ * Sets the app description.
252
+ */
253
+ setDescription(short: string, full: string): this;
254
+ /**
255
+ * Sets the developer information.
256
+ */
257
+ setDeveloper(developer: Developer): this;
258
+ /**
259
+ * Sets the icons.
260
+ */
261
+ setIcons(color: string, outline: string): this;
262
+ /**
263
+ * Sets the accent color.
264
+ */
265
+ setAccentColor(color: string): this;
266
+ /**
267
+ * Sets the default install scope.
268
+ */
269
+ setDefaultInstallScope(scope: DefaultInstallScopeValue): this;
270
+ /**
271
+ * Adds a valid domain.
272
+ * @param domain - The domain to add.
273
+ */
274
+ addValidDomain(domain: string): this;
275
+ /**
276
+ * Removes a valid domain.
277
+ * @param domain - The domain to remove.
278
+ */
279
+ removeValidDomain(domain: string): this;
280
+ /**
281
+ * Adds a bot to the manifest.
282
+ * @param botId - The Microsoft App ID for the bot.
283
+ * @param scopes - The scopes for the bot.
284
+ * @param options - Additional bot configuration options.
285
+ */
286
+ addBot(botId: string, scopes: BotType["scopes"], options?: Partial<Omit<BotType, "botId" | "scopes">>): this;
287
+ /**
288
+ * Removes a bot by ID.
289
+ * @param botId - The bot ID to remove.
290
+ */
291
+ removeBot(botId: string): this;
292
+ /**
293
+ * Checks if a bot exists by ID.
294
+ */
295
+ hasBot(botId: string): boolean;
296
+ /**
297
+ * Gets a bot by ID.
298
+ */
299
+ getBot(botId: string): BotType | undefined;
300
+ /**
301
+ * Adds a static tab to the manifest.
302
+ * @param entityId - Unique identifier for the tab entity.
303
+ * @param name - Display name of the tab.
304
+ * @param contentUrl - URL for the tab content.
305
+ * @param scopes - The scopes for the tab.
306
+ */
307
+ addStaticTab(entityId: string, name: string, contentUrl: string, scopes?: StaticTabType["scopes"]): this;
308
+ /**
309
+ * Removes a static tab by entity ID.
310
+ * @param entityId - The entity ID of the tab to remove.
311
+ */
312
+ removeStaticTab(entityId: string): this;
313
+ /**
314
+ * Checks if a static tab exists by entity ID.
315
+ */
316
+ hasStaticTab(entityId: string): boolean;
317
+ /**
318
+ * Gets a static tab by entity ID.
319
+ */
320
+ getStaticTab(entityId: string): StaticTabType | undefined;
321
+ /**
322
+ * Adds a configurable tab to the manifest.
323
+ * @param configurationUrl - URL for the tab configuration.
324
+ * @param scopes - The scopes for the tab.
325
+ */
326
+ addConfigurableTab(configurationUrl: string, scopes?: ConfigurableTabType["scopes"]): this;
327
+ /**
328
+ * Removes a configurable tab by configuration URL.
329
+ * @param configurationUrl - The configuration URL of the tab to remove.
330
+ */
331
+ removeConfigurableTab(configurationUrl: string): this;
332
+ /**
333
+ * Adds a compose extension to the manifest.
334
+ * @param extension - The compose extension configuration.
335
+ */
336
+ addComposeExtension(extension: ComposeExtensionType): this;
337
+ /**
338
+ * Adds a bot-based compose extension.
339
+ * @param botId - The bot ID for the message extension.
340
+ * @param commands - The commands for the message extension.
341
+ */
342
+ addBotBasedComposeExtension(botId: string, commands?: ComposeExtensionType["commands"]): this;
343
+ /**
344
+ * Adds an API-based compose extension.
345
+ * @param apiSpecificationFile - Path to the API specification file.
346
+ * @param commands - The commands for the message extension.
347
+ */
348
+ addApiBasedComposeExtension(apiSpecificationFile: string, commands?: ComposeExtensionType["commands"]): this;
349
+ /**
350
+ * Removes a compose extension by bot ID.
351
+ * @param botId - The bot ID of the compose extension to remove.
352
+ */
353
+ removeComposeExtensionByBotId(botId: string): this;
354
+ /**
355
+ * Sets the web application info for SSO.
356
+ * @param id - The AAD application ID.
357
+ * @param resource - Optional resource URL for acquiring auth token.
358
+ */
359
+ setWebApplicationInfo(id: string, resource?: string): this;
360
+ /**
361
+ * Removes the web application info.
362
+ */
363
+ removeWebApplicationInfo(): this;
364
+ /**
365
+ * Adds a declarative agent reference.
366
+ * @param id - Unique identifier for the agent.
367
+ * @param file - Relative path to the agent manifest file.
368
+ */
369
+ addDeclarativeAgent(id: string, file: string): this;
370
+ /**
371
+ * Removes a declarative agent by ID.
372
+ * @param id - The ID of the agent to remove.
373
+ */
374
+ removeDeclarativeAgent(id: string): this;
375
+ /**
376
+ * Checks if a declarative agent exists by ID.
377
+ */
378
+ hasDeclarativeAgent(id: string): boolean;
379
+ /**
380
+ * Gets a declarative agent by ID.
381
+ */
382
+ getDeclarativeAgent(id: string): DeclarativeAgentRefType | undefined;
383
+ /**
384
+ * Adds a custom engine agent.
385
+ * @param id - The bot ID for the custom engine agent.
386
+ */
387
+ addCustomEngineAgent(id: string): this;
388
+ /**
389
+ * Removes a custom engine agent by ID.
390
+ * @param id - The ID of the agent to remove.
391
+ */
392
+ removeCustomEngineAgent(id: string): this;
393
+ /**
394
+ * Returns all bot IDs from the manifest.
395
+ */
396
+ getBotIds(): string[];
397
+ /**
398
+ * Returns all static tab entity IDs.
399
+ */
400
+ getStaticTabEntityIds(): string[];
401
+ /**
402
+ * Returns all declarative agent file paths.
403
+ */
404
+ getDeclarativeAgentPaths(): string[];
405
+ /**
406
+ * Checks if the manifest has any Copilot agent configuration.
407
+ */
408
+ hasCopilotAgents(): boolean;
409
+ /**
410
+ * Validates the manifest against its JSON schema.
411
+ * @returns Array of validation error messages, empty if valid.
412
+ */
413
+ validate(): Promise<string[]>;
414
+ /**
415
+ * Converts the manifest to a formatted JSON string.
416
+ */
417
+ toJSON(): string;
418
+ /**
419
+ * Creates a deep clone of this manifest.
420
+ */
421
+ clone(): TeamsManifestWrapper;
422
+ /**
423
+ * Creates a deep clone with partial modifications applied.
424
+ * Useful for creating a modified copy without mutating the original.
425
+ * @param changes - Partial manifest data to merge into the clone.
426
+ * @returns A new TeamsManifestWrapper with the changes applied.
427
+ */
428
+ cloneWith(changes: Partial<TeamsManifest> & Record<string, unknown>): TeamsManifestWrapper;
429
+ /**
430
+ * Returns a mutable reference to the manifest data for direct modification.
431
+ * Use with caution - prefer using the fluent API methods when possible.
432
+ * Changes made through this reference will be tracked as dirty.
433
+ */
434
+ get mutableData(): TeamsManifest;
435
+ }
436
+ export {};