@nmshd/connector-tui 3.1.2 → 3.2.1

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.
@@ -19,6 +19,10 @@ export function AddSendPremadeRequestByMessage(Base) {
19
19
  title: "Gynaecology Questionnaire",
20
20
  value: this.createGynaecologyQuestionnaire.bind(this),
21
21
  },
22
+ {
23
+ title: "Extension Social Card",
24
+ value: this.createExtensionSocialCard.bind(this),
25
+ },
22
26
  ],
23
27
  });
24
28
  if (!whatRequest.requestMethod || typeof whatRequest.requestMethod !== "function")
@@ -356,5 +360,130 @@ Selbstverständlich unterliegen alle Ihre Angaben der
356
360
  ],
357
361
  };
358
362
  }
363
+ createExtensionSocialCard(_) {
364
+ const description = `Guten Tag,
365
+ in 4 Wochen läuft Ihr Sozialpass aus.
366
+ Bitte überprüfen Sie die Aktualität Ihrer Daten und laden Sie einen aktuellen Leistungsbescheid hoch.`;
367
+ return {
368
+ "@type": "Request",
369
+ title: "Verlängerung Sozialpass",
370
+ description,
371
+ items: [
372
+ {
373
+ "@type": "RequestItemGroup",
374
+ title: "Persönliche Daten",
375
+ description: "Bitte überprüfen Sie Ihre persönlichen Daten und aktualisieren Sie diese bei Bedarf.",
376
+ items: [
377
+ {
378
+ "@type": "ProposeAttributeRequestItem",
379
+ mustBeAccepted: true,
380
+ query: { "@type": "IdentityAttributeQuery", valueType: "GivenName" },
381
+ attribute: {
382
+ "@type": "IdentityAttribute",
383
+ owner: "",
384
+ value: { "@type": "GivenName", value: "Elke" },
385
+ },
386
+ },
387
+ {
388
+ "@type": "ProposeAttributeRequestItem",
389
+ mustBeAccepted: true,
390
+ query: { "@type": "IdentityAttributeQuery", valueType: "Surname" },
391
+ attribute: {
392
+ "@type": "IdentityAttribute",
393
+ owner: "",
394
+ value: { "@type": "Surname", value: "Mustermann" },
395
+ },
396
+ },
397
+ {
398
+ "@type": "ProposeAttributeRequestItem",
399
+ mustBeAccepted: true,
400
+ query: { "@type": "IdentityAttributeQuery", valueType: "MaritalStatus" },
401
+ attribute: {
402
+ "@type": "IdentityAttribute",
403
+ owner: "",
404
+ value: { "@type": "MaritalStatus", value: "single" },
405
+ },
406
+ },
407
+ {
408
+ "@type": "ProposeAttributeRequestItem",
409
+ mustBeAccepted: true,
410
+ query: { "@type": "IdentityAttributeQuery", valueType: "BirthDate" },
411
+ attribute: {
412
+ "@type": "IdentityAttribute",
413
+ owner: "",
414
+ value: { "@type": "BirthDate", day: 1, month: 1, year: 2000 },
415
+ },
416
+ },
417
+ {
418
+ "@type": "ProposeAttributeRequestItem",
419
+ mustBeAccepted: true,
420
+ query: { "@type": "IdentityAttributeQuery", valueType: "StreetAddress" },
421
+ attribute: {
422
+ "@type": "IdentityAttribute",
423
+ owner: "",
424
+ value: {
425
+ "@type": "StreetAddress",
426
+ recipient: "Elke Mustermann",
427
+ street: "Musterstraße",
428
+ houseNo: "1",
429
+ zipCode: "12345",
430
+ city: "Musterstadt",
431
+ country: "DE",
432
+ },
433
+ },
434
+ },
435
+ {
436
+ "@type": "ProposeAttributeRequestItem",
437
+ mustBeAccepted: true,
438
+ query: { "@type": "IdentityAttributeQuery", valueType: "PhoneNumber" },
439
+ attribute: {
440
+ "@type": "IdentityAttribute",
441
+ owner: "",
442
+ value: { "@type": "PhoneNumber", value: "012345" },
443
+ },
444
+ },
445
+ {
446
+ "@type": "ProposeAttributeRequestItem",
447
+ mustBeAccepted: false,
448
+ query: { "@type": "IdentityAttributeQuery", valueType: "EMailAddress" },
449
+ attribute: {
450
+ "@type": "IdentityAttribute",
451
+ owner: "",
452
+ value: { "@type": "EMailAddress", value: "example@example.com" },
453
+ },
454
+ },
455
+ ],
456
+ },
457
+ {
458
+ "@type": "RequestItemGroup",
459
+ title: "Weitere im Haushalt lebende Personen",
460
+ items: [
461
+ {
462
+ "@type": "ProposeAttributeRequestItem",
463
+ mustBeAccepted: true,
464
+ query: { "@type": "IdentityAttributeQuery", valueType: "SchematizedJSON" },
465
+ attribute: {
466
+ "@type": "IdentityAttribute",
467
+ owner: "",
468
+ value: { "@type": "SchematizedJSON", value: "<Bekannte Familienmitglieder>" },
469
+ },
470
+ },
471
+ ],
472
+ },
473
+ {
474
+ "@type": "RequestItemGroup",
475
+ title: "Leistungsbescheid",
476
+ description: "Zur Prüfung Ihres Anspruchs benötigen wir einen Einkommensnachweis der letzten 12 Monate, Rentenbescheid, Wohngeldbescheid oder Kindergeldnachweis.",
477
+ items: [
478
+ {
479
+ "@type": "ReadAttributeRequestItem",
480
+ mustBeAccepted: true,
481
+ query: { "@type": "IdentityAttributeQuery", valueType: "IdentityFileReference" },
482
+ },
483
+ ],
484
+ },
485
+ ],
486
+ };
487
+ }
359
488
  };
