Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ozmap/ozn-sdk",
"version": "0.0.1-1075-4",
"version": "0.0.1-1066-4",
"description": "OZN SDK is a powerful tool for developers to build their own applications on top of OZN using TMForum pattern.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 0 additions & 2 deletions src/types/confirm-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { z } from 'zod';
export const ConfirmOrderInputSchema = z.object({
port: z.object({
idExternal: z.string(),
idArea: z.string(),
idOperator: z.string(),
nameExternal: z.string(),
}),
address: z.string(),
Expand Down
71 changes: 71 additions & 0 deletions src/types/service-inventory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { z } from 'zod';
import { geographicAddressOutputSchema } from './geographic-address';

const ResourceLocationSchema = z.object({
type: z.string(),
labelType: z.string(),
name: z.string(),
description: z.nullable(z.string()),
parentLocation: z.nullable(z.any()), // Assuming it can be null or a reference to another location
address: geographicAddressOutputSchema,
});

const CharacteristicSchema = z.object({
id: z.nullable(z.string()),
name: z.string(),
valueType: z.string(),
value: z.string(),
});

const ResourceSchema = z.object({
id: z.string(),
name: z.string(),
entityType: z.string(),
characteristic: z.array(CharacteristicSchema).nullable(),
resourceLocation: z.nullable(ResourceLocationSchema),
});

const SupportingResourceSchema = z.object({
id: z.string(),
entityType: z.string(),
name: z.nullable(z.string()),
role: z.nullable(z.string()),
resource: z.array(ResourceSchema).nullable(),
characteristic: z.array(CharacteristicSchema).nullable(),
supportingResource: z.nullable(z.any()), // Recursive, will define later
});

// Update SupportingResourceSchema to handle recursion
SupportingResourceSchema.partial().extend({
supportingResource: z.nullable(z.array(SupportingResourceSchema)),
});

const RelatedPartyPropertySchema = z.object({
name: z.string(),
value: z.string(),
});

const RelatedPartySchema = z.object({
role: z.string(),
property: z.array(RelatedPartyPropertySchema),
});

const PlaceSchema = z.object({
id: z.string(),
type: z.string(),
});

const ServiceSchema = z.object({
id: z.string(),
description: z.string(),
isServiceEnabled: z.boolean(),
name: z.string(),
serviceType: z.string(),
relatedParty: z.array(RelatedPartySchema),
place: z.array(PlaceSchema),
state: z.string(),
supportingResource: z.array(SupportingResourceSchema),
});

export const ServiceInventoryOutputSchema = z.array(ServiceSchema);
export type ServiceInventoryOutput = z.infer<typeof ServiceInventoryOutputSchema>;
2 changes: 1 addition & 1 deletion src/types/service-qualification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const RelatedEntitySchema = z.object({
const ServiceSchema = z.object({
serviceCharacteristic: z.array(CharacteristicSchema),
relatedEntity: z.array(RelatedEntitySchema),
iframeViability: z.boolean(),
iframeViability: z.string().optional(),
});

const ServiceQualificationItemSchema = z.object({
Expand Down
Loading