@openvtc/trust-tasks 0.28.19 → 0.28.21

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 (78) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/_shared/components.d.ts +16 -1
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/auth/step-up/requests/show/0.1/payload.d.ts +458 -0
  5. package/dist/auth/step-up/requests/show/0.1/payload.d.ts.map +1 -0
  6. package/dist/auth/step-up/requests/show/0.1/payload.js +261 -0
  7. package/dist/auth/step-up/requests/show/0.1/payload.js.map +1 -0
  8. package/dist/index.d.ts +9 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +9 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/vtc/badges/_shared/0.1/badge.d.ts +1 -1
  13. package/dist/vtc/badges/_shared/0.1/badge.d.ts.map +1 -1
  14. package/dist/vtc/badges/awards/list/0.1/payload.d.ts +118 -6
  15. package/dist/vtc/badges/awards/list/0.1/payload.d.ts.map +1 -1
  16. package/dist/vtc/badges/awards/list/0.1/payload.js +64 -2
  17. package/dist/vtc/badges/awards/list/0.1/payload.js.map +1 -1
  18. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts +118 -6
  19. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts.map +1 -1
  20. package/dist/vtc/badges/awards/offer/0.1/payload.js +64 -2
  21. package/dist/vtc/badges/awards/offer/0.1/payload.js.map +1 -1
  22. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts +118 -6
  23. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts.map +1 -1
  24. package/dist/vtc/badges/awards/revoke/0.1/payload.js +64 -2
  25. package/dist/vtc/badges/awards/revoke/0.1/payload.js.map +1 -1
  26. package/dist/vtc/badges/awards/share/0.1/payload.d.ts +701 -0
  27. package/dist/vtc/badges/awards/share/0.1/payload.d.ts.map +1 -0
  28. package/dist/vtc/badges/awards/share/0.1/payload.js +406 -0
  29. package/dist/vtc/badges/awards/share/0.1/payload.js.map +1 -0
  30. package/dist/vtc/badges/awards/unshare/0.1/payload.d.ts +701 -0
  31. package/dist/vtc/badges/awards/unshare/0.1/payload.d.ts.map +1 -0
  32. package/dist/vtc/badges/awards/unshare/0.1/payload.js +406 -0
  33. package/dist/vtc/badges/awards/unshare/0.1/payload.js.map +1 -0
  34. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts +118 -6
  35. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts.map +1 -1
  36. package/dist/vtc/badges/awards/withdraw/0.1/payload.js +64 -2
  37. package/dist/vtc/badges/awards/withdraw/0.1/payload.js.map +1 -1
  38. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts +118 -6
  39. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts.map +1 -1
  40. package/dist/vtc/badges/kudos/give/0.1/payload.js +64 -2
  41. package/dist/vtc/badges/kudos/give/0.1/payload.js.map +1 -1
  42. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts +118 -6
  43. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts.map +1 -1
  44. package/dist/vtc/badges/kudos/list/0.1/payload.js +64 -2
  45. package/dist/vtc/badges/kudos/list/0.1/payload.js.map +1 -1
  46. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts +118 -6
  47. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts.map +1 -1
  48. package/dist/vtc/badges/mine/accept/0.1/payload.js +64 -2
  49. package/dist/vtc/badges/mine/accept/0.1/payload.js.map +1 -1
  50. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts +118 -6
  51. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts.map +1 -1
  52. package/dist/vtc/badges/mine/decline/0.1/payload.js +64 -2
  53. package/dist/vtc/badges/mine/decline/0.1/payload.js.map +1 -1
  54. package/dist/vtc/badges/mine/list/0.1/payload.d.ts +118 -6
  55. package/dist/vtc/badges/mine/list/0.1/payload.d.ts.map +1 -1
  56. package/dist/vtc/badges/mine/list/0.1/payload.js +64 -2
  57. package/dist/vtc/badges/mine/list/0.1/payload.js.map +1 -1
  58. package/dist/vtc/badges/show/0.1/payload.d.ts +472 -26
  59. package/dist/vtc/badges/show/0.1/payload.d.ts.map +1 -1
  60. package/dist/vtc/badges/show/0.1/payload.js +264 -12
  61. package/dist/vtc/badges/show/0.1/payload.js.map +1 -1
  62. package/package.json +1 -1
  63. package/src/_shared/components.ts +16 -1
  64. package/src/auth/step-up/requests/show/0.1/payload.ts +317 -0
  65. package/src/index.ts +9 -0
  66. package/src/vtc/badges/_shared/0.1/badge.ts +1 -1
  67. package/src/vtc/badges/awards/list/0.1/payload.ts +66 -4
  68. package/src/vtc/badges/awards/offer/0.1/payload.ts +66 -4
  69. package/src/vtc/badges/awards/revoke/0.1/payload.ts +66 -4
  70. package/src/vtc/badges/awards/share/0.1/payload.ts +446 -0
  71. package/src/vtc/badges/awards/unshare/0.1/payload.ts +446 -0
  72. package/src/vtc/badges/awards/withdraw/0.1/payload.ts +66 -4
  73. package/src/vtc/badges/kudos/give/0.1/payload.ts +66 -4
  74. package/src/vtc/badges/kudos/list/0.1/payload.ts +66 -4
  75. package/src/vtc/badges/mine/accept/0.1/payload.ts +66 -4
  76. package/src/vtc/badges/mine/decline/0.1/payload.ts +66 -4
  77. package/src/vtc/badges/mine/list/0.1/payload.ts +66 -4
  78. package/src/vtc/badges/show/0.1/payload.ts +272 -14
