@truvity/sdk 0.38.2 → 0.40.13
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.
- package/Client.d.ts +5 -0
- package/Client.d.ts.map +1 -1
- package/Client.js +10 -4
- package/Client.js.map +1 -1
- package/ExtendedClient.d.ts +2 -1
- package/ExtendedClient.d.ts.map +1 -1
- package/ExtendedClient.js +6 -0
- package/ExtendedClient.js.map +1 -1
- package/api/resources/apiKeys/client/Client.d.ts +2 -0
- package/api/resources/apiKeys/client/Client.d.ts.map +1 -1
- package/api/resources/apiKeys/client/Client.js +45 -27
- package/api/resources/apiKeys/client/Client.js.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyHistoryRequest.d.ts +1 -3
- package/api/resources/apiKeys/client/requests/ApiKeyHistoryRequest.d.ts.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyHistoryRequest.js.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyLatestRequest.d.ts +1 -3
- package/api/resources/apiKeys/client/requests/ApiKeyLatestRequest.d.ts.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyLatestRequest.js.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyRevisionRequest.d.ts +1 -3
- package/api/resources/apiKeys/client/requests/ApiKeyRevisionRequest.d.ts.map +1 -1
- package/api/resources/apiKeys/client/requests/ApiKeyRevisionRequest.js.map +1 -1
- package/api/resources/credentials/client/Client.d.ts +23 -1
- package/api/resources/credentials/client/Client.d.ts.map +1 -1
- package/api/resources/credentials/client/Client.js +178 -41
- package/api/resources/credentials/client/Client.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialDownloadRequest.d.ts +5 -3
- package/api/resources/credentials/client/requests/CredentialDownloadRequest.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/CredentialDownloadRequest.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialHistoryRequest.d.ts +1 -3
- package/api/resources/credentials/client/requests/CredentialHistoryRequest.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/CredentialHistoryRequest.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialImportRequest.d.ts +2 -6
- package/api/resources/credentials/client/requests/CredentialImportRequest.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/CredentialImportRequest.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialLatestRequest.d.ts +1 -3
- package/api/resources/credentials/client/requests/CredentialLatestRequest.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/CredentialLatestRequest.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialRevisionRequest.d.ts +1 -3
- package/api/resources/credentials/client/requests/CredentialRevisionRequest.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/CredentialRevisionRequest.js.map +1 -1
- package/api/resources/credentials/client/requests/CredentialVerifyRequest.d.ts +10 -0
- package/api/resources/credentials/client/requests/CredentialVerifyRequest.d.ts.map +1 -0
- package/api/{types/DraftFieldDateTimeValue.js → resources/credentials/client/requests/CredentialVerifyRequest.js} +1 -1
- package/api/resources/credentials/client/requests/CredentialVerifyRequest.js.map +1 -0
- package/api/resources/credentials/client/requests/GetCredentialClaimValuesRequest.d.ts +10 -0
- package/api/resources/credentials/client/requests/GetCredentialClaimValuesRequest.d.ts.map +1 -0
- package/api/resources/credentials/client/requests/GetCredentialClaimValuesRequest.js +6 -0
- package/api/resources/credentials/client/requests/GetCredentialClaimValuesRequest.js.map +1 -0
- package/api/resources/credentials/client/requests/index.d.ts +2 -0
- package/api/resources/credentials/client/requests/index.d.ts.map +1 -1
- package/api/resources/credentials/client/requests/index.js.map +1 -1
- package/api/resources/desk/client/Client.d.ts +15 -7
- package/api/resources/desk/client/Client.d.ts.map +1 -1
- package/api/resources/desk/client/Client.js +58 -40
- package/api/resources/desk/client/Client.js.map +1 -1
- package/api/resources/desk/client/requests/DidCommMessageRecvRequest.d.ts +13 -0
- package/api/resources/desk/client/requests/DidCommMessageRecvRequest.d.ts.map +1 -0
- package/api/resources/desk/client/requests/DidCommMessageRecvRequest.js +6 -0
- package/api/resources/desk/client/requests/DidCommMessageRecvRequest.js.map +1 -0
- package/api/resources/desk/client/requests/PublishedJsonLdVocabFetchRequest.d.ts +10 -0
- package/api/resources/desk/client/requests/PublishedJsonLdVocabFetchRequest.d.ts.map +1 -0
- package/api/resources/desk/client/requests/PublishedJsonLdVocabFetchRequest.js +6 -0
- package/api/resources/desk/client/requests/PublishedJsonLdVocabFetchRequest.js.map +1 -0
- package/api/resources/desk/client/requests/PublishedJsonSchemaFetchRequest.d.ts +10 -0
- package/api/resources/desk/client/requests/PublishedJsonSchemaFetchRequest.d.ts.map +1 -0
- package/api/resources/desk/client/requests/PublishedJsonSchemaFetchRequest.js +6 -0
- package/api/resources/desk/client/requests/PublishedJsonSchemaFetchRequest.js.map +1 -0
- package/api/resources/desk/client/requests/PublishedMetaSchemaFetchRequest.d.ts +10 -0
- package/api/resources/desk/client/requests/PublishedMetaSchemaFetchRequest.d.ts.map +1 -0
- package/api/resources/desk/client/requests/PublishedMetaSchemaFetchRequest.js +6 -0
- package/api/resources/desk/client/requests/PublishedMetaSchemaFetchRequest.js.map +1 -0
- package/api/resources/desk/client/requests/PublishedVcdmJsonSchemaFetchRequest.d.ts +10 -0
- package/api/resources/desk/client/requests/PublishedVcdmJsonSchemaFetchRequest.d.ts.map +1 -0
- package/api/resources/desk/client/requests/PublishedVcdmJsonSchemaFetchRequest.js +6 -0
- package/api/resources/desk/client/requests/PublishedVcdmJsonSchemaFetchRequest.js.map +1 -0
- package/api/resources/desk/client/requests/index.d.ts +5 -0
- package/api/resources/desk/client/requests/index.d.ts.map +1 -1
- package/api/resources/desk/client/requests/index.js.map +1 -1
- package/api/resources/didcommMessages/client/Client.d.ts +2 -0
- package/api/resources/didcommMessages/client/Client.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/Client.js +45 -27
- package/api/resources/didcommMessages/client/Client.js.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageHistoryRequest.d.ts +1 -3
- package/api/resources/didcommMessages/client/requests/DidcommMessageHistoryRequest.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageHistoryRequest.js.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageLatestRequest.d.ts +1 -3
- package/api/resources/didcommMessages/client/requests/DidcommMessageLatestRequest.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageLatestRequest.js.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageRevisionRequest.d.ts +1 -3
- package/api/resources/didcommMessages/client/requests/DidcommMessageRevisionRequest.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/requests/DidcommMessageRevisionRequest.js.map +1 -1
- package/api/resources/dids/client/Client.d.ts +2 -0
- package/api/resources/dids/client/Client.d.ts.map +1 -1
- package/api/resources/dids/client/Client.js +5 -3
- package/api/resources/dids/client/Client.js.map +1 -1
- package/api/resources/drafts/client/Client.d.ts +9 -7
- package/api/resources/drafts/client/Client.d.ts.map +1 -1
- package/api/resources/drafts/client/Client.js +67 -43
- package/api/resources/drafts/client/Client.js.map +1 -1
- package/api/resources/drafts/client/requests/DraftCreateRequest.d.ts +7 -7
- package/api/resources/drafts/client/requests/DraftCreateRequest.js.map +1 -1
- package/api/resources/drafts/client/requests/DraftExportRequest.d.ts +8 -0
- package/api/resources/drafts/client/requests/DraftExportRequest.d.ts.map +1 -1
- package/api/resources/drafts/client/requests/DraftExportRequest.js.map +1 -1
- package/api/resources/drafts/client/requests/DraftHistoryRequest.d.ts +1 -3
- package/api/resources/drafts/client/requests/DraftHistoryRequest.d.ts.map +1 -1
- package/api/resources/drafts/client/requests/DraftHistoryRequest.js.map +1 -1
- package/api/resources/drafts/client/requests/DraftLatestRequest.d.ts +1 -3
- package/api/resources/drafts/client/requests/DraftLatestRequest.d.ts.map +1 -1
- package/api/resources/drafts/client/requests/DraftLatestRequest.js.map +1 -1
- package/api/resources/drafts/client/requests/DraftRevisionRequest.d.ts +1 -3
- package/api/resources/drafts/client/requests/DraftRevisionRequest.d.ts.map +1 -1
- package/api/resources/drafts/client/requests/DraftRevisionRequest.js.map +1 -1
- package/api/resources/files/client/Client.d.ts +2 -0
- package/api/resources/files/client/Client.d.ts.map +1 -1
- package/api/resources/files/client/Client.js +55 -34
- package/api/resources/files/client/Client.js.map +1 -1
- package/api/resources/files/client/requests/FileCreateRequest.d.ts +1 -3
- package/api/resources/files/client/requests/FileCreateRequest.d.ts.map +1 -1
- package/api/resources/files/client/requests/FileCreateRequest.js.map +1 -1
- package/api/resources/files/client/requests/FileDownloadRequest.d.ts +5 -3
- package/api/resources/files/client/requests/FileDownloadRequest.d.ts.map +1 -1
- package/api/resources/files/client/requests/FileDownloadRequest.js.map +1 -1
- package/api/resources/files/client/requests/FileHistoryRequest.d.ts +1 -3
- package/api/resources/files/client/requests/FileHistoryRequest.d.ts.map +1 -1
- package/api/resources/files/client/requests/FileHistoryRequest.js.map +1 -1
- package/api/resources/files/client/requests/FileLatestRequest.d.ts +1 -3
- package/api/resources/files/client/requests/FileLatestRequest.d.ts.map +1 -1
- package/api/resources/files/client/requests/FileLatestRequest.js.map +1 -1
- package/api/resources/files/client/requests/FileRevisionRequest.d.ts +1 -3
- package/api/resources/files/client/requests/FileRevisionRequest.d.ts.map +1 -1
- package/api/resources/files/client/requests/FileRevisionRequest.js.map +1 -1
- package/api/resources/gdpr/client/Client.d.ts +2 -0
- package/api/resources/gdpr/client/Client.d.ts.map +1 -1
- package/api/resources/gdpr/client/Client.js +5 -3
- package/api/resources/gdpr/client/Client.js.map +1 -1
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.d.ts.map +1 -1
- package/api/resources/index.js +3 -1
- package/api/resources/index.js.map +1 -1
- package/api/resources/keys/client/Client.d.ts +2 -0
- package/api/resources/keys/client/Client.d.ts.map +1 -1
- package/api/resources/keys/client/Client.js +65 -42
- package/api/resources/keys/client/Client.js.map +1 -1
- package/api/resources/keys/client/requests/CredentialSignRequest.d.ts +8 -6
- package/api/resources/keys/client/requests/CredentialSignRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/CredentialSignRequest.js.map +1 -1
- package/api/resources/keys/client/requests/DidCommMessageSignRequest.d.ts +8 -6
- package/api/resources/keys/client/requests/DidCommMessageSignRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/DidCommMessageSignRequest.js.map +1 -1
- package/api/resources/keys/client/requests/KeyHistoryRequest.d.ts +1 -3
- package/api/resources/keys/client/requests/KeyHistoryRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/KeyHistoryRequest.js.map +1 -1
- package/api/resources/keys/client/requests/KeyLatestRequest.d.ts +1 -3
- package/api/resources/keys/client/requests/KeyLatestRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/KeyLatestRequest.js.map +1 -1
- package/api/resources/keys/client/requests/KeyRevisionRequest.d.ts +1 -3
- package/api/resources/keys/client/requests/KeyRevisionRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/KeyRevisionRequest.js.map +1 -1
- package/api/resources/keys/client/requests/PresentationSignRequest.d.ts +8 -6
- package/api/resources/keys/client/requests/PresentationSignRequest.d.ts.map +1 -1
- package/api/resources/keys/client/requests/PresentationSignRequest.js.map +1 -1
- package/api/resources/presentations/client/Client.d.ts +5 -1
- package/api/resources/presentations/client/Client.d.ts.map +1 -1
- package/api/resources/presentations/client/Client.js +80 -51
- package/api/resources/presentations/client/Client.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationDownloadRequest.d.ts +5 -3
- package/api/resources/presentations/client/requests/PresentationDownloadRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationDownloadRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationExportRequest.d.ts +10 -0
- package/api/resources/presentations/client/requests/PresentationExportRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationExportRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationHistoryRequest.d.ts +1 -3
- package/api/resources/presentations/client/requests/PresentationHistoryRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationHistoryRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationImportRequest.d.ts +1 -3
- package/api/resources/presentations/client/requests/PresentationImportRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationImportRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationIssueRequest.d.ts +2 -0
- package/api/resources/presentations/client/requests/PresentationIssueRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationIssueRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationLatestRequest.d.ts +1 -3
- package/api/resources/presentations/client/requests/PresentationLatestRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationLatestRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationRevisionRequest.d.ts +1 -3
- package/api/resources/presentations/client/requests/PresentationRevisionRequest.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/PresentationRevisionRequest.js.map +1 -1
- package/api/resources/presentations/client/requests/PresentationVerifyRequest.d.ts +10 -0
- package/api/resources/presentations/client/requests/PresentationVerifyRequest.d.ts.map +1 -0
- package/api/resources/presentations/client/requests/PresentationVerifyRequest.js +6 -0
- package/api/resources/presentations/client/requests/PresentationVerifyRequest.js.map +1 -0
- package/api/resources/presentations/client/requests/index.d.ts +1 -0
- package/api/resources/presentations/client/requests/index.d.ts.map +1 -1
- package/api/resources/presentations/client/requests/index.js.map +1 -1
- package/api/resources/presentations/types/PresentationExportRequestCompositionType.d.ts +8 -0
- package/api/resources/presentations/types/PresentationExportRequestCompositionType.d.ts.map +1 -0
- package/api/resources/presentations/types/PresentationExportRequestCompositionType.js +10 -0
- package/api/resources/presentations/types/PresentationExportRequestCompositionType.js.map +1 -0
- package/api/resources/presentations/types/PresentationIssueRequestCompositionType.d.ts +8 -0
- package/api/resources/presentations/types/PresentationIssueRequestCompositionType.d.ts.map +1 -0
- package/api/resources/presentations/types/PresentationIssueRequestCompositionType.js +10 -0
- package/api/resources/presentations/types/PresentationIssueRequestCompositionType.js.map +1 -0
- package/api/resources/presentations/types/index.d.ts +2 -0
- package/api/resources/presentations/types/index.d.ts.map +1 -1
- package/api/resources/presentations/types/index.js +2 -0
- package/api/resources/presentations/types/index.js.map +1 -1
- package/api/resources/publishedSchemas/client/Client.d.ts +201 -0
- package/api/resources/publishedSchemas/client/Client.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/Client.js +986 -0
- package/api/resources/publishedSchemas/client/Client.js.map +1 -0
- package/api/resources/publishedSchemas/client/index.d.ts +3 -0
- package/api/resources/publishedSchemas/client/index.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/index.js +18 -0
- package/api/resources/publishedSchemas/client/index.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaDeleteRequest.d.ts +47 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaDeleteRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaDeleteRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaDeleteRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaLatestRequest.d.ts +12 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaLatestRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaLatestRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaLatestRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRestoreRequest.d.ts +47 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRestoreRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRestoreRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRestoreRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRevisionRequest.d.ts +12 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRevisionRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRevisionRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaRevisionRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.d.ts +15 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.d.ts +52 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.d.ts +52 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.js +6 -0
- package/api/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.js.map +1 -0
- package/api/resources/publishedSchemas/client/requests/index.d.ts +8 -0
- package/api/resources/publishedSchemas/client/requests/index.d.ts.map +1 -0
- package/api/resources/publishedSchemas/client/requests/index.js +3 -0
- package/api/resources/publishedSchemas/client/requests/index.js.map +1 -0
- package/api/resources/publishedSchemas/index.d.ts +2 -0
- package/api/resources/publishedSchemas/index.d.ts.map +1 -0
- package/api/resources/publishedSchemas/index.js +18 -0
- package/api/resources/publishedSchemas/index.js.map +1 -0
- package/api/resources/schemas/client/Client.d.ts +42 -11
- package/api/resources/schemas/client/Client.d.ts.map +1 -1
- package/api/resources/schemas/client/Client.js +212 -47
- package/api/resources/schemas/client/Client.js.map +1 -1
- package/api/resources/schemas/client/requests/SchemaHistoryRequest.d.ts +1 -3
- package/api/resources/schemas/client/requests/SchemaHistoryRequest.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/SchemaHistoryRequest.js.map +1 -1
- package/api/resources/schemas/client/requests/SchemaImportRequest.d.ts +25 -0
- package/api/resources/schemas/client/requests/SchemaImportRequest.d.ts.map +1 -0
- package/api/{types/DraftFieldFileValue.js → resources/schemas/client/requests/SchemaImportRequest.js} +1 -1
- package/api/resources/schemas/client/requests/SchemaImportRequest.js.map +1 -0
- package/api/resources/schemas/client/requests/SchemaLatestRequest.d.ts +1 -3
- package/api/resources/schemas/client/requests/SchemaLatestRequest.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/SchemaLatestRequest.js.map +1 -1
- package/api/resources/schemas/client/requests/SchemaPublishRequest.d.ts +2 -4
- package/api/resources/schemas/client/requests/SchemaPublishRequest.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/SchemaPublishRequest.js.map +1 -1
- package/api/resources/schemas/client/requests/SchemaRevisionRequest.d.ts +1 -3
- package/api/resources/schemas/client/requests/SchemaRevisionRequest.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/SchemaRevisionRequest.js.map +1 -1
- package/api/resources/schemas/client/requests/SchemaUpdateRequest.d.ts +1 -6
- package/api/resources/schemas/client/requests/SchemaUpdateRequest.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/SchemaUpdateRequest.js.map +1 -1
- package/api/resources/schemas/client/requests/index.d.ts +1 -0
- package/api/resources/schemas/client/requests/index.d.ts.map +1 -1
- package/api/resources/schemas/client/requests/index.js.map +1 -1
- package/api/types/ArrayClaimValue.d.ts +12 -0
- package/api/types/ArrayClaimValue.d.ts.map +1 -0
- package/api/types/{DraftFieldDateValue.js → ArrayClaimValue.js} +1 -1
- package/api/types/ArrayClaimValue.js.map +1 -0
- package/api/types/BooleanClaimValue.d.ts +11 -0
- package/api/types/BooleanClaimValue.d.ts.map +1 -0
- package/api/types/{DraftFieldLinkValue.js → BooleanClaimValue.js} +1 -1
- package/api/types/BooleanClaimValue.js.map +1 -0
- package/api/types/ClaimsSchema.d.ts +6 -2
- package/api/types/ClaimsSchema.d.ts.map +1 -1
- package/api/types/ClaimsSchema.js.map +1 -1
- package/api/types/ClaimsSchemaFieldLinkValue.d.ts +2 -1
- package/api/types/ClaimsSchemaFieldLinkValue.d.ts.map +1 -1
- package/api/types/ClaimsSchemaFieldLinkValue.js.map +1 -1
- package/api/types/ClaimsSchemaFieldLinkValueLinkType.d.ts +11 -0
- package/api/types/ClaimsSchemaFieldLinkValueLinkType.d.ts.map +1 -0
- package/api/types/ClaimsSchemaFieldLinkValueLinkType.js +10 -0
- package/api/types/ClaimsSchemaFieldLinkValueLinkType.js.map +1 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValue.d.ts +27 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValue.d.ts.map +1 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValue.js +6 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValue.js.map +1 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.d.ts +35 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.d.ts.map +1 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.js +6 -0
- package/api/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.js.map +1 -0
- package/api/types/ClaimsSchemaFieldStructValue.d.ts +7 -1
- package/api/types/ClaimsSchemaFieldStructValue.d.ts.map +1 -1
- package/api/types/ClaimsSchemaFieldStructValue.js.map +1 -1
- package/api/types/ClaimsSchemaOptional.d.ts +20 -0
- package/api/types/ClaimsSchemaOptional.d.ts.map +1 -0
- package/api/types/ClaimsSchemaOptional.js +6 -0
- package/api/types/ClaimsSchemaOptional.js.map +1 -0
- package/api/types/ClaimsSchemaOptionalFieldsItem.d.ts +35 -0
- package/api/types/ClaimsSchemaOptionalFieldsItem.d.ts.map +1 -0
- package/api/types/ClaimsSchemaOptionalFieldsItem.js +6 -0
- package/api/types/ClaimsSchemaOptionalFieldsItem.js.map +1 -0
- package/api/types/CredentialClaimLinkedCredentialValue.d.ts +13 -0
- package/api/types/CredentialClaimLinkedCredentialValue.d.ts.map +1 -0
- package/api/types/CredentialClaimLinkedCredentialValue.js +6 -0
- package/api/types/CredentialClaimLinkedCredentialValue.js.map +1 -0
- package/api/types/CredentialClaimLinkedFileValue.d.ts +13 -0
- package/api/types/CredentialClaimLinkedFileValue.d.ts.map +1 -0
- package/api/types/CredentialClaimLinkedFileValue.js +6 -0
- package/api/types/CredentialClaimLinkedFileValue.js.map +1 -0
- package/api/types/CredentialClaimValue.d.ts +38 -0
- package/api/types/CredentialClaimValue.d.ts.map +1 -0
- package/api/types/CredentialClaimValue.js +6 -0
- package/api/types/CredentialClaimValue.js.map +1 -0
- package/api/types/CredentialClaimValues.d.ts +9 -0
- package/api/types/CredentialClaimValues.d.ts.map +1 -0
- package/api/types/CredentialClaimValues.js +6 -0
- package/api/types/CredentialClaimValues.js.map +1 -0
- package/api/types/CredentialSchema.d.ts +7 -2
- package/api/types/CredentialSchema.d.ts.map +1 -1
- package/api/types/CredentialSchema.js.map +1 -1
- package/api/types/CredentialSchemaCreate.d.ts +1 -1
- package/api/types/CredentialSchemaCreate.d.ts.map +1 -1
- package/api/types/CredentialSchemaCreate.js.map +1 -1
- package/api/types/CredentialSchemaUpdate.d.ts +1 -1
- package/api/types/CredentialSchemaUpdate.d.ts.map +1 -1
- package/api/types/CredentialSchemaUpdate.js.map +1 -1
- package/api/types/DateClaimValue.d.ts +11 -0
- package/api/types/DateClaimValue.d.ts.map +1 -0
- package/api/types/{DraftEnumValue.js → DateClaimValue.js} +1 -1
- package/api/types/DateClaimValue.js.map +1 -0
- package/api/types/DateTimeClaimValue.d.ts +11 -0
- package/api/types/DateTimeClaimValue.d.ts.map +1 -0
- package/api/types/DateTimeClaimValue.js +6 -0
- package/api/types/DateTimeClaimValue.js.map +1 -0
- package/api/types/Draft.d.ts +8 -4
- package/api/types/Draft.d.ts.map +1 -1
- package/api/types/Draft.js.map +1 -1
- package/api/types/DraftCreate.d.ts +7 -3
- package/api/types/DraftCreate.d.ts.map +1 -1
- package/api/types/DraftCreate.js.map +1 -1
- package/api/types/DraftCreateMetaSchema.d.ts +12 -0
- package/api/types/DraftCreateMetaSchema.d.ts.map +1 -0
- package/api/types/DraftCreateMetaSchema.js +6 -0
- package/api/types/DraftCreateMetaSchema.js.map +1 -0
- package/api/types/DraftUpdate.d.ts +2 -2
- package/api/types/DraftUpdate.d.ts.map +1 -1
- package/api/types/DraftUpdate.js.map +1 -1
- package/api/types/ErrorDetail.d.ts +1 -0
- package/api/types/ErrorDetail.d.ts.map +1 -1
- package/api/types/ErrorDetail.js.map +1 -1
- package/api/types/FileClaimValue.d.ts +12 -0
- package/api/types/FileClaimValue.d.ts.map +1 -0
- package/api/types/FileClaimValue.js +6 -0
- package/api/types/FileClaimValue.js.map +1 -0
- package/api/types/LinkClaimValue.d.ts +12 -0
- package/api/types/LinkClaimValue.d.ts.map +1 -0
- package/api/types/LinkClaimValue.js +6 -0
- package/api/types/LinkClaimValue.js.map +1 -0
- package/api/types/ListPublishedCredentialSchema.d.ts +12 -0
- package/api/types/ListPublishedCredentialSchema.d.ts.map +1 -0
- package/api/types/ListPublishedCredentialSchema.js +6 -0
- package/api/types/ListPublishedCredentialSchema.js.map +1 -0
- package/api/types/MetaSchema.d.ts +16 -0
- package/api/types/MetaSchema.d.ts.map +1 -0
- package/api/types/{DraftSchema.js → MetaSchema.js} +1 -1
- package/api/types/MetaSchema.js.map +1 -0
- package/api/types/NumberClaimValue.d.ts +11 -0
- package/api/types/NumberClaimValue.d.ts.map +1 -0
- package/api/types/NumberClaimValue.js +6 -0
- package/api/types/NumberClaimValue.js.map +1 -0
- package/api/types/ProblemInternalServerError.d.ts +1 -1
- package/api/types/ProblemInternalServerError.d.ts.map +1 -1
- package/api/types/ProblemInternalServerError.js.map +1 -1
- package/api/types/ProblemInternalServerErrorType.d.ts +11 -0
- package/api/types/ProblemInternalServerErrorType.d.ts.map +1 -0
- package/api/types/ProblemInternalServerErrorType.js +10 -0
- package/api/types/ProblemInternalServerErrorType.js.map +1 -0
- package/api/types/PublishedCredentialSchema.d.ts +12 -0
- package/api/types/PublishedCredentialSchema.d.ts.map +1 -1
- package/api/types/PublishedCredentialSchema.js.map +1 -1
- package/api/types/PublishedSchemaBaseFilter.d.ts +27 -0
- package/api/types/PublishedSchemaBaseFilter.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilter.js +6 -0
- package/api/types/PublishedSchemaBaseFilter.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterAnnotationsItem.d.ts +20 -0
- package/api/types/PublishedSchemaBaseFilterAnnotationsItem.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterAnnotationsItem.js +6 -0
- package/api/types/PublishedSchemaBaseFilterAnnotationsItem.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterCreatedAt.d.ts +26 -0
- package/api/types/PublishedSchemaBaseFilterCreatedAt.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterCreatedAt.js +6 -0
- package/api/types/PublishedSchemaBaseFilterCreatedAt.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterDeletedAt.d.ts +32 -0
- package/api/types/PublishedSchemaBaseFilterDeletedAt.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterDeletedAt.js +6 -0
- package/api/types/PublishedSchemaBaseFilterDeletedAt.js.map +1 -0
- package/api/types/{SchemaFilterPublicationEtag.d.ts → PublishedSchemaBaseFilterEtag.d.ts} +6 -3
- package/api/types/PublishedSchemaBaseFilterEtag.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterEtag.js +6 -0
- package/api/types/PublishedSchemaBaseFilterEtag.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterId.d.ts +23 -0
- package/api/types/PublishedSchemaBaseFilterId.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterId.js +6 -0
- package/api/types/PublishedSchemaBaseFilterId.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterLabelsItem.d.ts +20 -0
- package/api/types/PublishedSchemaBaseFilterLabelsItem.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterLabelsItem.js +6 -0
- package/api/types/PublishedSchemaBaseFilterLabelsItem.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterModifiedAt.d.ts +26 -0
- package/api/types/PublishedSchemaBaseFilterModifiedAt.d.ts.map +1 -0
- package/api/types/PublishedSchemaBaseFilterModifiedAt.js +6 -0
- package/api/types/PublishedSchemaBaseFilterModifiedAt.js.map +1 -0
- package/api/types/PublishedSchemaBaseFilterRevision.d.ts +38 -0
- package/api/types/PublishedSchemaBaseFilterRevision.d.ts.map +1 -0
- package/api/types/{CredentialSchemaPublicationOutput.js → PublishedSchemaBaseFilterRevision.js} +1 -1
- package/api/types/PublishedSchemaBaseFilterRevision.js.map +1 -0
- package/api/types/PublishedSchemaFilter.d.ts +9 -0
- package/api/types/PublishedSchemaFilter.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilter.js +6 -0
- package/api/types/PublishedSchemaFilter.js.map +1 -0
- package/api/types/PublishedSchemaFilterData.d.ts +14 -0
- package/api/types/PublishedSchemaFilterData.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilterData.js +6 -0
- package/api/types/PublishedSchemaFilterData.js.map +1 -0
- package/api/types/PublishedSchemaFilterDataDigestMultibase.d.ts +20 -0
- package/api/types/PublishedSchemaFilterDataDigestMultibase.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilterDataDigestMultibase.js +6 -0
- package/api/types/PublishedSchemaFilterDataDigestMultibase.js.map +1 -0
- package/api/types/{SchemaFilterPublicationPublishedAt.d.ts → PublishedSchemaFilterDataPublishedAt.d.ts} +3 -3
- package/api/types/PublishedSchemaFilterDataPublishedAt.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilterDataPublishedAt.js +6 -0
- package/api/types/PublishedSchemaFilterDataPublishedAt.js.map +1 -0
- package/api/types/{SchemaFilterPublicationSlug.d.ts → PublishedSchemaFilterDataSlug.d.ts} +3 -3
- package/api/types/PublishedSchemaFilterDataSlug.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilterDataSlug.js +6 -0
- package/api/types/PublishedSchemaFilterDataSlug.js.map +1 -0
- package/api/types/{SchemaFilterPublicationVersion.d.ts → PublishedSchemaFilterDataVersion.d.ts} +3 -3
- package/api/types/PublishedSchemaFilterDataVersion.d.ts.map +1 -0
- package/api/types/PublishedSchemaFilterDataVersion.js +6 -0
- package/api/types/PublishedSchemaFilterDataVersion.js.map +1 -0
- package/api/types/PublishedSchemaSort.d.ts +14 -0
- package/api/types/PublishedSchemaSort.d.ts.map +1 -0
- package/api/types/PublishedSchemaSort.js +6 -0
- package/api/types/PublishedSchemaSort.js.map +1 -0
- package/api/types/PublishedSchemaSortField.d.ts +20 -0
- package/api/types/PublishedSchemaSortField.d.ts.map +1 -0
- package/api/types/PublishedSchemaSortField.js +19 -0
- package/api/types/PublishedSchemaSortField.js.map +1 -0
- package/api/types/PublishedSchemaSortOrder.d.ts +12 -0
- package/api/types/PublishedSchemaSortOrder.d.ts.map +1 -0
- package/api/types/PublishedSchemaSortOrder.js +11 -0
- package/api/types/PublishedSchemaSortOrder.js.map +1 -0
- package/api/types/ResourcePublishedCredentialSchema.d.ts +30 -0
- package/api/types/ResourcePublishedCredentialSchema.d.ts.map +1 -0
- package/api/types/ResourcePublishedCredentialSchema.js +6 -0
- package/api/types/ResourcePublishedCredentialSchema.js.map +1 -0
- package/api/types/SchemaFilterData.d.ts +1 -1
- package/api/types/SchemaFilterData.d.ts.map +1 -1
- package/api/types/SchemaFilterData.js.map +1 -1
- package/api/types/SchemaFilterDataDigestMultibase.d.ts +20 -0
- package/api/types/SchemaFilterDataDigestMultibase.d.ts.map +1 -0
- package/api/types/SchemaFilterDataDigestMultibase.js +6 -0
- package/api/types/SchemaFilterDataDigestMultibase.js.map +1 -0
- package/api/types/SchemaImportDataRequest.d.ts +15 -0
- package/api/types/SchemaImportDataRequest.d.ts.map +1 -0
- package/api/types/{DraftFieldBooleanValue.js → SchemaImportDataRequest.js} +1 -1
- package/api/types/SchemaImportDataRequest.js.map +1 -0
- package/api/types/SchemaSortField.d.ts +2 -6
- package/api/types/SchemaSortField.d.ts.map +1 -1
- package/api/types/SchemaSortField.js +1 -5
- package/api/types/SchemaSortField.js.map +1 -1
- package/api/types/StringClaimValue.d.ts +11 -0
- package/api/types/StringClaimValue.d.ts.map +1 -0
- package/api/types/StringClaimValue.js +6 -0
- package/api/types/StringClaimValue.js.map +1 -0
- package/api/types/StructClaimValue.d.ts +12 -0
- package/api/types/StructClaimValue.d.ts.map +1 -0
- package/api/types/StructClaimValue.js +6 -0
- package/api/types/StructClaimValue.js.map +1 -0
- package/api/types/index.d.ts +43 -19
- package/api/types/index.d.ts.map +1 -1
- package/api/types/index.js +43 -19
- package/api/types/index.js.map +1 -1
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts.map +1 -1
- package/core/fetcher/Fetcher.js.map +1 -1
- package/core/fetcher/index.d.ts +1 -1
- package/core/fetcher/index.d.ts.map +1 -1
- package/core/fetcher/index.js.map +1 -1
- package/core/schemas/utils/maybeSkipValidation.js +1 -1
- package/core/schemas/utils/maybeSkipValidation.js.map +1 -1
- package/core/url/join.d.ts.map +1 -1
- package/core/url/join.js +23 -3
- package/core/url/join.js.map +1 -1
- package/documents/credential/claims.d.ts +11 -7
- package/documents/credential/claims.d.ts.map +1 -1
- package/documents/credential/claims.js +187 -38
- package/documents/credential/claims.js.map +1 -1
- package/documents/credential/claims.spec.js +484 -165
- package/documents/credential/claims.spec.js.map +1 -1
- package/documents/credential/testdata/udt.d.ts +50 -0
- package/documents/credential/testdata/udt.d.ts.map +1 -1
- package/documents/credential/testdata/udt.js +226 -6
- package/documents/credential/testdata/udt.js.map +1 -1
- package/documents/credential/types.d.ts +3 -3
- package/documents/credential/types.d.ts.map +1 -1
- package/documents/credential/types.js.map +1 -1
- package/documents/credential.d.ts +11 -5
- package/documents/credential.d.ts.map +1 -1
- package/documents/credential.js +151 -32
- package/documents/credential.js.map +1 -1
- package/documents/decorators.d.ts +40 -7
- package/documents/decorators.d.ts.map +1 -1
- package/documents/decorators.js +105 -20
- package/documents/decorators.js.map +1 -1
- package/documents/models.d.ts +5 -5
- package/documents/models.d.ts.map +1 -1
- package/documents/models.js +20 -16
- package/documents/models.js.map +1 -1
- package/documents/models.spec.js +1 -5
- package/documents/models.spec.js.map +1 -1
- package/documents/presentation.d.ts.map +1 -1
- package/documents/presentation.js +1 -0
- package/documents/presentation.js.map +1 -1
- package/documents/types.d.ts +8 -2
- package/documents/types.d.ts.map +1 -1
- package/documents/types.js +8 -1
- package/documents/types.js.map +1 -1
- package/documents/utils/error.d.ts +2 -0
- package/documents/utils/error.d.ts.map +1 -1
- package/documents/utils/error.js +2 -0
- package/documents/utils/error.js.map +1 -1
- package/documents/utils/error.spec.js +1 -1
- package/documents/utils/error.spec.js.map +1 -1
- package/package.json +7 -3
- package/reference.md +1499 -166
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.d.ts.map +1 -1
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/index.js.map +1 -1
- package/serialization/resources/presentations/client/requests/PresentationExportRequest.d.ts +2 -0
- package/serialization/resources/presentations/client/requests/PresentationExportRequest.d.ts.map +1 -1
- package/serialization/resources/presentations/client/requests/PresentationExportRequest.js +2 -0
- package/serialization/resources/presentations/client/requests/PresentationExportRequest.js.map +1 -1
- package/serialization/resources/presentations/client/requests/PresentationIssueRequest.d.ts +2 -0
- package/serialization/resources/presentations/client/requests/PresentationIssueRequest.d.ts.map +1 -1
- package/serialization/resources/presentations/client/requests/PresentationIssueRequest.js +2 -0
- package/serialization/resources/presentations/client/requests/PresentationIssueRequest.js.map +1 -1
- package/serialization/resources/presentations/types/PresentationExportRequestCompositionType.d.ts +11 -0
- package/serialization/resources/presentations/types/PresentationExportRequestCompositionType.d.ts.map +1 -0
- package/serialization/resources/presentations/types/PresentationExportRequestCompositionType.js +42 -0
- package/serialization/resources/presentations/types/PresentationExportRequestCompositionType.js.map +1 -0
- package/serialization/resources/presentations/types/PresentationIssueRequestCompositionType.d.ts +11 -0
- package/serialization/resources/presentations/types/PresentationIssueRequestCompositionType.d.ts.map +1 -0
- package/serialization/resources/presentations/types/PresentationIssueRequestCompositionType.js +42 -0
- package/serialization/resources/presentations/types/PresentationIssueRequestCompositionType.js.map +1 -0
- package/serialization/resources/presentations/types/index.d.ts +2 -0
- package/serialization/resources/presentations/types/index.d.ts.map +1 -1
- package/serialization/resources/presentations/types/index.js +2 -0
- package/serialization/resources/presentations/types/index.js.map +1 -1
- package/serialization/resources/publishedSchemas/client/index.d.ts +2 -0
- package/serialization/resources/publishedSchemas/client/index.d.ts.map +1 -0
- package/serialization/resources/publishedSchemas/client/index.js +18 -0
- package/serialization/resources/publishedSchemas/client/index.js.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.d.ts +16 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.d.ts.map +1 -0
- package/serialization/{types/DraftFieldDateTimeValue.js → resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.js} +8 -9
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaSearchRequest.js.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.d.ts +13 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.d.ts.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.js +44 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateAnnotationsRequest.js.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.d.ts +13 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.d.ts.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.js +44 -0
- package/serialization/resources/publishedSchemas/client/requests/PublishedSchemaUpdateLabelsRequest.js.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/index.d.ts +4 -0
- package/serialization/resources/publishedSchemas/client/requests/index.d.ts.map +1 -0
- package/serialization/resources/publishedSchemas/client/requests/index.js +10 -0
- package/serialization/resources/publishedSchemas/client/requests/index.js.map +1 -0
- package/serialization/resources/publishedSchemas/index.d.ts +2 -0
- package/serialization/resources/publishedSchemas/index.d.ts.map +1 -0
- package/serialization/resources/publishedSchemas/index.js +18 -0
- package/serialization/resources/publishedSchemas/index.js.map +1 -0
- package/serialization/resources/schemas/client/requests/SchemaImportRequest.d.ts +16 -0
- package/serialization/resources/schemas/client/requests/SchemaImportRequest.d.ts.map +1 -0
- package/serialization/{types/DraftFieldBooleanValue.js → resources/schemas/client/requests/SchemaImportRequest.js} +8 -9
- package/serialization/resources/schemas/client/requests/SchemaImportRequest.js.map +1 -0
- package/serialization/resources/schemas/client/requests/SchemaPublishRequest.d.ts +1 -1
- package/serialization/resources/schemas/client/requests/SchemaPublishRequest.d.ts.map +1 -1
- package/serialization/resources/schemas/client/requests/SchemaPublishRequest.js +1 -1
- package/serialization/resources/schemas/client/requests/SchemaPublishRequest.js.map +1 -1
- package/serialization/resources/schemas/client/requests/index.d.ts +1 -0
- package/serialization/resources/schemas/client/requests/index.d.ts.map +1 -1
- package/serialization/resources/schemas/client/requests/index.js +3 -1
- package/serialization/resources/schemas/client/requests/index.js.map +1 -1
- package/serialization/types/ArrayClaimValue.d.ts +13 -0
- package/serialization/types/ArrayClaimValue.d.ts.map +1 -0
- package/serialization/types/{DraftFieldFileValue.js → ArrayClaimValue.js} +5 -7
- package/serialization/types/ArrayClaimValue.js.map +1 -0
- package/serialization/types/BooleanClaimValue.d.ts +13 -0
- package/serialization/types/BooleanClaimValue.d.ts.map +1 -0
- package/serialization/types/{CredentialSchemaPublicationOutput.js → BooleanClaimValue.js} +4 -8
- package/serialization/types/BooleanClaimValue.js.map +1 -0
- package/serialization/types/ClaimsSchema.d.ts +2 -0
- package/serialization/types/ClaimsSchema.d.ts.map +1 -1
- package/serialization/types/ClaimsSchema.js +2 -0
- package/serialization/types/ClaimsSchema.js.map +1 -1
- package/serialization/types/ClaimsSchemaFieldLinkValue.d.ts +2 -1
- package/serialization/types/ClaimsSchemaFieldLinkValue.d.ts.map +1 -1
- package/serialization/types/ClaimsSchemaFieldLinkValue.js +2 -1
- package/serialization/types/ClaimsSchemaFieldLinkValue.js.map +1 -1
- package/serialization/types/ClaimsSchemaFieldLinkValueLinkType.d.ts +11 -0
- package/serialization/types/ClaimsSchemaFieldLinkValueLinkType.d.ts.map +1 -0
- package/serialization/types/ClaimsSchemaFieldLinkValueLinkType.js +42 -0
- package/serialization/types/ClaimsSchemaFieldLinkValueLinkType.js.map +1 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValue.d.ts +21 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValue.d.ts.map +1 -0
- package/serialization/types/{DraftFieldStructValue.js → ClaimsSchemaFieldStructOptionalValue.js} +10 -6
- package/serialization/types/ClaimsSchemaFieldStructOptionalValue.js.map +1 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.d.ts +42 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.d.ts.map +1 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.js +64 -0
- package/serialization/types/ClaimsSchemaFieldStructOptionalValueFieldsItem.js.map +1 -0
- package/serialization/types/ClaimsSchemaFieldStructValue.d.ts +3 -0
- package/serialization/types/ClaimsSchemaFieldStructValue.d.ts.map +1 -1
- package/serialization/types/ClaimsSchemaFieldStructValue.js +3 -0
- package/serialization/types/ClaimsSchemaFieldStructValue.js.map +1 -1
- package/serialization/types/ClaimsSchemaOptional.d.ts +18 -0
- package/serialization/types/ClaimsSchemaOptional.d.ts.map +1 -0
- package/serialization/types/ClaimsSchemaOptional.js +49 -0
- package/serialization/types/ClaimsSchemaOptional.js.map +1 -0
- package/serialization/types/ClaimsSchemaOptionalFieldsItem.d.ts +42 -0
- package/serialization/types/ClaimsSchemaOptionalFieldsItem.d.ts.map +1 -0
- package/serialization/types/{DraftFieldStructValueFieldsItem.js → ClaimsSchemaOptionalFieldsItem.js} +18 -18
- package/serialization/types/ClaimsSchemaOptionalFieldsItem.js.map +1 -0
- package/serialization/types/CredentialClaimLinkedCredentialValue.d.ts +14 -0
- package/serialization/types/CredentialClaimLinkedCredentialValue.d.ts.map +1 -0
- package/serialization/types/{DraftFieldDateValue.js → CredentialClaimLinkedCredentialValue.js} +5 -8
- package/serialization/types/CredentialClaimLinkedCredentialValue.js.map +1 -0
- package/serialization/types/CredentialClaimLinkedFileValue.d.ts +14 -0
- package/serialization/types/CredentialClaimLinkedFileValue.d.ts.map +1 -0
- package/serialization/types/CredentialClaimLinkedFileValue.js +45 -0
- package/serialization/types/CredentialClaimLinkedFileValue.js.map +1 -0
- package/serialization/types/CredentialClaimValue.d.ts +45 -0
- package/serialization/types/CredentialClaimValue.d.ts.map +1 -0
- package/serialization/types/{DraftSchemaFieldsItem.js → CredentialClaimValue.js} +19 -18
- package/serialization/types/CredentialClaimValue.js.map +1 -0
- package/serialization/types/CredentialClaimValues.d.ts +11 -0
- package/serialization/types/CredentialClaimValues.d.ts.map +1 -0
- package/serialization/types/CredentialClaimValues.js +43 -0
- package/serialization/types/CredentialClaimValues.js.map +1 -0
- package/serialization/types/CredentialSchema.d.ts +3 -4
- package/serialization/types/CredentialSchema.d.ts.map +1 -1
- package/serialization/types/CredentialSchema.js +3 -4
- package/serialization/types/CredentialSchema.js.map +1 -1
- package/serialization/types/CredentialSchemaCreate.d.ts +2 -2
- package/serialization/types/CredentialSchemaCreate.d.ts.map +1 -1
- package/serialization/types/CredentialSchemaCreate.js +2 -2
- package/serialization/types/CredentialSchemaCreate.js.map +1 -1
- package/serialization/types/CredentialSchemaUpdate.d.ts +2 -2
- package/serialization/types/CredentialSchemaUpdate.d.ts.map +1 -1
- package/serialization/types/CredentialSchemaUpdate.js +2 -2
- package/serialization/types/CredentialSchemaUpdate.js.map +1 -1
- package/serialization/types/{DraftEnumValue.d.ts → DateClaimValue.d.ts} +3 -4
- package/serialization/types/DateClaimValue.d.ts.map +1 -0
- package/serialization/types/{DraftEnumValue.js → DateClaimValue.js} +3 -4
- package/serialization/types/DateClaimValue.js.map +1 -0
- package/serialization/types/DateTimeClaimValue.d.ts +13 -0
- package/serialization/types/DateTimeClaimValue.d.ts.map +1 -0
- package/serialization/types/DateTimeClaimValue.js +44 -0
- package/serialization/types/DateTimeClaimValue.js.map +1 -0
- package/serialization/types/Draft.d.ts +4 -3
- package/serialization/types/Draft.d.ts.map +1 -1
- package/serialization/types/Draft.js +5 -3
- package/serialization/types/Draft.js.map +1 -1
- package/serialization/types/DraftCreate.d.ts +5 -3
- package/serialization/types/DraftCreate.d.ts.map +1 -1
- package/serialization/types/DraftCreate.js +6 -3
- package/serialization/types/DraftCreate.js.map +1 -1
- package/serialization/types/DraftCreateMetaSchema.d.ts +12 -0
- package/serialization/types/DraftCreateMetaSchema.d.ts.map +1 -0
- package/serialization/types/DraftCreateMetaSchema.js +43 -0
- package/serialization/types/DraftCreateMetaSchema.js.map +1 -0
- package/serialization/types/DraftUpdate.d.ts +1 -1
- package/serialization/types/DraftUpdate.d.ts.map +1 -1
- package/serialization/types/DraftUpdate.js +2 -1
- package/serialization/types/DraftUpdate.js.map +1 -1
- package/serialization/types/FileClaimValue.d.ts +14 -0
- package/serialization/types/FileClaimValue.d.ts.map +1 -0
- package/serialization/types/FileClaimValue.js +45 -0
- package/serialization/types/FileClaimValue.js.map +1 -0
- package/serialization/types/LinkClaimValue.d.ts +14 -0
- package/serialization/types/LinkClaimValue.d.ts.map +1 -0
- package/serialization/types/LinkClaimValue.js +45 -0
- package/serialization/types/LinkClaimValue.js.map +1 -0
- package/serialization/types/ListPublishedCredentialSchema.d.ts +14 -0
- package/serialization/types/ListPublishedCredentialSchema.d.ts.map +1 -0
- package/serialization/types/ListPublishedCredentialSchema.js +45 -0
- package/serialization/types/ListPublishedCredentialSchema.js.map +1 -0
- package/serialization/types/MetaSchema.d.ts +16 -0
- package/serialization/types/MetaSchema.d.ts.map +1 -0
- package/serialization/types/MetaSchema.js +47 -0
- package/serialization/types/MetaSchema.js.map +1 -0
- package/serialization/types/NumberClaimValue.d.ts +13 -0
- package/serialization/types/NumberClaimValue.d.ts.map +1 -0
- package/serialization/types/NumberClaimValue.js +44 -0
- package/serialization/types/NumberClaimValue.js.map +1 -0
- package/serialization/types/ProblemInternalServerError.d.ts +2 -1
- package/serialization/types/ProblemInternalServerError.d.ts.map +1 -1
- package/serialization/types/ProblemInternalServerError.js +2 -1
- package/serialization/types/ProblemInternalServerError.js.map +1 -1
- package/serialization/types/ProblemInternalServerErrorType.d.ts +11 -0
- package/serialization/types/ProblemInternalServerErrorType.d.ts.map +1 -0
- package/serialization/types/ProblemInternalServerErrorType.js +42 -0
- package/serialization/types/ProblemInternalServerErrorType.js.map +1 -0
- package/serialization/types/PublishedCredentialSchema.d.ts +4 -0
- package/serialization/types/PublishedCredentialSchema.d.ts.map +1 -1
- package/serialization/types/PublishedCredentialSchema.js +4 -0
- package/serialization/types/PublishedCredentialSchema.js.map +1 -1
- package/serialization/types/PublishedSchemaBaseFilter.d.ts +30 -0
- package/serialization/types/PublishedSchemaBaseFilter.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilter.js +61 -0
- package/serialization/types/PublishedSchemaBaseFilter.js.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterAnnotationsItem.d.ts +27 -0
- package/serialization/types/PublishedSchemaBaseFilterAnnotationsItem.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterAnnotationsItem.js +56 -0
- package/serialization/types/PublishedSchemaBaseFilterAnnotationsItem.js.map +1 -0
- package/serialization/types/{SchemaFilterPublicationPublishedAt.d.ts → PublishedSchemaBaseFilterCreatedAt.d.ts} +4 -4
- package/serialization/types/{SchemaFilterPublicationPublishedAt.d.ts.map → PublishedSchemaBaseFilterCreatedAt.d.ts.map} +1 -1
- package/serialization/types/{SchemaFilterPublicationPublishedAt.js → PublishedSchemaBaseFilterCreatedAt.js} +3 -3
- package/serialization/types/{SchemaFilterPublicationPublishedAt.js.map → PublishedSchemaBaseFilterCreatedAt.js.map} +1 -1
- package/serialization/types/PublishedSchemaBaseFilterDeletedAt.d.ts +39 -0
- package/serialization/types/PublishedSchemaBaseFilterDeletedAt.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterDeletedAt.js +62 -0
- package/serialization/types/PublishedSchemaBaseFilterDeletedAt.js.map +1 -0
- package/serialization/types/{SchemaFilterPublicationEtag.d.ts → PublishedSchemaBaseFilterEtag.d.ts} +4 -4
- package/serialization/types/PublishedSchemaBaseFilterEtag.d.ts.map +1 -0
- package/serialization/types/{SchemaFilterPublicationEtag.js → PublishedSchemaBaseFilterEtag.js} +3 -3
- package/serialization/types/PublishedSchemaBaseFilterEtag.js.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterId.d.ts +27 -0
- package/serialization/types/PublishedSchemaBaseFilterId.d.ts.map +1 -0
- package/serialization/types/{SchemaFilterPublicationUrl.js → PublishedSchemaBaseFilterId.js} +11 -11
- package/serialization/types/PublishedSchemaBaseFilterId.js.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterLabelsItem.d.ts +27 -0
- package/serialization/types/PublishedSchemaBaseFilterLabelsItem.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterLabelsItem.js +56 -0
- package/serialization/types/PublishedSchemaBaseFilterLabelsItem.js.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterModifiedAt.d.ts +31 -0
- package/serialization/types/PublishedSchemaBaseFilterModifiedAt.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterModifiedAt.js +58 -0
- package/serialization/types/PublishedSchemaBaseFilterModifiedAt.js.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterRevision.d.ts +47 -0
- package/serialization/types/PublishedSchemaBaseFilterRevision.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaBaseFilterRevision.js +66 -0
- package/serialization/types/PublishedSchemaBaseFilterRevision.js.map +1 -0
- package/serialization/types/PublishedSchemaFilter.d.ts +12 -0
- package/serialization/types/PublishedSchemaFilter.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaFilter.js +9 -0
- package/serialization/types/PublishedSchemaFilter.js.map +1 -0
- package/serialization/types/PublishedSchemaFilterData.d.ts +20 -0
- package/serialization/types/PublishedSchemaFilterData.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaFilterData.js +51 -0
- package/serialization/types/PublishedSchemaFilterData.js.map +1 -0
- package/serialization/types/PublishedSchemaFilterDataDigestMultibase.d.ts +27 -0
- package/serialization/types/PublishedSchemaFilterDataDigestMultibase.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaFilterDataDigestMultibase.js +56 -0
- package/serialization/types/PublishedSchemaFilterDataDigestMultibase.js.map +1 -0
- package/serialization/types/PublishedSchemaFilterDataPublishedAt.d.ts +31 -0
- package/serialization/types/PublishedSchemaFilterDataPublishedAt.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaFilterDataPublishedAt.js +58 -0
- package/serialization/types/PublishedSchemaFilterDataPublishedAt.js.map +1 -0
- package/serialization/types/{SchemaFilterPublicationSlug.d.ts → PublishedSchemaFilterDataSlug.d.ts} +4 -4
- package/serialization/types/PublishedSchemaFilterDataSlug.d.ts.map +1 -0
- package/serialization/types/{SchemaFilterPublicationSlug.js → PublishedSchemaFilterDataSlug.js} +3 -3
- package/serialization/types/PublishedSchemaFilterDataSlug.js.map +1 -0
- package/serialization/types/{SchemaFilterPublicationVersion.d.ts → PublishedSchemaFilterDataVersion.d.ts} +4 -4
- package/serialization/types/PublishedSchemaFilterDataVersion.d.ts.map +1 -0
- package/serialization/types/{SchemaFilterPublicationVersion.js → PublishedSchemaFilterDataVersion.js} +3 -3
- package/serialization/types/PublishedSchemaFilterDataVersion.js.map +1 -0
- package/serialization/types/PublishedSchemaSort.d.ts +16 -0
- package/serialization/types/PublishedSchemaSort.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaSort.js +47 -0
- package/serialization/types/PublishedSchemaSort.js.map +1 -0
- package/serialization/types/PublishedSchemaSortField.d.ts +11 -0
- package/serialization/types/PublishedSchemaSortField.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaSortField.js +53 -0
- package/serialization/types/PublishedSchemaSortField.js.map +1 -0
- package/serialization/types/PublishedSchemaSortOrder.d.ts +11 -0
- package/serialization/types/PublishedSchemaSortOrder.d.ts.map +1 -0
- package/serialization/types/PublishedSchemaSortOrder.js +42 -0
- package/serialization/types/PublishedSchemaSortOrder.js.map +1 -0
- package/serialization/types/ResourcePublishedCredentialSchema.d.ts +24 -0
- package/serialization/types/ResourcePublishedCredentialSchema.d.ts.map +1 -0
- package/serialization/types/ResourcePublishedCredentialSchema.js +55 -0
- package/serialization/types/ResourcePublishedCredentialSchema.js.map +1 -0
- package/serialization/types/SchemaFilterData.d.ts +2 -2
- package/serialization/types/SchemaFilterData.d.ts.map +1 -1
- package/serialization/types/SchemaFilterData.js +2 -2
- package/serialization/types/SchemaFilterData.js.map +1 -1
- package/serialization/types/SchemaFilterDataDigestMultibase.d.ts +27 -0
- package/serialization/types/SchemaFilterDataDigestMultibase.d.ts.map +1 -0
- package/serialization/types/SchemaFilterDataDigestMultibase.js +56 -0
- package/serialization/types/SchemaFilterDataDigestMultibase.js.map +1 -0
- package/serialization/types/SchemaImportDataRequest.d.ts +16 -0
- package/serialization/types/SchemaImportDataRequest.d.ts.map +1 -0
- package/serialization/types/SchemaImportDataRequest.js +47 -0
- package/serialization/types/SchemaImportDataRequest.js.map +1 -0
- package/serialization/types/SchemaSortField.d.ts +1 -1
- package/serialization/types/SchemaSortField.d.ts.map +1 -1
- package/serialization/types/SchemaSortField.js +1 -5
- package/serialization/types/SchemaSortField.js.map +1 -1
- package/serialization/types/StringClaimValue.d.ts +13 -0
- package/serialization/types/StringClaimValue.d.ts.map +1 -0
- package/serialization/types/StringClaimValue.js +44 -0
- package/serialization/types/StringClaimValue.js.map +1 -0
- package/serialization/types/StructClaimValue.d.ts +13 -0
- package/serialization/types/StructClaimValue.d.ts.map +1 -0
- package/serialization/types/StructClaimValue.js +45 -0
- package/serialization/types/StructClaimValue.js.map +1 -0
- package/serialization/types/index.d.ts +43 -19
- package/serialization/types/index.d.ts.map +1 -1
- package/serialization/types/index.js +43 -19
- package/serialization/types/index.js.map +1 -1
- package/api/types/CredentialSchemaPublicationOutput.d.ts +0 -27
- package/api/types/CredentialSchemaPublicationOutput.d.ts.map +0 -1
- package/api/types/CredentialSchemaPublicationOutput.js.map +0 -1
- package/api/types/DraftEnumValue.d.ts +0 -13
- package/api/types/DraftEnumValue.d.ts.map +0 -1
- package/api/types/DraftEnumValue.js.map +0 -1
- package/api/types/DraftFieldBooleanValue.d.ts +0 -18
- package/api/types/DraftFieldBooleanValue.d.ts.map +0 -1
- package/api/types/DraftFieldBooleanValue.js.map +0 -1
- package/api/types/DraftFieldDateTimeValue.d.ts +0 -18
- package/api/types/DraftFieldDateTimeValue.d.ts.map +0 -1
- package/api/types/DraftFieldDateTimeValue.js.map +0 -1
- package/api/types/DraftFieldDateValue.d.ts +0 -18
- package/api/types/DraftFieldDateValue.d.ts.map +0 -1
- package/api/types/DraftFieldDateValue.js.map +0 -1
- package/api/types/DraftFieldFileValue.d.ts +0 -16
- package/api/types/DraftFieldFileValue.d.ts.map +0 -1
- package/api/types/DraftFieldFileValue.js.map +0 -1
- package/api/types/DraftFieldLinkValue.d.ts +0 -18
- package/api/types/DraftFieldLinkValue.d.ts.map +0 -1
- package/api/types/DraftFieldLinkValue.js.map +0 -1
- package/api/types/DraftFieldNumberValue.d.ts +0 -18
- package/api/types/DraftFieldNumberValue.d.ts.map +0 -1
- package/api/types/DraftFieldNumberValue.js +0 -6
- package/api/types/DraftFieldNumberValue.js.map +0 -1
- package/api/types/DraftFieldStringValue.d.ts +0 -21
- package/api/types/DraftFieldStringValue.d.ts.map +0 -1
- package/api/types/DraftFieldStringValue.js +0 -6
- package/api/types/DraftFieldStringValue.js.map +0 -1
- package/api/types/DraftFieldStructValue.d.ts +0 -23
- package/api/types/DraftFieldStructValue.d.ts.map +0 -1
- package/api/types/DraftFieldStructValue.js +0 -6
- package/api/types/DraftFieldStructValue.js.map +0 -1
- package/api/types/DraftFieldStructValueFieldsItem.d.ts +0 -35
- package/api/types/DraftFieldStructValueFieldsItem.d.ts.map +0 -1
- package/api/types/DraftFieldStructValueFieldsItem.js +0 -6
- package/api/types/DraftFieldStructValueFieldsItem.js.map +0 -1
- package/api/types/DraftSchema.d.ts +0 -49
- package/api/types/DraftSchema.d.ts.map +0 -1
- package/api/types/DraftSchema.js.map +0 -1
- package/api/types/DraftSchemaFieldsItem.d.ts +0 -35
- package/api/types/DraftSchemaFieldsItem.d.ts.map +0 -1
- package/api/types/DraftSchemaFieldsItem.js +0 -6
- package/api/types/DraftSchemaFieldsItem.js.map +0 -1
- package/api/types/SchemaFilterPublication.d.ts +0 -15
- package/api/types/SchemaFilterPublication.d.ts.map +0 -1
- package/api/types/SchemaFilterPublication.js +0 -6
- package/api/types/SchemaFilterPublication.js.map +0 -1
- package/api/types/SchemaFilterPublicationEtag.d.ts.map +0 -1
- package/api/types/SchemaFilterPublicationEtag.js +0 -6
- package/api/types/SchemaFilterPublicationEtag.js.map +0 -1
- package/api/types/SchemaFilterPublicationPublishedAt.d.ts.map +0 -1
- package/api/types/SchemaFilterPublicationPublishedAt.js +0 -6
- package/api/types/SchemaFilterPublicationPublishedAt.js.map +0 -1
- package/api/types/SchemaFilterPublicationSlug.d.ts.map +0 -1
- package/api/types/SchemaFilterPublicationSlug.js +0 -6
- package/api/types/SchemaFilterPublicationSlug.js.map +0 -1
- package/api/types/SchemaFilterPublicationUrl.d.ts +0 -20
- package/api/types/SchemaFilterPublicationUrl.d.ts.map +0 -1
- package/api/types/SchemaFilterPublicationUrl.js +0 -6
- package/api/types/SchemaFilterPublicationUrl.js.map +0 -1
- package/api/types/SchemaFilterPublicationVersion.d.ts.map +0 -1
- package/api/types/SchemaFilterPublicationVersion.js +0 -6
- package/api/types/SchemaFilterPublicationVersion.js.map +0 -1
- package/serialization/types/CredentialSchemaPublicationOutput.d.ts +0 -17
- package/serialization/types/CredentialSchemaPublicationOutput.d.ts.map +0 -1
- package/serialization/types/CredentialSchemaPublicationOutput.js.map +0 -1
- package/serialization/types/DraftEnumValue.d.ts.map +0 -1
- package/serialization/types/DraftEnumValue.js.map +0 -1
- package/serialization/types/DraftFieldBooleanValue.d.ts +0 -17
- package/serialization/types/DraftFieldBooleanValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldBooleanValue.js.map +0 -1
- package/serialization/types/DraftFieldDateTimeValue.d.ts +0 -17
- package/serialization/types/DraftFieldDateTimeValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldDateTimeValue.js.map +0 -1
- package/serialization/types/DraftFieldDateValue.d.ts +0 -17
- package/serialization/types/DraftFieldDateValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldDateValue.js.map +0 -1
- package/serialization/types/DraftFieldFileValue.d.ts +0 -16
- package/serialization/types/DraftFieldFileValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldFileValue.js.map +0 -1
- package/serialization/types/DraftFieldLinkValue.d.ts +0 -17
- package/serialization/types/DraftFieldLinkValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldLinkValue.js +0 -48
- package/serialization/types/DraftFieldLinkValue.js.map +0 -1
- package/serialization/types/DraftFieldNumberValue.d.ts +0 -17
- package/serialization/types/DraftFieldNumberValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldNumberValue.js +0 -48
- package/serialization/types/DraftFieldNumberValue.js.map +0 -1
- package/serialization/types/DraftFieldStringValue.d.ts +0 -19
- package/serialization/types/DraftFieldStringValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldStringValue.js +0 -50
- package/serialization/types/DraftFieldStringValue.js.map +0 -1
- package/serialization/types/DraftFieldStructValue.d.ts +0 -19
- package/serialization/types/DraftFieldStructValue.d.ts.map +0 -1
- package/serialization/types/DraftFieldStructValue.js.map +0 -1
- package/serialization/types/DraftFieldStructValueFieldsItem.d.ts +0 -42
- package/serialization/types/DraftFieldStructValueFieldsItem.d.ts.map +0 -1
- package/serialization/types/DraftFieldStructValueFieldsItem.js.map +0 -1
- package/serialization/types/DraftSchema.d.ts +0 -17
- package/serialization/types/DraftSchema.d.ts.map +0 -1
- package/serialization/types/DraftSchema.js +0 -48
- package/serialization/types/DraftSchema.js.map +0 -1
- package/serialization/types/DraftSchemaFieldsItem.d.ts +0 -42
- package/serialization/types/DraftSchemaFieldsItem.d.ts.map +0 -1
- package/serialization/types/DraftSchemaFieldsItem.js.map +0 -1
- package/serialization/types/SchemaFilterPublication.d.ts +0 -22
- package/serialization/types/SchemaFilterPublication.d.ts.map +0 -1
- package/serialization/types/SchemaFilterPublication.js +0 -53
- package/serialization/types/SchemaFilterPublication.js.map +0 -1
- package/serialization/types/SchemaFilterPublicationEtag.d.ts.map +0 -1
- package/serialization/types/SchemaFilterPublicationEtag.js.map +0 -1
- package/serialization/types/SchemaFilterPublicationSlug.d.ts.map +0 -1
- package/serialization/types/SchemaFilterPublicationSlug.js.map +0 -1
- package/serialization/types/SchemaFilterPublicationUrl.d.ts +0 -27
- package/serialization/types/SchemaFilterPublicationUrl.d.ts.map +0 -1
- package/serialization/types/SchemaFilterPublicationUrl.js.map +0 -1
- package/serialization/types/SchemaFilterPublicationVersion.d.ts.map +0 -1
- package/serialization/types/SchemaFilterPublicationVersion.js.map +0 -1
|
@@ -9,7 +9,7 @@ function transformAndMaybeSkipValidation(transform) {
|
|
|
9
9
|
const transformed = transform(value, opts);
|
|
10
10
|
const { skipValidation = false } = opts !== null && opts !== void 0 ? opts : {};
|
|
11
11
|
if (!transformed.ok && skipValidation) {
|
|
12
|
-
//
|
|
12
|
+
// biome-ignore lint/suspicious/noConsole: allow console
|
|
13
13
|
console.warn([
|
|
14
14
|
'Failed to validate.',
|
|
15
15
|
...transformed.errors.map((error) => ' - ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybeSkipValidation.js","sourceRoot":"","sources":["../../../../src/core/schemas/utils/maybeSkipValidation.ts"],"names":[],"mappings":";;AAEA,kDAMC;AAND,SAAgB,mBAAmB,CAAiD,MAAS;IACzF,uCACO,MAAM,KACT,IAAI,EAAE,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC,EAClD,KAAK,EAAE,+BAA+B,CAAC,MAAM,CAAC,KAAK,CAAC,IACtD;AACN,CAAC;AAED,SAAS,+BAA+B,CACpC,SAAkE;IAElE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAiB,EAAE;QAClC,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3C,MAAM,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,cAAc,EAAE,CAAC;YACpC,
|
|
1
|
+
{"version":3,"file":"maybeSkipValidation.js","sourceRoot":"","sources":["../../../../src/core/schemas/utils/maybeSkipValidation.ts"],"names":[],"mappings":";;AAEA,kDAMC;AAND,SAAgB,mBAAmB,CAAiD,MAAS;IACzF,uCACO,MAAM,KACT,IAAI,EAAE,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC,EAClD,KAAK,EAAE,+BAA+B,CAAC,MAAM,CAAC,KAAK,CAAC,IACtD;AACN,CAAC;AAED,SAAS,+BAA+B,CACpC,SAAkE;IAElE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAiB,EAAE;QAClC,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3C,MAAM,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,cAAc,EAAE,CAAC;YACpC,wDAAwD;YACxD,OAAO,CAAC,IAAI,CACR;gBACI,qBAAqB;gBACrB,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CACrB,CAAC,KAAK,EAAE,EAAE,CACN,MAAM;oBACN,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAC5F;aACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;YAEF,OAAO;gBACH,EAAE,EAAE,IAAI;gBACR,KAAK,EAAE,KAAU;aACpB,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,OAAO,WAAW,CAAC;QACvB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { BaseSchema, MaybeValid, SchemaOptions } from '../Schema';\n\nexport function maybeSkipValidation<S extends BaseSchema<Raw, Parsed>, Raw, Parsed>(schema: S): S {\n return {\n ...schema,\n json: transformAndMaybeSkipValidation(schema.json),\n parse: transformAndMaybeSkipValidation(schema.parse),\n };\n}\n\nfunction transformAndMaybeSkipValidation<T>(\n transform: (value: unknown, opts?: SchemaOptions) => MaybeValid<T>,\n): (value: unknown, opts?: SchemaOptions) => MaybeValid<T> {\n return (value, opts): MaybeValid<T> => {\n const transformed = transform(value, opts);\n const { skipValidation = false } = opts ?? {};\n if (!transformed.ok && skipValidation) {\n // biome-ignore lint/suspicious/noConsole: allow console\n console.warn(\n [\n 'Failed to validate.',\n ...transformed.errors.map(\n (error) =>\n ' - ' +\n (error.path.length > 0 ? `${error.path.join('.')}: ${error.message}` : error.message),\n ),\n ].join('\\n'),\n );\n\n return {\n ok: true,\n value: value as T,\n };\n } else {\n return transformed;\n }\n };\n}\n"]}
|
package/core/url/join.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../src/core/url/join.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../src/core/url/join.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAoChE"}
|
package/core/url/join.js
CHANGED
|
@@ -5,6 +5,9 @@ function join(base, ...segments) {
|
|
|
5
5
|
if (!base) {
|
|
6
6
|
return '';
|
|
7
7
|
}
|
|
8
|
+
if (segments.length === 0) {
|
|
9
|
+
return base;
|
|
10
|
+
}
|
|
8
11
|
if (base.includes('://')) {
|
|
9
12
|
let url;
|
|
10
13
|
try {
|
|
@@ -14,24 +17,37 @@ function join(base, ...segments) {
|
|
|
14
17
|
// Fallback to path joining if URL is malformed
|
|
15
18
|
return joinPath(base, ...segments);
|
|
16
19
|
}
|
|
20
|
+
const lastSegment = segments[segments.length - 1];
|
|
21
|
+
const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith('/');
|
|
17
22
|
for (const segment of segments) {
|
|
18
23
|
const cleanSegment = trimSlashes(segment);
|
|
19
24
|
if (cleanSegment) {
|
|
20
25
|
url.pathname = joinPathSegments(url.pathname, cleanSegment);
|
|
21
26
|
}
|
|
22
27
|
}
|
|
28
|
+
if (shouldPreserveTrailingSlash && !url.pathname.endsWith('/')) {
|
|
29
|
+
url.pathname += '/';
|
|
30
|
+
}
|
|
23
31
|
return url.toString();
|
|
24
32
|
}
|
|
25
33
|
return joinPath(base, ...segments);
|
|
26
34
|
}
|
|
27
35
|
function joinPath(base, ...segments) {
|
|
36
|
+
if (segments.length === 0) {
|
|
37
|
+
return base;
|
|
38
|
+
}
|
|
28
39
|
let result = base;
|
|
40
|
+
const lastSegment = segments[segments.length - 1];
|
|
41
|
+
const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith('/');
|
|
29
42
|
for (const segment of segments) {
|
|
30
43
|
const cleanSegment = trimSlashes(segment);
|
|
31
44
|
if (cleanSegment) {
|
|
32
45
|
result = joinPathSegments(result, cleanSegment);
|
|
33
46
|
}
|
|
34
47
|
}
|
|
48
|
+
if (shouldPreserveTrailingSlash && !result.endsWith('/')) {
|
|
49
|
+
result += '/';
|
|
50
|
+
}
|
|
35
51
|
return result;
|
|
36
52
|
}
|
|
37
53
|
function joinPathSegments(left, right) {
|
|
@@ -43,8 +59,12 @@ function joinPathSegments(left, right) {
|
|
|
43
59
|
function trimSlashes(str) {
|
|
44
60
|
if (!str)
|
|
45
61
|
return str;
|
|
46
|
-
let start =
|
|
47
|
-
let end = str.
|
|
48
|
-
|
|
62
|
+
let start = 0;
|
|
63
|
+
let end = str.length;
|
|
64
|
+
if (str.startsWith('/'))
|
|
65
|
+
start = 1;
|
|
66
|
+
if (str.endsWith('/'))
|
|
67
|
+
end = str.length - 1;
|
|
68
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
49
69
|
}
|
|
50
70
|
//# sourceMappingURL=join.js.map
|
package/core/url/join.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join.js","sourceRoot":"","sources":["../../../src/core/url/join.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"join.js","sourceRoot":"","sources":["../../../src/core/url/join.ts"],"names":[],"mappings":";;AAAA,oBAoCC;AApCD,SAAgB,IAAI,CAAC,IAAY,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,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["export function join(base: string, ...segments: string[]): string {\n if (!base) {\n return '';\n }\n\n if (segments.length === 0) {\n return base;\n }\n\n if (base.includes('://')) {\n let url: URL;\n try {\n url = new URL(base);\n } catch {\n // Fallback to path joining if URL is malformed\n return joinPath(base, ...segments);\n }\n\n const lastSegment = segments[segments.length - 1];\n const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith('/');\n\n for (const segment of segments) {\n const cleanSegment = trimSlashes(segment);\n if (cleanSegment) {\n url.pathname = joinPathSegments(url.pathname, cleanSegment);\n }\n }\n\n if (shouldPreserveTrailingSlash && !url.pathname.endsWith('/')) {\n url.pathname += '/';\n }\n\n return url.toString();\n }\n\n return joinPath(base, ...segments);\n}\n\nfunction joinPath(base: string, ...segments: string[]): string {\n if (segments.length === 0) {\n return base;\n }\n\n let result = base;\n\n const lastSegment = segments[segments.length - 1];\n const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith('/');\n\n for (const segment of segments) {\n const cleanSegment = trimSlashes(segment);\n if (cleanSegment) {\n result = joinPathSegments(result, cleanSegment);\n }\n }\n\n if (shouldPreserveTrailingSlash && !result.endsWith('/')) {\n result += '/';\n }\n\n return result;\n}\n\nfunction joinPathSegments(left: string, right: string): string {\n if (left.endsWith('/')) {\n return left + right;\n }\n return left + '/' + right;\n}\n\nfunction trimSlashes(str: string): string {\n if (!str) return str;\n\n let start = 0;\n let end = str.length;\n\n if (str.startsWith('/')) start = 1;\n if (str.endsWith('/')) end = str.length - 1;\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n"]}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClaimsSchema, ClaimsSchemaFieldsItem, CredentialClaimValues } from '../../api';
|
|
2
2
|
import { ClaimDescriptor } from '../decorators';
|
|
3
3
|
import { ApiClient, Claims, Ctor, ReadClaims, ReadDraftClaims, UserUpdateClaims } from '../types';
|
|
4
|
-
import {
|
|
4
|
+
import { Json } from './types';
|
|
5
5
|
export declare class UdtClaims<T extends Claims> {
|
|
6
6
|
protected client: ApiClient;
|
|
7
7
|
protected claimsModel: Ctor<T>;
|
|
8
8
|
constructor(client: ApiClient, claimsModel: Ctor<T>);
|
|
9
9
|
private processValues;
|
|
10
|
+
private processUdt;
|
|
11
|
+
private processCredentialClaimValues;
|
|
10
12
|
private getClaimTypeInfo;
|
|
13
|
+
/** convertCredentialClaimValuesToUdt maps and converts the API received claims values to the UDT claims model */
|
|
14
|
+
protected convertCredentialClaimValuesToUdt<K extends Claims>(model: Ctor<any>, input: CredentialClaimValues): K;
|
|
11
15
|
/** convertApiValuesToUdt maps and converts the API received claims values to the UDT claims model */
|
|
12
16
|
protected convertApiValuesToUdt<K extends Claims>(model: Ctor<any>, input: Json): K;
|
|
13
17
|
/** convertUdtToApiValues maps and converts the user received claims values onto UDT claims model */
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
18
|
+
protected convertUdtToCredentialClaimValues<K extends Claims>(model: Ctor<any>, input: K): CredentialClaimValues;
|
|
19
|
+
protected mapClaimDescriptorToClaimsSchemaFieldItem(claim: ClaimDescriptor, claimsModel: Ctor<any>): ClaimsSchemaFieldsItem;
|
|
16
20
|
/**
|
|
17
21
|
* Marshalling is the process of transforming the internal representation of values to a data format suitable
|
|
18
22
|
* for transmission.
|
|
19
23
|
*/
|
|
20
|
-
marshalValues(input: UserUpdateClaims<T>):
|
|
24
|
+
marshalValues(input: UserUpdateClaims<T>): Claims;
|
|
21
25
|
/**
|
|
22
26
|
* Unmarshalling is the reverse process of marshalling. It involves converting data from a serialized format back
|
|
23
27
|
* into an internal representation.
|
|
24
28
|
*/
|
|
25
|
-
unmarshalValuesToDraft(input:
|
|
29
|
+
unmarshalValuesToDraft(input: CredentialClaimValues): ReadDraftClaims<T>;
|
|
26
30
|
unmarshalValuesToCredential(input: Json): ReadClaims<T>;
|
|
27
|
-
|
|
31
|
+
getClaimsSchema(): ClaimsSchema;
|
|
28
32
|
}
|
|
29
33
|
//# sourceMappingURL=claims.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/documents/credential/claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/documents/credential/claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAwB,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE9G,OAAO,EACH,eAAe,EAIlB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,SAAS,EACT,MAAM,EACN,IAAI,EAIJ,UAAU,EACV,eAAe,EACf,gBAAgB,EACnB,MAAM,UAAU,CAAC;AAKlB,OAAO,EAA0B,IAAI,EAAE,MAAM,SAAS,CAAC;AAGvD,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM;IAE/B,SAAS,CAAC,MAAM,EAAE,SAAS;IAC3B,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;gBADpB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IAGlC,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,UAAU;IAsClB,OAAO,CAAC,4BAA4B;IAkCpC,OAAO,CAAC,gBAAgB;IAYxB,iHAAiH;IACjH,SAAS,CAAC,iCAAiC,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,qBAAqB,GAAG,CAAC;IAwGhH,qGAAqG;IACrG,SAAS,CAAC,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC;IAiEnF,oGAAoG;IACpG,SAAS,CAAC,iCAAiC,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,qBAAqB;IAoGhH,SAAS,CAAC,yCAAyC,CAC/C,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,GACvB,sBAAsB;IAsGzB;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM;IAIjD;;;OAGG;IACH,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,eAAe,CAAC,CAAC,CAAC;IAIxE,2BAA2B,CAAC,KAAK,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC;IAIvD,eAAe,IAAI,YAAY;CAalC"}
|
|
@@ -74,6 +74,61 @@ class UdtClaims {
|
|
|
74
74
|
return result;
|
|
75
75
|
}, initialValue);
|
|
76
76
|
}
|
|
77
|
+
processUdt(model, input, processValue, initialValue) {
|
|
78
|
+
return (0, decorators_1.getRegisteredClaimsList)(model).reduce((result, descriptor) => {
|
|
79
|
+
if (descriptor.name in input) {
|
|
80
|
+
const value = input[descriptor.name];
|
|
81
|
+
let processedValue;
|
|
82
|
+
if (value == null) {
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
if (descriptor.isArray) {
|
|
86
|
+
if (Array.isArray(value)) {
|
|
87
|
+
processedValue = {
|
|
88
|
+
kind: 'ARRAY',
|
|
89
|
+
value: value.map((item) => {
|
|
90
|
+
return processValue(descriptor, item);
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "Array".`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
processedValue = processValue(descriptor, value);
|
|
100
|
+
}
|
|
101
|
+
Reflect.set(result, descriptor.name, processedValue);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}, initialValue);
|
|
105
|
+
}
|
|
106
|
+
processCredentialClaimValues(model, input, processValue, initialValue) {
|
|
107
|
+
return (0, decorators_1.getRegisteredClaimsList)(model).reduce((result, descriptor) => {
|
|
108
|
+
if (descriptor.name in input) {
|
|
109
|
+
const value = input[descriptor.name];
|
|
110
|
+
let processedValue;
|
|
111
|
+
if (descriptor.isArray) {
|
|
112
|
+
if (value == null) {
|
|
113
|
+
processedValue = null;
|
|
114
|
+
}
|
|
115
|
+
else if (value.kind === 'ARRAY') {
|
|
116
|
+
processedValue = value.value.map((item) => {
|
|
117
|
+
return processValue(descriptor, item);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "Array".`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
processedValue = processValue(descriptor, value);
|
|
126
|
+
}
|
|
127
|
+
Reflect.set(result, descriptor.name, processedValue);
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
}, initialValue);
|
|
131
|
+
}
|
|
77
132
|
getClaimTypeInfo(model, descriptor) {
|
|
78
133
|
const typeInfo = descriptor.nestedType ? descriptor.nestedType : (0, decorators_1.getTsDataTypeMetadata)(model, descriptor.name);
|
|
79
134
|
if (typeInfo == null) {
|
|
@@ -81,6 +136,68 @@ class UdtClaims {
|
|
|
81
136
|
}
|
|
82
137
|
return typeInfo;
|
|
83
138
|
}
|
|
139
|
+
/** convertCredentialClaimValuesToUdt maps and converts the API received claims values to the UDT claims model */
|
|
140
|
+
convertCredentialClaimValuesToUdt(model, input) {
|
|
141
|
+
const processValue = (descriptor, value) => {
|
|
142
|
+
if (value == null) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
const typeInfo = this.getClaimTypeInfo(model, descriptor);
|
|
146
|
+
if (typeInfo === models_1.LinkedCredential) {
|
|
147
|
+
if (value.kind !== 'LINK') {
|
|
148
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "LinkedCredential".`);
|
|
149
|
+
}
|
|
150
|
+
return new models_1.LinkedCredential(this.client, value.value.id, value.value.digestMultibase);
|
|
151
|
+
}
|
|
152
|
+
if (typeInfo === models_1.LinkedFile) {
|
|
153
|
+
if (value.kind !== 'FILE') {
|
|
154
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "LinkedFile".`);
|
|
155
|
+
}
|
|
156
|
+
return new models_1.LinkedFile(this.client, value.value.id, value.value.digestMultibase);
|
|
157
|
+
}
|
|
158
|
+
if (typeInfo === Date) {
|
|
159
|
+
if (value.kind !== 'DATETIME') {
|
|
160
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "Date".`);
|
|
161
|
+
}
|
|
162
|
+
return new Date(value.value);
|
|
163
|
+
}
|
|
164
|
+
if (typeInfo === models_1.Rfc3339DateTime) {
|
|
165
|
+
if (value.kind !== 'DATETIME') {
|
|
166
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "Rfc3339DateTime".`);
|
|
167
|
+
}
|
|
168
|
+
return new models_1.Rfc3339DateTime(value.value);
|
|
169
|
+
}
|
|
170
|
+
if (typeInfo === models_1.Rfc3339Date) {
|
|
171
|
+
if (value.kind !== 'DATE') {
|
|
172
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "Rfc3339Date".`);
|
|
173
|
+
}
|
|
174
|
+
return new models_1.Rfc3339Date(value.value);
|
|
175
|
+
}
|
|
176
|
+
if (typeInfo === String) {
|
|
177
|
+
if (value.kind !== 'STRING') {
|
|
178
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "string".`);
|
|
179
|
+
}
|
|
180
|
+
return value.value;
|
|
181
|
+
}
|
|
182
|
+
if (typeInfo === Number) {
|
|
183
|
+
if (value.kind !== 'NUMBER') {
|
|
184
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "number".`);
|
|
185
|
+
}
|
|
186
|
+
return value.value;
|
|
187
|
+
}
|
|
188
|
+
if (typeInfo === Boolean) {
|
|
189
|
+
if (value.kind !== 'BOOLEAN') {
|
|
190
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "boolean".`);
|
|
191
|
+
}
|
|
192
|
+
return value.value;
|
|
193
|
+
}
|
|
194
|
+
if (value.kind !== 'STRUCT') {
|
|
195
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "${typeInfo.name}".`);
|
|
196
|
+
}
|
|
197
|
+
return this.convertCredentialClaimValuesToUdt(typeInfo, value.value);
|
|
198
|
+
};
|
|
199
|
+
return this.processCredentialClaimValues(model, input, processValue, new model());
|
|
200
|
+
}
|
|
84
201
|
/** convertApiValuesToUdt maps and converts the API received claims values to the UDT claims model */
|
|
85
202
|
convertApiValuesToUdt(model, input) {
|
|
86
203
|
const processValue = (descriptor, value) => {
|
|
@@ -126,11 +243,8 @@ class UdtClaims {
|
|
|
126
243
|
return this.processValues(model, input, processValue, new model());
|
|
127
244
|
}
|
|
128
245
|
/** convertUdtToApiValues maps and converts the user received claims values onto UDT claims model */
|
|
129
|
-
|
|
246
|
+
convertUdtToCredentialClaimValues(model, input) {
|
|
130
247
|
const processValue = (descriptor, value) => {
|
|
131
|
-
if (value == null) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
248
|
const typeInfo = this.getClaimTypeInfo(model, descriptor);
|
|
135
249
|
if (typeInfo === models_1.LinkedCredential) {
|
|
136
250
|
if (value instanceof models_1.LinkedCredential) {
|
|
@@ -142,29 +256,69 @@ class UdtClaims {
|
|
|
142
256
|
return value.toLinkedCredential().toJSON();
|
|
143
257
|
}
|
|
144
258
|
if ((0, types_1.isValueWithId)(value)) {
|
|
145
|
-
return models_1.LinkedCredential.
|
|
259
|
+
return models_1.LinkedCredential.createCredentialClaimValue(value.id, value.digestMultibase);
|
|
146
260
|
}
|
|
261
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, 'Invalid value for linked credential');
|
|
147
262
|
}
|
|
148
263
|
if (typeInfo === models_1.LinkedFile) {
|
|
149
264
|
if (value instanceof models_1.LinkedFile) {
|
|
150
265
|
return value.toJSON();
|
|
151
266
|
}
|
|
267
|
+
if ((0, types_1.isValueWithDataId)(value)) {
|
|
268
|
+
return models_1.LinkedFile.createCredentialClaimValue(value.data.id, value.data.digestMultibase);
|
|
269
|
+
}
|
|
152
270
|
if ((0, types_1.isValueWithId)(value)) {
|
|
153
|
-
return models_1.LinkedFile.
|
|
271
|
+
return models_1.LinkedFile.createCredentialClaimValue(value.id, value.digestMultibase);
|
|
154
272
|
}
|
|
273
|
+
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, 'Invalid value for linked file');
|
|
155
274
|
}
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
275
|
+
if (typeInfo === String && typeof value === 'string') {
|
|
276
|
+
return {
|
|
277
|
+
kind: 'STRING',
|
|
278
|
+
value,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
if (typeInfo === Number && typeof value === 'number') {
|
|
282
|
+
return {
|
|
283
|
+
kind: 'NUMBER',
|
|
284
|
+
value,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
if (typeInfo === Date && value instanceof Date) {
|
|
288
|
+
return {
|
|
289
|
+
kind: 'DATETIME',
|
|
290
|
+
value,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
if (typeInfo === models_1.Rfc3339Date && value instanceof models_1.Rfc3339Date) {
|
|
294
|
+
return {
|
|
295
|
+
kind: 'DATE',
|
|
296
|
+
value: value.toString(),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
if (typeInfo === models_1.Rfc3339DateTime && value instanceof models_1.Rfc3339DateTime) {
|
|
300
|
+
return {
|
|
301
|
+
kind: 'DATETIME',
|
|
302
|
+
value: value.toDate(),
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
if (typeInfo === Boolean && typeof value === 'boolean') {
|
|
306
|
+
return {
|
|
307
|
+
kind: 'BOOLEAN',
|
|
308
|
+
value,
|
|
309
|
+
};
|
|
158
310
|
}
|
|
159
311
|
if (!(value instanceof Object)) {
|
|
160
312
|
throw new error_1.DocumentedError(error_1.ErrorCode.UnexpectedTypeInSerialization, `Can't convert received value as it has an unexpected type. The value is defined in UDT as "${typeInfo.name}".`);
|
|
161
313
|
}
|
|
162
|
-
return
|
|
314
|
+
return {
|
|
315
|
+
kind: 'STRUCT',
|
|
316
|
+
value: this.convertUdtToCredentialClaimValues(typeInfo, value),
|
|
317
|
+
};
|
|
163
318
|
};
|
|
164
|
-
return this.
|
|
319
|
+
return this.processUdt(model, input, processValue, {});
|
|
165
320
|
}
|
|
166
|
-
|
|
167
|
-
const claimJsonLdType = (0, decorators_1.getClaimJsonLdTypeMetadata)(claimsModel, claim.name);
|
|
321
|
+
mapClaimDescriptorToClaimsSchemaFieldItem(claim, claimsModel) {
|
|
168
322
|
const draftBaseFieldValue = {
|
|
169
323
|
name: claim.name,
|
|
170
324
|
title: claim.title,
|
|
@@ -174,13 +328,10 @@ class UdtClaims {
|
|
|
174
328
|
if (claim.nestedType &&
|
|
175
329
|
!Array.of(String, Number, Date, models_1.Rfc3339DateTime, models_1.Rfc3339Date, Boolean, models_1.LinkedFile, models_1.LinkedCredential).includes(claim.nestedType)) {
|
|
176
330
|
const claimNestedType = claim.nestedType;
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.DraftSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'STRUCT', fields: (0, decorators_1.getRegisteredClaimsList)(claimNestedType).map((nestedClaim) => {
|
|
182
|
-
return this.mapClaimToApi(nestedClaim, claimNestedType);
|
|
183
|
-
}), vocabNamespace: nestedContextInfo.namespace, vocabName: nestedContextInfo.name }));
|
|
331
|
+
const nestedVcSchemaMetadata = (0, decorators_1.getVcSchemaMetadataOrThrow)(claimNestedType);
|
|
332
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'STRUCT', fields: (0, decorators_1.getRegisteredClaimsList)(claimNestedType).map((nestedClaim) => {
|
|
333
|
+
return this.mapClaimDescriptorToClaimsSchemaFieldItem(nestedClaim, claimNestedType);
|
|
334
|
+
}), jsonLdIri: undefined, jsonLdBaseIri: nestedVcSchemaMetadata.jsonLdBaseIri, jsonLdTermName: nestedVcSchemaMetadata.jsonLdTermName, jsonLdRelativeIriDelimiter: undefined }));
|
|
184
335
|
}
|
|
185
336
|
const tsDataType = claim.nestedType || (0, decorators_1.getTsDataTypeMetadata)(claimsModel, claim.name);
|
|
186
337
|
if (!tsDataType) {
|
|
@@ -188,20 +339,20 @@ class UdtClaims {
|
|
|
188
339
|
}
|
|
189
340
|
switch (tsDataType) {
|
|
190
341
|
case String:
|
|
191
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
342
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'STRING', enum: claim.enumValuesDescriptor, jsonLdIri: claim.jsonLdIri, jsonLdType: claim.jsonLdType }));
|
|
192
343
|
case Number:
|
|
193
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
344
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'NUMBER', jsonLdIri: claim.jsonLdIri, jsonLdType: claim.jsonLdType }));
|
|
194
345
|
case Boolean:
|
|
195
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
346
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'BOOLEAN', jsonLdIri: claim.jsonLdIri, jsonLdType: claim.jsonLdType }));
|
|
196
347
|
case models_1.Rfc3339Date:
|
|
197
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
348
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'DATE', jsonLdIri: claim.jsonLdIri, jsonLdType: claim.jsonLdType }));
|
|
198
349
|
case models_1.Rfc3339DateTime:
|
|
199
350
|
case Date:
|
|
200
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
351
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'DATETIME', jsonLdIri: claim.jsonLdIri, jsonLdType: claim.jsonLdType }));
|
|
201
352
|
case models_1.LinkedFile:
|
|
202
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
353
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'FILE' }));
|
|
203
354
|
case models_1.LinkedCredential:
|
|
204
|
-
return (0, converters_1.strictlyConvertToApiType)(serialization.
|
|
355
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchemaFieldsItem, Object.assign(Object.assign({}, draftBaseFieldValue), { kind: 'LINK', linkType: undefined }));
|
|
205
356
|
default:
|
|
206
357
|
throw new error_1.DocumentedError(error_1.ErrorCode.UnsupportedTypeInUDT, `Unsupported data type: ${tsDataType.name}. Please use one of the supported types.`);
|
|
207
358
|
}
|
|
@@ -211,28 +362,26 @@ class UdtClaims {
|
|
|
211
362
|
* for transmission.
|
|
212
363
|
*/
|
|
213
364
|
marshalValues(input) {
|
|
214
|
-
return this.
|
|
365
|
+
return this.convertUdtToCredentialClaimValues(this.claimsModel, input);
|
|
215
366
|
}
|
|
216
367
|
/**
|
|
217
368
|
* Unmarshalling is the reverse process of marshalling. It involves converting data from a serialized format back
|
|
218
369
|
* into an internal representation.
|
|
219
370
|
*/
|
|
220
371
|
unmarshalValuesToDraft(input) {
|
|
221
|
-
return this.
|
|
372
|
+
return this.convertCredentialClaimValuesToUdt(this.claimsModel, input);
|
|
222
373
|
}
|
|
223
374
|
unmarshalValuesToCredential(input) {
|
|
224
375
|
return this.convertApiValuesToUdt(this.claimsModel, input);
|
|
225
376
|
}
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
vocabName: vcContextMetadata.name,
|
|
235
|
-
vcType: vcContextMetadata.vcType,
|
|
377
|
+
getClaimsSchema() {
|
|
378
|
+
const vcSchemaMetadata = (0, decorators_1.getVcSchemaMetadataOrThrow)(this.claimsModel);
|
|
379
|
+
return (0, converters_1.strictlyConvertToApiType)(serialization.ClaimsSchema, {
|
|
380
|
+
fields: (0, decorators_1.getRegisteredClaimsList)(this.claimsModel).map((claim) => this.mapClaimDescriptorToClaimsSchemaFieldItem(claim, this.claimsModel)),
|
|
381
|
+
jsonLdBaseIri: vcSchemaMetadata.jsonLdBaseIri,
|
|
382
|
+
jsonLdIri: undefined,
|
|
383
|
+
jsonLdTermName: vcSchemaMetadata.jsonLdTermName,
|
|
384
|
+
jsonLdRelativeIriDelimiter: undefined,
|
|
236
385
|
});
|
|
237
386
|
}
|
|
238
387
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/documents/credential/claims.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAqD;AACrD,8CAMuB;AACvB,sCAAuF;AACvF,oCASkB;AAClB,oDAA8E;AAC9E,0CAA4D;AAC5D,6CAA0C;AAC1C,yCAAgD;AAEhD,wDAA+D;AAE/D,MAAa,SAAS;IAClB,YACc,MAAiB,EACjB,WAAoB;QADpB,WAAM,GAAN,MAAM,CAAW;QACjB,gBAAW,GAAX,WAAW,CAAS;IAC/B,CAAC;IAEI,aAAa,CACjB,KAAgB,EAChB,KAAW,EACX,YAAsE,EACtE,YAAe;QAEf,OAAO,IAAA,oCAAuB,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAChE,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC3B,MAAM,KAAK,GAAY,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC9C,IAAI,cAAuB,CAAC;gBAE5B,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;wBAChB,cAAc,GAAG,IAAI,CAAC;oBAC1B,CAAC;yBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC9B,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;4BAChC,OAAO,YAAY,CAAC,UAAU,EAAE,IAAI,CAA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O,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,cAAc;QACV,MAAM,iBAAiB,GAAG,IAAA,qCAAwB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAErE,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACrB,MAAM,IAAI,uBAAe,CACrB,iBAAS,CAAC,0BAA0B,EACpC,4GAA4G,CAC/G,CAAC;QACN,CAAC;QAED,OAAO,IAAA,qCAAwB,EAAC,aAAa,CAAC,WAAW,EAAE;YACvD,MAAM,EAAE,IAAA,oCAAuB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5D,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAC9C;YACD,cAAc,EAAE,iBAAiB,CAAC,SAAS;YAC3C,SAAS,EAAE,iBAAiB,CAAC,IAAI;YACjC,MAAM,EAAE,iBAAiB,CAAC,MAAM;SACnC,CAAC,CAAC;IACP,CAAC;CACJ;AApUD,8BAoUC","sourcesContent":["import { DraftSchema, DraftSchemaFieldsItem } from '../../api';\nimport * as serialization from '../../serialization';\nimport {\n ClaimDescriptor,\n getClaimJsonLdTypeMetadata,\n getContextJsonLdMetadata,\n getRegisteredClaimsList,\n getTsDataTypeMetadata,\n} from '../decorators';\nimport { LinkedCredential, LinkedFile, Rfc3339Date, Rfc3339DateTime } from '../models';\nimport {\n ApiClient,\n Claims,\n Ctor,\n isLinkedEntityDescriptor,\n isValueWithId,\n ReadClaims,\n ReadDraftClaims,\n UserUpdateClaims,\n} from '../types';\nimport { StrictPartial, strictlyConvertToApiType } from '../utils/converters';\nimport { DocumentedError, ErrorCode } from '../utils/error';\nimport { Credential } from './credential';\nimport { DraftCredential } from './draft/draft';\nimport { CredentialClaims, DraftFieldValue, Json } from './types';\nimport { VerifiableCredential } from './verifiable/verifiable';\n\nexport class UdtClaims<T extends Claims> {\n constructor(\n protected client: ApiClient,\n protected claimsModel: Ctor<T>,\n ) {}\n\n private processValues<K extends Claims>(\n model: Ctor<any>,\n input: Json,\n processValue: (descriptor: ClaimDescriptor, value: unknown) => unknown,\n initialValue: K,\n ): K {\n return getRegisteredClaimsList(model).reduce((result, descriptor) => {\n if (descriptor.name in input) {\n const value: unknown = input[descriptor.name];\n let processedValue: unknown;\n\n if (descriptor.isArray) {\n if (value == null) {\n processedValue = null;\n } else if (Array.isArray(value)) {\n processedValue = value.map((item) => {\n return processValue(descriptor, item);\n });\n } else {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Array\".`,\n );\n }\n } else {\n processedValue = processValue(descriptor, value);\n }\n Reflect.set(result, descriptor.name, processedValue);\n }\n\n return result;\n }, initialValue);\n }\n\n private getClaimTypeInfo(model: Ctor<any>, descriptor: ClaimDescriptor): Ctor<any> {\n const typeInfo = descriptor.nestedType ? descriptor.nestedType : getTsDataTypeMetadata(model, descriptor.name);\n\n if (typeInfo == null) {\n throw new Error(\n `Can't convert received value. Inconsistent data definition. Please reach out to support for assistance.`,\n );\n }\n\n return typeInfo;\n }\n\n /** convertApiValuesToUdt maps and converts the API received claims values to the UDT claims model */\n protected convertApiValuesToUdt<K extends Claims>(model: Ctor<any>, input: Json): K {\n const processValue = (descriptor: ClaimDescriptor, value: unknown): unknown => {\n if (value == null) {\n return null;\n }\n\n const typeInfo = this.getClaimTypeInfo(model, descriptor);\n\n if (isLinkedEntityDescriptor(value)) {\n if (typeInfo === LinkedCredential) {\n return new LinkedCredential(this.client, value.id, value.digestMultibase);\n }\n\n if (typeInfo === LinkedFile) {\n return new LinkedFile(this.client, value.id, value.digestMultibase);\n }\n }\n\n if (typeInfo === Date) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Date\".`,\n );\n }\n return new Date(value);\n }\n\n if (typeInfo === Rfc3339DateTime) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339DateTime\".`,\n );\n }\n return new Rfc3339DateTime(value);\n }\n\n if (typeInfo === Rfc3339Date) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339Date\".`,\n );\n }\n return new Rfc3339Date(value);\n }\n\n // Primitive values should be returned as-is\n if (Array.of<Ctor<any>>(String, Number, Boolean, Object).includes(typeInfo)) {\n return value;\n }\n\n if (!(value instanceof Object)) {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"${typeInfo.name}\".`,\n );\n }\n return this.convertApiValuesToUdt(typeInfo, value);\n };\n\n return this.processValues<K>(model, input, processValue, new model());\n }\n\n /** convertUdtToApiValues maps and converts the user received claims values onto UDT claims model */\n protected convertUdtToApiValues<K extends Claims>(model: Ctor<any>, input: K): CredentialClaims {\n const processValue = (descriptor: ClaimDescriptor, value: unknown): unknown => {\n if (value == null) {\n return null;\n }\n\n const typeInfo = this.getClaimTypeInfo(model, descriptor);\n\n if (typeInfo === LinkedCredential) {\n if (value instanceof LinkedCredential) {\n return value.toJSON();\n }\n\n if (\n value instanceof VerifiableCredential ||\n value instanceof DraftCredential ||\n value instanceof Credential\n ) {\n return value.toLinkedCredential().toJSON();\n }\n\n if (isValueWithId(value)) {\n return LinkedCredential.createClaimValue(value.id, value.digestMultibase);\n }\n }\n\n if (typeInfo === LinkedFile) {\n if (value instanceof LinkedFile) {\n return value.toJSON();\n }\n\n if (isValueWithId(value)) {\n return LinkedFile.createClaimValue(value.id, value.digestMultibase);\n }\n }\n\n if (\n Array.of<Ctor<any>>(\n String,\n Number,\n Date,\n Rfc3339DateTime,\n Rfc3339Date,\n Boolean,\n Object,\n Function,\n ).includes(typeInfo)\n ) {\n return value;\n }\n\n if (!(value instanceof Object)) {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"${typeInfo.name}\".`,\n );\n }\n return this.convertUdtToApiValues(typeInfo, value);\n };\n\n return this.processValues(model, input, processValue, {});\n }\n\n protected mapClaimToApi(claim: ClaimDescriptor, claimsModel: Ctor<any>): DraftSchemaFieldsItem {\n const claimJsonLdType = getClaimJsonLdTypeMetadata(claimsModel, claim.name);\n const draftBaseFieldValue: StrictPartial<DraftFieldValue> = {\n name: claim.name,\n title: claim.title,\n notEmpty: claim.notEmpty,\n isArray: claim.isArray || undefined,\n };\n\n if (\n claim.nestedType &&\n !Array.of<Ctor<any>>(\n String,\n Number,\n Date,\n Rfc3339DateTime,\n Rfc3339Date,\n Boolean,\n LinkedFile,\n LinkedCredential,\n ).includes(claim.nestedType)\n ) {\n const claimNestedType = claim.nestedType;\n const nestedContextInfo = getContextJsonLdMetadata(claimNestedType);\n\n if (!nestedContextInfo) {\n throw new DocumentedError(\n ErrorCode.VcContextAnnotationMissing,\n `The information about the VC context was not found in the \"${claimNestedType.name}\" model. Please use the \"@VcContext\" decorator to define the necessary information.`,\n );\n }\n\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'STRUCT',\n fields: getRegisteredClaimsList(claimNestedType).map((nestedClaim) => {\n return this.mapClaimToApi(nestedClaim, claimNestedType);\n }),\n vocabNamespace: nestedContextInfo.namespace,\n vocabName: nestedContextInfo.name,\n });\n }\n\n const tsDataType = claim.nestedType || getTsDataTypeMetadata(claimsModel, claim.name);\n\n if (!tsDataType) {\n throw new Error(\n `The information about the VC claim data type was not found for the \"${claim.name}\" property. Ensure that \"emitDecoratorMetadata\" is enabled in your \"tsconfig.json\".`,\n );\n }\n\n switch (tsDataType) {\n case String:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'STRING',\n type: claimJsonLdType,\n enum: claim.enumValuesDescriptor,\n });\n case Number:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'NUMBER',\n type: claimJsonLdType,\n });\n case Boolean:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'BOOLEAN',\n type: claimJsonLdType,\n });\n case Rfc3339Date:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'DATE',\n type: claimJsonLdType,\n });\n case Rfc3339DateTime:\n case Date:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'DATETIME',\n type: claimJsonLdType,\n });\n case LinkedFile:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'FILE',\n });\n case LinkedCredential:\n return strictlyConvertToApiType(serialization.DraftSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'LINK',\n linkType: undefined,\n });\n default:\n throw new DocumentedError(\n ErrorCode.UnsupportedTypeInUDT,\n `Unsupported data type: ${tsDataType.name}. Please use one of the supported types.`,\n );\n }\n }\n\n /**\n * Marshalling is the process of transforming the internal representation of values to a data format suitable\n * for transmission.\n */\n marshalValues(input: UserUpdateClaims<T>): Json {\n return this.convertUdtToApiValues(this.claimsModel, input);\n }\n\n /**\n * Unmarshalling is the reverse process of marshalling. It involves converting data from a serialized format back\n * into an internal representation.\n */\n unmarshalValuesToDraft(input: Json): ReadDraftClaims<T> {\n return this.convertApiValuesToUdt(this.claimsModel, input);\n }\n\n unmarshalValuesToCredential(input: Json): ReadClaims<T> {\n return this.convertApiValuesToUdt(this.claimsModel, input);\n }\n\n getDraftSchema(): DraftSchema {\n const vcContextMetadata = getContextJsonLdMetadata(this.claimsModel);\n\n if (!vcContextMetadata) {\n throw new DocumentedError(\n ErrorCode.VcContextAnnotationMissing,\n `Unable to find JSON-LD metadata. Make sure you have defined the claims model with the @VcContext decorator`,\n );\n }\n\n return strictlyConvertToApiType(serialization.DraftSchema, {\n fields: getRegisteredClaimsList(this.claimsModel).map((claim) =>\n this.mapClaimToApi(claim, this.claimsModel),\n ),\n vocabNamespace: vcContextMetadata.namespace,\n vocabName: vcContextMetadata.name,\n vcType: vcContextMetadata.vcType,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/documents/credential/claims.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAqD;AACrD,8CAKuB;AACvB,sCAAuF;AACvF,oCAUkB;AAClB,oDAA8E;AAC9E,0CAA4D;AAC5D,6CAA0C;AAC1C,yCAAgD;AAEhD,wDAA+D;AAE/D,MAAa,SAAS;IAClB,YACc,MAAiB,EACjB,WAAoB;QADpB,WAAM,GAAN,MAAM,CAAW;QACjB,gBAAW,GAAX,WAAW,CAAS;IAC/B,CAAC;IAEI,aAAa,CACjB,KAAgB,EAChB,KAAW,EACX,YAAsE,EACtE,YAAe;QAEf,OAAO,IAAA,oCAAuB,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAChE,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC3B,MAAM,KAAK,GAAY,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC9C,IAAI,cAAuB,CAAC;gBAE5B,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;wBAChB,cAAc,GAAG,IAAI,CAAC;oBAC1B,CAAC;yBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC9B,cAAc,GAAG,KAAK,CAAC,GAAG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2B,CAAC,KAAW;QACnC,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,eAAe;QACX,MAAM,gBAAgB,GAAG,IAAA,uCAA0B,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEtE,OAAO,IAAA,qCAAwB,EAAC,aAAa,CAAC,YAAY,EAAE;YACxD,MAAM,EAAE,IAAA,oCAAuB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5D,IAAI,CAAC,yCAAyC,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAC1E;YACD,aAAa,EAAE,gBAAgB,CAAC,aAAa;YAC7C,SAAS,EAAE,SAAS;YACpB,cAAc,EAAE,gBAAgB,CAAC,cAAc;YAC/C,0BAA0B,EAAE,SAAS;SACxC,CAAC,CAAC;IACP,CAAC;CACJ;AAthBD,8BAshBC","sourcesContent":["import { ClaimsSchema, ClaimsSchemaFieldsItem, CredentialClaimValue, CredentialClaimValues } from '../../api';\nimport * as serialization from '../../serialization';\nimport {\n ClaimDescriptor,\n getRegisteredClaimsList,\n getTsDataTypeMetadata,\n getVcSchemaMetadataOrThrow,\n} from '../decorators';\nimport { LinkedCredential, LinkedFile, Rfc3339Date, Rfc3339DateTime } from '../models';\nimport {\n ApiClient,\n Claims,\n Ctor,\n isLinkedEntityDescriptor,\n isValueWithDataId,\n isValueWithId,\n ReadClaims,\n ReadDraftClaims,\n UserUpdateClaims,\n} from '../types';\nimport { StrictPartial, strictlyConvertToApiType } from '../utils/converters';\nimport { DocumentedError, ErrorCode } from '../utils/error';\nimport { Credential } from './credential';\nimport { DraftCredential } from './draft/draft';\nimport { ClaimsSchemaFieldValue, Json } from './types';\nimport { VerifiableCredential } from './verifiable/verifiable';\n\nexport class UdtClaims<T extends Claims> {\n constructor(\n protected client: ApiClient,\n protected claimsModel: Ctor<T>,\n ) {}\n\n private processValues<K extends Claims>(\n model: Ctor<any>,\n input: Json,\n processValue: (descriptor: ClaimDescriptor, value: unknown) => unknown,\n initialValue: K,\n ): K {\n return getRegisteredClaimsList(model).reduce((result, descriptor) => {\n if (descriptor.name in input) {\n const value: unknown = input[descriptor.name];\n let processedValue: unknown;\n\n if (descriptor.isArray) {\n if (value == null) {\n processedValue = null;\n } else if (Array.isArray(value)) {\n processedValue = value.map((item) => {\n return processValue(descriptor, item);\n });\n } else {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Array\".`,\n );\n }\n } else {\n processedValue = processValue(descriptor, value);\n }\n Reflect.set(result, descriptor.name, processedValue);\n }\n\n return result;\n }, initialValue);\n }\n\n private processUdt<K extends Claims>(\n model: Ctor<any>,\n input: K,\n processValue: (descriptor: ClaimDescriptor, value: unknown) => CredentialClaimValue,\n initialValue: CredentialClaimValues,\n ): CredentialClaimValues {\n return getRegisteredClaimsList(model).reduce((result, descriptor) => {\n if (descriptor.name in input) {\n const value: unknown = input[descriptor.name];\n let processedValue: CredentialClaimValue | null;\n\n if (value == null) {\n return result;\n }\n if (descriptor.isArray) {\n if (Array.isArray(value)) {\n processedValue = {\n kind: 'ARRAY',\n value: value.map((item) => {\n return processValue(descriptor, item);\n }),\n };\n } else {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Array\".`,\n );\n }\n } else {\n processedValue = processValue(descriptor, value);\n }\n Reflect.set(result, descriptor.name, processedValue);\n }\n\n return result;\n }, initialValue);\n }\n\n private processCredentialClaimValues<K extends Claims>(\n model: Ctor<any>,\n input: CredentialClaimValues,\n processValue: (descriptor: ClaimDescriptor, value: CredentialClaimValue) => unknown,\n initialValue: K,\n ): K {\n return getRegisteredClaimsList(model).reduce((result, descriptor) => {\n if (descriptor.name in input) {\n const value = input[descriptor.name];\n let processedValue: unknown;\n\n if (descriptor.isArray) {\n if (value == null) {\n processedValue = null;\n } else if (value.kind === 'ARRAY') {\n processedValue = value.value.map((item) => {\n return processValue(descriptor, item);\n });\n } else {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Array\".`,\n );\n }\n } else {\n processedValue = processValue(descriptor, value);\n }\n Reflect.set(result, descriptor.name, processedValue);\n }\n\n return result;\n }, initialValue);\n }\n\n private getClaimTypeInfo(model: Ctor<any>, descriptor: ClaimDescriptor): Ctor<any> {\n const typeInfo = descriptor.nestedType ? descriptor.nestedType : getTsDataTypeMetadata(model, descriptor.name);\n\n if (typeInfo == null) {\n throw new Error(\n `Can't convert received value. Inconsistent data definition. Please reach out to support for assistance.`,\n );\n }\n\n return typeInfo;\n }\n\n /** convertCredentialClaimValuesToUdt maps and converts the API received claims values to the UDT claims model */\n protected convertCredentialClaimValuesToUdt<K extends Claims>(model: Ctor<any>, input: CredentialClaimValues): K {\n const processValue = (descriptor: ClaimDescriptor, value: CredentialClaimValue): unknown => {\n if (value == null) {\n return null;\n }\n\n const typeInfo = this.getClaimTypeInfo(model, descriptor);\n\n if (typeInfo === LinkedCredential) {\n if (value.kind !== 'LINK') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"LinkedCredential\".`,\n );\n }\n return new LinkedCredential(this.client, value.value.id, value.value.digestMultibase);\n }\n\n if (typeInfo === LinkedFile) {\n if (value.kind !== 'FILE') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"LinkedFile\".`,\n );\n }\n return new LinkedFile(this.client, value.value.id, value.value.digestMultibase);\n }\n\n if (typeInfo === Date) {\n if (value.kind !== 'DATETIME') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Date\".`,\n );\n }\n return new Date(value.value);\n }\n\n if (typeInfo === Rfc3339DateTime) {\n if (value.kind !== 'DATETIME') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339DateTime\".`,\n );\n }\n return new Rfc3339DateTime(value.value);\n }\n\n if (typeInfo === Rfc3339Date) {\n if (value.kind !== 'DATE') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339Date\".`,\n );\n }\n return new Rfc3339Date(value.value);\n }\n\n if (typeInfo === String) {\n if (value.kind !== 'STRING') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"string\".`,\n );\n }\n\n return value.value;\n }\n\n if (typeInfo === Number) {\n if (value.kind !== 'NUMBER') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"number\".`,\n );\n }\n\n return value.value;\n }\n\n if (typeInfo === Boolean) {\n if (value.kind !== 'BOOLEAN') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"boolean\".`,\n );\n }\n\n return value.value;\n }\n\n if (value.kind !== 'STRUCT') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"${typeInfo.name}\".`,\n );\n }\n\n return this.convertCredentialClaimValuesToUdt(typeInfo, value.value);\n };\n\n return this.processCredentialClaimValues<K>(model, input, processValue, new model());\n }\n\n /** convertApiValuesToUdt maps and converts the API received claims values to the UDT claims model */\n protected convertApiValuesToUdt<K extends Claims>(model: Ctor<any>, input: Json): K {\n const processValue = (descriptor: ClaimDescriptor, value: unknown): unknown => {\n if (value == null) {\n return null;\n }\n\n const typeInfo = this.getClaimTypeInfo(model, descriptor);\n\n if (isLinkedEntityDescriptor(value)) {\n if (typeInfo === LinkedCredential) {\n return new LinkedCredential(this.client, value.id, value.digestMultibase);\n }\n\n if (typeInfo === LinkedFile) {\n return new LinkedFile(this.client, value.id, value.digestMultibase);\n }\n }\n\n if (typeInfo === Date) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Date\".`,\n );\n }\n return new Date(value);\n }\n\n if (typeInfo === Rfc3339DateTime) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339DateTime\".`,\n );\n }\n return new Rfc3339DateTime(value);\n }\n\n if (typeInfo === Rfc3339Date) {\n if (typeof value !== 'string') {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"Rfc3339Date\".`,\n );\n }\n return new Rfc3339Date(value);\n }\n\n // Primitive values should be returned as-is\n if (Array.of<Ctor<any>>(String, Number, Boolean, Object).includes(typeInfo)) {\n return value;\n }\n\n if (!(value instanceof Object)) {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"${typeInfo.name}\".`,\n );\n }\n return this.convertApiValuesToUdt(typeInfo, value);\n };\n\n return this.processValues<K>(model, input, processValue, new model());\n }\n\n /** convertUdtToApiValues maps and converts the user received claims values onto UDT claims model */\n protected convertUdtToCredentialClaimValues<K extends Claims>(model: Ctor<any>, input: K): CredentialClaimValues {\n const processValue = (descriptor: ClaimDescriptor, value: unknown): CredentialClaimValue => {\n const typeInfo = this.getClaimTypeInfo(model, descriptor);\n\n if (typeInfo === LinkedCredential) {\n if (value instanceof LinkedCredential) {\n return value.toJSON();\n }\n\n if (\n value instanceof VerifiableCredential ||\n value instanceof DraftCredential ||\n value instanceof Credential\n ) {\n return value.toLinkedCredential().toJSON();\n }\n\n if (isValueWithId(value)) {\n return LinkedCredential.createCredentialClaimValue(value.id, value.digestMultibase);\n }\n\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n 'Invalid value for linked credential',\n );\n }\n\n if (typeInfo === LinkedFile) {\n if (value instanceof LinkedFile) {\n return value.toJSON();\n }\n\n if (isValueWithDataId(value)) {\n return LinkedFile.createCredentialClaimValue(value.data.id, value.data.digestMultibase);\n }\n\n if (isValueWithId(value)) {\n return LinkedFile.createCredentialClaimValue(value.id, value.digestMultibase);\n }\n\n throw new DocumentedError(ErrorCode.UnexpectedTypeInSerialization, 'Invalid value for linked file');\n }\n\n if (typeInfo === String && typeof value === 'string') {\n return {\n kind: 'STRING',\n value,\n };\n }\n\n if (typeInfo === Number && typeof value === 'number') {\n return {\n kind: 'NUMBER',\n value,\n };\n }\n\n if (typeInfo === Date && value instanceof Date) {\n return {\n kind: 'DATETIME',\n value,\n };\n }\n\n if (typeInfo === Rfc3339Date && value instanceof Rfc3339Date) {\n return {\n kind: 'DATE',\n value: value.toString(),\n };\n }\n\n if (typeInfo === Rfc3339DateTime && value instanceof Rfc3339DateTime) {\n return {\n kind: 'DATETIME',\n value: value.toDate(),\n };\n }\n\n if (typeInfo === Boolean && typeof value === 'boolean') {\n return {\n kind: 'BOOLEAN',\n value,\n };\n }\n\n if (!(value instanceof Object)) {\n throw new DocumentedError(\n ErrorCode.UnexpectedTypeInSerialization,\n `Can't convert received value as it has an unexpected type. The value is defined in UDT as \"${typeInfo.name}\".`,\n );\n }\n\n return {\n kind: 'STRUCT',\n value: this.convertUdtToCredentialClaimValues(typeInfo, value),\n };\n };\n return this.processUdt(model, input, processValue, {});\n }\n\n protected mapClaimDescriptorToClaimsSchemaFieldItem(\n claim: ClaimDescriptor,\n claimsModel: Ctor<any>,\n ): ClaimsSchemaFieldsItem {\n const draftBaseFieldValue: StrictPartial<ClaimsSchemaFieldValue> = {\n name: claim.name,\n title: claim.title,\n notEmpty: claim.notEmpty,\n isArray: claim.isArray || undefined,\n };\n\n if (\n claim.nestedType &&\n !Array.of<Ctor<any>>(\n String,\n Number,\n Date,\n Rfc3339DateTime,\n Rfc3339Date,\n Boolean,\n LinkedFile,\n LinkedCredential,\n ).includes(claim.nestedType)\n ) {\n const claimNestedType = claim.nestedType;\n const nestedVcSchemaMetadata = getVcSchemaMetadataOrThrow(claimNestedType);\n\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'STRUCT',\n fields: getRegisteredClaimsList(claimNestedType).map((nestedClaim) => {\n return this.mapClaimDescriptorToClaimsSchemaFieldItem(nestedClaim, claimNestedType);\n }),\n jsonLdIri: undefined,\n jsonLdBaseIri: nestedVcSchemaMetadata.jsonLdBaseIri,\n jsonLdTermName: nestedVcSchemaMetadata.jsonLdTermName,\n jsonLdRelativeIriDelimiter: undefined,\n });\n }\n\n const tsDataType = claim.nestedType || getTsDataTypeMetadata(claimsModel, claim.name);\n\n if (!tsDataType) {\n throw new Error(\n `The information about the VC claim data type was not found for the \"${claim.name}\" property. Ensure that \"emitDecoratorMetadata\" is enabled in your \"tsconfig.json\".`,\n );\n }\n\n switch (tsDataType) {\n case String:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'STRING',\n enum: claim.enumValuesDescriptor,\n jsonLdIri: claim.jsonLdIri,\n jsonLdType: claim.jsonLdType,\n });\n case Number:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'NUMBER',\n jsonLdIri: claim.jsonLdIri,\n jsonLdType: claim.jsonLdType,\n });\n case Boolean:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'BOOLEAN',\n jsonLdIri: claim.jsonLdIri,\n jsonLdType: claim.jsonLdType,\n });\n case Rfc3339Date:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'DATE',\n jsonLdIri: claim.jsonLdIri,\n jsonLdType: claim.jsonLdType,\n });\n case Rfc3339DateTime:\n case Date:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'DATETIME',\n jsonLdIri: claim.jsonLdIri,\n jsonLdType: claim.jsonLdType,\n });\n case LinkedFile:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'FILE',\n });\n case LinkedCredential:\n return strictlyConvertToApiType(serialization.ClaimsSchemaFieldsItem, {\n ...draftBaseFieldValue,\n kind: 'LINK',\n linkType: undefined,\n });\n default:\n throw new DocumentedError(\n ErrorCode.UnsupportedTypeInUDT,\n `Unsupported data type: ${tsDataType.name}. Please use one of the supported types.`,\n );\n }\n }\n\n /**\n * Marshalling is the process of transforming the internal representation of values to a data format suitable\n * for transmission.\n */\n marshalValues(input: UserUpdateClaims<T>): Claims {\n return this.convertUdtToCredentialClaimValues(this.claimsModel, input);\n }\n\n /**\n * Unmarshalling is the reverse process of marshalling. It involves converting data from a serialized format back\n * into an internal representation.\n */\n unmarshalValuesToDraft(input: CredentialClaimValues): ReadDraftClaims<T> {\n return this.convertCredentialClaimValuesToUdt(this.claimsModel, input);\n }\n\n unmarshalValuesToCredential(input: Json): ReadClaims<T> {\n return this.convertApiValuesToUdt(this.claimsModel, input);\n }\n\n getClaimsSchema(): ClaimsSchema {\n const vcSchemaMetadata = getVcSchemaMetadataOrThrow(this.claimsModel);\n\n return strictlyConvertToApiType(serialization.ClaimsSchema, {\n fields: getRegisteredClaimsList(this.claimsModel).map((claim) =>\n this.mapClaimDescriptorToClaimsSchemaFieldItem(claim, this.claimsModel),\n ),\n jsonLdBaseIri: vcSchemaMetadata.jsonLdBaseIri,\n jsonLdIri: undefined,\n jsonLdTermName: vcSchemaMetadata.jsonLdTermName,\n jsonLdRelativeIriDelimiter: undefined,\n });\n }\n}\n"]}
|