360
489
  }
@@ -1,4 +1,5 @@
1
1
  import { RelationshipAttributeConfidentiality, } from "@nmshd/content";
2
+ import fs from "fs";
2
3
  import prompts from "prompts";
3
4
  export function AddSendRequestByMessage(Base) {
4
5
  return class SendRequestByMessage extends Base {
@@ -47,6 +48,10 @@ export function AddSendRequestByMessage(Base) {
47
48
  title: "CreateRelationshipAttributeRequestItem with Boolean value",
48
49
  value: this.createCreateRelationshipAttributeRequestItemWithBooleanValue.bind(this),
49
50
  },
51
+ {
52
+ title: "CreateRelationshipAttributeRequestItem with ProprietaryJSON value",
53
+ value: this.createCreateRelationshipAttributeRequestItemWithProprietaryJSONValue.bind(this),
54
+ },
50
55
  {
51
56
  title: "CreateIdentityAttributeRequestItem",
52
57
  value: this.createCreateIdentityAttributeRequestItem.bind(this),
@@ -360,6 +365,12 @@ export function AddSendRequestByMessage(Base) {
360
365
  type: "text",
361
366
  name: "value",
362
367
  },
368
+ {
369
+ message: "What's the key of your Attribute?",
370
+ type: "text",
371
+ name: "key",
372
+ initial: "Key of RelationshipAttribute",
373
+ },
363
374
  ]);
364
375
  const requestItem = {
365
376
  "@type": "ProposeAttributeRequestItem",
@@ -371,13 +382,13 @@ export function AddSendRequestByMessage(Base) {
371
382
  confidentiality: RelationshipAttributeConfidentiality.Public,
372
383
  valueType: "ProprietaryString",
373
384
  },
374
- key: "aKey",
385
+ key: result.key,
375
386
  owner: "",
376
387
  },
377
388
  attribute: {
378
389
  "@type": "RelationshipAttribute",
379
390
  owner: "",
380
- key: "aKey",
391
+ key: result.key,
381
392
  confidentiality: RelationshipAttributeConfidentiality.Public,
382
393
  value: {
383
394
  "@type": "ProprietaryString",
@@ -522,6 +533,60 @@ export function AddSendRequestByMessage(Base) {
522
533
  };
523
534
  return requestItem;
524
535
  }
536
+ async createCreateRelationshipAttributeRequestItemWithProprietaryJSONValue() {
537
+ const result = await prompts([
538
+ {
539
+ message: "What's the title of the RelationshipAttribute you would like to create?",
540
+ type: "text",
541
+ name: "title",
542
+ initial: "Title of RelationshipAttribute",
543
+ },
544
+ {
545
+ message: "[Optional] What's the description of the RelationshipAttribute?",
546
+ type: "text",
547
+ name: "description",
548
+ format: (value) => (value.length > 0 ? value : undefined),
549
+ },
550
+ {
551
+ message: "What's the key of the RelationshipAttribute you would like to create?",
552
+ type: "text",
553
+ name: "key",
554
+ initial: "Key of RelationshipAttribute",
555
+ },
556
+ {
557
+ message: "Who will be the owner of the RelationshipAttribute?",
558
+ type: "select",
559
+ name: "owner",
560
+ choices: [
561
+ { title: "You (Connector)", value: this.connectorAddress },
562
+ { title: "The other Side", value: "" },
563
+ ],
564
+ },
565
+ {
566
+ message: "Enter the path to a JSON file:",
567
+ type: "text",
568
+ name: "jsonValue",
569
+ format: (value) => JSON.parse(fs.readFileSync(value, "utf-8")),
570
+ },
571
+ ]);
572
+ const requestItem = {
573
+ "@type": "CreateAttributeRequestItem",
574
+ mustBeAccepted: true,
575
+ attribute: {
576
+ "@type": "RelationshipAttribute",
577
+ owner: result.owner,
578
+ key: result.key,
579
+ confidentiality: RelationshipAttributeConfidentiality.Public,
580
+ value: {
581
+ "@type": "ProprietaryJSON",
582
+ title: result.title,
583
+ description: result.description,
584
+ value: result.jsonValue,
585
+ },
586
+ },
587
+ };
588
+ return requestItem;
589
+ }
525
590
  async createCreateIdentityAttributeRequestItem(peer) {
526
591
  const result = await prompts([
527
592
  {
package/package.json CHANGED
@@ -28,34 +28,34 @@
28
28
  "watch": "node --watch --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' src/run.ts"
29
29
  },
30
30
  "dependencies": {
31
- "@nmshd/connector-sdk": "^7.3.0",
32
- "axios": "^1.13.2",
31
+ "@nmshd/connector-sdk": "^7.4.0",
32
+ "axios": "^1.18.1",
33
33
  "chalk": "^5.6.2",
34
- "dotenv": "^17.2.3",
34
+ "dotenv": "^17.4.2",
35
35
  "luxon": "^3.7.2",
36
36
  "prompts": "^2.4.2",
37
37
  "qrcode-terminal": "^0.12.0",
38
38
  "yargs": "^18.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@js-soft/eslint-config-ts": "^2.0.4",
42
- "@js-soft/license-check": "^1.0.10",
43
- "@types/luxon": "^3.7.1",
44
- "@types/node": "^24.10.9",
45
- "@types/prompts": "^2.4.9",
46
- "@types/qrcode-terminal": "^0.12.2",
47
- "@types/yargs": "^17.0.35",
48
- "eslint": "^9.39.2",
49
- "prettier": "^3.8.1",
50
- "ts-node": "^10.9.2",
51
- "typescript": "^5.9.3"
41
+ "@js-soft/eslint-config-ts": "2.0.6",
42
+ "@js-soft/license-check": "1.0.11",
43
+ "@types/luxon": "3.7.2",
44
+ "@types/node": "24.13.3",
45
+ "@types/prompts": "2.4.9",
46
+ "@types/qrcode-terminal": "0.12.2",
47
+ "@types/yargs": "17.0.35",
48
+ "eslint": "10.6.0",
49
+ "prettier": "3.9.5",
50
+ "ts-node": "10.9.2",
51
+ "typescript": "6.0.2"
52
52
  },
53
53
  "engines": {
54
- "node": ">=24.13.0"
54
+ "node": ">=24.18.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public",
58
58
  "provenance": true
59
59
  },
60
- "version": "3.1.2"
60
+ "version": "3.2.1"
61
61
  }