@@ -3,7 +3,7 @@
3
3
  * Source: specs/vtc/badges/show/0.1/payload.schema.json
4
4
  */
5
5
 
6
- import type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupId } from "../../../../_shared/components.js";
6
+ import type { Award, AwardId, AwardNote, AwardShare, AwardState, Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupCredentialId, GroupId } from "../../../../_shared/components.js";
7
7
 
8
8
 
9
9
  /**
@@ -35,6 +35,12 @@ export interface VTCBadgesShowResponsePayload {
35
35
  */
36
36
  myCount: number;
37
37
  myState: MyState;
38
+ /**
39
+ * The caller's own accepted awards of this badge, newest first, each with `shared` where they show it outside the community — what `vtc/badges/awards/share` and `unshare` name. Absent where the caller holds none. Never another member's award.
40
+ *
41
+ * @maxItems 1000
42
+ */
43
+ myAwards?: Award[];
38
44
  /**
39
45
  * Community badges only: the badge group's managers, whom a request for the badge goes to. Shown to every caller who may see the badge.
40
46
  *
@@ -50,7 +56,7 @@ export interface VTCBadgesShowResponsePayload {
50
56
  }
51
57
 
52
58
  /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
53
- export type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupId };
59
+ export type { Award, AwardId, AwardNote, AwardShare, AwardState, Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupCredentialId, GroupId };
54
60
 
55
61
  /** Trust Task type URI. */
56
62
  export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/show/0.1" as const;
