From 4dd5ee219ba87ece7eb91c7bf3c6c93a4340f9ec Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Tue, 9 Apr 2024 13:19:06 -0500 Subject: [PATCH] Add additional identity helpers --- .../packages/xns/plugins/record/src/Domain/Domain.ts | 12 +++++++++++- .../xns/plugins/record/src/Domain/DomainLease.ts | 12 +++++++++++- .../src/DomainRegistration/DomainRegistration.ts | 12 +++++++++++- .../DomainRegistration/DomainRegistrationLease.ts | 12 +++++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/packages/payload/packages/xns/plugins/record/src/Domain/Domain.ts b/packages/payload/packages/xns/plugins/record/src/Domain/Domain.ts index 2b7678b0d..60db023e7 100644 --- a/packages/payload/packages/xns/plugins/record/src/Domain/Domain.ts +++ b/packages/payload/packages/xns/plugins/record/src/Domain/Domain.ts @@ -1,4 +1,4 @@ -import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' +import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model' export type DomainSchema = 'network.xyo.ns.domain' export const DomainSchema: DomainSchema = 'network.xyo.ns.domain' @@ -32,3 +32,13 @@ export type Domain = Payload * Identity function for Domain payload */ export const isDomain = isPayloadOfSchemaType(DomainSchema) + +/** + * Identity function for Domain payload with sources + */ +export const isDomainWithSources = isPayloadOfSchemaTypeWithSources(DomainSchema) + +/** + * Identity function for Domain payload with meta + */ +export const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta(DomainSchema) diff --git a/packages/payload/packages/xns/plugins/record/src/Domain/DomainLease.ts b/packages/payload/packages/xns/plugins/record/src/Domain/DomainLease.ts index aaa5fa700..3116091d9 100644 --- a/packages/payload/packages/xns/plugins/record/src/Domain/DomainLease.ts +++ b/packages/payload/packages/xns/plugins/record/src/Domain/DomainLease.ts @@ -1,4 +1,4 @@ -import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' +import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model' import { DurationFields } from '../Duration' import { DomainFields } from './Domain' @@ -20,3 +20,13 @@ export type DomainLease = Payload * Identity function for DomainLease payload */ export const isDomainLease = isPayloadOfSchemaType(DomainLeaseSchema) + +/** + * Identity function for DomainLease payload with sources + */ +export const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources(DomainLeaseSchema) + +/** + * Identity function for DomainLease payload with meta + */ +export const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta(DomainLeaseSchema) diff --git a/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistration.ts b/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistration.ts index 1b00433a8..713b5c2e8 100644 --- a/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistration.ts +++ b/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistration.ts @@ -1,5 +1,5 @@ import { Address } from '@xylabs/hex' -import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' +import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model' import { DomainFields, DomainSchema } from '../Domain' @@ -26,3 +26,13 @@ export type DomainRegistration = Payload(DomainRegistrationSchema) + +/** + * Identity function for DomainRegistration payload with sources + */ +export const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources(DomainRegistrationSchema) + +/** + * Identity function for DomainRegistration payload with meta + */ +export const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta(DomainRegistrationSchema) diff --git a/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistrationLease.ts b/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistrationLease.ts index da8bc1dc3..d3ef006a9 100644 --- a/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistrationLease.ts +++ b/packages/payload/packages/xns/plugins/record/src/DomainRegistration/DomainRegistrationLease.ts @@ -1,4 +1,4 @@ -import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' +import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model' import { DurationFields } from '../Duration' import { DomainRegistrationFields, DomainRegistrationSchema } from './DomainRegistration' @@ -17,3 +17,13 @@ export type DomainRegistrationLease = Payload(DomainRegistrationLeaseSchema) + +/** + * Identity function for DomainRegistrationLease payload with sources + */ +export const isDomainRegistrationLeaseSources = isPayloadOfSchemaTypeWithSources(DomainRegistrationLeaseSchema) + +/** + * Identity function for DomainRegistrationLease payload with meta + */ +export const isDomainRegistrationLeaseMeta = isPayloadOfSchemaTypeWithMeta(DomainRegistrationLeaseSchema)