@webex/internal-plugin-avatar 3.13.0-next.3 → 3.13.0-next.5

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.
@@ -0,0 +1,496 @@
1
+ {
2
+ "$schema": "./schemas/repo-context.schema.json",
3
+ "version": 1,
4
+ "repository": {
5
+ "name": "@webex/internal-plugin-avatar",
6
+ "purpose": "Internal plugin registered as webex.internal.avatar that resolves Webex users to avatar URLs. retrieveAvatarUrl(user, options) turns a uuid, email, or user object into a uuid through webex.internal.user.asUUID, answers from an in-memory store keyed by uuid and size, and on a miss requests the asked size plus every configured size (40, 50, 80, 110, 135, 192, 640, 1600; default 80) through a batcher that groups lookups into one POST profiles/urls to the avatar service; entries expire after cacheControl seconds (3600 by default), and hideDefaultAvatar makes a default avatar resolve null. setAvatar(file) resizes the image with @webex/helper-image, uploads it as the current user's avatar through the three-phase webex-core upload to profile sessions of the avatar service, clears that user's cached sizes, and resolves the new URL. Nothing is persisted."
7
+ },
8
+ "commands": {
9
+ "install": "yarn",
10
+ "prebuild": "yarn prebuild:modules",
11
+ "compile": "yarn build",
12
+ "build": "yarn build:src",
13
+ "unit-test": "yarn test:unit",
14
+ "lint": "yarn test:style",
15
+ "browser-test": "yarn test:browser",
16
+ "deploy": "yarn deploy:npm"
17
+ },
18
+ "public_interfaces": [
19
+ {
20
+ "name": "@webex/internal-plugin-avatar package entry",
21
+ "kind": "package_export",
22
+ "source": "src/index.js",
23
+ "entrypoints": [
24
+ "import '@webex/internal-plugin-avatar'",
25
+ "import Avatar from '@webex/internal-plugin-avatar'"
26
+ ],
27
+ "audience": "first-party Webex clients and the SDK packages that register it",
28
+ "notes": "Importing the package imports the user and device plugins, then registers Avatar as internal plugin 'avatar' with the avatar config; the first registration of the name wins. The default export Avatar is the only export; config is not exported."
29
+ },
30
+ {
31
+ "name": "webex.internal.avatar methods",
32
+ "kind": "plugin_api",
33
+ "source": "src/avatar.js",
34
+ "entrypoints": [
35
+ "webex.internal.avatar.retrieveAvatarUrl(user, options)",
36
+ "webex.internal.avatar.setAvatar(file)",
37
+ "webex.internal.avatar.enableThumbnails"
38
+ ],
39
+ "audience": "first-party Webex clients",
40
+ "notes": "retrieveAvatarUrl resolves a URL string, or null when options.hideDefaultAvatar is set and the avatar is a default one; options.size defaults to 80 and options.cacheControl to 3600 seconds, filled only where undefined and written into the caller's object. A miss prefetches every configured size, and one missing size rejects the call with 'Failed to retrieve avatar'. setAvatar uploads the helper-image thumbnail of the file for the current user and resolves the finalize url; it rejects with a TypeError for a non-image. The store, the batcher child, and the underscore-prefixed fetch helpers are reachable but not supported entries."
41
+ },
42
+ {
43
+ "name": "package scripts",
44
+ "kind": "npm_scripts",
45
+ "source": "package.json",
46
+ "entrypoints": [
47
+ "build",
48
+ "build:src",
49
+ "test:unit",
50
+ "test:style",
51
+ "test:browser",
52
+ "test",
53
+ "deploy:npm"
54
+ ],
55
+ "audience": "contributors and CI",
56
+ "notes": "build runs build:src, which writes dist. test:unit runs the jest unit specs, which import the package by name and so test dist; run build:src first. test:browser (commands.browser-test) runs karma over test/integration/spec but bundles nothing today (0 tests, exit 0), and its one spec has every case commented out. The aggregate test script runs test:style and test:unit, then exits 1 because test:integration is not defined; it is deliberately not a manifest command."
57
+ }
58
+ ],
59
+ "source_of_truth": [
60
+ {
61
+ "surface": "Avatar plugin implementation",
62
+ "paths": [
63
+ "src/index.js",
64
+ "src/avatar.js",
65
+ "src/avatar-url-batcher.js",
66
+ "src/avatar-url-store.js",
67
+ "src/config.js"
68
+ ],
69
+ "generated_artifacts": [
70
+ "dist"
71
+ ],
72
+ "refresh_with": [
73
+ "yarn build:src"
74
+ ],
75
+ "validate_with": [
76
+ "yarn test:unit",
77
+ "yarn test:style"
78
+ ]
79
+ },
80
+ {
81
+ "surface": "module specification",
82
+ "paths": [
83
+ "src/docs/README.md"
84
+ ],
85
+ "generated_artifacts": [],
86
+ "refresh_with": [
87
+ "update alongside the behavior change in the same commit"
88
+ ],
89
+ "validate_with": [
90
+ "spec-validator on an independent runtime"
91
+ ]
92
+ }
93
+ ],
94
+ "generated_artifacts": [
95
+ {
96
+ "path": "dist",
97
+ "generated_from": "src",
98
+ "refresh_with": "yarn build:src"
99
+ },
100
+ {
101
+ "path": "../../../.sdd/templates/repo-standards/template-map.json",
102
+ "generated_from": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
103
+ "refresh_with": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
104
+ }
105
+ ],
106
+ "validation_matrix": [
107
+ {
108
+ "paths": [
109
+ "src/**"
110
+ ],
111
+ "minimum": [
112
+ "yarn build:src",
113
+ "yarn test:unit",
114
+ "yarn test:style"
115
+ ],
116
+ "recommended": [
117
+ "add or update cases in test/unit/spec/avatar.js, test/unit/spec/avatar-url-batcher.js, or test/unit/spec/avatar-url-store.js for the changed behavior"
118
+ ]
119
+ },
120
+ {
121
+ "paths": [
122
+ "src/avatar.js",
123
+ "src/avatar-url-batcher.js"
124
+ ],
125
+ "minimum": [
126
+ "yarn build:src",
127
+ "yarn test:unit",
128
+ "yarn test:style"
129
+ ],
130
+ "recommended": [
131
+ "keep the assertion that a burst of lookups sends one request (INV-002), and add a case for a partial response or an HTTP error when the batch handling changes (INV-003)"
132
+ ]
133
+ },
134
+ {
135
+ "paths": [
136
+ "src/avatar-url-store.js",
137
+ "src/config.js"
138
+ ],
139
+ "minimum": [
140
+ "yarn build:src",
141
+ "yarn test:unit",
142
+ "yarn test:style"
143
+ ],
144
+ "recommended": [
145
+ "change config.sizes and the fixed size list in AvatarUrlStore.remove together, and pin the expiry timer with sinon fake timers (INV-001)"
146
+ ]
147
+ },
148
+ {
149
+ "paths": [
150
+ "src/index.js"
151
+ ],
152
+ "minimum": [
153
+ "yarn build:src",
154
+ "yarn test:unit",
155
+ "yarn test:style"
156
+ ],
157
+ "recommended": [
158
+ "check the packages that register the plugin (@webex/webex-server, @webex/recipe-private-web-client) when the registered name or an import changes"
159
+ ]
160
+ }
161
+ ],
162
+ "change_impact": [
163
+ {
164
+ "paths": [
165
+ "src/avatar.js"
166
+ ],
167
+ "affects": [
168
+ "retrieveAvatarUrl option defaults and the hideDefaultAvatar result",
169
+ "the all-sizes prefetch and oneFlight keys",
170
+ "the setAvatar upload phases and cache invalidation"
171
+ ],
172
+ "refresh_with": [
173
+ "yarn build:src"
174
+ ],
175
+ "validate_with": [
176
+ "yarn test:unit",
177
+ "yarn test:style"
178
+ ],
179
+ "avoid_direct_edits": [
180
+ "dist"
181
+ ],
182
+ "notes": "setAvatar has no unit case; add one stubbing detectFileType, processImage, and upload before changing it."
183
+ },
184
+ {
185
+ "paths": [
186
+ "src/avatar-url-batcher.js"
187
+ ],
188
+ "affects": [
189
+ "the profiles/urls request body",
190
+ "response mapping, the size-substitution warning, and error fan-out"
191
+ ],
192
+ "refresh_with": [
193
+ "yarn build:src"
194
+ ],
195
+ "validate_with": [
196
+ "yarn test:unit",
197
+ "yarn test:style"
198
+ ],
199
+ "avoid_direct_edits": [
200
+ "dist"
201
+ ],
202
+ "notes": "handleHttpError and the missing-size path have no unit case (MOD-009, INV-003)."
203
+ },
204
+ {
205
+ "paths": [
206
+ "src/avatar-url-store.js",
207
+ "src/config.js"
208
+ ],
209
+ "affects": [
210
+ "the store key, guards, and TTL",
211
+ "the size list and default size",
212
+ "the batcher timings"
213
+ ],
214
+ "refresh_with": [
215
+ "yarn build:src"
216
+ ],
217
+ "validate_with": [
218
+ "yarn test:unit",
219
+ "yarn test:style"
220
+ ],
221
+ "avoid_direct_edits": [
222
+ "dist"
223
+ ],
224
+ "notes": "Keep INV-001 and INV-004 intact; the expiry timer is not asserted today."
225
+ },
226
+ {
227
+ "paths": [
228
+ "src/index.js"
229
+ ],
230
+ "affects": [
231
+ "the registered plugin name and config",
232
+ "the user and device plugin imports"
233
+ ],
234
+ "refresh_with": [
235
+ "yarn build:src"
236
+ ],
237
+ "validate_with": [
238
+ "yarn test:unit",
239
+ "yarn test:style"
240
+ ],
241
+ "avoid_direct_edits": [
242
+ "dist"
243
+ ],
244
+ "notes": "No unit case covers registration; add one before changing it."
245
+ }
246
+ ],
247
+ "evidence_rules": [
248
+ {
249
+ "claim_category": "command_name",
250
+ "sources": [
251
+ "package.json"
252
+ ],
253
+ "requirement": "The script must exist in package.json scripts.",
254
+ "notes": "test:integration does not exist, so the aggregate test script fails; test:browser currently verifies nothing."
255
+ },
256
+ {
257
+ "claim_category": "import_path",
258
+ "sources": [
259
+ "src/index.js"
260
+ ],
261
+ "requirement": "A binding is public only if exported from src/index.js.",
262
+ "notes": "The only export is the default Avatar."
263
+ },
264
+ {
265
+ "claim_category": "behavior_claim",
266
+ "sources": [
267
+ "src",
268
+ "test/unit/spec"
269
+ ],
270
+ "requirement": "Ground every behavioral claim in source and unit-test evidence.",
271
+ "notes": "Commit history is not an evidence source for this package. README.md is context only (docs/adr/0001-retain-product-readme.md). The webex-core, common, common-timers, helper-image, internal-plugin-user, and internal-plugin-device specs were consulted; the webex-core batcher and the common oneFlight and patterns code were read where those specs are silent."
272
+ }
273
+ ],
274
+ "negative_guidance": [
275
+ {
276
+ "rule": "Do not call webex.request for profiles/urls outside the batcher.",
277
+ "why": "Lookups must be de-duplicated and grouped so a burst sends one request per flush (INV-002)."
278
+ },
279
+ {
280
+ "rule": "Do not change config.sizes without changing the fixed size list in AvatarUrlStore.remove.",
281
+ "why": "setAvatar invalidation would leave sizes cached until their TTL (module spec Pitfalls)."
282
+ },
283
+ {
284
+ "rule": "Do not read the service cacheControl field for the TTL without updating INV-001.",
285
+ "why": "The store TTL comes from options.cacheControl or config.cacheControl by design (config comment)."
286
+ },
287
+ {
288
+ "rule": "Do not log user ids, emails, or avatar URLs.",
289
+ "why": "They identify users; the only log line today prints sizes only."
290
+ },
291
+ {
292
+ "rule": "Do not treat README.md as a usage reference.",
293
+ "why": "Its Usage block names a placeholder member; see docs/adr/0001-retain-product-readme.md."
294
+ },
295
+ {
296
+ "rule": "Do not infer a coverage threshold for this package.",
297
+ "why": "No coverage script or threshold exists."
298
+ }
299
+ ],
300
+ "confidence_policy": {
301
+ "high": {
302
+ "action": "update",
303
+ "expectation": "Source and a unit case in test/unit/spec agree."
304
+ },
305
+ "medium": {
306
+ "action": "narrow-scope",
307
+ "expectation": "Only source evidence exists, as for registration, the config defaults, handleHttpError, the missing-size path, the expiry timer, and setAvatar. Pin current behavior with a unit case before modifying."
308
+ },
309
+ "low": {
310
+ "action": "noop",
311
+ "expectation": "Neither source, tests, nor a dependency's spec or code settles the question. Stop and report the gap."
312
+ }
313
+ },
314
+ "repository_topology": {
315
+ "main_entrypoints": [
316
+ {
317
+ "name": "package entry",
318
+ "path": "src/index.js",
319
+ "purpose": "Registers the avatar plugin and exports the class",
320
+ "notes": "No subpath exports; package.json main is dist/index.js and devMain is src/index.js."
321
+ }
322
+ ],
323
+ "workspace_packages": [
324
+ {
325
+ "name": "@webex/internal-plugin-avatar",
326
+ "paths": [
327
+ "src",
328
+ "test"
329
+ ],
330
+ "notes": "One module; this SDD root is the package directory inside the webex-js-sdk monorepo."
331
+ }
332
+ ],
333
+ "source_surfaces": [
334
+ {
335
+ "name": "Avatar plugin",
336
+ "paths": [
337
+ "src"
338
+ ],
339
+ "notes": "index.js, avatar.js, avatar-url-batcher.js, avatar-url-store.js, config.js. Specified at src/docs/README.md."
340
+ },
341
+ {
342
+ "name": "tests",
343
+ "paths": [
344
+ "test/unit/spec",
345
+ "test/integration/spec"
346
+ ],
347
+ "notes": "Three unit specs run by test:unit; one integration spec, with every case commented out, run only by test:browser."
348
+ }
349
+ ],
350
+ "generated_surfaces": [
351
+ {
352
+ "name": "build output",
353
+ "paths": [
354
+ "dist"
355
+ ],
356
+ "generated_from": "src",
357
+ "refresh_with": "yarn build:src",
358
+ "notes": "JavaScript and source maps from webex-legacy-tools; no type declarations. Do not edit by hand."
359
+ },
360
+ {
361
+ "name": "repo-standards template map",
362
+ "paths": [
363
+ "../../../.sdd/templates/repo-standards"
364
+ ],
365
+ "generated_from": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
366
+ "refresh_with": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package.",
367
+ "notes": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
368
+ }
369
+ ],
370
+ "validation_entrypoints": [
371
+ {
372
+ "name": "compile",
373
+ "command": "yarn build",
374
+ "scope": "src",
375
+ "notes": "Runs build:src."
376
+ },
377
+ {
378
+ "name": "unit-test",
379
+ "command": "yarn test:unit",
380
+ "scope": "test/unit/spec",
381
+ "notes": "Run build:src first; the specs test dist."
382
+ },
383
+ {
384
+ "name": "lint",
385
+ "command": "yarn test:style",
386
+ "scope": "src",
387
+ "notes": "eslint via the local .eslintrc.js; docs/** and *.md are ignored."
388
+ }
389
+ ],
390
+ "sync_paths": [
391
+ {
392
+ "source": "src/avatar.js",
393
+ "targets": [
394
+ "src/docs/README.md"
395
+ ],
396
+ "mechanism": "Manual; update the module specification in the same change that alters observable behavior.",
397
+ "notes": "Keep the retrieval, batching, store, and upload rows of the specification aligned with src/avatar.js, src/avatar-url-batcher.js, src/avatar-url-store.js, and src/config.js."
398
+ },
399
+ {
400
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
401
+ "targets": [
402
+ "../../../.sdd/templates/repo-standards"
403
+ ],
404
+ "mechanism": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package.",
405
+ "notes": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
406
+ }
407
+ ]
408
+ },
409
+ "folder_readme_contract": {
410
+ "required_sections": [
411
+ "purpose",
412
+ "boundaries",
413
+ "key-files",
414
+ "common-tasks"
415
+ ],
416
+ "rules": [
417
+ "Orient the reader before describing detail.",
418
+ "Link to the module specification rather than duplicating it."
419
+ ],
420
+ "example_policy": "Examples are allowed only when verified against src/ or test/.",
421
+ "fallback": "Omit a section rather than inventing content; report unresolved facts as gaps."
422
+ },
423
+ "regression_feedback_rules": [
424
+ {
425
+ "trigger": "The profiles/urls request, its grouping, or the response mapping in src/avatar-url-batcher.js changes.",
426
+ "required_followups": [
427
+ "Add or update a unit case in test/unit/spec/avatar-url-batcher.js or test/unit/spec/avatar.js asserting the request and the resolved items",
428
+ "Update MOD-007 to MOD-009 and INV-002 and INV-003 in src/docs/README.md"
429
+ ],
430
+ "notes": "handleHttpError and the missing-size path are untested; the missing-size case is skipped."
431
+ },
432
+ {
433
+ "trigger": "The store key, guards, TTL, or remove list in src/avatar-url-store.js or src/config.js changes.",
434
+ "required_followups": [
435
+ "Add a fake-timer unit case for expiry; none exists today",
436
+ "Update MOD-002, MOD-010, MOD-011, INV-001, and INV-004 in src/docs/README.md"
437
+ ],
438
+ "notes": "The remove list is fixed and not read from config.sizes."
439
+ },
440
+ {
441
+ "trigger": "setAvatar, registration, or the imports in src/avatar.js or src/index.js change.",
442
+ "required_followups": [
443
+ "Add unit cases for setAvatar and registration; none exist today",
444
+ "Update MOD-001, MOD-003, MOD-012, and INV-005 in src/docs/README.md"
445
+ ],
446
+ "notes": "The integration cases for setAvatar and retrieveAvatarUrl are commented out."
447
+ }
448
+ ],
449
+ "surface_owners": [
450
+ {
451
+ "surface": "module implementation and specifications",
452
+ "owner": "@webex/web-sdk",
453
+ "edit_boundary": "Owner per the default rule of the monorepo .github/CODEOWNERS; the file has no line for packages/@webex/internal-plugin-avatar."
454
+ }
455
+ ],
456
+ "do_not_edit": [
457
+ "dist",
458
+ "../../../.sdd/templates/repo-standards"
459
+ ],
460
+ "marker_scopes": {
461
+ "sdd": [
462
+ ".sdd/manifest.json",
463
+ "src/docs/README.md",
464
+ "docs"
465
+ ]
466
+ },
467
+ "fallback_rules": [
468
+ "When source and tests disagree, code is the referee and the disagreement is recorded rather than silently resolved.",
469
+ "When neither source nor tests settle a question, report it as a gap instead of inferring.",
470
+ "Commit history is not a valid rationale source for this package.",
471
+ "When a dependency's specification disagrees with that dependency's code, use the code and record the disagreement; when a dependency has no specification, use its code."
472
+ ],
473
+ "downstream_context_pack": {
474
+ "required_human_surfaces": [
475
+ "README.md",
476
+ "docs/index.md",
477
+ "docs/architecture.md",
478
+ "src/docs/README.md"
479
+ ],
480
+ "required_agent_operational_surfaces": [
481
+ "AGENTS.md",
482
+ "docs/specs/README.md"
483
+ ],
484
+ "required_machine_readable_surface": ".sdd/manifest.json",
485
+ "recommended_machine_readable_sections": [
486
+ "public_interfaces",
487
+ "change_impact",
488
+ "evidence_rules",
489
+ "negative_guidance",
490
+ "confidence_policy",
491
+ "repository_topology",
492
+ "folder_readme_contract",
493
+ "regression_feedback_rules"
494
+ ]
495
+ }
496
+ }