@@ -154,6 +160,14 @@ export const PAYLOAD_SCHEMA = {
154
160
  "myState": {
155
161
  "$ref": "#/$defs/MyState"
156
162
  },
163
+ "myAwards": {
164
+ "type": "array",
165
+ "maxItems": 1000,
166
+ "items": {
167
+ "$ref": "#/$defs/Award"
168
+ },
169
+ "description": "The caller's own accepted awards of this badge, newest first, each with `shared` where they show it outside the community — what `vtc/badges/awards/share` and `unshare` name. Absent where the caller holds none. Never another member's award."
170
+ },
157
171
  "owners": {
158
172
  "type": "array",
159
173
  "maxItems": 64,
@@ -191,6 +205,130 @@ export const PAYLOAD_SCHEMA = {
191
205
  "type": "string",
192
206
  "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
193
207
  },
208
+ "Award": {
209
+ "title": "Award",
210
+ "description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires. `shared` is present on an accepted award of a badge its holders may show outside while its holder shares it (vtc/badges/awards/share).",
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": [
214
+ "awardId",
215
+ "badgeId",
216
+ "entryId",
217
+ "state",
218
+ "offeredAt"
219
+ ],
220
+ "properties": {
221
+ "awardId": {
222
+ "$ref": "#/$defs/AwardId"
223
+ },
224
+ "badgeId": {
225
+ "$ref": "#/$defs/BadgeId"
226
+ },
227
+ "entryId": {
228
+ "$ref": "#/$defs/EntryId",
229
+ "description": "The recipient."
230
+ },
231
+ "givenBy": {
232
+ "$ref": "#/$defs/EntryId"
233
+ },
234
+ "note": {
235
+ "$ref": "#/$defs/AwardNote"
236
+ },
237
+ "state": {
238
+ "$ref": "#/$defs/AwardState"
239
+ },
240
+ "offeredAt": {
241
+ "type": "string",
242
+ "format": "date-time"
243
+ },
244
+ "decidedAt": {
245
+ "type": "string",
246
+ "format": "date-time",
247
+ "description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
248
+ },
249
+ "expiresAt": {
250
+ "type": "string",
251
+ "format": "date-time",
252
+ "description": "When an unanswered offer lapses, where the community expires offers."
253
+ },
254
+ "credentialId": {
255
+ "$ref": "#/$defs/GroupCredentialId"
256
+ },
257
+ "shared": {
258
+ "$ref": "#/$defs/AwardShare"
259
+ },
260
+ "ext": {
261
+ "$ref": "#/$defs/Ext"
262
+ }
263
+ }
264
+ },
265
+ "AwardShare": {
266
+ "title": "AwardShare",
267
+ "description": "Where an accepted award is shown outside the community, by its holder's choice (VTI-BDG-070): the public location that answers a verification of exactly what the credential says, the baked image where the community serves one, and since when. Present only while the holder shares the award; absent once they stop, the award is taken back, the badge is retired or the holder departs. The locations are unguessable and name no other holder (VTI-BDG-071).",
268
+ "type": "object",
269
+ "additionalProperties": false,
270
+ "required": [
271
+ "verificationUrl",
272
+ "since"
273
+ ],
274
+ "properties": {
275
+ "verificationUrl": {
276
+ "type": "string",
277
+ "format": "uri",
278
+ "maxLength": 2048,
279
+ "description": "The public location that answers the credential and a verification of it."
280
+ },
281
+ "bakedImageUrl": {
282
+ "type": "string",
283
+ "format": "uri",
284
+ "maxLength": 2048,
285
+ "description": "The badge's picture with the credential baked into it, for a website or an email signature. Absent where the community serves no baked image."
286
+ },
287
+ "since": {
288
+ "type": "string",
289
+ "format": "date-time"
290
+ }
291
+ }
292
+ },
293
+ "AwardState": {
294
+ "title": "AwardState",
295
+ "description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
296
+ "type": "string",
297
+ "enum": [
298
+ "offered",
299
+ "accepted",
300
+ "declined",
301
+ "withdrawn",
302
+ "expired",
303
+ "revoked"
304
+ ]
305
+ },
306
+ "AwardNote": {
307
+ "title": "AwardNote",
308
+ "type": "string",
309
+ "minLength": 1,
310
+ "maxLength": 500,
311
+ "description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
312
+ },
313
+ "BadgeId": {
314
+ "title": "BadgeId",
315
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
316
+ "type": "string",
317
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
318
+ },
319
+ "AwardId": {
320
+ "title": "AwardId",
321
+ "description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
322
+ "type": "string",
323
+ "pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
324
+ },
325
+ "GroupCredentialId": {
326
+ "title": "GroupCredentialId",
327
+ "description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
328
+ "type": "string",
329
+ "minLength": 1,
330
+ "maxLength": 512
331
+ },
194
332
  "Badge": {
195
333
  "title": "Badge",
196
334
  "description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
@@ -315,12 +453,6 @@ export const PAYLOAD_SCHEMA = {
315
453
  "kudos"
316
454
  ]
317
455
  },
318
- "BadgeId": {
319
- "title": "BadgeId",
320
- "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
321
- "type": "string",
322
- "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
323
- },
324
456
  "GroupId": {
325
457
  "title": "GroupId",
326
458
  "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
@@ -425,6 +557,14 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
425
557
  "myState": {
426
558
  "$ref": "#/$defs/MyState"
427
559
  },
560
+ "myAwards": {
561
+ "type": "array",
562
+ "maxItems": 1000,
563
+ "items": {
564
+ "$ref": "#/$defs/Award"
565
+ },
566
+ "description": "The caller's own accepted awards of this badge, newest first, each with `shared` where they show it outside the community — what `vtc/badges/awards/share` and `unshare` name. Absent where the caller holds none. Never another member's award."
567
+ },
428
568
  "owners": {
429
569
  "type": "array",
430
570
  "maxItems": 64,
@@ -462,6 +602,130 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
462
602
  "type": "string",
463
603
  "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
464
604
  },
605
+ "Award": {
606
+ "title": "Award",
607
+ "description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires. `shared` is present on an accepted award of a badge its holders may show outside while its holder shares it (vtc/badges/awards/share).",
608
+ "type": "object",
609
+ "additionalProperties": false,
610
+ "required": [
611
+ "awardId",
612
+ "badgeId",
613
+ "entryId",
614
+ "state",
615
+ "offeredAt"
616
+ ],
617
+ "properties": {
618
+ "awardId": {
619
+ "$ref": "#/$defs/AwardId"
620
+ },
621
+ "badgeId": {
622
+ "$ref": "#/$defs/BadgeId"
623
+ },
624
+ "entryId": {
625
+ "$ref": "#/$defs/EntryId",
626
+ "description": "The recipient."
627
+ },
628
+ "givenBy": {
629
+ "$ref": "#/$defs/EntryId"
630
+ },
631
+ "note": {
632
+ "$ref": "#/$defs/AwardNote"
633
+ },
634
+ "state": {
635
+ "$ref": "#/$defs/AwardState"
636
+ },
637
+ "offeredAt": {
638
+ "type": "string",
639
+ "format": "date-time"
640
+ },
641
+ "decidedAt": {
642
+ "type": "string",
643
+ "format": "date-time",
644
+ "description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
645
+ },
646
+ "expiresAt": {
647
+ "type": "string",
648
+ "format": "date-time",
649
+ "description": "When an unanswered offer lapses, where the community expires offers."
650
+ },
651
+ "credentialId": {
652
+ "$ref": "#/$defs/GroupCredentialId"
653
+ },
654
+ "shared": {
655
+ "$ref": "#/$defs/AwardShare"
656
+ },
657
+ "ext": {
658
+ "$ref": "#/$defs/Ext"
659
+ }
660
+ }
661
+ },
662
+ "AwardShare": {
663
+ "title": "AwardShare",
664
+ "description": "Where an accepted award is shown outside the community, by its holder's choice (VTI-BDG-070): the public location that answers a verification of exactly what the credential says, the baked image where the community serves one, and since when. Present only while the holder shares the award; absent once they stop, the award is taken back, the badge is retired or the holder departs. The locations are unguessable and name no other holder (VTI-BDG-071).",
665
+ "type": "object",
666
+ "additionalProperties": false,
667
+ "required": [
668
+ "verificationUrl",
669
+ "since"
670
+ ],
671
+ "properties": {
672
+ "verificationUrl": {
673
+ "type": "string",
674
+ "format": "uri",
675
+ "maxLength": 2048,
676
+ "description": "The public location that answers the credential and a verification of it."
677
+ },
678
+ "bakedImageUrl": {
679
+ "type": "string",
680
+ "format": "uri",
681
+ "maxLength": 2048,
682
+ "description": "The badge's picture with the credential baked into it, for a website or an email signature. Absent where the community serves no baked image."
683
+ },
684
+ "since": {
685
+ "type": "string",
686
+ "format": "date-time"
687
+ }
688
+ }
689
+ },
690
+ "AwardState": {
691
+ "title": "AwardState",
692
+ "description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
693
+ "type": "string",
694
+ "enum": [
695
+ "offered",
696
+ "accepted",
697
+ "declined",
698
+ "withdrawn",
699
+ "expired",
700
+ "revoked"
701
+ ]
702
+ },
703
+ "AwardNote": {
704
+ "title": "AwardNote",
705
+ "type": "string",
706
+ "minLength": 1,
707
+ "maxLength": 500,
708
+ "description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
709
+ },
710
+ "BadgeId": {
711
+ "title": "BadgeId",
712
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
713
+ "type": "string",
714
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
715
+ },
716
+ "AwardId": {
717
+ "title": "AwardId",
718
+ "description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
719
+ "type": "string",
720
+ "pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
721
+ },
722
+ "GroupCredentialId": {
723
+ "title": "GroupCredentialId",
724
+ "description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
725
+ "type": "string",
726
+ "minLength": 1,
727
+ "maxLength": 512
728
+ },
465
729
  "Badge": {
466
730
  "title": "Badge",
467
731
  "description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
@@ -586,12 +850,6 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
586
850
  "kudos"
587
851
  ]
588
852
  },
589
- "BadgeId": {
590
- "title": "BadgeId",
591
- "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
592
- "type": "string",
593
- "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
594
- },
595
853
  "GroupId": {
596
854
  "title": "GroupId",
597
855
  "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",