diff --git a/graphql.schema.json b/graphql.schema.json index d48854c..cfaa56c 100644 --- a/graphql.schema.json +++ b/graphql.schema.json @@ -6,6 +6,80 @@ "mutationType": null, "subscriptionType": null, "types": [ + { + "kind": "OBJECT", + "name": "AlternativeConnection", + "description": null, + "fields": [ + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AlternativeEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "The total count of all queryable objects for this schema listing", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AlternativeEdge", + "description": null, + "fields": [ + { + "name": "cursor", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "Boolean", @@ -35,6 +109,11 @@ "name": "property_object", "ofType": null }, + { + "kind": "OBJECT", + "name": "property_select", + "ofType": null + }, { "kind": "OBJECT", "name": "property_text", @@ -318,6 +397,184 @@ "name": "Query", "description": null, "fields": [ + { + "name": "getAlternative", + "description": null, + "args": [ + { + "name": "defaultLanguage", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullpath", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "getAlternativeListing", + "description": null, + "args": [ + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultLanguage", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "filter", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullpaths", + "description": "Comma separated list of fullpath", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ids", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "published", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sortBy", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sortOrder", + "description": "Sort by ASC or DESC, use the same position as the sortBy argument for each column to sort by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AlternativeConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "getProduct", "description": null, @@ -2502,15 +2759,40 @@ "deprecationReason": null }, { - "name": "filename", + "name": "dimensions", "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, + "args": [ + { + "name": "thumbnail", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "dimensions", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "filename", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, "deprecationReason": null }, { @@ -2529,6 +2811,18 @@ "name": "fullpath", "description": null, "args": [ + { + "name": "format", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "thumbnail", "description": null, @@ -4941,6 +5235,41 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "dimensions", + "description": null, + "fields": [ + { + "name": "height", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "INTERFACE", "name": "element", @@ -4963,6 +5292,11 @@ "interfaces": [], "enumValues": null, "possibleTypes": [ + { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + }, { "kind": "OBJECT", "name": "object_product", @@ -4992,7 +5326,7 @@ }, { "kind": "OBJECT", - "name": "element_metadata_item_621f7745f2ed6", + "name": "element_metadata_item_626823308bb9e", "description": null, "fields": [ { @@ -5081,6 +5415,11 @@ "interfaces": null, "enumValues": null, "possibleTypes": [ + { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + }, { "kind": "OBJECT", "name": "object_product", @@ -5108,6 +5447,287 @@ } ] }, + { + "kind": "OBJECT", + "name": "object_alternative", + "description": null, + "fields": [ + { + "name": "_siblings", + "description": null, + "args": [ + { + "name": "objectTypes", + "description": "list of object types (object, variant, folder)", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "object_tree", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bundlePath", + "description": null, + "args": [], + "type": { + "kind": "UNION", + "name": "object_alternative_bundlePath", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "children", + "description": null, + "args": [ + { + "name": "objectTypes", + "description": "list of object types (object, variant, folder)", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "object_tree", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "childrenSortBy", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "classname", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasPegs", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "index", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "modificationDate", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parent", + "description": null, + "args": [], + "type": { + "kind": "UNION", + "name": "object_tree", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "properties", + "description": null, + "args": [ + { + "name": "keys", + "description": "comma separated list of key names", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "ElementProperty", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tags", + "description": null, + "args": [ + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "element_tag", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "element", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "object_alternative_bundlePath", + "description": "pseudo class for field bundlePath", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "asset", + "ofType": null + } + ] + }, { "kind": "OBJECT", "name": "object_product", @@ -5146,6 +5766,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "alternative", + "description": null, + "args": [], + "type": { + "kind": "UNION", + "name": "object_product_alternative", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "alwaysDisplay", "description": null, @@ -5392,6 +6024,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "options", "description": null, @@ -5481,6 +6125,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "secondaryBundlePath", + "description": null, + "args": [], + "type": { + "kind": "UNION", + "name": "object_product_secondaryBundlePath", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "shortDescription", "description": null, @@ -5614,6 +6270,22 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "UNION", + "name": "object_product_alternative", + "description": "pseudo class for field alternative", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + } + ] + }, { "kind": "UNION", "name": "object_product_bundlePath", @@ -5656,7 +6328,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "element_metadata_item_621f7745f2ed6", + "name": "element_metadata_item_626823308bb9e", "ofType": null } }, @@ -5701,6 +6373,22 @@ } ] }, + { + "kind": "UNION", + "name": "object_product_secondaryBundlePath", + "description": "pseudo class for field secondaryBundlePath", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "asset", + "ofType": null + } + ] + }, { "kind": "UNION", "name": "object_product_spCategories", @@ -5932,6 +6620,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "parent", "description": null, @@ -6245,6 +6945,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "parent", "description": null, @@ -6574,6 +7286,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "parent", "description": null, @@ -6891,6 +7615,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "objectType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "parent", "description": null, @@ -7014,6 +7750,11 @@ "interfaces": null, "enumValues": null, "possibleTypes": [ + { + "kind": "OBJECT", + "name": "object_alternative", + "ofType": null + }, { "kind": "OBJECT", "name": "object_product", @@ -7135,6 +7876,53 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "property_select", + "description": null, + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "property_text", diff --git a/package-lock.json b/package-lock.json index 3e479af..6d33af4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5460,16 +5460,16 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } }, "mimic-fn": { diff --git a/package.json b/package.json index 96df5f2..d420692 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "graphql-middleware": "^6.0.10", "graphql-shield": "^7.5.0", "lodash": "^4.17.21", + "mime-types": "^2.1.35", "multer": "^1.4.3", "multer-s3": "^2.10.0", "nanoid": "^3.2.0", diff --git a/prisma/migrations/20220425145821_add_original_marathon_json_field/migration.sql b/prisma/migrations/20220425145821_add_original_marathon_json_field/migration.sql new file mode 100644 index 0000000..05161b7 --- /dev/null +++ b/prisma/migrations/20220425145821_add_original_marathon_json_field/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `Module` ADD COLUMN `originalMarathonProductJson` JSON; diff --git a/prisma/migrations/20220426145400_add_virtual_product_column/migration.sql b/prisma/migrations/20220426145400_add_virtual_product_column/migration.sql new file mode 100644 index 0000000..21e044d --- /dev/null +++ b/prisma/migrations/20220426145400_add_virtual_product_column/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `Module` ADD COLUMN `isVirtualProduct` BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/migrations/20220426150934_adds_owner_external_id/migration.sql b/prisma/migrations/20220426150934_adds_owner_external_id/migration.sql new file mode 100644 index 0000000..67478b6 --- /dev/null +++ b/prisma/migrations/20220426150934_adds_owner_external_id/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `Module` ADD COLUMN `ownerExternalId` VARCHAR(191); diff --git a/prisma/migrations/20220427142747_makes_owner_relationship/migration.sql b/prisma/migrations/20220427142747_makes_owner_relationship/migration.sql new file mode 100644 index 0000000..8b9091b --- /dev/null +++ b/prisma/migrations/20220427142747_makes_owner_relationship/migration.sql @@ -0,0 +1,2 @@ +-- AddForeignKey +ALTER TABLE `Module` ADD FOREIGN KEY (`ownerExternalId`) REFERENCES `Module`(`externalId`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20220427170908_adds_updatedat_to_list/migration.sql b/prisma/migrations/20220427170908_adds_updatedat_to_list/migration.sql new file mode 100644 index 0000000..025576c --- /dev/null +++ b/prisma/migrations/20220427170908_adds_updatedat_to_list/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE `List` ADD COLUMN `createdAt` DATETIME(0) DEFAULT CURRENT_TIMESTAMP(0), + ADD COLUMN `updatedAt` DATETIME(0) DEFAULT CURRENT_TIMESTAMP(0); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ec32663..3f6620d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -86,11 +86,13 @@ model FinishTranslations { } model List { - id Int @id @default(autoincrement()) - externalId String? @unique + id Int @id @default(autoincrement()) + externalId String? @unique name String? + createdAt DateTime? @default(now()) @db.DateTime(0) + updatedAt DateTime? @default(now()) @updatedAt @db.DateTime(0) projectId Int? - project Project? @relation(fields: [projectId], references: [id]) + project Project? @relation(fields: [projectId], references: [id]) } model ModuleAttachments { @@ -105,6 +107,8 @@ model Module { id Int @id @default(autoincrement()) partNumber String @unique externalId String? @unique + ownerExternalId String? + owner Module? @relation("ownerRelation", fields: [ownerExternalId], references: [externalId]) description String? thumbnailUrl String? @db.VarChar(255) bundleUrl String? @db.VarChar(255) @@ -113,6 +117,7 @@ model Module { isMat Boolean @default(false) isExtension Boolean @default(false) shouldHideBasedOnWidth Boolean @default(false) + isVirtualProduct Boolean @default(false) createdAt DateTime @default(now()) @db.DateTime(0) updatedAt DateTime @default(now()) @db.DateTime(0) alwaysDisplay Boolean @default(false) @@ -128,6 +133,7 @@ model Module { collectionId Int collection Collection @relation(fields: [collectionId], references: [id]) rules Json? + originalMarathonProductJson Json? projectModules ProjectModule[] moduleCategories ModuleCategory[] defaultLeftExtensionParents Module[] @relation("defaultLeftExtensionRelation") @@ -136,6 +142,7 @@ model Module { moduleAttachments ModuleAttachments[] @relation("module_moduleAttachments") moduleAttachedTo ModuleAttachments[] @relation("attachment_moduleAttachments") moduleType ModuleType[] + modulesIOwn Module[] @relation("ownerRelation") } model Project { diff --git a/prisma/seed.ts b/prisma/seed.ts index bf4a9f4..57fb2e3 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -7,226 +7,202 @@ const db = new PrismaClient(); const main = async () => { // -- Collections - await db.collection.createMany({ - data: seedValues.collections.map(({ slug, thumbnailUrl, hasPegs, isComingSoon }) => ({ - slug: slug.toLowerCase(), - thumbnailUrl, - isComingSoon: isComingSoon || false, - hasPegs: hasPegs || false - })) - }); - - const collections = await db.collection.findMany({ select: { id: true, slug: true } }); - - await db.collectionTranslations.createMany({ - data: seedValues.collections - .flatMap((x) => - x.translations.map((y) => ({ - ...y, - collectionSlug: x.slug.toLowerCase() - })) - ) - .map(({ locale, collectionSlug, ...collectionTranslation }) => ({ - locale: locale as Locale, - collectionId: collections.find((x) => x.slug === collectionSlug)?.id || -1, - ...collectionTranslation - })) - }); - + // await db.collection.createMany({ + // data: seedValues.collections.map(({ slug, thumbnailUrl, hasPegs, isComingSoon }) => ({ + // slug: slug.toLowerCase(), + // thumbnailUrl, + // isComingSoon: isComingSoon || false, + // hasPegs: hasPegs || false + // })) + // }); + // const collections = await db.collection.findMany({ select: { id: true, slug: true } }); + // await db.collectionTranslations.createMany({ + // data: seedValues.collections + // .flatMap((x) => + // x.translations.map((y) => ({ + // ...y, + // collectionSlug: x.slug.toLowerCase() + // })) + // ) + // .map(({ locale, collectionSlug, ...collectionTranslation }) => ({ + // locale: locale as Locale, + // collectionId: collections.find((x) => x.slug === collectionSlug)?.id || -1, + // ...collectionTranslation + // })) + // }); // -- Finishes - await db.finish.createMany({ - data: seedValues.finishes.map(({ name, thumbnailUrl }) => ({ - thumbnailUrl, - slug: helpers.slugify(name).toLowerCase() - })) - }); - - const finishes = await db.finish.findMany({ select: { id: true, slug: true } }); - - await db.finishTranslations.createMany({ - data: seedValues.finishes.map(({ name }) => ({ - locale: 'en' as Locale, - name, - finishId: finishes.find((x) => x.slug === helpers.slugify(name).toLowerCase())?.id || -1 - })) - }); - - // -- Collection finishes - await db.collectionFinishes.createMany({ - data: seedValues.collectionFinishes.map(({ collection, finish }) => ({ - finishId: finishes.find((x) => x.slug === helpers.slugify(finish).toLowerCase())?.id || -1, - collectionId: collections.find((x) => x.slug === collection)?.id || -1 - })) - }); - + // await db.finish.createMany({ + // data: seedValues.finishes.map(({ name, thumbnailUrl }) => ({ + // thumbnailUrl, + // slug: helpers.slugify(name).toLowerCase() + // })) + // }); + // const finishes = await db.finish.findMany({ select: { id: true, slug: true } }); + // await db.finishTranslations.createMany({ + // data: seedValues.finishes.map(({ name }) => ({ + // locale: 'en' as Locale, + // name, + // finishId: finishes.find((x) => x.slug === helpers.slugify(name).toLowerCase())?.id || -1 + // })) + // }); + // // -- Collection finishes + // await db.collectionFinishes.createMany({ + // data: seedValues.collectionFinishes.map(({ collection, finish }) => ({ + // finishId: finishes.find((x) => x.slug === helpers.slugify(finish).toLowerCase())?.id || -1, + // collectionId: collections.find((x) => x.slug === collection)?.id || -1 + // })) + // }); // -- Types - await db.type.createMany({ - data: seedValues.types.map(({ slug, thumbnailUrl, hasPegs }) => ({ - slug: slug.toLowerCase(), - thumbnailUrl, - hasPegs: hasPegs || false - })) - }); - - const types = await db.type.findMany({ select: { id: true, slug: true } }); - - await db.typeTranslations.createMany({ - data: seedValues.types - .flatMap((x) => - x.translations.map((y) => ({ - ...y, - typeSlug: x.slug.toLowerCase() - })) - ) - .map(({ locale, typeSlug, ...typeTranslation }) => ({ - locale: locale as Locale, - typeId: types.find((x) => x.slug === typeSlug)?.id || -1, - ...typeTranslation - })) - }); - + // await db.type.createMany({ + // data: seedValues.types.map(({ slug, thumbnailUrl, hasPegs }) => ({ + // slug: slug.toLowerCase(), + // thumbnailUrl, + // hasPegs: hasPegs || false + // })) + // }); + // const types = await db.type.findMany({ select: { id: true, slug: true } }); + // await db.typeTranslations.createMany({ + // data: seedValues.types + // .flatMap((x) => + // x.translations.map((y) => ({ + // ...y, + // typeSlug: x.slug.toLowerCase() + // })) + // ) + // .map(({ locale, typeSlug, ...typeTranslation }) => ({ + // locale: locale as Locale, + // typeId: types.find((x) => x.slug === typeSlug)?.id || -1, + // ...typeTranslation + // })) + // }); // -- Slides - - await db.slideSupplier.createMany({ - data: uniqBy(seedValues.slides, 'supplier').map((x) => ({ - slug: helpers.slugify(x.supplier).toLowerCase(), - thumbnailUrl: seedValues.supplierLogos.find((y) => y.supplier === helpers.slugify(x.supplier).toLowerCase()) - ?.supplierImgURL, - name: x.supplier - })) - }); - - const slideSuppliers = await db.slideSupplier.findMany({ select: { id: true, slug: true } }); - - const depths: ({ slug: string } & typeof seedValues['slides'][number]['depth'][number])[] = []; - - await db.slide.createMany({ - data: seedValues.slides.map(({ formula, product, collection, supplier, depth }) => { - const slug = helpers.slugify(`${supplier}-${product}-${collection}`).toLowerCase(); - depth.forEach((y) => depths.push({ slug, ...y })); - return { - slug, - formula, - product, - collectionId: collections.find((x) => x.slug === helpers.slugify(collection).toLowerCase())?.id || -1, - supplierId: slideSuppliers.find((x) => x.slug === helpers.slugify(supplier).toLowerCase())?.id || -1 - }; - }) - }); - - const slides = await db.slide.findMany({ select: { id: true, slug: true } }); - - await db.slideDepth.createMany({ - data: depths.map(({ slug, roundedValue, value }) => ({ - display: `${roundedValue}mm`, - depth: toNumber(value), - slideId: slides.find((x) => x.slug === slug)?.id || -1 - })) - }); - + // await db.slideSupplier.createMany({ + // data: uniqBy(seedValues.slides, 'supplier').map((x) => ({ + // slug: helpers.slugify(x.supplier).toLowerCase(), + // thumbnailUrl: seedValues.supplierLogos.find((y) => y.supplier === helpers.slugify(x.supplier).toLowerCase()) + // ?.supplierImgURL, + // name: x.supplier + // })) + // }); + // const slideSuppliers = await db.slideSupplier.findMany({ select: { id: true, slug: true } }); + // const depths: ({ slug: string } & typeof seedValues['slides'][number]['depth'][number])[] = []; + // await db.slide.createMany({ + // data: seedValues.slides.map(({ formula, product, collection, supplier, depth }) => { + // const slug = helpers.slugify(`${supplier}-${product}-${collection}`).toLowerCase(); + // depth.forEach((y) => depths.push({ slug, ...y })); + // return { + // slug, + // formula, + // product, + // collectionId: collections.find((x) => x.slug === helpers.slugify(collection).toLowerCase())?.id || -1, + // supplierId: slideSuppliers.find((x) => x.slug === helpers.slugify(supplier).toLowerCase())?.id || -1 + // }; + // }) + // }); + // const slides = await db.slide.findMany({ select: { id: true, slug: true } }); + // await db.slideDepth.createMany({ + // data: depths.map(({ slug, roundedValue, value }) => ({ + // display: `${roundedValue}mm`, + // depth: toNumber(value), + // slideId: slides.find((x) => x.slug === slug)?.id || -1 + // })) + // }); // -- Categories - await db.category.createMany({ - data: seedValues.categories.map(({ slug, name }) => ({ - name, - slug - })) - }); - - const categories = await db.category.findMany({ select: { id: true, slug: true } }); - + // await db.category.createMany({ + // data: seedValues.categories.map(({ slug, name }) => ({ + // name, + // slug + // })) + // }); + // const categories = await db.category.findMany({ select: { id: true, slug: true } }); // -- Modules - await db.module.createMany({ - data: seedValues.modules - .filter((x) => !!x.collection && !!x.finish) - .map( - ({ - partNumber, - rules, - finish, - collection, - isSubmodule, - hasPegs, - bundlePath, - imageUrl, - isMat, - shouldHideBasedOnWidth, - isExtension, - isEdge - }) => { - return { - thumbnailUrl: imageUrl, - partNumber, - bundleUrl: bundlePath, - isSubmodule, - hasPegs, - isMat, - isExtension, - shouldHideBasedOnWidth, - isEdge, - rules: rules ? JSON.parse(rules) : undefined, - collectionId: collections.find((x) => x.slug === helpers.slugify(collection).toLowerCase())?.id || -1, - finishId: finishes.find((x) => x.slug === helpers.slugify(finish).toLowerCase())?.id || -1 - }; - } - ) - }); - - const modules = await db.module.findMany({ select: { id: true, partNumber: true } }); - - await db.moduleType.createMany({ - data: seedValues.moduleTypes.map(({ partNumber, type }) => ({ - typeId: types.find((f) => f.slug === type)?.id || -1, - moduleId: modules.find((f) => f.partNumber === partNumber)?.id || -1 - })) - }); - - const moduleWithExtensions = seedValues.modules.filter((x) => x.defaultLeftExtension || x.defaultRightExtension); - for (const module of moduleWithExtensions) { - const extensionLeft = modules.find((x) => x.partNumber === module.defaultLeftExtension); - const extensionRight = modules.find((x) => x.partNumber === module.defaultRightExtension); - await db.module.update({ - where: { - partNumber: module.partNumber - }, - data: { - defaultLeftExtensionId: extensionLeft?.id || undefined, - defaultRightExtensionId: extensionRight?.id || undefined - } - }); - } - - const moduleWithAttachments = seedValues.modules.filter((x) => x.moduleAttachments || x.attachmentToAppend); - for (const module of moduleWithAttachments) { - const attachments = modules.filter((x) => moduleWithAttachments.some((y) => x.partNumber === y.partNumber)); - const appendAttachment = modules.find((x) => x.partNumber === module.attachmentToAppend); - await db.module.update({ - where: { - partNumber: module.partNumber - }, - data: { - attachmentToAppendId: appendAttachment?.id || undefined, - moduleAttachments: { - createMany: { - data: attachments.map((x) => ({ attachmentId: x.id })) - } - } - } - }); - } - - // Automatically puts modules in "all" category - const toCreate: { categoryId: number; moduleId: number }[] = []; - seedValues.modules.forEach((module) => { - module.categorySlug?.forEach((category) => { - toCreate.push({ - categoryId: categories.find((f) => f.slug === category)?.id || -1, - moduleId: modules.find((f) => f.partNumber === module.partNumber)?.id || -1 - }); - }); - }); - await db.moduleCategory.createMany({ - data: toCreate - }); + // await db.module.createMany({ + // data: seedValues.modules + // .filter((x) => !!x.collection && !!x.finish) + // .map( + // ({ + // partNumber, + // rules, + // finish, + // collection, + // isSubmodule, + // hasPegs, + // bundlePath, + // imageUrl, + // isMat, + // shouldHideBasedOnWidth, + // isExtension, + // isEdge + // }) => { + // return { + // thumbnailUrl: imageUrl, + // partNumber, + // bundleUrl: bundlePath, + // isSubmodule, + // hasPegs, + // isMat, + // isExtension, + // shouldHideBasedOnWidth, + // isEdge, + // rules: rules ? JSON.parse(rules) : undefined, + // collectionId: collections.find((x) => x.slug === helpers.slugify(collection).toLowerCase())?.id || -1, + // finishId: finishes.find((x) => x.slug === helpers.slugify(finish).toLowerCase())?.id || -1 + // }; + // } + // ) + // }); + // const modules = await db.module.findMany({ select: { id: true, partNumber: true } }); + // await db.moduleType.createMany({ + // data: seedValues.moduleTypes.map(({ partNumber, type }) => ({ + // typeId: types.find((f) => f.slug === type)?.id || -1, + // moduleId: modules.find((f) => f.partNumber === partNumber)?.id || -1 + // })) + // }); + // const moduleWithExtensions = seedValues.modules.filter((x) => x.defaultLeftExtension || x.defaultRightExtension); + // for (const module of moduleWithExtensions) { + // const extensionLeft = modules.find((x) => x.partNumber === module.defaultLeftExtension); + // const extensionRight = modules.find((x) => x.partNumber === module.defaultRightExtension); + // await db.module.update({ + // where: { + // partNumber: module.partNumber + // }, + // data: { + // defaultLeftExtensionId: extensionLeft?.id || undefined, + // defaultRightExtensionId: extensionRight?.id || undefined + // } + // }); + // } + // const moduleWithAttachments = seedValues.modules.filter((x) => x.moduleAttachments || x.attachmentToAppend); + // for (const module of moduleWithAttachments) { + // const attachments = modules.filter((x) => moduleWithAttachments.some((y) => x.partNumber === y.partNumber)); + // const appendAttachment = modules.find((x) => x.partNumber === module.attachmentToAppend); + // await db.module.update({ + // where: { + // partNumber: module.partNumber + // }, + // data: { + // attachmentToAppendId: appendAttachment?.id || undefined, + // moduleAttachments: { + // createMany: { + // data: attachments.map((x) => ({ attachmentId: x.id })) + // } + // } + // } + // }); + // } + // // Automatically puts modules in "all" category + // const toCreate: { categoryId: number; moduleId: number }[] = []; + // seedValues.modules.forEach((module) => { + // module.categorySlug?.forEach((category) => { + // toCreate.push({ + // categoryId: categories.find((f) => f.slug === category)?.id || -1, + // moduleId: modules.find((f) => f.partNumber === module.partNumber)?.id || -1 + // }); + // }); + // }); + // await db.moduleCategory.createMany({ + // data: toCreate + // }); }; let error = false; diff --git a/prisma/seedValues/seed.json b/prisma/seedValues/seed.json index 0f38e46..2594b12 100644 --- a/prisma/seedValues/seed.json +++ b/prisma/seedValues/seed.json @@ -3321,7 +3321,7 @@ }, { "partNumber": "04-AU-USHAPE-BIR-B", - "bundlePath": "modules/autograph/04-au-ushape-xxx-b/04-au-ushape-bir-b/module", + "bundlePath": "modules/autograph/04-au-xxx-ushape-b/04-au-bir-ushape-b/module", "finish": "birch", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-USHAPE-BIR-B\",\r\n \"finishes\": [\r\n \"04-AU-USHAPE-WAL-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true,\r\n \"options\": [\r\n \"04-AU-ACCENT-SW-141\",\r\n \"04-AU-ACCENT-MB-141\",\r\n \"04-AU-ACCENT-SD-141\",\r\n \"04-AU-ACCENT-AN-141\",\r\n \"04-AU-ACCENT-AU79-141\"\r\n ]\r\n }\r\n}", @@ -3329,13 +3329,41 @@ "hasPegs": false, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-USHAPE-xxx-B/04-AU-USHAPE-BIR-B/04-AU-USHAPE-BIR-B.jpg", - "genericName": "04-AU-USHAPE-xxx-B", + "imageUrl": "images/module/autograph/04-AU-xxx-USHAPE-B/04-AU-BIR-USHAPE-B/04-AU-BIR-USHAPE-B.jpg", + "genericName": "04-AU-xxx-USHAPE-B", + "categorySlug": ["all", "accessories"] + }, + { + "partNumber": "04-AU-BIR-USHAPE-B", + "bundlePath": "modules/autograph/04-au-xxx-ushape-b/04-au-bir-ushape-b/module", + "finish": "birch", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-USHAPE-BIR-B\",\r\n \"finishes\": [\r\n \"04-AU-USHAPE-WAL-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true,\r\n \"options\": [\r\n \"04-AU-ACCENT-SW-141\",\r\n \"04-AU-ACCENT-MB-141\",\r\n \"04-AU-ACCENT-SD-141\",\r\n \"04-AU-ACCENT-AN-141\",\r\n \"04-AU-ACCENT-AU79-141\"\r\n ]\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": false, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-USHAPE-B/04-AU-BIR-USHAPE-B/04-AU-BIR-USHAPE-B.jpg", + "genericName": "04-AU-xxx-USHAPE-B", "categorySlug": ["all", "accessories"] }, { "partNumber": "04-AU-USHAPE-WAL-B", - "bundlePath": "modules/autograph/04-au-ushape-xxx-b/04-au-ushape-wal-b/module", + "bundlePath": "modules/autograph/04-au-xxx-ushape-b/04-au-wal-ushape-b/module", + "finish": "walnut", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-USHAPE-WAL-B\",\r\n \"finishes\": [\r\n \"04-AU-USHAPE-BIR-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true,\r\n \"options\": [\r\n \"04-AU-ACCENT-SW-141\",\r\n \"04-AU-ACCENT-MB-141\",\r\n \"04-AU-ACCENT-SD-141\",\r\n \"04-AU-ACCENT-AN-141\",\r\n \"04-AU-ACCENT-AU79-141\"\r\n ]\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": false, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-USHAPE-B/04-AU-WAL-USHAPE-B/04-AU-WAL-USHAPE-B.jpg", + "genericName": "04-AU-xxx-USHAPE-B", + "categorySlug": ["all", "accessories"] + }, + { + "partNumber": "04-AU-WAL-USHAPE-B", + "bundlePath": "modules/autograph/04-au-xxx-ushape-b/04-au-wal-ushape-b/module", "finish": "walnut", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-USHAPE-WAL-B\",\r\n \"finishes\": [\r\n \"04-AU-USHAPE-BIR-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true,\r\n \"options\": [\r\n \"04-AU-ACCENT-SW-141\",\r\n \"04-AU-ACCENT-MB-141\",\r\n \"04-AU-ACCENT-SD-141\",\r\n \"04-AU-ACCENT-AN-141\",\r\n \"04-AU-ACCENT-AU79-141\"\r\n ]\r\n }\r\n}", @@ -3343,8 +3371,8 @@ "hasPegs": false, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-USHAPE-xxx-B/04-AU-USHAPE-WAL-B/04-AU-USHAPE-WAL-B.jpg", - "genericName": "04-AU-USHAPE-xxx-B", + "imageUrl": "images/module/autograph/04-AU-xxx-USHAPE-B/04-AU-WAL-USHAPE-B/04-AU-WAL-USHAPE-B.jpg", + "genericName": "04-AU-xxx-USHAPE-B", "categorySlug": ["all", "accessories"] }, { @@ -3376,7 +3404,7 @@ "categorySlug": ["all", "accessories"] }, { - "partNumber": "04-AU-BIR-CD-B.b", + "partNumber": "alt-04-au-bir-cd-b-b", "bundlePath": "modules/autograph/04-au-xxx-cd-b-b/04-au-bir-cd-b-b/module", "finish": "birch", "collection": "autograph", @@ -3390,7 +3418,7 @@ "categorySlug": ["all"] }, { - "partNumber": "04-AU-WAL-CD-B.b", + "partNumber": "alt-04-au-wal-cd-b-b", "bundlePath": "modules/autograph/04-au-xxx-cd-b-b/04-au-wal-cd-b-b/module", "finish": "walnut", "collection": "autograph", @@ -3461,7 +3489,7 @@ }, { "partNumber": "04-AU-BIR-DIVIDER-H55", - "bundlePath": "modules/autograph/04-au-xxx-divider-h55/module", + "bundlePath": "modules/autograph/04-au-xxx-divider-h55/04-au-bir-divider-h55/module", "finish": "birch", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-BIR-DIVIDER-H55\",\r\n \"finishes\": [\r\n \"04-AU-WAL-DIVIDER-H55\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"depth\": {\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3475,7 +3503,7 @@ }, { "partNumber": "04-AU-WAL-DIVIDER-H55", - "bundlePath": "modules/autograph/04-au-xxx-divider-h55/module", + "bundlePath": "modules/autograph/04-au-xxx-divider-h55/04-au-wal-divider-h55/module", "finish": "walnut", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-WAL-DIVIDER-H55\",\r\n \"finishes\": [\r\n \"04-AU-BIR-DIVIDER-H55\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 55,\r\n \"inches\": \"2\\\" 5/32\"\r\n },\r\n \"depth\": {\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3489,7 +3517,7 @@ }, { "partNumber": "04-AU-BIR-FLUTTED-B", - "bundlePath": "modules/autograph/04-au-xxx-flutted-b/04-au-bir-flutted-b/module", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b/04-au-bir-fluted-b/module", "finish": "birch", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-BIR-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-WAL-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3497,13 +3525,41 @@ "hasPegs": false, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-xxx-FLUTTED-B/04-AU-BIR-FLUTTED-B/04-AU-BIR-FLUTTED-B.jpg", - "genericName": "04-AU-xxx-FLUTTED-B", + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B/04-AU-BIR-FLUTED-B/04-AU-BIR-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B", + "categorySlug": ["all", "accessories"] + }, + { + "partNumber": "04-AU-BIR-FLUTED-B", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b/04-au-bir-fluted-b/module", + "finish": "birch", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-BIR-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-WAL-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": false, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B/04-AU-BIR-FLUTED-B/04-AU-BIR-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B", "categorySlug": ["all", "accessories"] }, { "partNumber": "04-AU-WAL-FLUTTED-B", - "bundlePath": "modules/autograph/04-au-xxx-flutted-b/04-au-wal-flutted-b/module", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b/04-au-wal-fluted-b/module", + "finish": "walnut", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-WAL-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-BIR-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": false, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B/04-AU-WAL-FLUTED-B/04-AU-WAL-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B", + "categorySlug": ["all", "accessories"] + }, + { + "partNumber": "04-AU-WAL-FLUTED-B", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b/04-au-wal-fluted-b/module", "finish": "walnut", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-WAL-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-BIR-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3511,13 +3567,13 @@ "hasPegs": false, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-xxx-FLUTTED-B/04-AU-WAL-FLUTTED-B/04-AU-WAL-FLUTTED-B.jpg", - "genericName": "04-AU-xxx-FLUTTED-B", + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B/04-AU-WAL-FLUTED-B/04-AU-WAL-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B", "categorySlug": ["all", "accessories"] }, { - "partNumber": "04-AU-BIR-FLUTTED-B.b", - "bundlePath": "modules/autograph/04-au-xxx-flutted-b-b/04-au-bir-flutted-b-b/module", + "partNumber": "alt-04-au-bir-flutted-b-b", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b-b/04-au-bir-fluted-b-b/module", "finish": "birch", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-BIR-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-WAL-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3525,13 +3581,41 @@ "hasPegs": true, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-xxx-FLUTTED-B.b/04-AU-BIR-FLUTTED-B.b/04-AU-BIR-FLUTTED-B.jpg", - "genericName": "04-AU-xxx-FLUTTED-B.b", + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B.b/04-AU-BIR-FLUTED-B.b/04-AU-BIR-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B.b", + "categorySlug": ["all"] + }, + { + "partNumber": "alt-04-au-bir-fluted-b-b", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b-b/04-au-bir-fluted-b-b/module", + "finish": "birch", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-BIR-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-WAL-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": true, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B.b/04-AU-BIR-FLUTED-B.b/04-AU-BIR-FLUTTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B.b", + "categorySlug": ["all"] + }, + { + "partNumber": "alt-04-au-wal-flutted-b-b", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b-b/04-au-wal-fluted-b-b/module", + "finish": "walnut", + "collection": "autograph", + "rules": "{\r\n \"partNumber\": \"04-AU-WAL-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-BIR-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", + "isSubmodule": false, + "hasPegs": true, + "isMat": false, + "isExtension": false, + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B.b/04-AU-WAL-FLUTED-B.b/04-AU-WAL-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B.b", "categorySlug": ["all"] }, { - "partNumber": "04-AU-WAL-FLUTTED-B.b", - "bundlePath": "modules/autograph/04-au-xxx-flutted-b-b/04-au-wal-flutted-b-b/module", + "partNumber": "alt-04-au-wal-fluted-b-b", + "bundlePath": "modules/autograph/04-au-xxx-fluted-b-b/04-au-wal-fluted-b-b/module", "finish": "walnut", "collection": "autograph", "rules": "{\r\n \"partNumber\": \"04-AU-WAL-FLUTTED-B\",\r\n \"finishes\": [\r\n \"04-AU-BIR-FLUTTED-B\"\r\n ],\r\n \"dimensions\": {\r\n \"height\": {\r\n \"millimeters\": 12,\r\n \"inches\": \"0\\\" 15/32\"\r\n },\r\n \"width\": {\r\n \"min\": {\r\n \"millimeters\": 138.5,\r\n \"inches\": \"5\\\" 7/16\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 152.4,\r\n \"inches\": \"6\\\"\"\r\n }\r\n },\r\n \"depth\": {\r\n \"min\": {\r\n \"millimeters\": 366,\r\n \"inches\": \"14\\\" 13/32\"\r\n },\r\n \"max\": {\r\n \"millimeters\": 589,\r\n \"inches\": \"23\\\" 3/16\"\r\n }\r\n }\r\n },\r\n \"rules\": {\r\n \"rotation\": 0,\r\n \"fullDepth\": true\r\n }\r\n}", @@ -3539,8 +3623,8 @@ "hasPegs": true, "isMat": false, "isExtension": false, - "imageUrl": "images/module/autograph/04-AU-xxx-FLUTTED-B.b/04-AU-WAL-FLUTTED-B.b/04-AU-WAL-FLUTTED-B.jpg", - "genericName": "04-AU-xxx-FLUTTED-B.b", + "imageUrl": "images/module/autograph/04-AU-xxx-FLUTED-B.b/04-AU-WAL-FLUTED-B.b/04-AU-WAL-FLUTED-B.jpg", + "genericName": "04-AU-xxx-FLUTED-B.b", "categorySlug": ["all"] }, { @@ -3572,7 +3656,7 @@ "categorySlug": ["all", "accessories"] }, { - "partNumber": "04-AU-BIR-KH-B.b", + "partNumber": "alt-04-au-bir-kh-b-b", "bundlePath": "modules/autograph/04-au-xxx-kh-b-b/04-au-bir-kh-b-b/module", "finish": "birch", "collection": "autograph", @@ -3586,7 +3670,7 @@ "categorySlug": ["all"] }, { - "partNumber": "04-AU-WAL-KH-B.b", + "partNumber": "alt-04-au-wal-kh-b-b", "bundlePath": "modules/autograph/04-au-xxx-kh-b-b/04-au-wal-kh-b-b/module", "finish": "walnut", "collection": "autograph", @@ -3684,7 +3768,7 @@ "categorySlug": ["all", "accessories"] }, { - "partNumber": "04-AU-BIR-SLOTTED-B.b", + "partNumber": "alt-04-au-bir-slotted-b-b", "bundlePath": "modules/autograph/04-au-xxx-slotted-b-b/04-au-bir-slotted-b-b/module", "finish": "birch", "collection": "autograph", @@ -3698,7 +3782,7 @@ "categorySlug": ["all"] }, { - "partNumber": "04-AU-WAL-SLOTTED-B.b", + "partNumber": "alt-04-au-wal-slotted-b-b", "bundlePath": "modules/autograph/04-au-xxx-slotted-b-b/04-au-wal-slotted-b-b/module", "finish": "walnut", "collection": "autograph", @@ -4031,6 +4115,16 @@ "imageUrl": "images/module/area/04-AREA-SP-CH/04-AREA-SP-CH.jpg", "genericName": "04-AREA-SP-CH", "shouldHideBasedOnWidth": true + }, + { + "partNumber": "04-AU-BIR-FILLER-1501200", + "bundlePath": "modules/autograph/04-au-xxx-filler-1501200/04-au-bir-filler-1501200/module", + "genericName": "04-AU-xxx-FILLER-1501200" + }, + { + "partNumber": "04-AU-WAL-FILLER-1501200", + "bundlePath": "modules/autograph/04-au-xxx-filler-1501200/04-au-wal-filler-1501200/module", + "genericName": "04-AU-xxx-FILLER-1501200" } ], "moduleTypes": [ @@ -4090,6 +4184,14 @@ "partNumber": "04-AU-WAL-FLUTTED-B", "type": "deep" }, + { + "partNumber": "04-AU-BIR-FLUTED-B", + "type": "deep" + }, + { + "partNumber": "04-AU-WAL-FLUTED-B", + "type": "deep" + }, { "partNumber": "04-AU-BIR-SLOTTED-B", "type": "deep" @@ -4390,6 +4492,14 @@ "partNumber": "04-AU-USHAPE-WAL-B", "type": "shallow" }, + { + "partNumber": "04-AU-BIR-USHAPE-B", + "type": "shallow" + }, + { + "partNumber": "04-AU-WAL-USHAPE-B", + "type": "shallow" + }, { "partNumber": "04-AU-LSHAPE600-AN", "type": "shallow" diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 74a595f..ca6db80 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -12,7 +12,20 @@ export type Scalars = { Float: number; }; -export type ElementProperty = Property_Checkbox | Property_Object | Property_Text; +export type AlternativeConnection = { + __typename?: 'AlternativeConnection'; + edges?: Maybe>>; + /** The total count of all queryable objects for this schema listing */ + totalCount?: Maybe; +}; + +export type AlternativeEdge = { + __typename?: 'AlternativeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type ElementProperty = Property_Checkbox | Property_Object | Property_Select | Property_Text; export type InputQuantityValue = { __typename?: 'InputQuantityValue'; @@ -60,6 +73,8 @@ export type QuantityValueUnit = { export type Query = { __typename?: 'Query'; + getAlternative?: Maybe; + getAlternativeListing?: Maybe; getProduct?: Maybe; getProductListing?: Maybe; getSpCategory?: Maybe; @@ -73,6 +88,26 @@ export type Query = { }; +export type QueryGetAlternativeArgs = { + defaultLanguage?: InputMaybe; + fullpath?: InputMaybe; + id?: InputMaybe; +}; + + +export type QueryGetAlternativeListingArgs = { + after?: InputMaybe; + defaultLanguage?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + fullpaths?: InputMaybe; + ids?: InputMaybe; + published?: InputMaybe; + sortBy?: InputMaybe>>; + sortOrder?: InputMaybe>>; +}; + + export type QueryGetProductArgs = { defaultLanguage?: InputMaybe; fullpath?: InputMaybe; @@ -230,6 +265,7 @@ export type Asset = { children?: Maybe>>; creationDate?: Maybe; data?: Maybe; + dimensions?: Maybe; filename?: Maybe; filesize?: Maybe; fullpath?: Maybe; @@ -251,7 +287,13 @@ export type AssetDataArgs = { }; +export type AssetDimensionsArgs = { + thumbnail?: InputMaybe; +}; + + export type AssetFullpathArgs = { + format?: InputMaybe; thumbnail?: InputMaybe; }; @@ -517,12 +559,18 @@ export type CsGroup = { name?: Maybe; }; +export type Dimensions = { + __typename?: 'dimensions'; + height?: Maybe; + width?: Maybe; +}; + export type Element = { id?: Maybe; }; -export type Element_Metadata_Item_621f7745f2ed6 = { - __typename?: 'element_metadata_item_621f7745f2ed6'; +export type Element_Metadata_Item_626823308bb9e = { + __typename?: 'element_metadata_item_626823308bb9e'; name?: Maybe; value?: Maybe; }; @@ -534,11 +582,53 @@ export type Element_Tag = { path?: Maybe; }; -export type Hotspot_Metadata_Object = Object_Product | Object_SpCategory | Object_SpCollection | Object_SpDrawerTypes | Object_SpFinish; +export type Hotspot_Metadata_Object = Object_Alternative | Object_Product | Object_SpCategory | Object_SpCollection | Object_SpDrawerTypes | Object_SpFinish; + +export type Object_Alternative = Element & { + __typename?: 'object_alternative'; + _siblings?: Maybe>>; + bundlePath?: Maybe; + children?: Maybe>>; + childrenSortBy?: Maybe; + classname?: Maybe; + hasPegs?: Maybe; + id?: Maybe; + index?: Maybe; + key?: Maybe; + modificationDate?: Maybe; + objectType?: Maybe; + parent?: Maybe; + properties?: Maybe>>; + tags?: Maybe>>; +}; + + +export type Object_Alternative_SiblingsArgs = { + objectTypes?: InputMaybe>>; +}; + + +export type Object_AlternativeChildrenArgs = { + objectTypes?: InputMaybe>>; +}; + + +export type Object_AlternativePropertiesArgs = { + keys?: InputMaybe>>; +}; + + +export type Object_AlternativeTagsArgs = { + name?: InputMaybe; +}; + +/** pseudo class for field bundlePath */ +export type Object_Alternative_BundlePath = Asset; export type Object_Product = Element & { __typename?: 'object_product'; _siblings?: Maybe>>; + alternative?: Maybe; alwaysDisplay?: Maybe; bundlePath?: Maybe; children?: Maybe>>; @@ -557,11 +647,13 @@ export type Object_Product = Element & { itemDescription?: Maybe; itemId?: Maybe; modificationDate?: Maybe; + objectType?: Maybe; options?: Maybe>>; p21Uid?: Maybe; parent?: Maybe; productPictures?: Maybe>>; properties?: Maybe>>; + secondaryBundlePath?: Maybe; shortDescription?: Maybe; shouldHideBasedOnWidth?: Maybe; spCategories?: Maybe>>; @@ -597,19 +689,25 @@ export type Object_ProductTagsArgs = { name?: InputMaybe; }; +/** pseudo class for field alternative */ +export type Object_Product_Alternative = Object_Alternative; + /** pseudo class for field bundlePath */ export type Object_Product_BundlePath = Asset; export type Object_Product_Finishes = { __typename?: 'object_product_finishes'; element?: Maybe; - metadata?: Maybe>>; + metadata?: Maybe>>; }; export type Object_Product_Options = Object_Product; export type Object_Product_ProductPictures = Asset; +/** pseudo class for field secondaryBundlePath */ +export type Object_Product_SecondaryBundlePath = Asset; + export type Object_Product_SpCategories = Object_SpCategory; /** pseudo class for field spCollection */ @@ -632,6 +730,7 @@ export type Object_SpCategory = Element & { key?: Maybe; modificationDate?: Maybe; name?: Maybe; + objectType?: Maybe; parent?: Maybe; properties?: Maybe>>; slug?: Maybe; @@ -674,6 +773,7 @@ export type Object_SpCollection = Element & { key?: Maybe; modificationDate?: Maybe; name?: Maybe; + objectType?: Maybe; parent?: Maybe; properties?: Maybe>>; slug?: Maybe; @@ -719,6 +819,7 @@ export type Object_SpDrawerTypes = Element & { key?: Maybe; modificationDate?: Maybe; name?: Maybe; + objectType?: Maybe; parent?: Maybe; properties?: Maybe>>; slug?: Maybe; @@ -763,6 +864,7 @@ export type Object_SpFinish = Element & { key?: Maybe; modificationDate?: Maybe; name?: Maybe; + objectType?: Maybe; parent?: Maybe; properties?: Maybe>>; slug?: Maybe; @@ -792,7 +894,7 @@ export type Object_SpFinishTagsArgs = { /** pseudo class for field image */ export type Object_SpFinish_Image = Asset; -export type Object_Tree = Object_Product | Object_SpCategory | Object_SpCollection | Object_SpDrawerTypes | Object_SpFinish; +export type Object_Tree = Object_Alternative | Object_Product | Object_SpCategory | Object_SpCollection | Object_SpDrawerTypes | Object_SpFinish; export type Property_Checkbox = { __typename?: 'property_checkbox'; @@ -808,6 +910,13 @@ export type Property_Object = { type?: Maybe; }; +export type Property_Select = { + __typename?: 'property_select'; + name?: Maybe; + text?: Maybe; + type?: Maybe; +}; + export type Property_Text = { __typename?: 'property_text'; name?: Maybe; @@ -845,7 +954,7 @@ export type SpFinishFragment = { __typename?: 'object_spFinish', id?: string | n export type ConfiguratorAttributesFragment = { __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null }; -export type ProductFragment = { __typename?: 'object_product', id?: string | null, childrenSortBy?: string | null, classname?: string | null, creationDate?: number | null, hasPegs?: boolean | null, index?: number | null, isMat?: boolean | null, isSubmodule?: boolean | null, itemDescription?: string | null, modificationDate?: number | null, p21Uid?: string | null, shortDescription?: string | null, shouldHideBasedOnWidth?: boolean | null, titleDescription?: string | null, isEdge?: boolean | null, alwaysDisplay?: boolean | null, partNumber?: string | null, productPictures?: Array<{ __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null> | null, properties?: Array<{ __typename?: 'property_checkbox', name?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'property_object', name?: string | null, type?: string | null, object?: { __typename?: 'object_product', id?: string | null, itemId?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null } | { __typename?: 'property_text', name?: string | null, type?: string | null, text?: string | null } | null> | null, tags?: Array<{ __typename?: 'element_tag', id?: string | null, name?: string | null, path?: string | null } | null> | null, spCategories?: Array<{ __typename?: 'object_spCategory', id?: string | null, name?: string | null, slug?: string | null } | null> | null, spCollection?: { __typename?: 'object_spCollection', id?: string | null, hasPegs?: boolean | null, slug?: string | null, subtitle?: string | null, description?: string | null, name?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null, spDrawerTypes?: Array<{ __typename?: 'object_spDrawerTypes', id?: string | null, name?: string | null, slug?: string | null, hasPegs?: boolean | null, description?: string | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null> | null, spFinish?: { __typename?: 'object_spFinish', id?: string | null, description?: string | null, name?: string | null, slug?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, filename?: string | null, fullpath?: string | null } | null } | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null, finishes?: Array<{ __typename?: 'object_product_finishes', element?: { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null, metadata?: Array<{ __typename?: 'element_metadata_item_621f7745f2ed6', name?: string | null } | null> | null } | null> | null, configuratorAttributes?: Array<{ __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null } | null> | null, options?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null> | null, children?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null> | null }; +export type ProductFragment = { __typename?: 'object_product', id?: string | null, childrenSortBy?: string | null, classname?: string | null, creationDate?: number | null, hasPegs?: boolean | null, index?: number | null, isMat?: boolean | null, isSubmodule?: boolean | null, itemDescription?: string | null, modificationDate?: number | null, p21Uid?: string | null, shortDescription?: string | null, shouldHideBasedOnWidth?: boolean | null, titleDescription?: string | null, isEdge?: boolean | null, alwaysDisplay?: boolean | null, partNumber?: string | null, alternative?: { __typename?: 'object_alternative', id?: string | null, hasPegs?: boolean | null, partNumber?: string | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null } | null, productPictures?: Array<{ __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null> | null, properties?: Array<{ __typename?: 'property_checkbox', name?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'property_object', name?: string | null, type?: string | null, object?: { __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, itemId?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null } | { __typename?: 'property_select' } | { __typename?: 'property_text', name?: string | null, type?: string | null, text?: string | null } | null> | null, tags?: Array<{ __typename?: 'element_tag', id?: string | null, name?: string | null, path?: string | null } | null> | null, spCategories?: Array<{ __typename?: 'object_spCategory', id?: string | null, name?: string | null, slug?: string | null } | null> | null, spCollection?: { __typename?: 'object_spCollection', id?: string | null, hasPegs?: boolean | null, slug?: string | null, subtitle?: string | null, description?: string | null, name?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null, spDrawerTypes?: Array<{ __typename?: 'object_spDrawerTypes', id?: string | null, name?: string | null, slug?: string | null, hasPegs?: boolean | null, description?: string | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null> | null, spFinish?: { __typename?: 'object_spFinish', id?: string | null, description?: string | null, name?: string | null, slug?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, filename?: string | null, fullpath?: string | null } | null } | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null, finishes?: Array<{ __typename?: 'object_product_finishes', element?: { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null, metadata?: Array<{ __typename?: 'element_metadata_item_626823308bb9e', name?: string | null } | null> | null } | null> | null, configuratorAttributes?: Array<{ __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null } | null> | null, options?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null> | null, children?: Array<{ __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null> | null }; export type GetSpCategoryListingQueryVariables = Exact<{ [key: string]: never; }>; @@ -894,9 +1003,16 @@ export type GetProductListingQueryVariables = Exact<{ }>; -export type GetProductListingQuery = { __typename?: 'Query', getProductListing?: { __typename?: 'ProductConnection', edges?: Array<{ __typename?: 'ProductEdge', node?: { __typename?: 'object_product', id?: string | null, childrenSortBy?: string | null, classname?: string | null, creationDate?: number | null, hasPegs?: boolean | null, index?: number | null, isMat?: boolean | null, isSubmodule?: boolean | null, itemDescription?: string | null, modificationDate?: number | null, p21Uid?: string | null, shortDescription?: string | null, shouldHideBasedOnWidth?: boolean | null, titleDescription?: string | null, isEdge?: boolean | null, alwaysDisplay?: boolean | null, partNumber?: string | null, productPictures?: Array<{ __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null> | null, properties?: Array<{ __typename?: 'property_checkbox', name?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'property_object', name?: string | null, type?: string | null, object?: { __typename?: 'object_product', id?: string | null, itemId?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null } | { __typename?: 'property_text', name?: string | null, type?: string | null, text?: string | null } | null> | null, tags?: Array<{ __typename?: 'element_tag', id?: string | null, name?: string | null, path?: string | null } | null> | null, spCategories?: Array<{ __typename?: 'object_spCategory', id?: string | null, name?: string | null, slug?: string | null } | null> | null, spCollection?: { __typename?: 'object_spCollection', id?: string | null, hasPegs?: boolean | null, slug?: string | null, subtitle?: string | null, description?: string | null, name?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null, spDrawerTypes?: Array<{ __typename?: 'object_spDrawerTypes', id?: string | null, name?: string | null, slug?: string | null, hasPegs?: boolean | null, description?: string | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null> | null, spFinish?: { __typename?: 'object_spFinish', id?: string | null, description?: string | null, name?: string | null, slug?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, filename?: string | null, fullpath?: string | null } | null } | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null, finishes?: Array<{ __typename?: 'object_product_finishes', element?: { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null, metadata?: Array<{ __typename?: 'element_metadata_item_621f7745f2ed6', name?: string | null } | null> | null } | null> | null, configuratorAttributes?: Array<{ __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null } | null> | null, options?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null> | null, children?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null> | null } | null } | null> | null } | null }; +export type GetProductListingQuery = { __typename?: 'Query', getProductListing?: { __typename?: 'ProductConnection', edges?: Array<{ __typename?: 'ProductEdge', node?: { __typename?: 'object_product', id?: string | null, childrenSortBy?: string | null, classname?: string | null, creationDate?: number | null, hasPegs?: boolean | null, index?: number | null, isMat?: boolean | null, isSubmodule?: boolean | null, itemDescription?: string | null, modificationDate?: number | null, p21Uid?: string | null, shortDescription?: string | null, shouldHideBasedOnWidth?: boolean | null, titleDescription?: string | null, isEdge?: boolean | null, alwaysDisplay?: boolean | null, partNumber?: string | null, alternative?: { __typename?: 'object_alternative', id?: string | null, hasPegs?: boolean | null, partNumber?: string | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null } | null, productPictures?: Array<{ __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null> | null, properties?: Array<{ __typename?: 'property_checkbox', name?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'property_object', name?: string | null, type?: string | null, object?: { __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, itemId?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null } | { __typename?: 'property_select' } | { __typename?: 'property_text', name?: string | null, type?: string | null, text?: string | null } | null> | null, tags?: Array<{ __typename?: 'element_tag', id?: string | null, name?: string | null, path?: string | null } | null> | null, spCategories?: Array<{ __typename?: 'object_spCategory', id?: string | null, name?: string | null, slug?: string | null } | null> | null, spCollection?: { __typename?: 'object_spCollection', id?: string | null, hasPegs?: boolean | null, slug?: string | null, subtitle?: string | null, description?: string | null, name?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null, spDrawerTypes?: Array<{ __typename?: 'object_spDrawerTypes', id?: string | null, name?: string | null, slug?: string | null, hasPegs?: boolean | null, description?: string | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null> | null, spFinish?: { __typename?: 'object_spFinish', id?: string | null, description?: string | null, name?: string | null, slug?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, filename?: string | null, fullpath?: string | null } | null } | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null, finishes?: Array<{ __typename?: 'object_product_finishes', element?: { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null, metadata?: Array<{ __typename?: 'element_metadata_item_626823308bb9e', name?: string | null } | null> | null } | null> | null, configuratorAttributes?: Array<{ __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null } | null> | null, options?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null> | null, children?: Array<{ __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null> | null } | null } | null> | null } | null }; export type GetProductStatusQueryVariables = Exact<{ [key: string]: never; }>; export type GetProductStatusQuery = { __typename?: 'Query', getProductListing?: { __typename?: 'ProductConnection', edges?: Array<{ __typename?: 'ProductEdge', node?: { __typename?: 'object_product', id?: string | null } | null } | null> | null } | null }; + +export type GetProductQueryVariables = Exact<{ + id?: InputMaybe; +}>; + + +export type GetProductQuery = { __typename?: 'Query', getProduct?: { __typename?: 'object_product', id?: string | null, childrenSortBy?: string | null, classname?: string | null, creationDate?: number | null, hasPegs?: boolean | null, index?: number | null, isMat?: boolean | null, isSubmodule?: boolean | null, itemDescription?: string | null, modificationDate?: number | null, p21Uid?: string | null, shortDescription?: string | null, shouldHideBasedOnWidth?: boolean | null, titleDescription?: string | null, isEdge?: boolean | null, alwaysDisplay?: boolean | null, partNumber?: string | null, alternative?: { __typename?: 'object_alternative', id?: string | null, hasPegs?: boolean | null, partNumber?: string | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null } | null, productPictures?: Array<{ __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null> | null, properties?: Array<{ __typename?: 'property_checkbox', name?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'property_object', name?: string | null, type?: string | null, object?: { __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, itemId?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null } | { __typename?: 'property_select' } | { __typename?: 'property_text', name?: string | null, type?: string | null, text?: string | null } | null> | null, tags?: Array<{ __typename?: 'element_tag', id?: string | null, name?: string | null, path?: string | null } | null> | null, spCategories?: Array<{ __typename?: 'object_spCategory', id?: string | null, name?: string | null, slug?: string | null } | null> | null, spCollection?: { __typename?: 'object_spCollection', id?: string | null, hasPegs?: boolean | null, slug?: string | null, subtitle?: string | null, description?: string | null, name?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null, spDrawerTypes?: Array<{ __typename?: 'object_spDrawerTypes', id?: string | null, name?: string | null, slug?: string | null, hasPegs?: boolean | null, description?: string | null, image?: { __typename?: 'asset', id?: string | null, fullpath?: string | null } | null } | null> | null, spFinish?: { __typename?: 'object_spFinish', id?: string | null, description?: string | null, name?: string | null, slug?: string | null, isComingSoon?: boolean | null, image?: { __typename?: 'asset', id?: string | null, filename?: string | null, fullpath?: string | null } | null } | null, bundlePath?: { __typename?: 'asset', id?: string | null, creationDate?: number | null, fullpath?: string | null, mimetype?: string | null, modificationDate?: number | null, type?: string | null, filesize?: number | null, metadata?: Array<{ __typename?: 'asset_metadata_item', name?: string | null, type?: string | null, data?: string | null, language?: string | null } | null> | null } | null, finishes?: Array<{ __typename?: 'object_product_finishes', element?: { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null, metadata?: Array<{ __typename?: 'element_metadata_item_626823308bb9e', name?: string | null } | null> | null } | null> | null, configuratorAttributes?: Array<{ __typename?: 'csGroup', id?: number | null, description?: string | null, features?: Array<{ __typename?: 'csFeatureBooleanSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCalculatedValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, calculatedvalue?: string | null } | { __typename?: 'csFeatureCheckbox', id?: number | null, name?: string | null, description?: string | null, type?: string | null, checked?: boolean | null } | { __typename?: 'csFeatureCountry', id?: number | null, name?: string | null, description?: string | null, type?: string | null, country?: string | null } | { __typename?: 'csFeatureCountryMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, countries?: Array | null } | { __typename?: 'csFeatureDate', id?: number | null, name?: string | null, description?: string | null, type?: string | null, date?: string | null } | { __typename?: 'csFeatureDatetime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, datetime?: string | null } | { __typename?: 'csFeatureInput', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureInputQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, inputquantityvalue?: { __typename?: 'InputQuantityValue', value?: string | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureLanguage', id?: number | null, name?: string | null, description?: string | null, type?: string | null, language?: string | null } | { __typename?: 'csFeatureLangugeMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, languages?: Array | null } | { __typename?: 'csFeatureMultiselect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selections?: Array | null } | { __typename?: 'csFeatureNumeric', id?: number | null, name?: string | null, description?: string | null, type?: string | null, number?: string | null } | { __typename?: 'csFeatureQuantityValue', id?: number | null, name?: string | null, description?: string | null, type?: string | null, quantityvalue?: { __typename?: 'QuantityValue', value?: number | null, unit?: { __typename?: 'QuantityValueUnit', id?: string | null, abbreviation?: string | null, longname?: string | null } | null } | null } | { __typename?: 'csFeatureRgbaColor', id?: number | null, name?: string | null, description?: string | null, type?: string | null, color?: string | null } | { __typename?: 'csFeatureSelect', id?: number | null, name?: string | null, description?: string | null, type?: string | null, selection?: string | null } | { __typename?: 'csFeatureSlider', id?: number | null, name?: string | null, description?: string | null, type?: string | null, slidervalue?: string | null } | { __typename?: 'csFeatureTextarea', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | { __typename?: 'csFeatureTime', id?: number | null, name?: string | null, description?: string | null, type?: string | null, time?: string | null } | { __typename?: 'csFeatureWysiwyg', id?: number | null, name?: string | null, description?: string | null, type?: string | null, text?: string | null } | null> | null } | null> | null, options?: Array<{ __typename?: 'object_product', id?: string | null, partNumber?: string | null } | null> | null, children?: Array<{ __typename?: 'object_alternative' } | { __typename?: 'object_product', id?: string | null, partNumber?: string | null } | { __typename?: 'object_spCategory' } | { __typename?: 'object_spCollection' } | { __typename?: 'object_spDrawerTypes' } | { __typename?: 'object_spFinish' } | null> | null } | null }; diff --git a/src/generated/nexus-prisma.d.ts b/src/generated/nexus-prisma.d.ts index 435bf55..5586d50 100644 --- a/src/generated/nexus-prisma.d.ts +++ b/src/generated/nexus-prisma.d.ts @@ -67,16 +67,16 @@ interface NexusPrismaInputs { ordering: 'id' | 'locale' | 'name' | 'description' | 'finishId' } lists: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'externalId' | 'name' | 'projectId' | 'project' - ordering: 'id' | 'externalId' | 'name' | 'projectId' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'externalId' | 'name' | 'createdAt' | 'updatedAt' | 'projectId' | 'project' + ordering: 'id' | 'externalId' | 'name' | 'createdAt' | 'updatedAt' | 'projectId' } moduleAttachments: { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'moduleId' | 'module' | 'attachmentId' | 'attachment' ordering: 'id' | 'moduleId' | 'attachmentId' } modules: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } projects: { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'slug' | 'title' | 'cabinetWidth' | 'calculatedWidth' | 'gable' | 'typeId' | 'hasPegs' | 'type' | 'collectionId' | 'collection' | 'finishId' | 'finish' | 'slideId' | 'slide' | 'slideDepthId' | 'slideDepth' | 'userId' | 'user' | 'projectModules' | 'lists' @@ -138,8 +138,8 @@ interface NexusPrismaInputs { ordering: 'id' | 'slug' | 'title' | 'cabinetWidth' | 'calculatedWidth' | 'gable' | 'typeId' | 'hasPegs' | 'collectionId' | 'finishId' | 'slideId' | 'slideDepthId' | 'userId' } modules: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } collectionFinishes: { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'collectionId' | 'collection' | 'finishId' | 'finish' @@ -166,8 +166,8 @@ interface NexusPrismaInputs { ordering: 'id' | 'slug' | 'title' | 'cabinetWidth' | 'calculatedWidth' | 'gable' | 'typeId' | 'hasPegs' | 'collectionId' | 'finishId' | 'slideId' | 'slideDepthId' | 'userId' } modules: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } collectionFinishes: { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'collectionId' | 'collection' | 'finishId' | 'finish' @@ -193,16 +193,16 @@ interface NexusPrismaInputs { ordering: 'id' | 'moduleId' | 'categoryId' } defaultLeftExtensionParents: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } defaultRightExtensionParents: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } attachmentToAppendParents: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' - ordering: 'id' | 'partNumber' | 'externalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' } moduleAttachments: { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'moduleId' | 'module' | 'attachmentId' | 'attachment' @@ -216,6 +216,10 @@ interface NexusPrismaInputs { filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'typeId' | 'moduleId' | 'type' | 'module' ordering: 'id' | 'typeId' | 'moduleId' } + modulesIOwn: { + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'owner' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultLeftExtension' | 'defaultRightExtensionId' | 'defaultRightExtension' | 'attachmentToAppendId' | 'attachmentToAppend' | 'finishId' | 'finish' | 'collectionId' | 'collection' | 'rules' | 'originalMarathonProductJson' | 'projectModules' | 'moduleCategories' | 'defaultLeftExtensionParents' | 'defaultRightExtensionParents' | 'attachmentToAppendParents' | 'moduleAttachments' | 'moduleAttachedTo' | 'moduleType' | 'modulesIOwn' + ordering: 'id' | 'partNumber' | 'externalId' | 'ownerExternalId' | 'description' | 'thumbnailUrl' | 'bundleUrl' | 'isSubmodule' | 'hasPegs' | 'isMat' | 'isExtension' | 'shouldHideBasedOnWidth' | 'isVirtualProduct' | 'createdAt' | 'updatedAt' | 'alwaysDisplay' | 'isEdge' | 'defaultLeftExtensionId' | 'defaultRightExtensionId' | 'attachmentToAppendId' | 'finishId' | 'collectionId' | 'rules' | 'originalMarathonProductJson' + } } Project: { projectModules: { @@ -223,8 +227,8 @@ interface NexusPrismaInputs { ordering: 'id' | 'nanoId' | 'posX' | 'posY' | 'posZ' | 'rotY' | 'moduleId' | 'parentId' | 'parentNanoId' | 'projectId' } lists: { - filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'externalId' | 'name' | 'projectId' | 'project' - ordering: 'id' | 'externalId' | 'name' | 'projectId' + filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'externalId' | 'name' | 'createdAt' | 'updatedAt' | 'projectId' | 'project' + ordering: 'id' | 'externalId' | 'name' | 'createdAt' | 'updatedAt' | 'projectId' } } ProjectModule: { @@ -522,6 +526,8 @@ interface NexusPrismaOutputs { id: 'Int' externalId: 'String' name: 'String' + createdAt: 'DateTime' + updatedAt: 'DateTime' projectId: 'Int' project: 'Project' } @@ -536,6 +542,8 @@ interface NexusPrismaOutputs { id: 'Int' partNumber: 'String' externalId: 'String' + ownerExternalId: 'String' + owner: 'Module' description: 'String' thumbnailUrl: 'String' bundleUrl: 'String' @@ -544,6 +552,7 @@ interface NexusPrismaOutputs { isMat: 'Boolean' isExtension: 'Boolean' shouldHideBasedOnWidth: 'Boolean' + isVirtualProduct: 'Boolean' createdAt: 'DateTime' updatedAt: 'DateTime' alwaysDisplay: 'Boolean' @@ -559,6 +568,7 @@ interface NexusPrismaOutputs { collectionId: 'Int' collection: 'Collection' rules: 'Json' + originalMarathonProductJson: 'Json' projectModules: 'ProjectModule' moduleCategories: 'ModuleCategory' defaultLeftExtensionParents: 'Module' @@ -567,6 +577,7 @@ interface NexusPrismaOutputs { moduleAttachments: 'ModuleAttachments' moduleAttachedTo: 'ModuleAttachments' moduleType: 'ModuleType' + modulesIOwn: 'Module' } Project: { id: 'Int' diff --git a/src/generated/nexus.d.ts b/src/generated/nexus.d.ts index 9c9913f..75b65c3 100644 --- a/src/generated/nexus.d.ts +++ b/src/generated/nexus.d.ts @@ -602,6 +602,17 @@ export interface NexusGenInputs { not?: NexusGenInputs['NestedDateTimeFilter'] | null; // NestedDateTimeFilter notIn?: NexusGenScalars['DateTime'][] | null; // [DateTime!] }; + DateTimeNullableFilter: { + // input type + equals?: NexusGenScalars['DateTime'] | null; // DateTime + gt?: NexusGenScalars['DateTime'] | null; // DateTime + gte?: NexusGenScalars['DateTime'] | null; // DateTime + in?: NexusGenScalars['DateTime'][] | null; // [DateTime!] + lt?: NexusGenScalars['DateTime'] | null; // DateTime + lte?: NexusGenScalars['DateTime'] | null; // DateTime + not?: NexusGenInputs['NestedDateTimeNullableFilter'] | null; // NestedDateTimeNullableFilter + notIn?: NexusGenScalars['DateTime'][] | null; // [DateTime!] + }; EnumLocaleFieldUpdateOperationsInput: { // input type set?: NexusGenEnums['Locale'] | null; // Locale @@ -938,9 +949,11 @@ export interface NexusGenInputs { }; ListCreateManyProjectInput: { // input type + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime externalId?: string | null; // String id?: number | null; // Int name?: string | null; // String + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime }; ListCreateManyProjectInputEnvelope: { // input type @@ -961,8 +974,10 @@ export interface NexusGenInputs { }; ListCreateWithoutProjectInput: { // input type + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime externalId?: string | null; // String name?: string | null; // String + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime }; ListListRelationFilter: { // input type @@ -975,15 +990,19 @@ export interface NexusGenInputs { AND?: NexusGenInputs['ListScalarWhereInput'][] | null; // [ListScalarWhereInput!] NOT?: NexusGenInputs['ListScalarWhereInput'][] | null; // [ListScalarWhereInput!] OR?: NexusGenInputs['ListScalarWhereInput'][] | null; // [ListScalarWhereInput!] + createdAt?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter externalId?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter id?: NexusGenInputs['IntFilter'] | null; // IntFilter name?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter projectId?: NexusGenInputs['IntNullableFilter'] | null; // IntNullableFilter + updatedAt?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter }; ListUpdateManyMutationInput: { // input type + createdAt?: NexusGenInputs['NullableDateTimeFieldUpdateOperationsInput'] | null; // NullableDateTimeFieldUpdateOperationsInput externalId?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput name?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + updatedAt?: NexusGenInputs['NullableDateTimeFieldUpdateOperationsInput'] | null; // NullableDateTimeFieldUpdateOperationsInput }; ListUpdateManyWithWhereWithoutProjectInput: { // input type @@ -1011,8 +1030,10 @@ export interface NexusGenInputs { }; ListUpdateWithoutProjectInput: { // input type + createdAt?: NexusGenInputs['NullableDateTimeFieldUpdateOperationsInput'] | null; // NullableDateTimeFieldUpdateOperationsInput externalId?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput name?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + updatedAt?: NexusGenInputs['NullableDateTimeFieldUpdateOperationsInput'] | null; // NullableDateTimeFieldUpdateOperationsInput }; ListUpsertWithWhereUniqueWithoutProjectInput: { // input type @@ -1025,11 +1046,13 @@ export interface NexusGenInputs { AND?: NexusGenInputs['ListWhereInput'][] | null; // [ListWhereInput!] NOT?: NexusGenInputs['ListWhereInput'][] | null; // [ListWhereInput!] OR?: NexusGenInputs['ListWhereInput'][] | null; // [ListWhereInput!] + createdAt?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter externalId?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter id?: NexusGenInputs['IntFilter'] | null; // IntFilter name?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter project?: NexusGenInputs['ProjectWhereInput'] | null; // ProjectWhereInput projectId?: NexusGenInputs['IntNullableFilter'] | null; // IntNullableFilter + updatedAt?: NexusGenInputs['DateTimeNullableFilter'] | null; // DateTimeNullableFilter }; ListWhereUniqueInput: { // input type @@ -1307,6 +1330,9 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1335,6 +1361,9 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1363,6 +1392,9 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1391,6 +1423,9 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1419,6 +1454,9 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1430,6 +1468,37 @@ export interface NexusGenInputs { data?: NexusGenInputs['ModuleCreateManyFinishInput'][] | null; // [ModuleCreateManyFinishInput!] skipDuplicates?: boolean | null; // Boolean }; + ModuleCreateManyOwnerInput: { + // input type + alwaysDisplay?: boolean | null; // Boolean + attachmentToAppendId?: number | null; // Int + bundleUrl?: string | null; // String + collectionId: number; // Int! + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime + defaultLeftExtensionId?: number | null; // Int + defaultRightExtensionId?: number | null; // Int + description?: string | null; // String + externalId?: string | null; // String + finishId: number; // Int! + hasPegs?: boolean | null; // Boolean + id?: number | null; // Int + isEdge?: boolean | null; // Boolean + isExtension?: boolean | null; // Boolean + isMat?: boolean | null; // Boolean + isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + partNumber: string; // String! + rules?: NexusGenScalars['Json'] | null; // Json + shouldHideBasedOnWidth?: boolean | null; // Boolean + thumbnailUrl?: string | null; // String + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime + }; + ModuleCreateManyOwnerInputEnvelope: { + // input type + data?: NexusGenInputs['ModuleCreateManyOwnerInput'][] | null; // [ModuleCreateManyOwnerInput!] + skipDuplicates?: boolean | null; // Boolean + }; ModuleCreateNestedManyWithoutAttachmentToAppendInput: { // input type connect?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] @@ -1465,6 +1534,13 @@ export interface NexusGenInputs { create?: NexusGenInputs['ModuleCreateWithoutFinishInput'][] | null; // [ModuleCreateWithoutFinishInput!] createMany?: NexusGenInputs['ModuleCreateManyFinishInputEnvelope'] | null; // ModuleCreateManyFinishInputEnvelope }; + ModuleCreateNestedManyWithoutOwnerInput: { + // input type + connect?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] + connectOrCreate?: NexusGenInputs['ModuleCreateOrConnectWithoutOwnerInput'][] | null; // [ModuleCreateOrConnectWithoutOwnerInput!] + create?: NexusGenInputs['ModuleCreateWithoutOwnerInput'][] | null; // [ModuleCreateWithoutOwnerInput!] + createMany?: NexusGenInputs['ModuleCreateManyOwnerInputEnvelope'] | null; // ModuleCreateManyOwnerInputEnvelope + }; ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput: { // input type connect?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput @@ -1501,6 +1577,12 @@ export interface NexusGenInputs { connectOrCreate?: NexusGenInputs['ModuleCreateOrConnectWithoutModuleTypeInput'] | null; // ModuleCreateOrConnectWithoutModuleTypeInput create?: NexusGenInputs['ModuleCreateWithoutModuleTypeInput'] | null; // ModuleCreateWithoutModuleTypeInput }; + ModuleCreateNestedOneWithoutModulesIOwnInput: { + // input type + connect?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput + connectOrCreate?: NexusGenInputs['ModuleCreateOrConnectWithoutModulesIOwnInput'] | null; // ModuleCreateOrConnectWithoutModulesIOwnInput + create?: NexusGenInputs['ModuleCreateWithoutModulesIOwnInput'] | null; // ModuleCreateWithoutModulesIOwnInput + }; ModuleCreateNestedOneWithoutProjectModulesInput: { // input type connect?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput @@ -1562,6 +1644,16 @@ export interface NexusGenInputs { create: NexusGenInputs['ModuleCreateWithoutModuleTypeInput']; // ModuleCreateWithoutModuleTypeInput! where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! }; + ModuleCreateOrConnectWithoutModulesIOwnInput: { + // input type + create: NexusGenInputs['ModuleCreateWithoutModulesIOwnInput']; // ModuleCreateWithoutModulesIOwnInput! + where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! + }; + ModuleCreateOrConnectWithoutOwnerInput: { + // input type + create: NexusGenInputs['ModuleCreateWithoutOwnerInput']; // ModuleCreateWithoutOwnerInput! + where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! + }; ModuleCreateOrConnectWithoutProjectModulesInput: { // input type create: NexusGenInputs['ModuleCreateWithoutProjectModulesInput']; // ModuleCreateWithoutProjectModulesInput! @@ -1586,10 +1678,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1616,10 +1712,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1646,10 +1746,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1676,10 +1780,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1706,10 +1814,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1736,10 +1848,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1766,10 +1882,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1796,10 +1916,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1827,9 +1951,13 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1857,9 +1985,13 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1887,9 +2019,81 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput + partNumber: string; // String! + projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput + rules?: NexusGenScalars['Json'] | null; // Json + shouldHideBasedOnWidth?: boolean | null; // Boolean + thumbnailUrl?: string | null; // String + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime + }; + ModuleCreateWithoutModulesIOwnInput: { + // input type + alwaysDisplay?: boolean | null; // Boolean + attachmentToAppend?: NexusGenInputs['ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput'] | null; // ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents?: NexusGenInputs['ModuleCreateNestedManyWithoutAttachmentToAppendInput'] | null; // ModuleCreateNestedManyWithoutAttachmentToAppendInput + bundleUrl?: string | null; // String + collection: NexusGenInputs['CollectionCreateNestedOneWithoutModulesInput']; // CollectionCreateNestedOneWithoutModulesInput! + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime + defaultLeftExtension?: NexusGenInputs['ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput'] | null; // ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents?: NexusGenInputs['ModuleCreateNestedManyWithoutDefaultLeftExtensionInput'] | null; // ModuleCreateNestedManyWithoutDefaultLeftExtensionInput + defaultRightExtension?: NexusGenInputs['ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput'] | null; // ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents?: NexusGenInputs['ModuleCreateNestedManyWithoutDefaultRightExtensionInput'] | null; // ModuleCreateNestedManyWithoutDefaultRightExtensionInput + description?: string | null; // String + externalId?: string | null; // String + finish: NexusGenInputs['FinishCreateNestedOneWithoutModulesInput']; // FinishCreateNestedOneWithoutModulesInput! + hasPegs?: boolean | null; // Boolean + isEdge?: boolean | null; // Boolean + isExtension?: boolean | null; // Boolean + isMat?: boolean | null; // Boolean + isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput + moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput + moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput + moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput + partNumber: string; // String! + projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput + rules?: NexusGenScalars['Json'] | null; // Json + shouldHideBasedOnWidth?: boolean | null; // Boolean + thumbnailUrl?: string | null; // String + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime + }; + ModuleCreateWithoutOwnerInput: { + // input type + alwaysDisplay?: boolean | null; // Boolean + attachmentToAppend?: NexusGenInputs['ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput'] | null; // ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents?: NexusGenInputs['ModuleCreateNestedManyWithoutAttachmentToAppendInput'] | null; // ModuleCreateNestedManyWithoutAttachmentToAppendInput + bundleUrl?: string | null; // String + collection: NexusGenInputs['CollectionCreateNestedOneWithoutModulesInput']; // CollectionCreateNestedOneWithoutModulesInput! + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime + defaultLeftExtension?: NexusGenInputs['ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput'] | null; // ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents?: NexusGenInputs['ModuleCreateNestedManyWithoutDefaultLeftExtensionInput'] | null; // ModuleCreateNestedManyWithoutDefaultLeftExtensionInput + defaultRightExtension?: NexusGenInputs['ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput'] | null; // ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents?: NexusGenInputs['ModuleCreateNestedManyWithoutDefaultRightExtensionInput'] | null; // ModuleCreateNestedManyWithoutDefaultRightExtensionInput + description?: string | null; // String + externalId?: string | null; // String + finish: NexusGenInputs['FinishCreateNestedOneWithoutModulesInput']; // FinishCreateNestedOneWithoutModulesInput! + hasPegs?: boolean | null; // Boolean + isEdge?: boolean | null; // Boolean + isExtension?: boolean | null; // Boolean + isMat?: boolean | null; // Boolean + isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput + moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput + moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput + moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json partNumber: string; // String! projectModules?: NexusGenInputs['ProjectModuleCreateNestedManyWithoutModuleInput'] | null; // ProjectModuleCreateNestedManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -1917,10 +2121,14 @@ export interface NexusGenInputs { isExtension?: boolean | null; // Boolean isMat?: boolean | null; // Boolean isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutAttachmentInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsCreateNestedManyWithoutModuleInput'] | null; // ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryCreateNestedManyWithoutModuleInput'] | null; // ModuleCategoryCreateNestedManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeCreateNestedManyWithoutModuleInput'] | null; // ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleCreateNestedManyWithoutOwnerInput'] | null; // ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleCreateNestedOneWithoutModulesIOwnInput'] | null; // ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: string; // String! rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: boolean | null; // Boolean @@ -1951,6 +2159,9 @@ export interface NexusGenInputs { isExtension?: NexusGenEnums['SortOrder'] | null; // SortOrder isMat?: NexusGenEnums['SortOrder'] | null; // SortOrder isSubmodule?: NexusGenEnums['SortOrder'] | null; // SortOrder + isVirtualProduct?: NexusGenEnums['SortOrder'] | null; // SortOrder + originalMarathonProductJson?: NexusGenEnums['SortOrder'] | null; // SortOrder + ownerExternalId?: NexusGenEnums['SortOrder'] | null; // SortOrder partNumber?: NexusGenEnums['SortOrder'] | null; // SortOrder rules?: NexusGenEnums['SortOrder'] | null; // SortOrder shouldHideBasedOnWidth?: NexusGenEnums['SortOrder'] | null; // SortOrder @@ -1978,6 +2189,9 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFilter'] | null; // BoolFilter isMat?: NexusGenInputs['BoolFilter'] | null; // BoolFilter isSubmodule?: NexusGenInputs['BoolFilter'] | null; // BoolFilter + isVirtualProduct?: NexusGenInputs['BoolFilter'] | null; // BoolFilter + originalMarathonProductJson?: NexusGenInputs['JsonNullableFilter'] | null; // JsonNullableFilter + ownerExternalId?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter partNumber?: NexusGenInputs['StringFilter'] | null; // StringFilter rules?: NexusGenInputs['JsonNullableFilter'] | null; // JsonNullableFilter shouldHideBasedOnWidth?: NexusGenInputs['BoolFilter'] | null; // BoolFilter @@ -2150,6 +2364,8 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput @@ -2181,6 +2397,11 @@ export interface NexusGenInputs { data: NexusGenInputs['ModuleUpdateManyMutationInput']; // ModuleUpdateManyMutationInput! where: NexusGenInputs['ModuleScalarWhereInput']; // ModuleScalarWhereInput! }; + ModuleUpdateManyWithWhereWithoutOwnerInput: { + // input type + data: NexusGenInputs['ModuleUpdateManyMutationInput']; // ModuleUpdateManyMutationInput! + where: NexusGenInputs['ModuleScalarWhereInput']; // ModuleScalarWhereInput! + }; ModuleUpdateManyWithoutAttachmentToAppendInput: { // input type connect?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] @@ -2251,6 +2472,20 @@ export interface NexusGenInputs { updateMany?: NexusGenInputs['ModuleUpdateManyWithWhereWithoutFinishInput'][] | null; // [ModuleUpdateManyWithWhereWithoutFinishInput!] upsert?: NexusGenInputs['ModuleUpsertWithWhereUniqueWithoutFinishInput'][] | null; // [ModuleUpsertWithWhereUniqueWithoutFinishInput!] }; + ModuleUpdateManyWithoutOwnerInput: { + // input type + connect?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] + connectOrCreate?: NexusGenInputs['ModuleCreateOrConnectWithoutOwnerInput'][] | null; // [ModuleCreateOrConnectWithoutOwnerInput!] + create?: NexusGenInputs['ModuleCreateWithoutOwnerInput'][] | null; // [ModuleCreateWithoutOwnerInput!] + createMany?: NexusGenInputs['ModuleCreateManyOwnerInputEnvelope'] | null; // ModuleCreateManyOwnerInputEnvelope + delete?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] + deleteMany?: NexusGenInputs['ModuleScalarWhereInput'][] | null; // [ModuleScalarWhereInput!] + disconnect?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] + set?: NexusGenInputs['ModuleWhereUniqueInput'][] | null; // [ModuleWhereUniqueInput!] + update?: NexusGenInputs['ModuleUpdateWithWhereUniqueWithoutOwnerInput'][] | null; // [ModuleUpdateWithWhereUniqueWithoutOwnerInput!] + updateMany?: NexusGenInputs['ModuleUpdateManyWithWhereWithoutOwnerInput'][] | null; // [ModuleUpdateManyWithWhereWithoutOwnerInput!] + upsert?: NexusGenInputs['ModuleUpsertWithWhereUniqueWithoutOwnerInput'][] | null; // [ModuleUpsertWithWhereUniqueWithoutOwnerInput!] + }; ModuleUpdateOneRequiredWithoutModuleAttachedToInput: { // input type connect?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput @@ -2313,6 +2548,16 @@ export interface NexusGenInputs { update?: NexusGenInputs['ModuleUpdateWithoutDefaultRightExtensionParentsInput'] | null; // ModuleUpdateWithoutDefaultRightExtensionParentsInput upsert?: NexusGenInputs['ModuleUpsertWithoutDefaultRightExtensionParentsInput'] | null; // ModuleUpsertWithoutDefaultRightExtensionParentsInput }; + ModuleUpdateOneWithoutModulesIOwnInput: { + // input type + connect?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput + connectOrCreate?: NexusGenInputs['ModuleCreateOrConnectWithoutModulesIOwnInput'] | null; // ModuleCreateOrConnectWithoutModulesIOwnInput + create?: NexusGenInputs['ModuleCreateWithoutModulesIOwnInput'] | null; // ModuleCreateWithoutModulesIOwnInput + delete?: boolean | null; // Boolean + disconnect?: boolean | null; // Boolean + update?: NexusGenInputs['ModuleUpdateWithoutModulesIOwnInput'] | null; // ModuleUpdateWithoutModulesIOwnInput + upsert?: NexusGenInputs['ModuleUpsertWithoutModulesIOwnInput'] | null; // ModuleUpsertWithoutModulesIOwnInput + }; ModuleUpdateWithWhereUniqueWithoutAttachmentToAppendInput: { // input type data: NexusGenInputs['ModuleUpdateWithoutAttachmentToAppendInput']; // ModuleUpdateWithoutAttachmentToAppendInput! @@ -2338,6 +2583,11 @@ export interface NexusGenInputs { data: NexusGenInputs['ModuleUpdateWithoutFinishInput']; // ModuleUpdateWithoutFinishInput! where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! }; + ModuleUpdateWithWhereUniqueWithoutOwnerInput: { + // input type + data: NexusGenInputs['ModuleUpdateWithoutOwnerInput']; // ModuleUpdateWithoutOwnerInput! + where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! + }; ModuleUpdateWithoutAttachmentToAppendInput: { // input type alwaysDisplay?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput @@ -2357,10 +2607,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2387,10 +2641,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2417,10 +2675,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2447,10 +2709,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2477,10 +2743,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2507,10 +2777,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2537,10 +2811,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2567,10 +2845,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2598,9 +2880,13 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2628,9 +2914,13 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2658,9 +2948,81 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput + moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput + moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput + partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput + projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput + rules?: NexusGenScalars['Json'] | null; // Json + shouldHideBasedOnWidth?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + thumbnailUrl?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + updatedAt?: NexusGenInputs['DateTimeFieldUpdateOperationsInput'] | null; // DateTimeFieldUpdateOperationsInput + }; + ModuleUpdateWithoutModulesIOwnInput: { + // input type + alwaysDisplay?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + attachmentToAppend?: NexusGenInputs['ModuleUpdateOneWithoutAttachmentToAppendParentsInput'] | null; // ModuleUpdateOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents?: NexusGenInputs['ModuleUpdateManyWithoutAttachmentToAppendInput'] | null; // ModuleUpdateManyWithoutAttachmentToAppendInput + bundleUrl?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + collection?: NexusGenInputs['CollectionUpdateOneRequiredWithoutModulesInput'] | null; // CollectionUpdateOneRequiredWithoutModulesInput + createdAt?: NexusGenInputs['DateTimeFieldUpdateOperationsInput'] | null; // DateTimeFieldUpdateOperationsInput + defaultLeftExtension?: NexusGenInputs['ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput'] | null; // ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents?: NexusGenInputs['ModuleUpdateManyWithoutDefaultLeftExtensionInput'] | null; // ModuleUpdateManyWithoutDefaultLeftExtensionInput + defaultRightExtension?: NexusGenInputs['ModuleUpdateOneWithoutDefaultRightExtensionParentsInput'] | null; // ModuleUpdateOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents?: NexusGenInputs['ModuleUpdateManyWithoutDefaultRightExtensionInput'] | null; // ModuleUpdateManyWithoutDefaultRightExtensionInput + description?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + externalId?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + finish?: NexusGenInputs['FinishUpdateOneRequiredWithoutModulesInput'] | null; // FinishUpdateOneRequiredWithoutModulesInput + hasPegs?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isEdge?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput + moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput + partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput + projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput + rules?: NexusGenScalars['Json'] | null; // Json + shouldHideBasedOnWidth?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + thumbnailUrl?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + updatedAt?: NexusGenInputs['DateTimeFieldUpdateOperationsInput'] | null; // DateTimeFieldUpdateOperationsInput + }; + ModuleUpdateWithoutOwnerInput: { + // input type + alwaysDisplay?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + attachmentToAppend?: NexusGenInputs['ModuleUpdateOneWithoutAttachmentToAppendParentsInput'] | null; // ModuleUpdateOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents?: NexusGenInputs['ModuleUpdateManyWithoutAttachmentToAppendInput'] | null; // ModuleUpdateManyWithoutAttachmentToAppendInput + bundleUrl?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + collection?: NexusGenInputs['CollectionUpdateOneRequiredWithoutModulesInput'] | null; // CollectionUpdateOneRequiredWithoutModulesInput + createdAt?: NexusGenInputs['DateTimeFieldUpdateOperationsInput'] | null; // DateTimeFieldUpdateOperationsInput + defaultLeftExtension?: NexusGenInputs['ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput'] | null; // ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents?: NexusGenInputs['ModuleUpdateManyWithoutDefaultLeftExtensionInput'] | null; // ModuleUpdateManyWithoutDefaultLeftExtensionInput + defaultRightExtension?: NexusGenInputs['ModuleUpdateOneWithoutDefaultRightExtensionParentsInput'] | null; // ModuleUpdateOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents?: NexusGenInputs['ModuleUpdateManyWithoutDefaultRightExtensionInput'] | null; // ModuleUpdateManyWithoutDefaultRightExtensionInput + description?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + externalId?: NexusGenInputs['NullableStringFieldUpdateOperationsInput'] | null; // NullableStringFieldUpdateOperationsInput + finish?: NexusGenInputs['FinishUpdateOneRequiredWithoutModulesInput'] | null; // FinishUpdateOneRequiredWithoutModulesInput + hasPegs?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isEdge?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput + moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput + moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput + moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput projectModules?: NexusGenInputs['ProjectModuleUpdateManyWithoutModuleInput'] | null; // ProjectModuleUpdateManyWithoutModuleInput rules?: NexusGenScalars['Json'] | null; // Json @@ -2688,10 +3050,14 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isMat?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput isSubmodule?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput + isVirtualProduct?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutAttachmentInput'] | null; // ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments?: NexusGenInputs['ModuleAttachmentsUpdateManyWithoutModuleInput'] | null; // ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories?: NexusGenInputs['ModuleCategoryUpdateManyWithoutModuleInput'] | null; // ModuleCategoryUpdateManyWithoutModuleInput moduleType?: NexusGenInputs['ModuleTypeUpdateManyWithoutModuleInput'] | null; // ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn?: NexusGenInputs['ModuleUpdateManyWithoutOwnerInput'] | null; // ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + owner?: NexusGenInputs['ModuleUpdateOneWithoutModulesIOwnInput'] | null; // ModuleUpdateOneWithoutModulesIOwnInput partNumber?: NexusGenInputs['StringFieldUpdateOperationsInput'] | null; // StringFieldUpdateOperationsInput rules?: NexusGenScalars['Json'] | null; // Json shouldHideBasedOnWidth?: NexusGenInputs['BoolFieldUpdateOperationsInput'] | null; // BoolFieldUpdateOperationsInput @@ -2728,6 +3094,12 @@ export interface NexusGenInputs { update: NexusGenInputs['ModuleUpdateWithoutFinishInput']; // ModuleUpdateWithoutFinishInput! where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! }; + ModuleUpsertWithWhereUniqueWithoutOwnerInput: { + // input type + create: NexusGenInputs['ModuleCreateWithoutOwnerInput']; // ModuleCreateWithoutOwnerInput! + update: NexusGenInputs['ModuleUpdateWithoutOwnerInput']; // ModuleUpdateWithoutOwnerInput! + where: NexusGenInputs['ModuleWhereUniqueInput']; // ModuleWhereUniqueInput! + }; ModuleUpsertWithoutAttachmentToAppendParentsInput: { // input type create: NexusGenInputs['ModuleCreateWithoutAttachmentToAppendParentsInput']; // ModuleCreateWithoutAttachmentToAppendParentsInput! @@ -2758,6 +3130,11 @@ export interface NexusGenInputs { create: NexusGenInputs['ModuleCreateWithoutModuleTypeInput']; // ModuleCreateWithoutModuleTypeInput! update: NexusGenInputs['ModuleUpdateWithoutModuleTypeInput']; // ModuleUpdateWithoutModuleTypeInput! }; + ModuleUpsertWithoutModulesIOwnInput: { + // input type + create: NexusGenInputs['ModuleCreateWithoutModulesIOwnInput']; // ModuleCreateWithoutModulesIOwnInput! + update: NexusGenInputs['ModuleUpdateWithoutModulesIOwnInput']; // ModuleUpdateWithoutModulesIOwnInput! + }; ModuleUpsertWithoutProjectModulesInput: { // input type create: NexusGenInputs['ModuleCreateWithoutProjectModulesInput']; // ModuleCreateWithoutProjectModulesInput! @@ -2792,10 +3169,15 @@ export interface NexusGenInputs { isExtension?: NexusGenInputs['BoolFilter'] | null; // BoolFilter isMat?: NexusGenInputs['BoolFilter'] | null; // BoolFilter isSubmodule?: NexusGenInputs['BoolFilter'] | null; // BoolFilter + isVirtualProduct?: NexusGenInputs['BoolFilter'] | null; // BoolFilter moduleAttachedTo?: NexusGenInputs['ModuleAttachmentsListRelationFilter'] | null; // ModuleAttachmentsListRelationFilter moduleAttachments?: NexusGenInputs['ModuleAttachmentsListRelationFilter'] | null; // ModuleAttachmentsListRelationFilter moduleCategories?: NexusGenInputs['ModuleCategoryListRelationFilter'] | null; // ModuleCategoryListRelationFilter moduleType?: NexusGenInputs['ModuleTypeListRelationFilter'] | null; // ModuleTypeListRelationFilter + modulesIOwn?: NexusGenInputs['ModuleListRelationFilter'] | null; // ModuleListRelationFilter + originalMarathonProductJson?: NexusGenInputs['JsonNullableFilter'] | null; // JsonNullableFilter + owner?: NexusGenInputs['ModuleWhereInput'] | null; // ModuleWhereInput + ownerExternalId?: NexusGenInputs['StringNullableFilter'] | null; // StringNullableFilter partNumber?: NexusGenInputs['StringFilter'] | null; // StringFilter projectModules?: NexusGenInputs['ProjectModuleListRelationFilter'] | null; // ProjectModuleListRelationFilter rules?: NexusGenInputs['JsonNullableFilter'] | null; // JsonNullableFilter @@ -2825,6 +3207,17 @@ export interface NexusGenInputs { not?: NexusGenInputs['NestedDateTimeFilter'] | null; // NestedDateTimeFilter notIn?: NexusGenScalars['DateTime'][] | null; // [DateTime!] }; + NestedDateTimeNullableFilter: { + // input type + equals?: NexusGenScalars['DateTime'] | null; // DateTime + gt?: NexusGenScalars['DateTime'] | null; // DateTime + gte?: NexusGenScalars['DateTime'] | null; // DateTime + in?: NexusGenScalars['DateTime'][] | null; // [DateTime!] + lt?: NexusGenScalars['DateTime'] | null; // DateTime + lte?: NexusGenScalars['DateTime'] | null; // DateTime + not?: NexusGenInputs['NestedDateTimeNullableFilter'] | null; // NestedDateTimeNullableFilter + notIn?: NexusGenScalars['DateTime'][] | null; // [DateTime!] + }; NestedEnumLocaleFilter: { // input type equals?: NexusGenEnums['Locale'] | null; // Locale @@ -2904,6 +3297,10 @@ export interface NexusGenInputs { notIn?: string[] | null; // [String!] startsWith?: string | null; // String }; + NullableDateTimeFieldUpdateOperationsInput: { + // input type + set?: NexusGenScalars['DateTime'] | null; // DateTime + }; NullableFloatFieldUpdateOperationsInput: { // input type decrement?: number | null; // Float @@ -4842,10 +5239,12 @@ export interface NexusGenObjects { }; List: { // root type + createdAt?: NexusGenScalars['DateTime'] | null; // DateTime externalId?: string | null; // String id: number; // Int! name?: string | null; // String projectId?: number | null; // Int + updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime }; Module: { // root type @@ -4864,6 +5263,9 @@ export interface NexusGenObjects { isExtension: boolean; // Boolean! isMat: boolean; // Boolean! isSubmodule: boolean; // Boolean! + isVirtualProduct: boolean; // Boolean! + originalMarathonProductJson?: NexusGenScalars['Json'] | null; // Json + ownerExternalId?: string | null; // String partNumber: string; // String! shouldHideBasedOnWidth: boolean; // Boolean! updatedAt: NexusGenScalars['DateTime']; // DateTime! @@ -4880,18 +5282,38 @@ export interface NexusGenObjects { id: number; // Int! moduleId: number; // Int! }; + ModuleCategoryMetadata: { + // root type + externalId: string; // String! + slug?: string | null; // String + }; + ModuleCollectionsMetadata: { + // root type + externalId: string; // String! + slug?: string | null; // String + }; ModuleDimension: { // root type depth?: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax height?: NexusGenRootTypes['ModuleUnit'] | null; // ModuleUnit width?: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax }; + ModuleDrawerTypesMetadata: { + // root type + externalId: string; // String! + slug?: string | null; // String + }; ModuleExtensionsMetadata: { // root type left?: string | null; // String - options?: string[] | null; // [String!] + options?: Array | null; // [String] right?: string | null; // String }; + ModuleFinishesMetadata: { + // root type + externalId: string; // String! + slug?: string | null; // String + }; ModuleMinMax: { // root type max?: NexusGenRootTypes['ModuleUnit'] | null; // ModuleUnit @@ -4899,24 +5321,41 @@ export interface NexusGenObjects { }; ModuleRules: { // root type + alwaysDisplay?: boolean | null; // Boolean bundleUrl?: string | null; // String - dimensions?: NexusGenRootTypes['ModuleDimension'] | null; // ModuleDimension + categories?: Array | null; // [ModuleCategoryMetadata] + collection: NexusGenRootTypes['ModuleCollectionsMetadata']; // ModuleCollectionsMetadata! + description?: string | null; // String + dimensions: NexusGenRootTypes['ModuleDimension']; // ModuleDimension! + drawerTypes?: Array | null; // [ModuleDrawerTypesMetadata] extensions?: NexusGenRootTypes['ModuleExtensionsMetadata'] | null; // ModuleExtensionsMetadata - finishes?: string[] | null; // [String!] - isImprintExtension: boolean; // Boolean! + externalId: string; // String! + finish: NexusGenRootTypes['ModuleFinishesMetadata']; // ModuleFinishesMetadata! + hasPegs?: boolean | null; // Boolean + isEdge?: boolean | null; // Boolean + isExtension: boolean; // Boolean! + isMat?: boolean | null; // Boolean + isSubmodule?: boolean | null; // Boolean + isVirtualProduct?: boolean | null; // Boolean + otherFinishes?: string[] | null; // [String!] + ownerExternalId?: string | null; // String partNumber: string; // String! rules?: NexusGenRootTypes['ModuleRulesMetadata'] | null; // ModuleRulesMetadata - trims?: string[] | null; // [String!] + shouldHideBasedOnWidth?: boolean | null; // Boolean + thumbnailUrl?: string | null; // String + trims?: Array | null; // [String] }; ModuleRulesMetadata: { // root type + angle?: number | null; // Float fullDepth?: boolean | null; // Boolean - options?: string[] | null; // [String!] + isFiller?: boolean | null; // Boolean + options?: Array | null; // [String] queue?: NexusGenRootTypes['QueueInfoMetadata'] | null; // QueueInfoMetadata requiredNetInterior?: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax rotation?: number | null; // Float trimOffset?: NexusGenRootTypes['TrimOffsetMetadata'] | null; // TrimOffsetMetadata - trimmable?: string[] | null; // [String!] + trimmable?: Array | null; // [String] }; ModuleType: { // root type @@ -5110,11 +5549,13 @@ export interface NexusGenFieldTypes { }; List: { // field return type + createdAt: NexusGenScalars['DateTime'] | null; // DateTime externalId: string | null; // String id: number; // Int! name: string | null; // String project: NexusGenRootTypes['Project'] | null; // Project projectId: number | null; // Int + updatedAt: NexusGenScalars['DateTime'] | null; // DateTime }; Module: { // field return type @@ -5143,9 +5584,14 @@ export interface NexusGenFieldTypes { isExtension: boolean; // Boolean! isMat: boolean; // Boolean! isSubmodule: boolean; // Boolean! + isVirtualProduct: boolean; // Boolean! moduleAttachedTo: NexusGenRootTypes['ModuleAttachments'][]; // [ModuleAttachments!]! moduleAttachments: NexusGenRootTypes['ModuleAttachments'][]; // [ModuleAttachments!]! moduleType: NexusGenRootTypes['ModuleType'][]; // [ModuleType!]! + modulesIOwn: NexusGenRootTypes['Module'][]; // [Module!]! + originalMarathonProductJson: NexusGenScalars['Json'] | null; // Json + owner: NexusGenRootTypes['Module'] | null; // Module + ownerExternalId: string | null; // String partNumber: string; // String! projectModules: NexusGenRootTypes['ProjectModule'][]; // [ProjectModule!]! rules: NexusGenRootTypes['ModuleRules'] | null; // ModuleRules @@ -5170,18 +5616,38 @@ export interface NexusGenFieldTypes { module: NexusGenRootTypes['Module']; // Module! moduleId: number; // Int! }; + ModuleCategoryMetadata: { + // field return type + externalId: string; // String! + slug: string | null; // String + }; + ModuleCollectionsMetadata: { + // field return type + externalId: string; // String! + slug: string | null; // String + }; ModuleDimension: { // field return type depth: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax height: NexusGenRootTypes['ModuleUnit'] | null; // ModuleUnit width: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax }; + ModuleDrawerTypesMetadata: { + // field return type + externalId: string; // String! + slug: string | null; // String + }; ModuleExtensionsMetadata: { // field return type left: string | null; // String - options: string[] | null; // [String!] + options: Array | null; // [String] right: string | null; // String }; + ModuleFinishesMetadata: { + // field return type + externalId: string; // String! + slug: string | null; // String + }; ModuleMinMax: { // field return type max: NexusGenRootTypes['ModuleUnit'] | null; // ModuleUnit @@ -5189,24 +5655,41 @@ export interface NexusGenFieldTypes { }; ModuleRules: { // field return type + alwaysDisplay: boolean | null; // Boolean bundleUrl: string | null; // String - dimensions: NexusGenRootTypes['ModuleDimension'] | null; // ModuleDimension + categories: Array | null; // [ModuleCategoryMetadata] + collection: NexusGenRootTypes['ModuleCollectionsMetadata']; // ModuleCollectionsMetadata! + description: string | null; // String + dimensions: NexusGenRootTypes['ModuleDimension']; // ModuleDimension! + drawerTypes: Array | null; // [ModuleDrawerTypesMetadata] extensions: NexusGenRootTypes['ModuleExtensionsMetadata'] | null; // ModuleExtensionsMetadata - finishes: string[] | null; // [String!] - isImprintExtension: boolean; // Boolean! + externalId: string; // String! + finish: NexusGenRootTypes['ModuleFinishesMetadata']; // ModuleFinishesMetadata! + hasPegs: boolean | null; // Boolean + isEdge: boolean | null; // Boolean + isExtension: boolean; // Boolean! + isMat: boolean | null; // Boolean + isSubmodule: boolean | null; // Boolean + isVirtualProduct: boolean | null; // Boolean + otherFinishes: string[] | null; // [String!] + ownerExternalId: string | null; // String partNumber: string; // String! rules: NexusGenRootTypes['ModuleRulesMetadata'] | null; // ModuleRulesMetadata - trims: string[] | null; // [String!] + shouldHideBasedOnWidth: boolean | null; // Boolean + thumbnailUrl: string | null; // String + trims: Array | null; // [String] }; ModuleRulesMetadata: { // field return type + angle: number | null; // Float fullDepth: boolean | null; // Boolean - options: string[] | null; // [String!] + isFiller: boolean | null; // Boolean + options: Array | null; // [String] queue: NexusGenRootTypes['QueueInfoMetadata'] | null; // QueueInfoMetadata requiredNetInterior: NexusGenRootTypes['ModuleMinMax'] | null; // ModuleMinMax rotation: number | null; // Float trimOffset: NexusGenRootTypes['TrimOffsetMetadata'] | null; // TrimOffsetMetadata - trimmable: string[] | null; // [String!] + trimmable: Array | null; // [String] }; ModuleType: { // field return type @@ -5465,11 +5948,13 @@ export interface NexusGenFieldTypeNames { }; List: { // field return type name + createdAt: 'DateTime'; externalId: 'String'; id: 'Int'; name: 'String'; project: 'Project'; projectId: 'Int'; + updatedAt: 'DateTime'; }; Module: { // field return type name @@ -5498,9 +5983,14 @@ export interface NexusGenFieldTypeNames { isExtension: 'Boolean'; isMat: 'Boolean'; isSubmodule: 'Boolean'; + isVirtualProduct: 'Boolean'; moduleAttachedTo: 'ModuleAttachments'; moduleAttachments: 'ModuleAttachments'; moduleType: 'ModuleType'; + modulesIOwn: 'Module'; + originalMarathonProductJson: 'Json'; + owner: 'Module'; + ownerExternalId: 'String'; partNumber: 'String'; projectModules: 'ProjectModule'; rules: 'ModuleRules'; @@ -5525,18 +6015,38 @@ export interface NexusGenFieldTypeNames { module: 'Module'; moduleId: 'Int'; }; + ModuleCategoryMetadata: { + // field return type name + externalId: 'String'; + slug: 'String'; + }; + ModuleCollectionsMetadata: { + // field return type name + externalId: 'String'; + slug: 'String'; + }; ModuleDimension: { // field return type name depth: 'ModuleMinMax'; height: 'ModuleUnit'; width: 'ModuleMinMax'; }; + ModuleDrawerTypesMetadata: { + // field return type name + externalId: 'String'; + slug: 'String'; + }; ModuleExtensionsMetadata: { // field return type name left: 'String'; options: 'String'; right: 'String'; }; + ModuleFinishesMetadata: { + // field return type name + externalId: 'String'; + slug: 'String'; + }; ModuleMinMax: { // field return type name max: 'ModuleUnit'; @@ -5544,18 +6054,35 @@ export interface NexusGenFieldTypeNames { }; ModuleRules: { // field return type name + alwaysDisplay: 'Boolean'; bundleUrl: 'String'; + categories: 'ModuleCategoryMetadata'; + collection: 'ModuleCollectionsMetadata'; + description: 'String'; dimensions: 'ModuleDimension'; + drawerTypes: 'ModuleDrawerTypesMetadata'; extensions: 'ModuleExtensionsMetadata'; - finishes: 'String'; - isImprintExtension: 'Boolean'; + externalId: 'String'; + finish: 'ModuleFinishesMetadata'; + hasPegs: 'Boolean'; + isEdge: 'Boolean'; + isExtension: 'Boolean'; + isMat: 'Boolean'; + isSubmodule: 'Boolean'; + isVirtualProduct: 'Boolean'; + otherFinishes: 'String'; + ownerExternalId: 'String'; partNumber: 'String'; rules: 'ModuleRulesMetadata'; + shouldHideBasedOnWidth: 'Boolean'; + thumbnailUrl: 'String'; trims: 'String'; }; ModuleRulesMetadata: { // field return type name + angle: 'Float'; fullDepth: 'Boolean'; + isFiller: 'Boolean'; options: 'String'; queue: 'QueueInfoMetadata'; requiredNetInterior: 'ModuleMinMax'; @@ -5856,6 +6383,12 @@ export interface NexusGenArgTypes { skip?: number | null; // Int take?: number | null; // Int }; + modulesIOwn: { + // args + cursor?: NexusGenInputs['ModuleWhereUniqueInput'] | null; // ModuleWhereUniqueInput + skip?: number | null; // Int + take?: number | null; // Int + }; projectModules: { // args cursor?: NexusGenInputs['ProjectModuleWhereUniqueInput'] | null; // ProjectModuleWhereUniqueInput diff --git a/src/generated/schema.graphql b/src/generated/schema.graphql index 9465073..15d9c55 100644 --- a/src/generated/schema.graphql +++ b/src/generated/schema.graphql @@ -660,6 +660,17 @@ input DateTimeFilter { notIn: [DateTime!] } +input DateTimeNullableFilter { + equals: DateTime + gt: DateTime + gte: DateTime + in: [DateTime!] + lt: DateTime + lte: DateTime + not: NestedDateTimeNullableFilter + notIn: [DateTime!] +} + input EnumLocaleFieldUpdateOperationsInput { set: Locale } @@ -1036,17 +1047,21 @@ input JsonNullableFilter { } type List { + createdAt: DateTime externalId: String id: Int! name: String project: Project projectId: Int + updatedAt: DateTime } input ListCreateManyProjectInput { + createdAt: DateTime externalId: String id: Int name: String + updatedAt: DateTime } input ListCreateManyProjectInputEnvelope { @@ -1067,8 +1082,10 @@ input ListCreateOrConnectWithoutProjectInput { } input ListCreateWithoutProjectInput { + createdAt: DateTime externalId: String name: String + updatedAt: DateTime } input ListListRelationFilter { @@ -1081,15 +1098,19 @@ input ListScalarWhereInput { AND: [ListScalarWhereInput!] NOT: [ListScalarWhereInput!] OR: [ListScalarWhereInput!] + createdAt: DateTimeNullableFilter externalId: StringNullableFilter id: IntFilter name: StringNullableFilter projectId: IntNullableFilter + updatedAt: DateTimeNullableFilter } input ListUpdateManyMutationInput { + createdAt: NullableDateTimeFieldUpdateOperationsInput externalId: NullableStringFieldUpdateOperationsInput name: NullableStringFieldUpdateOperationsInput + updatedAt: NullableDateTimeFieldUpdateOperationsInput } input ListUpdateManyWithWhereWithoutProjectInput { @@ -1117,8 +1138,10 @@ input ListUpdateWithWhereUniqueWithoutProjectInput { } input ListUpdateWithoutProjectInput { + createdAt: NullableDateTimeFieldUpdateOperationsInput externalId: NullableStringFieldUpdateOperationsInput name: NullableStringFieldUpdateOperationsInput + updatedAt: NullableDateTimeFieldUpdateOperationsInput } input ListUpsertWithWhereUniqueWithoutProjectInput { @@ -1131,11 +1154,13 @@ input ListWhereInput { AND: [ListWhereInput!] NOT: [ListWhereInput!] OR: [ListWhereInput!] + createdAt: DateTimeNullableFilter externalId: StringNullableFilter id: IntFilter name: StringNullableFilter project: ProjectWhereInput projectId: IntNullableFilter + updatedAt: DateTimeNullableFilter } input ListWhereUniqueInput { @@ -1174,9 +1199,14 @@ type Module { isExtension: Boolean! isMat: Boolean! isSubmodule: Boolean! + isVirtualProduct: Boolean! moduleAttachedTo(cursor: ModuleAttachmentsWhereUniqueInput, skip: Int, take: Int): [ModuleAttachments!]! moduleAttachments(cursor: ModuleAttachmentsWhereUniqueInput, skip: Int, take: Int): [ModuleAttachments!]! moduleType(cursor: ModuleTypeWhereUniqueInput, skip: Int, take: Int): [ModuleType!]! + modulesIOwn(cursor: ModuleWhereUniqueInput, skip: Int, take: Int): [Module!]! + originalMarathonProductJson: Json + owner: Module + ownerExternalId: String partNumber: String! projectModules( cursor: ProjectModuleWhereUniqueInput @@ -1394,6 +1424,11 @@ input ModuleCategoryListRelationFilter { some: ModuleCategoryWhereInput } +type ModuleCategoryMetadata { + externalId: String! + slug: String +} + input ModuleCategoryOrderByInput { categoryId: SortOrder id: SortOrder @@ -1462,6 +1497,11 @@ input ModuleCategoryWhereUniqueInput { id: Int } +type ModuleCollectionsMetadata { + externalId: String! + slug: String +} + input ModuleCreateManyAttachmentToAppendInput { alwaysDisplay: Boolean bundleUrl: String @@ -1478,6 +1518,9 @@ input ModuleCreateManyAttachmentToAppendInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + ownerExternalId: String partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -1506,6 +1549,9 @@ input ModuleCreateManyCollectionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + ownerExternalId: String partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -1534,6 +1580,9 @@ input ModuleCreateManyDefaultLeftExtensionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + ownerExternalId: String partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -1562,6 +1611,9 @@ input ModuleCreateManyDefaultRightExtensionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + ownerExternalId: String partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -1590,6 +1642,9 @@ input ModuleCreateManyFinishInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + ownerExternalId: String partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -1602,6 +1657,37 @@ input ModuleCreateManyFinishInputEnvelope { skipDuplicates: Boolean } +input ModuleCreateManyOwnerInput { + alwaysDisplay: Boolean + attachmentToAppendId: Int + bundleUrl: String + collectionId: Int! + createdAt: DateTime + defaultLeftExtensionId: Int + defaultRightExtensionId: Int + description: String + externalId: String + finishId: Int! + hasPegs: Boolean + id: Int + isEdge: Boolean + isExtension: Boolean + isMat: Boolean + isSubmodule: Boolean + isVirtualProduct: Boolean + originalMarathonProductJson: Json + partNumber: String! + rules: Json + shouldHideBasedOnWidth: Boolean + thumbnailUrl: String + updatedAt: DateTime +} + +input ModuleCreateManyOwnerInputEnvelope { + data: [ModuleCreateManyOwnerInput!] + skipDuplicates: Boolean +} + input ModuleCreateNestedManyWithoutAttachmentToAppendInput { connect: [ModuleWhereUniqueInput!] connectOrCreate: [ModuleCreateOrConnectWithoutAttachmentToAppendInput!] @@ -1637,6 +1723,13 @@ input ModuleCreateNestedManyWithoutFinishInput { createMany: ModuleCreateManyFinishInputEnvelope } +input ModuleCreateNestedManyWithoutOwnerInput { + connect: [ModuleWhereUniqueInput!] + connectOrCreate: [ModuleCreateOrConnectWithoutOwnerInput!] + create: [ModuleCreateWithoutOwnerInput!] + createMany: ModuleCreateManyOwnerInputEnvelope +} + input ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput { connect: ModuleWhereUniqueInput connectOrCreate: ModuleCreateOrConnectWithoutAttachmentToAppendParentsInput @@ -1673,6 +1766,12 @@ input ModuleCreateNestedOneWithoutModuleTypeInput { create: ModuleCreateWithoutModuleTypeInput } +input ModuleCreateNestedOneWithoutModulesIOwnInput { + connect: ModuleWhereUniqueInput + connectOrCreate: ModuleCreateOrConnectWithoutModulesIOwnInput + create: ModuleCreateWithoutModulesIOwnInput +} + input ModuleCreateNestedOneWithoutProjectModulesInput { connect: ModuleWhereUniqueInput connectOrCreate: ModuleCreateOrConnectWithoutProjectModulesInput @@ -1734,6 +1833,16 @@ input ModuleCreateOrConnectWithoutModuleTypeInput { where: ModuleWhereUniqueInput! } +input ModuleCreateOrConnectWithoutModulesIOwnInput { + create: ModuleCreateWithoutModulesIOwnInput! + where: ModuleWhereUniqueInput! +} + +input ModuleCreateOrConnectWithoutOwnerInput { + create: ModuleCreateWithoutOwnerInput! + where: ModuleWhereUniqueInput! +} + input ModuleCreateOrConnectWithoutProjectModulesInput { create: ModuleCreateWithoutProjectModulesInput! where: ModuleWhereUniqueInput! @@ -1757,10 +1866,14 @@ input ModuleCreateWithoutAttachmentToAppendInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1787,10 +1900,14 @@ input ModuleCreateWithoutAttachmentToAppendParentsInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1817,10 +1934,14 @@ input ModuleCreateWithoutCollectionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1847,10 +1968,14 @@ input ModuleCreateWithoutDefaultLeftExtensionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1877,10 +2002,14 @@ input ModuleCreateWithoutDefaultLeftExtensionParentsInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1907,10 +2036,14 @@ input ModuleCreateWithoutDefaultRightExtensionInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1937,10 +2070,14 @@ input ModuleCreateWithoutDefaultRightExtensionParentsInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1967,10 +2104,14 @@ input ModuleCreateWithoutFinishInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -1998,9 +2139,13 @@ input ModuleCreateWithoutModuleAttachedToInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -2028,9 +2173,13 @@ input ModuleCreateWithoutModuleAttachmentsInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -2058,9 +2207,81 @@ input ModuleCreateWithoutModuleTypeInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean + moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput + moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput + moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput + partNumber: String! + projectModules: ProjectModuleCreateNestedManyWithoutModuleInput + rules: Json + shouldHideBasedOnWidth: Boolean + thumbnailUrl: String + updatedAt: DateTime +} + +input ModuleCreateWithoutModulesIOwnInput { + alwaysDisplay: Boolean + attachmentToAppend: ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents: ModuleCreateNestedManyWithoutAttachmentToAppendInput + bundleUrl: String + collection: CollectionCreateNestedOneWithoutModulesInput! + createdAt: DateTime + defaultLeftExtension: ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents: ModuleCreateNestedManyWithoutDefaultLeftExtensionInput + defaultRightExtension: ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents: ModuleCreateNestedManyWithoutDefaultRightExtensionInput + description: String + externalId: String + finish: FinishCreateNestedOneWithoutModulesInput! + hasPegs: Boolean + isEdge: Boolean + isExtension: Boolean + isMat: Boolean + isSubmodule: Boolean + isVirtualProduct: Boolean + moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput + moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput + moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput + moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput + partNumber: String! + projectModules: ProjectModuleCreateNestedManyWithoutModuleInput + rules: Json + shouldHideBasedOnWidth: Boolean + thumbnailUrl: String + updatedAt: DateTime +} + +input ModuleCreateWithoutOwnerInput { + alwaysDisplay: Boolean + attachmentToAppend: ModuleCreateNestedOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents: ModuleCreateNestedManyWithoutAttachmentToAppendInput + bundleUrl: String + collection: CollectionCreateNestedOneWithoutModulesInput! + createdAt: DateTime + defaultLeftExtension: ModuleCreateNestedOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents: ModuleCreateNestedManyWithoutDefaultLeftExtensionInput + defaultRightExtension: ModuleCreateNestedOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents: ModuleCreateNestedManyWithoutDefaultRightExtensionInput + description: String + externalId: String + finish: FinishCreateNestedOneWithoutModulesInput! + hasPegs: Boolean + isEdge: Boolean + isExtension: Boolean + isMat: Boolean + isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput + moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json partNumber: String! projectModules: ProjectModuleCreateNestedManyWithoutModuleInput rules: Json @@ -2088,10 +2309,14 @@ input ModuleCreateWithoutProjectModulesInput { isExtension: Boolean isMat: Boolean isSubmodule: Boolean + isVirtualProduct: Boolean moduleAttachedTo: ModuleAttachmentsCreateNestedManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsCreateNestedManyWithoutModuleInput moduleCategories: ModuleCategoryCreateNestedManyWithoutModuleInput moduleType: ModuleTypeCreateNestedManyWithoutModuleInput + modulesIOwn: ModuleCreateNestedManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleCreateNestedOneWithoutModulesIOwnInput partNumber: String! rules: Json shouldHideBasedOnWidth: Boolean @@ -2105,12 +2330,22 @@ type ModuleDimension { width: ModuleMinMax } +type ModuleDrawerTypesMetadata { + externalId: String! + slug: String +} + type ModuleExtensionsMetadata { left: String - options: [String!] + options: [String] right: String } +type ModuleFinishesMetadata { + externalId: String! + slug: String +} + input ModuleListRelationFilter { every: ModuleWhereInput none: ModuleWhereInput @@ -2139,6 +2374,9 @@ input ModuleOrderByInput { isExtension: SortOrder isMat: SortOrder isSubmodule: SortOrder + isVirtualProduct: SortOrder + originalMarathonProductJson: SortOrder + ownerExternalId: SortOrder partNumber: SortOrder rules: SortOrder shouldHideBasedOnWidth: SortOrder @@ -2147,42 +2385,71 @@ input ModuleOrderByInput { } type ModuleRules { + alwaysDisplay: Boolean bundleUrl: String - dimensions: ModuleDimension + categories: [ModuleCategoryMetadata] + collection: ModuleCollectionsMetadata! + description: String + dimensions: ModuleDimension! + drawerTypes: [ModuleDrawerTypesMetadata] """ Extensions are sub pieces that MUST BE CONNECTED to the main product or other extension. """ extensions: ModuleExtensionsMetadata + externalId: String! + + """ + The current finish of this module + """ + finish: ModuleFinishesMetadata! + hasPegs: Boolean + isEdge: Boolean + isExtension: Boolean! + isMat: Boolean + isSubmodule: Boolean + isVirtualProduct: Boolean """ - Modules that are basically this module but in a different finish(color), to allow the ui to easily switch between them + The equivalent of same module but on other finishes """ - finishes: [String!] - isImprintExtension: Boolean! + otherFinishes: [String!] + ownerExternalId: String """ The module part number, probably equivalent to the module id """ partNumber: String! rules: ModuleRulesMetadata + shouldHideBasedOnWidth: Boolean + thumbnailUrl: String """ Different types of edges a module might have """ - trims: [String!] + trims: [String] } type ModuleRulesMetadata { + """ + The amount (in degrees) that the product can be angled + """ + angle: Float + """ Whether or not this module is only valid if it's taking the drawer full depth """ fullDepth: Boolean + """ + Whether or not this module is a filler kind of module + """ + isFiller: Boolean + """ Options are which other modules can be put IN modules """ - options: [String!] + options: [String] """ Queue info @@ -2203,7 +2470,7 @@ type ModuleRulesMetadata { """ Where a module can be cut if there's excess beyond the drawer """ - trimmable: [String!] + trimmable: [String] } input ModuleScalarWhereInput { @@ -2226,6 +2493,9 @@ input ModuleScalarWhereInput { isExtension: BoolFilter isMat: BoolFilter isSubmodule: BoolFilter + isVirtualProduct: BoolFilter + originalMarathonProductJson: JsonNullableFilter + ownerExternalId: StringNullableFilter partNumber: StringFilter rules: JsonNullableFilter shouldHideBasedOnWidth: BoolFilter @@ -2411,6 +2681,8 @@ input ModuleUpdateManyMutationInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput + originalMarathonProductJson: Json partNumber: StringFieldUpdateOperationsInput rules: Json shouldHideBasedOnWidth: BoolFieldUpdateOperationsInput @@ -2443,6 +2715,11 @@ input ModuleUpdateManyWithWhereWithoutFinishInput { where: ModuleScalarWhereInput! } +input ModuleUpdateManyWithWhereWithoutOwnerInput { + data: ModuleUpdateManyMutationInput! + where: ModuleScalarWhereInput! +} + input ModuleUpdateManyWithoutAttachmentToAppendInput { connect: [ModuleWhereUniqueInput!] connectOrCreate: [ModuleCreateOrConnectWithoutAttachmentToAppendInput!] @@ -2513,6 +2790,20 @@ input ModuleUpdateManyWithoutFinishInput { upsert: [ModuleUpsertWithWhereUniqueWithoutFinishInput!] } +input ModuleUpdateManyWithoutOwnerInput { + connect: [ModuleWhereUniqueInput!] + connectOrCreate: [ModuleCreateOrConnectWithoutOwnerInput!] + create: [ModuleCreateWithoutOwnerInput!] + createMany: ModuleCreateManyOwnerInputEnvelope + delete: [ModuleWhereUniqueInput!] + deleteMany: [ModuleScalarWhereInput!] + disconnect: [ModuleWhereUniqueInput!] + set: [ModuleWhereUniqueInput!] + update: [ModuleUpdateWithWhereUniqueWithoutOwnerInput!] + updateMany: [ModuleUpdateManyWithWhereWithoutOwnerInput!] + upsert: [ModuleUpsertWithWhereUniqueWithoutOwnerInput!] +} + input ModuleUpdateOneRequiredWithoutModuleAttachedToInput { connect: ModuleWhereUniqueInput connectOrCreate: ModuleCreateOrConnectWithoutModuleAttachedToInput @@ -2575,6 +2866,16 @@ input ModuleUpdateOneWithoutDefaultRightExtensionParentsInput { upsert: ModuleUpsertWithoutDefaultRightExtensionParentsInput } +input ModuleUpdateOneWithoutModulesIOwnInput { + connect: ModuleWhereUniqueInput + connectOrCreate: ModuleCreateOrConnectWithoutModulesIOwnInput + create: ModuleCreateWithoutModulesIOwnInput + delete: Boolean + disconnect: Boolean + update: ModuleUpdateWithoutModulesIOwnInput + upsert: ModuleUpsertWithoutModulesIOwnInput +} + input ModuleUpdateWithWhereUniqueWithoutAttachmentToAppendInput { data: ModuleUpdateWithoutAttachmentToAppendInput! where: ModuleWhereUniqueInput! @@ -2600,6 +2901,11 @@ input ModuleUpdateWithWhereUniqueWithoutFinishInput { where: ModuleWhereUniqueInput! } +input ModuleUpdateWithWhereUniqueWithoutOwnerInput { + data: ModuleUpdateWithoutOwnerInput! + where: ModuleWhereUniqueInput! +} + input ModuleUpdateWithoutAttachmentToAppendInput { alwaysDisplay: BoolFieldUpdateOperationsInput attachmentToAppendParents: ModuleUpdateManyWithoutAttachmentToAppendInput @@ -2618,10 +2924,14 @@ input ModuleUpdateWithoutAttachmentToAppendInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2648,10 +2958,14 @@ input ModuleUpdateWithoutAttachmentToAppendParentsInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2678,10 +2992,14 @@ input ModuleUpdateWithoutCollectionInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2708,10 +3026,14 @@ input ModuleUpdateWithoutDefaultLeftExtensionInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2738,10 +3060,14 @@ input ModuleUpdateWithoutDefaultLeftExtensionParentsInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2768,10 +3094,14 @@ input ModuleUpdateWithoutDefaultRightExtensionInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2798,10 +3128,14 @@ input ModuleUpdateWithoutDefaultRightExtensionParentsInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2828,10 +3162,14 @@ input ModuleUpdateWithoutFinishInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2859,9 +3197,13 @@ input ModuleUpdateWithoutModuleAttachedToInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2889,9 +3231,13 @@ input ModuleUpdateWithoutModuleAttachmentsInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2919,9 +3265,81 @@ input ModuleUpdateWithoutModuleTypeInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput + partNumber: StringFieldUpdateOperationsInput + projectModules: ProjectModuleUpdateManyWithoutModuleInput + rules: Json + shouldHideBasedOnWidth: BoolFieldUpdateOperationsInput + thumbnailUrl: NullableStringFieldUpdateOperationsInput + updatedAt: DateTimeFieldUpdateOperationsInput +} + +input ModuleUpdateWithoutModulesIOwnInput { + alwaysDisplay: BoolFieldUpdateOperationsInput + attachmentToAppend: ModuleUpdateOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents: ModuleUpdateManyWithoutAttachmentToAppendInput + bundleUrl: NullableStringFieldUpdateOperationsInput + collection: CollectionUpdateOneRequiredWithoutModulesInput + createdAt: DateTimeFieldUpdateOperationsInput + defaultLeftExtension: ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents: ModuleUpdateManyWithoutDefaultLeftExtensionInput + defaultRightExtension: ModuleUpdateOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents: ModuleUpdateManyWithoutDefaultRightExtensionInput + description: NullableStringFieldUpdateOperationsInput + externalId: NullableStringFieldUpdateOperationsInput + finish: FinishUpdateOneRequiredWithoutModulesInput + hasPegs: BoolFieldUpdateOperationsInput + isEdge: BoolFieldUpdateOperationsInput + isExtension: BoolFieldUpdateOperationsInput + isMat: BoolFieldUpdateOperationsInput + isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput + moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput + moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput + moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput + moduleType: ModuleTypeUpdateManyWithoutModuleInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput + partNumber: StringFieldUpdateOperationsInput + projectModules: ProjectModuleUpdateManyWithoutModuleInput + rules: Json + shouldHideBasedOnWidth: BoolFieldUpdateOperationsInput + thumbnailUrl: NullableStringFieldUpdateOperationsInput + updatedAt: DateTimeFieldUpdateOperationsInput +} + +input ModuleUpdateWithoutOwnerInput { + alwaysDisplay: BoolFieldUpdateOperationsInput + attachmentToAppend: ModuleUpdateOneWithoutAttachmentToAppendParentsInput + attachmentToAppendParents: ModuleUpdateManyWithoutAttachmentToAppendInput + bundleUrl: NullableStringFieldUpdateOperationsInput + collection: CollectionUpdateOneRequiredWithoutModulesInput + createdAt: DateTimeFieldUpdateOperationsInput + defaultLeftExtension: ModuleUpdateOneWithoutDefaultLeftExtensionParentsInput + defaultLeftExtensionParents: ModuleUpdateManyWithoutDefaultLeftExtensionInput + defaultRightExtension: ModuleUpdateOneWithoutDefaultRightExtensionParentsInput + defaultRightExtensionParents: ModuleUpdateManyWithoutDefaultRightExtensionInput + description: NullableStringFieldUpdateOperationsInput + externalId: NullableStringFieldUpdateOperationsInput + finish: FinishUpdateOneRequiredWithoutModulesInput + hasPegs: BoolFieldUpdateOperationsInput + isEdge: BoolFieldUpdateOperationsInput + isExtension: BoolFieldUpdateOperationsInput + isMat: BoolFieldUpdateOperationsInput + isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput + moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput + moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput + moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput + moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json partNumber: StringFieldUpdateOperationsInput projectModules: ProjectModuleUpdateManyWithoutModuleInput rules: Json @@ -2949,10 +3367,14 @@ input ModuleUpdateWithoutProjectModulesInput { isExtension: BoolFieldUpdateOperationsInput isMat: BoolFieldUpdateOperationsInput isSubmodule: BoolFieldUpdateOperationsInput + isVirtualProduct: BoolFieldUpdateOperationsInput moduleAttachedTo: ModuleAttachmentsUpdateManyWithoutAttachmentInput moduleAttachments: ModuleAttachmentsUpdateManyWithoutModuleInput moduleCategories: ModuleCategoryUpdateManyWithoutModuleInput moduleType: ModuleTypeUpdateManyWithoutModuleInput + modulesIOwn: ModuleUpdateManyWithoutOwnerInput + originalMarathonProductJson: Json + owner: ModuleUpdateOneWithoutModulesIOwnInput partNumber: StringFieldUpdateOperationsInput rules: Json shouldHideBasedOnWidth: BoolFieldUpdateOperationsInput @@ -2990,6 +3412,12 @@ input ModuleUpsertWithWhereUniqueWithoutFinishInput { where: ModuleWhereUniqueInput! } +input ModuleUpsertWithWhereUniqueWithoutOwnerInput { + create: ModuleCreateWithoutOwnerInput! + update: ModuleUpdateWithoutOwnerInput! + where: ModuleWhereUniqueInput! +} + input ModuleUpsertWithoutAttachmentToAppendParentsInput { create: ModuleCreateWithoutAttachmentToAppendParentsInput! update: ModuleUpdateWithoutAttachmentToAppendParentsInput! @@ -3020,6 +3448,11 @@ input ModuleUpsertWithoutModuleTypeInput { update: ModuleUpdateWithoutModuleTypeInput! } +input ModuleUpsertWithoutModulesIOwnInput { + create: ModuleCreateWithoutModulesIOwnInput! + update: ModuleUpdateWithoutModulesIOwnInput! +} + input ModuleUpsertWithoutProjectModulesInput { create: ModuleCreateWithoutProjectModulesInput! update: ModuleUpdateWithoutProjectModulesInput! @@ -3053,10 +3486,15 @@ input ModuleWhereInput { isExtension: BoolFilter isMat: BoolFilter isSubmodule: BoolFilter + isVirtualProduct: BoolFilter moduleAttachedTo: ModuleAttachmentsListRelationFilter moduleAttachments: ModuleAttachmentsListRelationFilter moduleCategories: ModuleCategoryListRelationFilter moduleType: ModuleTypeListRelationFilter + modulesIOwn: ModuleListRelationFilter + originalMarathonProductJson: JsonNullableFilter + owner: ModuleWhereInput + ownerExternalId: StringNullableFilter partNumber: StringFilter projectModules: ProjectModuleListRelationFilter rules: JsonNullableFilter @@ -3104,6 +3542,17 @@ input NestedDateTimeFilter { notIn: [DateTime!] } +input NestedDateTimeNullableFilter { + equals: DateTime + gt: DateTime + gte: DateTime + in: [DateTime!] + lt: DateTime + lte: DateTime + not: NestedDateTimeNullableFilter + notIn: [DateTime!] +} + input NestedEnumLocaleFilter { equals: Locale in: [Locale!] @@ -3183,6 +3632,10 @@ input NestedStringNullableFilter { startsWith: String } +input NullableDateTimeFieldUpdateOperationsInput { + set: DateTime +} + input NullableFloatFieldUpdateOperationsInput { decrement: Float divide: Float diff --git a/src/routes/v1/sync.ts b/src/routes/v1/sync.ts index fae2174..74e74a9 100644 --- a/src/routes/v1/sync.ts +++ b/src/routes/v1/sync.ts @@ -16,4 +16,15 @@ router.get('/', async (req, res) => { } }); +router.get('/parse/:id', async (req, res) => { + const { SYNC_AUTH } = env; + if (SYNC_AUTH && req.query.auth === SYNC_AUTH && req.params.id) { + // Do not await, fire and forget + const data = await marathonService({ db: getDb() }).fetchSingleProduct(req.params.id); + res.json(data); + } else { + res.status(401).json({ error: 'unauthorized' }); + } +}); + export default router; diff --git a/src/schema/moduleRules.ts b/src/schema/moduleRules.ts index c5d969e..2fa9ce4 100644 --- a/src/schema/moduleRules.ts +++ b/src/schema/moduleRules.ts @@ -74,11 +74,15 @@ export const ModuleRulesMetadata = objectType({ description: 'The amount (in degrees) that the product can be rotated' }); - t.list.nonNull.string('options', { + t.float('angle', { + description: 'The amount (in degrees) that the product can be angled' + }); + + t.list.string('options', { description: 'Options are which other modules can be put IN modules' }); - t.list.nonNull.string('trimmable', { + t.list.string('trimmable', { description: "Where a module can be cut if there's excess beyond the drawer" }); @@ -90,6 +94,10 @@ export const ModuleRulesMetadata = objectType({ description: "Whether or not this module is only valid if it's taking the drawer full depth" }); + t.boolean('isFiller', { + description: 'Whether or not this module is a filler kind of module' + }); + t.field('queue', { type: QueueInfoMetadata, description: 'Queue info' @@ -97,12 +105,44 @@ export const ModuleRulesMetadata = objectType({ } }); +export const ModuleCollectionsMetadata = objectType({ + name: 'ModuleCollectionsMetadata', + definition(t) { + t.string('slug'); + t.nonNull.string('externalId'); + } +}); + export const ModuleExtensionsMetadata = objectType({ name: 'ModuleExtensionsMetadata', definition(t) { t.string('left'); t.string('right'); - t.list.nonNull.string('options'); + t.list.string('options'); + } +}); + +export const ModuleFinishesMetadata = objectType({ + name: 'ModuleFinishesMetadata', + definition(t) { + t.string('slug'); + t.nonNull.string('externalId'); + } +}); + +export const ModuleDrawerTypesMetadata = objectType({ + name: 'ModuleDrawerTypesMetadata', + definition(t) { + t.string('slug'); + t.nonNull.string('externalId'); + } +}); + +export const ModuleCategoryMetadata = objectType({ + name: 'ModuleCategoryMetadata', + definition(t) { + t.string('slug'); + t.nonNull.string('externalId'); } }); @@ -113,20 +153,47 @@ export const ModuleRules = objectType({ description: 'The module part number, probably equivalent to the module id' }); - t.list.nonNull.string('finishes', { - description: - 'Modules that are basically this module but in a different finish(color), to allow the ui to easily switch between them' + t.nonNull.string('externalId'); + t.string('description'); + t.string('thumbnailUrl'); + t.string('bundleUrl'); + t.boolean('isSubmodule'); + t.boolean('hasPegs'); + t.boolean('isMat'); + t.boolean('shouldHideBasedOnWidth'); + t.boolean('alwaysDisplay'); + t.boolean('isEdge'); + t.boolean('isVirtualProduct'); + t.string('ownerExternalId'); + + t.nonNull.boolean('isExtension'); + + t.list.string('trims', { + description: 'Different types of edges a module might have' }); - t.list.nonNull.string('trims', { - description: 'Different types of edges a module might have' + t.list.nonNull.string('otherFinishes', { + description: 'The equivalent of same module but on other finishes' }); - t.string('bundleUrl'); + t.nonNull.field('finish', { + type: ModuleFinishesMetadata, + description: 'The current finish of this module' + }); + + t.nonNull.field('collection', { + type: ModuleCollectionsMetadata + }); - t.nonNull.boolean('isImprintExtension'); + t.list.field('drawerTypes', { + type: ModuleDrawerTypesMetadata + }); + + t.list.field('categories', { + type: ModuleCategoryMetadata + }); - t.field('dimensions', { + t.nonNull.field('dimensions', { type: ModuleDimension }); diff --git a/src/schema/project.ts b/src/schema/project.ts index d8afcd8..79cb5d6 100644 --- a/src/schema/project.ts +++ b/src/schema/project.ts @@ -45,15 +45,39 @@ export const Project = objectType({ const modules = await ctx.prisma.module.findMany({ where: { collectionId: root.collectionId, - finishId: root.finishId, externalId: { not: null }, OR: [ + // Basic filter. Grabs modules based on selected options { moduleType: { some: { typeId: { equals: root.typeId } } }, - hasPegs: root.hasPegs + hasPegs: root.hasPegs, + finishId: root.finishId }, + // Same as basic filter BUT { - alwaysDisplay: true + moduleType: { some: { typeId: { equals: root.typeId } } }, + hasPegs: root.hasPegs, + // Also grabs all modules that the finish does not belong to the selected collection (makes aluminum modules show) + finish: { + collectionFinishes: { + none: { collectionId: root.collectionId } + } + } + }, + // Also grabs modules where they're set as alwaysDisplay regardless of peg + { + alwaysDisplay: true, + finishId: root.finishId + }, + // Grabs modules where they're set as alwaysDisplay regardless of peg BUT + { + alwaysDisplay: true, + // Also grabs all modules that the finish does not belong to the selected collection (makes aluminum modules show) + finish: { + collectionFinishes: { + none: { collectionId: root.collectionId } + } + } } ], isSubmodule: false, diff --git a/src/services/fileUpload.ts b/src/services/fileUpload.ts index cbfafdf..303fb1e 100644 --- a/src/services/fileUpload.ts +++ b/src/services/fileUpload.ts @@ -28,7 +28,7 @@ export const fileUploadService = () => { }); }; - const uploadFileToStorage = (file: Buffer, destination: string) => + const uploadFileToStorage = (file: Buffer, destination: string, mimetype?: string) => new Promise(async (resolve, reject) => { if (!AWS_STORAGE_BUCKET_NAME || !AWS_DEFAULT_ACL) { reject(makeError('Environment not set to upload files', 'invalidEnvironment')); @@ -45,7 +45,8 @@ export const fileUploadService = () => { Bucket: bucket, Key: destination, Body: file, - ACL: AWS_DEFAULT_ACL + ACL: AWS_DEFAULT_ACL, + ContentType: mimetype }, (err) => { if (err) return reject(err); diff --git a/src/services/marathon/fragments.ts b/src/services/marathon/fragments.ts index f437c30..f076e80 100644 --- a/src/services/marathon/fragments.ts +++ b/src/services/marathon/fragments.ts @@ -247,6 +247,16 @@ export const SP_PRODUCT_FRAGMENT = gql` partNumber: itemId childrenSortBy classname + alternative { + ... on object_alternative { + id + partNumber: key + hasPegs + bundlePath { + ...Asset + } + } + } creationDate hasPegs index diff --git a/src/services/marathon/index.ts b/src/services/marathon/index.ts index 8d37dfa..211e643 100644 --- a/src/services/marathon/index.ts +++ b/src/services/marathon/index.ts @@ -1,38 +1,41 @@ import { ApolloClient, from, HttpLink, InMemoryCache, NormalizedCacheObject } from '@apollo/client/core'; -// import { print } from 'graphql'; -import { Locale, PrismaClient } from '@prisma/client'; +import { Locale, Module, PrismaClient } from '@prisma/client'; import { ForbiddenError } from 'apollo-server'; import axios, { AxiosResponse } from 'axios'; import fetch from 'cross-fetch'; -import deepmerge from 'deepmerge'; -import { isEqual } from 'lodash'; +import { helpers } from 'faker'; +import { toNumber } from 'lodash'; +import mime from 'mime'; import path from 'path'; import { URL } from 'url'; +import seed from '../../../prisma/seedValues/seed.json'; import { env } from '../../env'; import { - CsFeatureMultiselect, - CsFeatureQuantityValue, GetProductListingQuery, GetProductListingQueryVariables, + GetProductQuery, + GetProductQueryVariables, GetSpCategoryListingQuery, GetSpCollectionListingQuery, GetSpDrawerTypesListingQuery, GetSpFinishListingQuery } from '../../generated/graphql'; -import { NexusGenObjects } from '../../generated/nexus'; -import { convertInToMmFormatted, convertMmToInFormatted } from '../../utils/conversion'; import { makeError } from '../../utils/exception'; -import { replaceExtension } from '../../utils/file'; +import { makeFile } from '../../utils/file'; import logging from '../../utils/logging'; import { fileUploadService } from '../fileUpload'; import { projectService } from '../project'; +import { MarathonModule, ModuleRules } from './parsing/constants'; +import { makeRulesFromMarathonModule, mergeRules } from './parsing/parseRules'; import { + GET_PRODUCT, GET_PRODUCT_LISTING, GET_SP_CATEGORY_LISTING, GET_SP_COLLECTION_LISTING, GET_SP_DRAWER_TYPES_LISTING, GET_SP_FINISH_LISTING } from './queries'; +import fs from 'fs'; type MarathonServiceDependencies = { db?: PrismaClient; @@ -40,25 +43,6 @@ type MarathonServiceDependencies = { let marathonApolloClient: ApolloClient | undefined; -const FEATURE_NAMES = { - DIMENSION_HEIGHT: 'height', - MM_ID: 'mm', - IN_ID: 'in', - MIN_WIDTH: 'width_min', - MAX_WIDTH: 'width_max', - MIN_DEPTH: 'depth_min', - MAX_DEPTH: 'depth_max', - TRIMMABLE: 'trimmable', - TRIM_OFFSET_BOTTOM: 'trim_offset_bottom', - TRIM_OFFSET_TOP: 'trim_offset_top', - TRIM_OFFSET_LEFT: 'trim_offset_left', - TRIM_OFFSET_RIGHT: 'trim_offset_right' -}; - -type MarathonModule = NonNullable< - NonNullable['edges']>[0] ->['node']; - export const marathonService = ({ db }: MarathonServiceDependencies) => { const { MARATHON_API, @@ -95,31 +79,8 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { cache: new InMemoryCache() }); - const storageSyncQueue: { - sourcePath: string; - originalPath: string; - destinationPath: string; - }[] = []; - - const makeThumbnailUrlAndQueue = (sourcePath?: string | null, currentPath?: string | null) => { - let thumbnailUrl: string | undefined; - - if (sourcePath?.trim() && currentPath?.trim()) { - thumbnailUrl = replaceExtension(currentPath, sourcePath); - let originalPath = thumbnailUrl; - - // If the extension were changed, the paths are now different. So store the previous original path so the image can be deleted - if (currentPath !== originalPath) originalPath = currentPath; - - storageSyncQueue.push({ - sourcePath, - originalPath, - destinationPath: thumbnailUrl - }); - } - - return thumbnailUrl; - }; + const storageSyncQueue: string[] = []; + const imagesNotFound: string[] = []; const storageSync = async () => { if (!MARATHON_MEDIA_URI) { @@ -139,24 +100,41 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { const promises: Promise[] = []; for (let index = 0; index < simultaneousSync; index++) { - const storageSync = storageSyncQueue[index]; + let imagePath = storageSyncQueue[index]; + + if (imagePath.startsWith('/')) { + imagePath = imagePath.substring(1); + } promises.push( new Promise(async (resolve, reject) => { try { - console.log(`Syncing image #${i + 1} of ${initialLength}`); + console.log(`Syncing image #${i + 1} of ${initialLength}. ${decodeURIComponent(imagePath)}`); i++; - // Download image - const file = await fileUpload.downloadFile( - new URL(storageSync.sourcePath, MARATHON_MEDIA_URI).toString() - ); + try { + // Download image + const file = await fileUpload.downloadFile(new URL(imagePath, MARATHON_MEDIA_URI).toString()); + + try { + // Try to delete current image, but only if managed to download previously + await fileUpload.DELETEFilesOnStorageCAUTION([imagePath]); + } catch { + // Do nothing, file probably doesn't exist + } - // Try to delete current image - await fileUpload.DELETEFilesOnStorageCAUTION([storageSync.originalPath]); + const mimetype = mime.lookup(imagePath) || 'application/octet-stream'; - // Upload new image - await fileUpload.uploadFileToStorage(file.data, storageSync.destinationPath); + // Upload new image + await fileUpload.uploadFileToStorage(file.data, decodeURIComponent(imagePath), mimetype); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (err: any) { + if (err?.response?.status && err.response.status === 404) { + imagesNotFound.push(new URL(imagePath, MARATHON_MEDIA_URI).toString()); + } else { + logging.error(err, 'Could not sync image'); + } + } resolve(); } catch (err) { reject(err); @@ -178,9 +156,13 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } console.log('Finished syncing images'); + + if (imagesNotFound.length > 0) { + logging.warn('These images returned 404', { missingFiles: imagesNotFound }); + } }; - const syncCategory = async () => { + const syncCategory = async (skipDatabase?: boolean) => { if (!db) { throw new Error('db dependency was not provided'); } @@ -196,46 +178,43 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { }); const categories = data?.getSpCategoryListing?.edges || []; - if (categories && categories.length > 0) { - console.log(`Fetched ${categories.length} categories`); - - const slugs = categories - .map((categoryEdge) => categoryEdge?.node?.slug?.trim() as string) // Casting because we're filtering right after - .filter((x) => !!x); - // const externalIds = categories.map(({ node: category }) => category.id); + console.log(`Fetched ${categories.length} categories`); + if (!skipDatabase && categories && categories.length > 0) { // Get all categories that we already have const existingCategories = await db.category.findMany({ - select: { slug: true }, - where: { - slug: { - in: slugs - } - } + select: { externalId: true, slug: true } }); // Received categories const categoriesToUpdate = categories.filter((categoryEdge) => // Where exists in the database - existingCategories.some((cat) => cat.slug === categoryEdge?.node?.slug?.trim()) + existingCategories.some((cat) => cat.externalId === categoryEdge?.node?.id) ); // Received categories const categoriesToCreate = categories.filter( // Where it DOESN'T exist in the database - (categoryEdge) => !existingCategories.some((cat) => cat.slug === categoryEdge?.node?.slug?.trim()) + (categoryEdge) => !existingCategories.some((cat) => cat.externalId === categoryEdge?.node?.id) + ); + + const categoriesWithSlug = existingCategories.filter((cat) => + categoriesToCreate.some((categoryEdge) => categoryEdge?.node?.slug === cat.slug) ); for (let i = 0; i < categoriesToUpdate.length; i++) { const categoryEdge = categoriesToUpdate[i]; - const slug = categoryEdge?.node?.slug?.trim(); - console.log(`Updating category #${i + 1} ${slug} of ${categoriesToUpdate.length}`); + const id = categoryEdge?.node?.id; + + if (!id) continue; + + console.log(`Updating category id: ${id} #${i + 1} of ${categoriesToUpdate.length}`); await db.category.update({ - where: { slug }, + where: { externalId: id }, data: { - externalId: categoryEdge?.node?.id?.trim(), - name: categoryEdge?.node?.name?.trim() + name: categoryEdge?.node?.name?.trim(), + slug: categoryEdge?.node?.slug?.trim() } }); } @@ -245,18 +224,37 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { await db.category.createMany({ data: categoriesToCreate .filter((categoryEdge) => categoryEdge?.node?.id && categoryEdge?.node?.slug && categoryEdge?.node?.name) - .map((categoryEdge) => ({ - // Casting because we're sure, since there's a filter right above - externalId: categoryEdge?.node?.id?.trim() as string, - slug: categoryEdge?.node?.slug?.trim() as string, - name: categoryEdge?.node?.name?.trim() as string - })) + .map((categoryEdge) => { + let slug = categoryEdge?.node?.slug?.trim() as string; + + const sameSlugCategories = categoriesWithSlug.filter((cat) => cat.slug === slug); + if (sameSlugCategories?.length > 0) { + slug = `${slug}-${sameSlugCategories.length}`; + } + + return { + // Casting because we're sure, since there's a filter right above + externalId: categoryEdge?.node?.id as string, + slug, + name: categoryEdge?.node?.name?.trim() as string + }; + }) }); } else { console.log(`No category to create`); } - } else { - console.log('No category has been returned'); + } + + if (!skipDatabase) { + const allCategory = await db.category.findUnique({ where: { slug: 'all' } }); + if (!allCategory) { + await db.category.create({ + data: { + name: 'All', + slug: 'all' + } + }); + } } } catch (err) { logging.error(err, 'Error fetching Marathon categories'); @@ -266,7 +264,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { console.timeEnd('categories'); }; - const syncCollection = async () => { + const syncCollection = async (skipDatabase?: boolean) => { if (!db) { throw new Error('db dependency was not provided'); } @@ -282,33 +280,25 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { }); const collections = data?.getSpCollectionListing?.edges || []; - if (collections && collections.length > 0) { - console.log(`Fetched ${collections.length} collections`); - - const slugs = collections - .map((collectionEdge) => collectionEdge?.node?.slug?.trim() as string) // Casting because we're filtering right after - .filter((x) => !!x); + console.log(`Fetched ${collections.length} collections`); + if (!skipDatabase && collections && collections.length > 0) { const existingCollections = await db.collection.findMany({ select: { + externalId: true, slug: true, thumbnailUrl: true, translations: { where: { locale: defaultSyncLocale }, select: { id: true } } - }, - where: { - slug: { - in: slugs - } } }); // Received collections const collectionsToUpdate = collections.filter((collectionEdge) => // Where exists in the database - existingCollections.some((col) => col.slug === collectionEdge?.node?.slug?.trim()) + existingCollections.some((col) => col.externalId === collectionEdge?.node?.id) ); const whitelistedSlugs = MARATHON_COLLECTIONS_WHITELIST.split(',').filter((x) => !!x); @@ -318,32 +308,37 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { // Where it DOESN'T exist in the database (collectionEdge) => collectionEdge?.node?.slug?.trim() && - !existingCollections.some((col) => col.slug === collectionEdge?.node?.slug?.trim()) && + !existingCollections.some((col) => col.externalId === collectionEdge?.node?.id) && whitelistedSlugs.includes(collectionEdge.node.slug.trim()) ); + const collectionsWithSlug = existingCollections.filter((col) => + collectionsToCreate.some((collectionEdge) => collectionEdge?.node?.slug === col.slug) + ); + for (let i = 0; i < collectionsToUpdate.length; i++) { const collectionEdge = collectionsToUpdate[i]; - const slug = collectionEdge?.node?.slug?.trim(); + const id = collectionEdge?.node?.id; - const currentCollection = existingCollections.find((x) => x.slug === slug); - if (!currentCollection) continue; + const currentCollection = existingCollections.find((x) => x.externalId === id); + if (!currentCollection || !currentCollection.externalId) continue; - console.log(`Updating collection #${i + 1} ${slug} of ${collectionsToUpdate.length}`); + console.log( + `Updating collection id: ${currentCollection.externalId} #${i + 1} of ${collectionsToUpdate.length}` + ); const translationIds = currentCollection.translations.map((x) => x.id); + const thumbnailUrl = collectionEdge?.node?.image?.fullpath; + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); await db.collection.update({ - where: { slug }, + where: { externalId: currentCollection.externalId }, data: { - externalId: collectionEdge?.node?.id?.trim(), - thumbnailUrl: makeThumbnailUrlAndQueue( - collectionEdge?.node?.image?.fullpath, - currentCollection.thumbnailUrl - ), + slug: collectionEdge?.node?.slug?.trim(), + thumbnailUrl, hasPegs: collectionEdge?.node?.hasPegs || undefined, isComingSoon: collectionEdge?.node?.isComingSoon || undefined, - translations: translationIds && translationIds.length > 0 ? { @@ -367,27 +362,35 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { await db.collection.createMany({ data: collectionsToCreate .filter((collectionEdge) => collectionEdge?.node?.id && collectionEdge?.node?.slug) - .map((collectionEdge) => ({ - // Casting because we're sure, since there's a filter right above - externalId: collectionEdge?.node?.id?.trim() as string, - slug: collectionEdge?.node?.slug?.trim() as string, - thumbnailUrl: makeThumbnailUrlAndQueue( - collectionEdge?.node?.image?.fullpath?.trim(), - `image/collection/${collectionEdge?.node?.slug?.trim()}${path.extname( - collectionEdge?.node?.image?.fullpath?.trim() || '' - )}}` - ), - hasPegs: collectionEdge?.node?.hasPegs || false, - isComingSoon: collectionEdge?.node?.isComingSoon || false - })) + .map((collectionEdge) => { + let slug = collectionEdge?.node?.slug?.trim() as string; + + const sameSlugCollections = collectionsWithSlug.filter((col) => col.slug === slug); + if (sameSlugCollections?.length > 0) { + slug = `${slug}-${sameSlugCollections.length}`; + } + + const thumbnailUrl = collectionEdge?.node?.image?.fullpath?.trim(); + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); + + return { + // Casting because we're sure, since there's a filter right above + externalId: collectionEdge?.node?.id as string, + slug, + thumbnailUrl, + hasPegs: collectionEdge?.node?.hasPegs || false, + isComingSoon: collectionEdge?.node?.isComingSoon || false + }; + }) }); console.log(`Fetching recently created ${collectionsToCreate.length} collections`); const recentlyCreatedCollections = await db.collection.findMany({ - where: { slug: { in: collectionsToCreate.map((x) => x?.node?.slug?.trim() as string).filter((x) => !!x) } }, + where: { externalId: { in: collectionsToCreate.map((x) => x?.node?.id as string).filter((x) => !!x) } }, select: { id: true, - slug: true + externalId: true } }); @@ -396,7 +399,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { data: recentlyCreatedCollections.map((dbCollection) => { // The type is undefined, but we're sure it returns correctly(at least it should) // Worst case translations will be empty, and that's their fault - const collection = collectionsToCreate.find((x) => x?.node?.slug?.trim() === dbCollection.slug); + const collection = collectionsToCreate.find((x) => x?.node?.id === dbCollection.externalId); return { locale: defaultSyncLocale, @@ -410,8 +413,6 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } else { console.log(`No collection to create`); } - } else { - console.log('No collection has been returned'); } } catch (err) { logging.error(err, 'Error fetching Marathon collections'); @@ -421,7 +422,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { console.timeEnd('collections'); }; - const syncDrawerType = async () => { + const syncDrawerType = async (skipDatabase?: boolean) => { if (!db) { throw new Error('db dependency was not provided'); } @@ -436,34 +437,25 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { }); const drawerTypes = data?.getSpDrawerTypesListing?.edges || []; + console.log(`Fetched ${drawerTypes.length} drawer types`); - if (drawerTypes && drawerTypes.length > 0) { - console.log(`Fetched ${drawerTypes.length} drawer types`); - - const slugs = drawerTypes - .map((drawerTypeEdge) => drawerTypeEdge?.node?.slug?.trim() as string) // Casting because we filter right after - .filter((x) => !!x); - + if (!skipDatabase && drawerTypes && drawerTypes.length > 0) { const existingDrawerTypes = await db.type.findMany({ select: { + externalId: true, slug: true, thumbnailUrl: true, translations: { where: { locale: defaultSyncLocale }, select: { id: true } } - }, - where: { - slug: { - in: slugs - } } }); // Received drawer types const drawerTypesToUpdate = drawerTypes.filter((drawerTypeEdge) => // Where exists in the database - existingDrawerTypes.some((type) => type.slug === drawerTypeEdge?.node?.slug?.trim()) + existingDrawerTypes.some((type) => type.externalId === drawerTypeEdge?.node?.id) ); const whitelistedSlugs = MARATHON_DRAWER_TYPES_WHITELIST.split(',').filter((x) => !!x); @@ -473,29 +465,36 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { // Where it DOESN'T exist in the database (drawerTypeEdge) => drawerTypeEdge?.node?.slug?.trim() && - !existingDrawerTypes.some((type) => type.slug === drawerTypeEdge?.node?.slug?.trim()) && + !existingDrawerTypes.some((type) => type.externalId === drawerTypeEdge?.node?.id) && whitelistedSlugs.includes(drawerTypeEdge.node.slug.trim()) ); + const typesWithSlug = existingDrawerTypes.filter((type) => + drawerTypesToCreate.some((typeEdge) => typeEdge?.node?.slug === type.slug) + ); + for (let i = 0; i < drawerTypesToUpdate.length; i++) { const drawerTypeEdge = drawerTypesToUpdate[i]; - const slug = drawerTypeEdge?.node?.slug?.trim(); + const id = drawerTypeEdge?.node?.id; - const currentDrawerType = existingDrawerTypes.find((x) => x.slug === slug); - if (!currentDrawerType) continue; + const currentDrawerType = existingDrawerTypes.find((x) => x.externalId === id); + if (!currentDrawerType || !currentDrawerType.externalId) continue; - console.log(`Updating drawer type #${i + 1} ${slug} of ${drawerTypesToUpdate.length}`); + console.log( + `Updating drawer type id: ${currentDrawerType.externalId} #${i + 1} of ${drawerTypesToUpdate.length}` + ); const translationIds = currentDrawerType.translations.map((x) => x.id); + const thumbnailUrl = drawerTypeEdge?.node?.image?.fullpath; + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); + await db.type.update({ - where: { slug }, + where: { externalId: currentDrawerType.externalId }, data: { - externalId: drawerTypeEdge?.node?.id?.trim(), - thumbnailUrl: makeThumbnailUrlAndQueue( - drawerTypeEdge?.node?.image?.fullpath, - currentDrawerType.thumbnailUrl - ), + slug: drawerTypeEdge?.node?.slug?.trim(), + thumbnailUrl, hasPegs: drawerTypeEdge?.node?.hasPegs || undefined, // isComingSoon: drawerTypeEdge?.node?.isComingSoon || undefined, @@ -521,27 +520,35 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { await db.type.createMany({ data: drawerTypesToCreate .filter((drawerTypeEdge) => drawerTypeEdge?.node?.id && drawerTypeEdge?.node?.slug) - .map((drawerTypeEdge) => ({ - // Casting because we're filtering right above - externalId: drawerTypeEdge?.node?.id?.trim() as string, - slug: drawerTypeEdge?.node?.slug?.trim() as string, - thumbnailUrl: makeThumbnailUrlAndQueue( - drawerTypeEdge?.node?.image?.fullpath?.trim(), - `image/type/${drawerTypeEdge?.node?.slug?.trim()}${path.extname( - drawerTypeEdge?.node?.image?.fullpath?.trim() || '' - )}` - ), - hasPegs: drawerTypeEdge?.node?.hasPegs || false - // isComingSoon: drawerTypeEdge?.node?.isComingSoon || false - })) + .map((drawerTypeEdge) => { + let slug = drawerTypeEdge?.node?.slug?.trim() as string; + + const sameSlugTypes = typesWithSlug.filter((type) => type.slug === slug); + if (sameSlugTypes?.length > 0) { + slug = `${slug}-${sameSlugTypes.length}`; + } + + const thumbnailUrl = drawerTypeEdge?.node?.image?.fullpath?.trim(); + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); + + return { + // Casting because we're filtering right above + externalId: drawerTypeEdge?.node?.id as string, + slug, + thumbnailUrl, + hasPegs: drawerTypeEdge?.node?.hasPegs || false + // isComingSoon: drawerTypeEdge?.node?.isComingSoon || false + }; + }) }); console.log(`Fetching recently created ${drawerTypesToCreate.length} drawer types`); - const recentlyCreatedDrawerTypes = await db.collection.findMany({ - where: { slug: { in: drawerTypesToCreate.map((x) => x?.node?.slug?.trim() as string).filter((x) => !!x) } }, + const recentlyCreatedDrawerTypes = await db.type.findMany({ + where: { externalId: { in: drawerTypesToCreate.map((x) => x?.node?.id as string).filter((x) => !!x) } }, select: { id: true, - slug: true + externalId: true } }); @@ -549,7 +556,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { await db.typeTranslations.createMany({ data: recentlyCreatedDrawerTypes.map((dbType) => { // This returns undefined, but we're sure it returns correctly(at least it should) - const drawerType = drawerTypesToCreate.find((x) => x?.node?.slug?.trim() === dbType.slug); + const drawerType = drawerTypesToCreate.find((x) => x?.node?.id === dbType.externalId); return { locale: defaultSyncLocale, @@ -562,8 +569,6 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } else { console.log(`No drawerType to create`); } - } else { - console.log('No drawer type has been returned'); } } catch (err) { logging.error(err, 'Error fetching Marathon drawer types'); @@ -573,7 +578,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { console.timeEnd('drawerType'); }; - const syncFinish = async () => { + const syncFinish = async (skipDatabase?: boolean) => { if (!db) { throw new Error('db dependency was not provided'); } @@ -588,33 +593,26 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { }); const finishes = data.getSpFinishListing?.edges || []; - if (finishes && finishes.length > 0) { - console.log(`Fetched ${finishes.length} finishes`); - - const slugs = finishes - .map((finishEdge) => finishEdge?.node?.slug?.trim() as string) // Casting since we're filtering right after - .filter((x) => !!x); + console.log(`Fetched ${finishes.length} finishes`); + if (!skipDatabase && finishes && finishes.length > 0) { const existingFinishes = await db.finish.findMany({ select: { + id: true, + externalId: true, slug: true, thumbnailUrl: true, translations: { where: { locale: defaultSyncLocale }, select: { id: true } } - }, - where: { - slug: { - in: slugs - } } }); // Received finishes const finishesToUpdate = finishes.filter((finishEdge) => // Where exists in the database - existingFinishes.some((fin) => fin.slug === finishEdge?.node?.slug?.trim()) + existingFinishes.some((fin) => fin.externalId === finishEdge?.node?.id) ); const whitelistedSlugs = MARATHON_FINISHES_WHITELIST.split(',').filter((x) => !!x); @@ -624,26 +622,33 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { // Where it DOESN'T exist in the database (finishEdge) => finishEdge?.node?.slug?.trim() && - !existingFinishes.some((fin) => fin.slug === finishEdge?.node?.slug?.trim()) && + !existingFinishes.some((fin) => fin.externalId === finishEdge?.node?.id) && whitelistedSlugs.includes(finishEdge.node.slug.trim()) ); + const finishesWithSlug = existingFinishes.filter((fin) => + finishesToCreate.some((finishEdge) => finishEdge?.node?.slug === fin.slug) + ); + for (let i = 0; i < finishesToUpdate.length; i++) { const finishEdge = finishesToUpdate[i]; - const slug = finishEdge?.node?.slug?.trim(); + const id = finishEdge?.node?.id; - const currentFinish = existingFinishes.find((x) => x.slug === slug); - if (!currentFinish) continue; + const currentFinish = existingFinishes.find((x) => x.externalId === id); + if (!currentFinish || !currentFinish.externalId) continue; - console.log(`Updating finish #${i + 1} ${slug} of ${finishesToUpdate.length}`); + console.log(`Updating finish id: ${id} #${i + 1} of ${finishesToUpdate.length}`); const translationIds = currentFinish.translations.map((x) => x.id); - await db.finish.update({ - where: { slug }, - data: { - externalId: finishEdge?.node?.id?.trim(), - thumbnailUrl: makeThumbnailUrlAndQueue(finishEdge?.node?.image?.fullpath, currentFinish.thumbnailUrl), + const thumbnailUrl = finishEdge?.node?.image?.fullpath; + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); + + try { + console.dir({ + slug: finishEdge?.node?.slug?.trim(), + thumbnailUrl, translations: translationIds && translationIds.length > 0 ? { @@ -657,36 +662,70 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } } : undefined - } - }); + }); + + await db.finish.update({ + where: { externalId: currentFinish.externalId }, + data: { + slug: finishEdge?.node?.slug?.trim(), + thumbnailUrl, + translations: + translationIds && translationIds.length > 0 + ? { + update: { + // Theoretically we should only have one id for locale+slug + where: { id: translationIds[0] }, + data: { + name: finishEdge?.node?.name?.trim(), + description: finishEdge?.node?.description?.trim() + } + } + } + : undefined + } + }); + } catch (ex) { + throw ex; + } + + await db.collectionFinishes.deleteMany({ where: { finish: { externalId: currentFinish.externalId } } }); } + let recentlyCreatedFinishes: { id: number; externalId: string | null; slug: string }[] = []; + if (finishesToCreate && finishesToCreate.length > 0) { console.log(`Batch creating ${finishesToCreate.length} finishes`); await db.finish.createMany({ data: finishesToCreate - .filter( - (finishEdge) => finishEdge?.node?.id && finishEdge?.node?.slug && finishEdge?.node?.image?.fullpath - ) - .map((finishEdge) => ({ - // Casing since we're filtering right above - externalId: finishEdge?.node?.id?.trim() as string, - slug: finishEdge?.node?.slug?.trim() as string, - thumbnailUrl: makeThumbnailUrlAndQueue( - finishEdge?.node?.image?.fullpath?.trim(), - `image/finish/${finishEdge?.node?.slug?.trim()}${path.extname( - finishEdge?.node?.image?.fullpath?.trim() || '' - )}` - ) - })) + .filter((finishEdge) => finishEdge?.node?.id && finishEdge?.node?.slug) + .map((finishEdge) => { + let slug = finishEdge?.node?.slug?.trim() as string; + + const sameSlugFinishes = finishesWithSlug.filter((fin) => fin.slug === slug); + if (sameSlugFinishes?.length > 0) { + slug = `${slug}-${sameSlugFinishes.length}`; + } + + const thumbnailUrl = finishEdge?.node?.image?.fullpath?.trim(); + + if (thumbnailUrl) storageSyncQueue.push(thumbnailUrl); + + return { + // Casing since we're filtering right above + externalId: finishEdge?.node?.id?.trim() as string, + slug, + thumbnailUrl + }; + }) }); console.log(`Fetching recently created ${finishesToCreate.length} finishes`); - const recentlyCreatedFinishes = await db.finish.findMany({ - where: { slug: { in: finishesToCreate.map((x) => x?.node?.slug?.trim() as string).filter((x) => !!x) } }, + recentlyCreatedFinishes = await db.finish.findMany({ + where: { externalId: { in: finishesToCreate.map((x) => x?.node?.id as string).filter((x) => !!x) } }, select: { id: true, - slug: true + slug: true, + externalId: true } }); @@ -694,7 +733,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { await db.finishTranslations.createMany({ data: recentlyCreatedFinishes.map((dbFinish) => { // This returns undefined, but we're sure it returns correctly(at least it should) - const finish = finishesToCreate.find((x) => x?.node?.slug?.trim() === dbFinish.slug); + const finish = finishesToCreate.find((x) => x?.node?.id === dbFinish.externalId); return { locale: defaultSyncLocale, @@ -707,8 +746,44 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } else { console.log(`No finish to create`); } - } else { - console.log('No finish has been returned'); + + const allFinishes = [...recentlyCreatedFinishes, ...existingFinishes]; + + const collectionsForFinishes = await db.collection.findMany({ + where: { + slug: { + in: seed.collectionFinishes + .filter((colFin) => allFinishes.some((dbFin) => dbFin.slug === colFin.finish)) + .map((x) => x.collection) + } + } + }); + + console.log(`Batch creating ${allFinishes.length} collection finishes`); + await db.collectionFinishes.createMany({ + skipDuplicates: true, + data: allFinishes + .flatMap((dbFinish) => { + const collectionFinish = seed.collectionFinishes.filter((x) => x.finish === dbFinish.slug); + return collectionFinish.flatMap((collectionFinish) => { + const collection = collectionsForFinishes.filter((x) => x.slug === collectionFinish?.collection); + + return collection.flatMap((collection) => ({ + finishId: dbFinish.id, + collectionId: collection?.id || -1 + })); + }); + }) + .filter((x) => !!x) + .map( + (x) => + // Casting because we filtered right before + x as { + finishId: number; + collectionId: number; + } + ) + }); } } catch (err) { logging.error(err, 'Error fetching Marathon finishes'); @@ -718,225 +793,409 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { console.timeEnd('finish'); }; - /** - * Tries to grab a value of @param featureName from a feature list - */ - const getQuantityValueFeature = ( - featureList: NonNullable['configuratorAttributes']>[number]>['features'], - featureName: string, - featureUnitId: string, - format?: (value?: unknown) => TResult - ): TResult => { - // Get the feature with the name we want from the list - const feature = featureList?.find((feature) => feature?.name === featureName) as CsFeatureQuantityValue | undefined; - - // If unit is wrong - if (feature?.quantityvalue?.unit?.id && feature.quantityvalue.unit.id !== featureUnitId) { - if (featureUnitId === FEATURE_NAMES.MM_ID && feature.quantityvalue.unit.id === FEATURE_NAMES.IN_ID) { - const inchValue = convertInToMmFormatted(`${feature.quantityvalue.value || 0}`); - - return format ? format(inchValue) : (inchValue as unknown as TResult); - } else if (featureUnitId === FEATURE_NAMES.IN_ID && feature.quantityvalue.unit.id === FEATURE_NAMES.MM_ID) { - const mmValue = convertMmToInFormatted(`${feature.quantityvalue.value || 0}`); - - return format ? format(mmValue) : (mmValue as unknown as TResult); - } else { - throw makeError( - `Expected ${featureName} feature as ${featureUnitId}, but was returned as "${feature?.quantityvalue?.unit?.id}" with value "${feature.quantityvalue.value}"`, - 'ruleMergeFeatureQuantityUnit' - ); + const syncSlides = async (skipDatabase?: boolean) => { + if (!db) { + throw new Error('db dependency was not provided'); + } + + console.log('Syncing slides'); + console.time('slides'); + console.log('Fetching slides'); + + try { + // const { data } = await marathonApollo.query({ + // query: GET_SP_FINISH_LISTING, + // fetchPolicy: 'no-cache' + // }); + const data = seed.slides; + + const slides = data; + console.log(`Fetched ${slides.length} slides`); + + if (!skipDatabase && slides && slides.length > 0) { + for (let i = 0; i < slides.length; i++) { + const slideEdge = slides[i]; + + console.log(`Upserting slide #${i + 1} of ${slides.length}`); + + const supplierSlug = helpers.slugify(slideEdge.supplier).toLowerCase(); + const slideSlug = helpers + .slugify(`${slideEdge.supplier}-${slideEdge.product}-${slideEdge.collection}`) + .toLowerCase(); + + const existingSlide = await db.slide.findUnique({ where: { slug: slideSlug } }); + const depths = slideEdge.depth; + + if (!existingSlide) { + if (!skipDatabase) { + // Commented since we're never updating it anyway + /* existingSlide = */ await db.slide.create({ + data: { + slug: slideSlug, + formula: slideEdge.formula, + product: slideEdge.product, + supplier: { + connectOrCreate: { + where: { + slug: supplierSlug + }, + create: { + name: slideEdge.supplier, + slug: supplierSlug, + thumbnailUrl: seed.supplierLogos.find((y) => y.supplier === supplierSlug)?.supplierImgURL + } + } + }, + collection: { + connect: { + slug: slideEdge.collection + } + }, + depths: { + createMany: { + data: depths.map(({ roundedValue, value }) => ({ + display: `${roundedValue}mm`, + depth: toNumber(value) + })) + } + } + } + }); + } + } else if (false) { + if (!skipDatabase) { + // Commented for now since we're using seed so data would never be updated + // existingSlide = await db.slide.update({ + // where: { slug: slideSlug }, + // data: { + // formula: slideEdge.formula, + // product: slideEdge.product, + // supplier: { + // connectOrCreate: { + // where: { + // slug: supplierSlug + // }, + // create: { + // name: slideEdge.supplier, + // slug: supplierSlug, + // thumbnailUrl: seed.supplierLogos.find((y) => y.supplier === supplierSlug)?.supplierImgURL + // } + // } + // }, + // collection: { + // connect: { + // slug: slideEdge.collection + // } + // } + // } + // }); + // await db.slideDepth.deleteMany({ where: { slideId: existingSlide.id } }); + // if (depths?.length > 0) { + // await db.slideDepth.createMany({ + // data: depths.map(({ roundedValue, value }) => ({ + // display: `${roundedValue}mm`, + // depth: toNumber(value), + // slideId: existingSlide?.id || -1 + // })) + // }); + // } + } + } + } } + } catch (err) { + logging.error(err, 'Error fetching Marathon slides'); } - // Format or return plain - return format ? format(feature?.quantityvalue?.value) : (feature?.quantityvalue?.value as unknown as TResult); + console.log('Finished syncing slides'); + console.timeEnd('slides'); }; - /** - * Tries to safely convert a param to a number - */ - const numberFromMaybe = (originalValue?: string | number | null | unknown): number => { - let value = originalValue; + const upsertProductModule = async ( + module: ModuleRules, + skipDatabase?: boolean, + originalMarathonProductJson?: MarathonModule + // eslint-disable-next-line @typescript-eslint/ban-types + ): Promise<'created' | 'updated' | (string & {})> => { + if (!db) { + throw new Error('db dependency was not provided'); + } - if (typeof value !== 'number') value = parseFloat(`${value}`); + if (!module.externalId) return `Module ${module.partNumber} has no externalId`; - // Castng because we convert the value above - return value && !isNaN(value as number) ? (value as number) : 0; - }; + let status = 'created'; + + console.log(`Upserting module ${module.partNumber} ${module.externalId}`); + + //const dir = path.join(__dirname, `./output`, '../../../../../marathon-module-jsons'); + //makeFile(dir, path.join(`jsons/${module.partNumber}.json`), module); + + const existingProduct = await db.module.findUnique({ + where: { + externalId: module.externalId + } + }); + + const partNumberProduct = await db.module.findMany({ + where: { + partNumber: { startsWith: module.partNumber } + } + }); + + // Removes unwanted data out of "module" + const { + finish, + collection, + drawerTypes, + categories, + otherFinishes, + extensions, + dimensions, + ownerExternalId, + ...moduleRest + } = module; + + let { partNumber } = module; + + const bundleUrl = seed.modules.find((x) => x.partNumber.toLowerCase() === partNumber.toLowerCase())?.bundlePath; + + if (!bundleUrl) { + try { + fs.writeFileSync( + path.normalize(__dirname + `./../../../debug/${module.partNumber}.json`), + JSON.stringify(module, null, 2), + { flag: 'w', encoding: 'utf-8' } + ); + } catch { + // Do nothing + } + } + + if (!existingProduct && partNumberProduct?.length > 0) { + partNumber = `${partNumber}-${partNumberProduct.length}`; + } - const makeRulesFromMarathonModule = (marathonModule: MarathonModule): NexusGenObjects['ModuleRules'] => { - const partNumber = marathonModule?.partNumber?.trim(); - if (!partNumber) throw makeError('Cannot create rule without partNumber', 'ruleMergeMissingPartNumber'); - - // ---- Dimensions - - const dimensionAttribute = marathonModule?.configuratorAttributes?.find((attribute) => - attribute?.features?.some((feature) => feature?.name === FEATURE_NAMES.DIMENSION_HEIGHT) - ); - - // -------- Height - - const heightMM = getQuantityValueFeature( - dimensionAttribute?.features, - FEATURE_NAMES.DIMENSION_HEIGHT, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - // -------- Width - - const minWidthMM = getQuantityValueFeature( - dimensionAttribute?.features, - FEATURE_NAMES.MIN_WIDTH, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - const maxWidthMM = getQuantityValueFeature( - dimensionAttribute?.features, - FEATURE_NAMES.MAX_WIDTH, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - // -------- Depth - - const minDepthMM = getQuantityValueFeature( - dimensionAttribute?.features, - FEATURE_NAMES.MIN_DEPTH, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - const maxDepthMM = getQuantityValueFeature( - dimensionAttribute?.features, - FEATURE_NAMES.MAX_DEPTH, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - // ---- Rules - - const rulesAttribute = marathonModule?.configuratorAttributes?.find((attribute) => - attribute?.features?.some((feature) => feature?.name === FEATURE_NAMES.TRIMMABLE) - ); - - // -------- Trimmable - - const trimmable = ( - rulesAttribute?.features?.find((feature) => feature?.name === FEATURE_NAMES.TRIMMABLE) as - | CsFeatureMultiselect - | undefined - )?.selections - ?.filter((x) => !!x) // Remove nulls and undefined values IF they exist - .map((x) => x as string); // Cast to string because we know there are no null/undefined values since we filtered - - // -------- Trim offset - - const trimOffsetBottomMM = getQuantityValueFeature( - rulesAttribute?.features, - FEATURE_NAMES.TRIM_OFFSET_BOTTOM, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - const trimOffsetTopMM = getQuantityValueFeature( - rulesAttribute?.features, - FEATURE_NAMES.TRIM_OFFSET_TOP, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - const trimOffsetLeftMM = getQuantityValueFeature( - rulesAttribute?.features, - FEATURE_NAMES.TRIM_OFFSET_LEFT, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - const trimOffsetRightMM = getQuantityValueFeature( - rulesAttribute?.features, - FEATURE_NAMES.TRIM_OFFSET_RIGHT, - FEATURE_NAMES.MM_ID, - numberFromMaybe - ); - - return { - partNumber, - isImprintExtension: false, // TODO: Grab correct value - finishes: marathonModule?.finishes - ?.map((x) => x?.element?.partNumber) - .filter((x) => !!x) // Remove nulls and undefined values IF they exist - .map((x) => x as string), // Cast to string because we know there are no null/undefined values since we filtered - dimensions: { - height: { - millimeters: heightMM, - // Currently they don't provide in so we must convert from mm - inches: convertMmToInFormatted(`${heightMM}`) - }, - width: { - min: { - millimeters: minWidthMM, - // Currently they don't provide in so we must convert from mm - inches: convertMmToInFormatted(`${minWidthMM}`) + let resultModule: Module | undefined; + + //! Use interactive transactions with caution. Keeping transactions open for a long time hurts database performance and can even cause deadlocks. + //! Try to avoid performing network requests and executing slow queries inside, get in and out as quick as possible! + // await db.$transaction(async (db) => { + if (!existingProduct) { + if (!skipDatabase) { + resultModule = await db.module.create({ + data: { + ...moduleRest, + partNumber, + bundleUrl, + rules: module, + originalMarathonProductJson, + finish: { + connect: { + externalId: finish.externalId + } + }, + collection: { + connect: { + externalId: collection.externalId + } + }, + defaultLeftExtension: extensions?.left + ? { + connect: { + partNumber: extensions.left + } + } + : undefined, + defaultRightExtension: extensions?.right + ? { + connect: { + partNumber: extensions.right + } + } + : undefined, + attachmentToAppend: module.rules?.queue?.append + ? { + connect: { + partNumber: module.rules.queue.append + } + } + : undefined + } + }); + + if (moduleRest.thumbnailUrl) storageSyncQueue.push(moduleRest.thumbnailUrl); + } + } else { + status = 'updated'; + if (!skipDatabase) { + const rules = existingProduct.rules ? mergeRules(module, existingProduct.rules as ModuleRules) : module; + + resultModule = await db.module.update({ + where: { id: existingProduct.id }, + data: { + ...moduleRest, + partNumber, + bundleUrl, + rules, + originalMarathonProductJson, + finish: { + connect: { + externalId: finish.externalId + } + }, + collection: { + connect: { + externalId: collection.externalId + } + }, + defaultLeftExtension: extensions?.left + ? { + connect: { + partNumber: extensions.left + } + } + : undefined, + defaultRightExtension: extensions?.right + ? { + connect: { + partNumber: extensions.right + } + } + : undefined, + attachmentToAppend: module.rules?.queue?.append + ? { + connect: { + partNumber: module.rules.queue.append + } + } + : undefined + } + }); + + if (moduleRest.thumbnailUrl) storageSyncQueue.push(moduleRest.thumbnailUrl); + + // If this module already exists, it already has all the relations, so delete them for them to be created + // This is needed in case they completely changed the values here + await db.moduleType.deleteMany({ where: { module: { id: existingProduct.id } } }); + await db.moduleCategory.deleteMany({ where: { module: { id: existingProduct.id } } }); + await db.moduleAttachments.deleteMany({ where: { module: { id: existingProduct.id } } }); + } + } + + if (resultModule) { + if (!skipDatabase && drawerTypes && drawerTypes.length > 0) { + const existingTypes = await db.type.findMany({ + where: { + externalId: { + // Casting since we're filtering right before + in: drawerTypes.filter((x) => !!x).map((x) => x?.externalId as string) + } }, - max: { - millimeters: maxWidthMM, - // Currently they don't provide in so we must convert from mm - inches: convertMmToInFormatted(`${maxWidthMM}`) + select: { + id: true, + externalId: true } - }, - depth: { - min: { - millimeters: minDepthMM, - // Currently they don't provide in so we must convert from mm - inches: convertMmToInFormatted(`${minDepthMM}`) + }); + + await db.moduleType.createMany({ + data: drawerTypes.map((type) => ({ + moduleId: resultModule?.id || -1, + typeId: existingTypes.find((x) => x.externalId === type?.externalId)?.id || -1 + })) + }); + } + + if (!skipDatabase && categories && categories.length > 0) { + const existingCategories = await db.category.findMany({ + where: { + OR: [ + { + externalId: { + // Casting since we're filtering right before + in: categories.filter((x) => !!x).map((x) => x?.externalId as string) + } + }, + { + slug: 'all' + } + ] }, - max: { - millimeters: maxDepthMM, - // Currently they don't provide in so we must convert from mm - inches: convertMmToInFormatted(`${maxDepthMM}`) + select: { + id: true, + externalId: true, + slug: true } - } - }, - rules: { - trimmable, - trimOffset: { - // Force undefined if zero - bottom: trimOffsetBottomMM || undefined, - top: trimOffsetTopMM || undefined, - left: trimOffsetLeftMM || undefined, - right: trimOffsetRightMM || undefined - }, - options: marathonModule?.options - ?.map((x) => x?.partNumber) - .filter((x) => !!x) // Remove nulls and undefined values IF they exist - .map((x) => x as string) // Cast to string because we know there are no null/undefined values since we filtered + }); + + await db.moduleCategory.createMany({ + // Manually add the all category + data: [...categories, { slug: 'all', externalId: undefined }].map((category) => ({ + moduleId: resultModule?.id || -1, + categoryId: + existingCategories.find( + // Whether it's the correct category or all category + (x) => x.externalId === category?.externalId || (category?.slug === 'all' && x.slug === 'all') + )?.id || -1 + })) + }); } - }; + + const moduleAttachments = module.rules?.queue?.modules; + + if (!skipDatabase && moduleAttachments && moduleAttachments.length > 0) { + const existingModules = await db.module.findMany({ + where: { + partNumber: { in: moduleAttachments.map((x) => x) } + }, + select: { + id: true, + partNumber: true + } + }); + + await db.moduleAttachments.createMany({ + // Manually add the all category + data: moduleAttachments.map((modAttachment) => ({ + moduleId: resultModule?.id || -1, + attachmentId: existingModules.find((x) => x.partNumber === modAttachment)?.id || -1 + })) + }); + } + } + // }); + + return status; }; - const mergeRules = ( - marathonModule: MarathonModule, - currentRules?: NexusGenObjects['ModuleRules'] - ): NexusGenObjects['ModuleRules'] | undefined => { - const partNumber = marathonModule?.partNumber?.trim() || currentRules?.partNumber; - if (!partNumber) throw makeError('Cannot create rule without partNumber', 'ruleMergeMissingPartNumber'); - - const marathonRules = makeRulesFromMarathonModule(marathonModule); - - return currentRules - ? deepmerge(currentRules, marathonRules, { - // combine arrays using object equality (like in sets) - arrayMerge: (destinationArray, sourceArray) => [ - ...sourceArray, - ...destinationArray.filter((d) => sourceArray.every((s) => !isEqual(d, s))) - ] - }) - : marathonRules; + const updateOwner = async ( + module: ModuleRules, + skipDatabase?: boolean + // eslint-disable-next-line @typescript-eslint/ban-types + ) => { + if (!db) { + throw new Error('db dependency was not provided'); + } + + const { externalId, ownerExternalId } = module; + if (!externalId || !ownerExternalId) return; + + if (!skipDatabase) { + await db.module.update({ + where: { externalId }, + data: { + owner: ownerExternalId + ? { + connect: { + externalId: ownerExternalId + } + } + : undefined + } + }); + } }; - const syncProduct = async () => { + const syncProduct = async (skipDatabase?: boolean) => { if (!db) { throw new Error('db dependency was not provided'); } @@ -949,36 +1208,24 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { try { console.log('Fetching required data'); - const existingCategories = await db.category.findMany({ - select: { - id: true, - slug: true - } - }); - - const existingTypes = await db.type.findMany({ - select: { - id: true, - slug: true - } - }); - const existingFinishes = await db.finish.findMany({ select: { id: true, - slug: true + externalId: true } }); const existingCollections = await db.collection.findMany({ select: { id: true, - slug: true + externalId: true } }); console.log('Fetching products'); - const ignoredModules: string[] = []; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const ignoredModules: any[] = []; + let extensions: string[] = []; // console.log(print(GET_PRODUCT_LISTING)); while (pageIndex >= 0) { console.log(`Asking for ${productsPerPage} products on page ${pageIndex + 1}`); @@ -992,295 +1239,202 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { } }); - const products = data.getProductListing?.edges || []; + let products = data.getProductListing?.edges || []; if (products && products.length > 0) { console.log(`Product page ${pageIndex + 1}, fetched ${products.length} products`); - const partNumbers = products - // Casting because we're explicitly filtering by only valid values - .map((productEdge) => productEdge?.node?.partNumber?.trim() as string) - .filter((x) => !!x); - - const noPartNumberModules = products.filter((x) => !x?.node?.partNumber); - if (noPartNumberModules && noPartNumberModules.length > 0) { - logging.warn(`Sync: ${noPartNumberModules.length} modules without part number. Which will get ignored`, { - noPartNumberModules: noPartNumberModules.map((x) => x?.node?.id) - }); - } - - const existingModules = await db.module.findMany({ - select: { - id: true, - partNumber: true, - rules: true, - thumbnailUrl: true - }, - where: { - partNumber: { - in: partNumbers - } - } - }); - - // Received products - const modulesToUpdate = products.filter( - (productEdge) => - // Where exists in the database - productEdge?.node?.partNumber?.trim() && - existingModules.some((mod) => mod.partNumber === productEdge?.node?.partNumber?.trim()) - ); - - // Received products - const modulesToCreate = products.filter( + products = products.filter( // Where it DOESN'T exist in the database (productEdge) => { + // Make a big filter because their api decides to return unrelated stuff, so we need to hard filter everything + const module = productEdge?.node; + //const dir = path.join(__dirname, `./output`, '../../../../../marathon-module-jsons'); + //makeFile(dir, path.join(`pre-rules/${productEdge?.node?.partNumber}.json`), module); + + // So we grab a finish Id if any(there should always be one) const finishId = - existingFinishes.find((finish) => finish.slug === module?.spFinish?.slug?.trim())?.id || undefined; + existingFinishes.find((finish) => finish.externalId === module?.spFinish?.id)?.id || undefined; + + // So we grab a collection Id if any(there should always be one) const collectionId = - existingCollections.find((collection) => collection.slug === module?.spCollection?.slug?.trim())?.id || + existingCollections.find((collection) => collection.externalId === module?.spCollection?.id)?.id || undefined; + // And filter const hasExpectedCondition = - finishId !== undefined && - collectionId !== undefined && - module?.partNumber?.trim() && - !existingModules.some((mod) => mod.partNumber === module.partNumber?.trim()); + finishId && // Is there finish id(should have) + collectionId && // Is there collection id(should have) + module?.id; // Does it have an id itself (all of them should have id) if (!hasExpectedCondition) { - // Casting because we know it should exist, since there's a condition for that in hasExpectedCondition - ignoredModules.push(module?.partNumber as string); + ignoredModules.push({ finishId, collectionId, module }); } return hasExpectedCondition; } ); - if (modulesToCreate && modulesToCreate.length > 0) { - console.log(`Batch creating ${modulesToCreate.length} products`); - try { - await db.$transaction(async (db) => { - await db.module.createMany({ - data: modulesToCreate.map((productEdge) => { - const module = productEdge?.node; - const rules = mergeRules(module); - const sourceThumbnail = - module?.productPictures && module.productPictures.length > 0 - ? module?.productPictures[0]?.fullpath?.trim() - : undefined; - return { - partNumber: module?.partNumber?.trim() as string, - externalId: module?.id?.trim(), - description: module?.titleDescription?.trim() || undefined, - thumbnailUrl: makeThumbnailUrlAndQueue( - sourceThumbnail, - `image/module/${module?.partNumber?.trim()}${path.extname(sourceThumbnail || '')}` - ), - // bundleUrl: module?.bundlePath?.fullpath?.trim() || undefined, // FIX: Uncomment after also importing/uploading the image - isSubmodule: module?.isSubmodule || false, - hasPegs: module?.hasPegs || false, - isMat: module?.isMat || false, - // isExtension: module.isExtension || false,, TODO: Make sure they provide this info - shouldHideBasedOnWidth: - module?.shouldHideBasedOnWidth !== undefined && module?.shouldHideBasedOnWidth !== null - ? module?.shouldHideBasedOnWidth - : true, - alwaysDisplay: module?.alwaysDisplay || false, - isEdge: module?.isEdge || false, - rules, - finishId: - existingFinishes.find((finish) => finish.slug === module?.spFinish?.slug?.trim())?.id || -1, - collectionId: - existingCollections.find((collection) => collection.slug === module?.spCollection?.slug?.trim()) - ?.id || -1 - // TODO: Default left extension - // TODO: Default right extension - // TODO: attachmentToAppend: newRules?.rules. - }; - }) - }); - - console.log(`Fetching recently created ${modulesToCreate.length} products`); - const recentlyCreatedModules = await db.module.findMany({ - where: { - partNumber: { - in: modulesToCreate.map((x) => x?.node?.partNumber?.trim() as string).filter((x) => !!x) - } - }, - select: { - id: true, - partNumber: true - } - }); - - console.log(`Batch creating ${recentlyCreatedModules.length} product categories`); - - const categoriesToCreate = modulesToCreate.flatMap((productEdge) => - productEdge?.node?.spCategories?.map((cat) => ({ - catSlug: cat?.slug?.trim(), - modulePartNumber: productEdge?.node?.partNumber?.trim() - })) + const parsedProducts = products + .filter((x) => !!x?.node) + .flatMap((productEdge) => { + try { + //const dir = path.join(__dirname, `./output`, '../../../../../marathon-module-jsons'); + //makeFile(dir, path.join(`marathon/${productEdge?.node?.partNumber}.json`), productEdge); + // Casting since we filtered it previously + const rules = makeRulesFromMarathonModule(productEdge?.node as MarathonModule); + //makeFile(dir, path.join(`rules/${productEdge?.node?.partNumber}.json`), rules); + return { + ...rules, + originalMarathonProductJson: productEdge + }; + } catch (err) { + logging.error( + err, + `Could not parse and convert module ${productEdge?.node?.partNumber} ${productEdge?.node?.id}` ); + return undefined; + } + }) + .filter((x) => !!x) + // We do this just for casting, since we know it won't be undefined due to the filter above + .map( + (x) => + x as ReturnType & { originalMarathonProductJson: MarathonModule } + ); - const categoryAllToCreate = modulesToCreate.map((productEdge) => ({ - catSlug: 'all', - modulePartNumber: productEdge?.node?.partNumber?.trim() - })); - - await db.moduleCategory.createMany({ - data: [...categoriesToCreate, ...categoryAllToCreate] - .filter((x) => !!x) - .map((catModule) => { - return { - moduleId: - recentlyCreatedModules.find((x) => x.partNumber === catModule?.modulePartNumber)?.id || -1, - categoryId: existingCategories.find((x) => x.slug === catModule?.catSlug)?.id || -1 - }; - }) - }); - - console.log(`Batch creating ${recentlyCreatedModules.length} product types`); - await db.moduleType.createMany({ - data: modulesToCreate - .flatMap((productEdge) => - productEdge?.node?.spDrawerTypes?.map((type) => ({ - typeSlug: type?.slug?.trim(), - modulePartNumber: productEdge?.node?.partNumber?.trim() - })) - ) - .filter((x) => !!x) - .map((typeModule) => ({ - moduleId: - recentlyCreatedModules.find((x) => x.partNumber === typeModule?.modulePartNumber)?.id || -1, - typeId: existingTypes.find((x) => x.slug === typeModule?.typeSlug)?.id || -1 - })) - }); - // TODO: module attachments - }); - } catch (err) { - logging.error(err, 'Error when batch creating products', { - modulesToCreate: modulesToCreate?.map((x) => x?.node).filter((x) => !!x), - existingCollections, - existingFinishes - }); - } - } else { - console.log(`No module to create`); - } - - for (let i = 0; i < modulesToUpdate.length; i++) { - const productEdge = modulesToUpdate[i]; - - const module = productEdge?.node; - if (!module?.partNumber?.trim()) return; + console.log(`Going to upsert ${parsedProducts.length} products`); - const existingModule = existingModules.find((x) => x.partNumber === module.partNumber?.trim()); - if (!existingModule) continue; + let created = 0; + let updated = 0; - console.log(`Updating module #${i + 1} ${module.partNumber?.trim()} of ${modulesToUpdate.length}`); - const rules = existingModule?.rules as NexusGenObjects['ModuleRules'] | undefined; + for (let i = 0; i < parsedProducts.length; i++) { + const product = parsedProducts[i]; - await db.$transaction(async (db) => { - // Sync categories + console.log(`Product ${i + 1} out of ${parsedProducts.length}`); - // Delete existing categories to re create - await db.moduleCategory.deleteMany({ - where: { module: { partNumber: module.partNumber?.trim() }, category: { slug: { not: 'all' } } } - }); + try { + if (product.attachments?.append) { + const appendStatus = await upsertProductModule( + product.attachments.append, + skipDatabase, + product.originalMarathonProductJson + ); + if (appendStatus === 'created') { + created++; + } else if (appendStatus === 'updated') { + updated++; + } else { + throw makeError(`Could not upsert attachment append: ${appendStatus}`, 'cannotUpsertAppend'); + } + } - // If there are categories for this module - if (module.spCategories && module.spCategories.length > 0) { - // Create them - await db.moduleCategory.createMany({ - data: module.spCategories.map((cat) => ({ - moduleId: existingModule?.id || -1, - categoryId: existingCategories.find((x) => x.slug === cat?.slug?.trim())?.id || -1 - })) - }); + if (product.attachments?.queueModules && product.attachments.queueModules.length > 0) { + for (let j = 0; j < product.attachments.queueModules.length; j++) { + const queueModule = product.attachments.queueModules[j]; + const queueStatus = await upsertProductModule( + queueModule, + skipDatabase, + product.originalMarathonProductJson + ); + if (queueStatus === 'created') { + created++; + } else if (queueStatus === 'updated') { + updated++; + } else { + throw makeError( + `Could not upsert attachment queue module: ${queueStatus}`, + 'cannotUpsertQueueModule' + ); + } + } } - // Sync type + if (product.extensions?.left) { + const extensionStatus = await upsertProductModule( + product.extensions.left, + skipDatabase, + product.originalMarathonProductJson + ); + if (extensionStatus === 'created') { + created++; + } else if (extensionStatus === 'updated') { + updated++; + } else { + throw makeError(`Could not upsert left extension: ${extensionStatus}`, 'cannotUpsertLeftExtension'); + } + } - // Delete existing types to then create - await db.moduleType.deleteMany({ where: { module: { partNumber: module.partNumber?.trim() } } }); + if (product.extensions?.right) { + const extensionStatus = await upsertProductModule( + product.extensions.right, + skipDatabase, + product.originalMarathonProductJson + ); + if (extensionStatus === 'created') { + created++; + } else if (extensionStatus === 'updated') { + updated++; + } else { + throw makeError(`Could not upsert right extension: ${extensionStatus}`, 'cannotUpsertRightExtension'); + } + } - // If there are types for this module - if (module.spDrawerTypes && module.spDrawerTypes.length > 0) { - // Create them - await db.moduleType.createMany({ - data: module.spDrawerTypes.map((type) => ({ - moduleId: existingModule?.id || -1, - typeId: existingTypes.find((x) => x.slug === type?.slug?.trim())?.id || -1 - })) - }); + if (product.module.extensions?.options) { + extensions = [ + ...extensions, + ...product.module.extensions.options.filter((x) => !!x).map((x) => x as string) + ]; } - // TODO: module attachments + if (product.alternative) { + const alternativeStatus = await upsertProductModule( + product.alternative, + skipDatabase, + product.originalMarathonProductJson + ); + if (alternativeStatus === 'created') { + created++; + } else if (alternativeStatus === 'updated') { + updated++; + } else { + throw makeError( + `Could not upsert alternative version: ${alternativeStatus}`, + 'cannotUpsertAlternative' + ); + } + } - const newRules = mergeRules(module, rules); - const sourceThumbnail = - module.productPictures && module.productPictures.length > 0 - ? module.productPictures[0]?.fullpath?.trim() - : undefined; + const productStatus = await upsertProductModule( + product.module, + skipDatabase, + product.originalMarathonProductJson + ); + if (productStatus === 'created') { + created++; + } else if (productStatus === 'updated') { + updated++; + } else { + throw makeError(`Could not upsert main product: ${productStatus}`, 'cannotUpsertMainProduct'); + } - await db.module.update({ - where: { partNumber: module.partNumber?.trim() }, - data: { - externalId: module.id?.trim(), - description: module.titleDescription?.trim() || undefined, - thumbnailUrl: makeThumbnailUrlAndQueue(sourceThumbnail, existingModule.thumbnailUrl), - // bundleUrl: module.bundlePath?.fullpath?.trim() || undefined, // FIX: Uncomment after also importing/uploading the image - isSubmodule: module.isSubmodule || undefined, - hasPegs: module.hasPegs || undefined, - isMat: module.isMat || undefined, - // isExtension: module.isExtension || false, - shouldHideBasedOnWidth: - module.shouldHideBasedOnWidth !== undefined && module.shouldHideBasedOnWidth !== null - ? module.shouldHideBasedOnWidth - : undefined, - // alwaysDisplay: module.alwaysDisplay || undefined, - // isEdge: module.isEdge || undefined, - rules: newRules, - - finish: module.spFinish?.slug?.trim() - ? { - connect: { - slug: module.spFinish.slug.trim() - } - } - : undefined, - collection: module.spCollection?.slug?.trim() - ? { - connect: { - slug: module.spCollection.slug.trim() - } - } - : undefined, - defaultLeftExtension: newRules?.extensions?.left - ? { - connect: { - partNumber: newRules.extensions.left - } - } - : undefined, - defaultRightExtension: newRules?.extensions?.right - ? { - connect: { - partNumber: newRules.extensions.right - } - } - : undefined - // TODO: Default left extension - // TODO: Default right extension - // TODO: attachmentToAppend: newRules?.rules. - } - }); - }); + // Update owners after the product has been created, because it must exist for it to be an owner, so we cannot do this before + if (product.alternative) { + await updateOwner(product.alternative, skipDatabase); + } + } catch (err) { + logging.error( + err, + `Error upserting product ${i + 1} out of ${parsedProducts.length}. ${product.module.partNumber} ${ + product.module.externalId + }` + ); + } } - if (modulesToCreate && modulesToCreate.length === 0 && modulesToUpdate && modulesToUpdate.length === 0) { + if (created === 0 && updated === 0) { emptyPages++; console.log(`Empty page ${emptyPages} of ${MARATHON_SYNC_EMPTY_PAGES_TO_STOP}`); } else { @@ -1299,16 +1453,30 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { pageIndex++; } } else { - // If there are no more procuts, it means we should stop + // If there are no more products, it means we should stop console.log(`No products on page ${pageIndex + 1}, last page finished.`); pageIndex = -1; } } + if (extensions && extensions.length > 0) { + await db.module.updateMany({ + where: { partNumber: { in: extensions } }, + data: { + isExtension: true + } + }); + } + if (ignoredModules && ignoredModules.length > 0) { + try { + //const dir = path.join(__dirname, `./output`, '../../../../../marathon-logs'); + //makeFile(dir, path.join(`ignored-modules.json`), { ignoredModules }); + } catch { + // Do nothing + } logging.warn( - `Sync: ${ignoredModules.length} modules that were not created due to not following required criteria`, - { ignoredModules } + `Sync: ${ignoredModules.length} modules that were not created due to not following required criteria` ); } } catch (err) { @@ -1319,16 +1487,17 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { console.timeEnd('products'); }; - const syncData = async () => { + const syncData = async (skipDatabase?: boolean) => { try { console.time('apiSync'); - await syncCategory(); - await syncCollection(); - await syncDrawerType(); - await syncFinish(); + await syncCategory(skipDatabase); + await syncCollection(skipDatabase); + await syncDrawerType(skipDatabase); + await syncFinish(skipDatabase); + await syncSlides(skipDatabase); // Always leave products for last!! - await syncProduct(); + await syncProduct(skipDatabase); console.timeEnd('apiSync'); console.time('storageSync'); @@ -1411,20 +1580,40 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { const items: MarathonCartItem[] = []; + // Flatten the product list cart .filter((x) => x.projectModule.module.externalId) .forEach((cartItem) => { - items.push({ - oid: cartItem.projectModule.module.externalId as string, - quantity: cartItem.quantity - }); + const oid = + (cartItem.projectModule.module.ownerExternalId as string) || + (cartItem.projectModule.module.externalId as string); + + const index = items.findIndex((x) => x.oid === oid); + if (index >= 0) { + items[index] = { ...items[index], quantity: (items[index].quantity || 0) + cartItem.quantity }; + } else { + items.push({ + oid, + quantity: cartItem.quantity, + tag: cartItem.projectModule.module.description as string + }); + } if (cartItem.children && cartItem.children.length > 0) { cartItem.children.forEach((cartItem) => { - items.push({ - oid: cartItem.projectModule.module.externalId as string, - quantity: cartItem.quantity - }); + const oid = + (cartItem.projectModule.module.ownerExternalId as string) || + (cartItem.projectModule.module.externalId as string); + const index = items.findIndex((x) => x.oid === oid); + if (index >= 0) { + items[index] = { ...items[index], quantity: (items[index].quantity || 0) + cartItem.quantity }; + } else { + items.push({ + oid, + quantity: cartItem.quantity, + tag: cartItem.projectModule.module.description as string + }); + } }); } }); @@ -1467,6 +1656,7 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { throw makeError("Couldn't save list", 'createListCannotComplete'); } } catch (err) { + console.warn(err, `Error on Marathon server when creating cart`); throw err; } }; @@ -1487,10 +1677,39 @@ export const marathonService = ({ db }: MarathonServiceDependencies) => { })) as AxiosResponse<{ user_id: number; user_token: string }>; }; + const fetchSingleProduct = async (id: string) => { + if (!db) { + throw new Error('db dependency was not provided'); + } + + const { data } = await marathonApollo.query({ + query: GET_PRODUCT, + fetchPolicy: 'no-cache', + variables: { + id: Number(id) + } + }); + + if (data?.getProduct) { + const parsedRules = makeRulesFromMarathonModule(data.getProduct); + + const currentDbEntry = await db.module.findUnique({ where: { externalId: id } }); + + return { + original: data.getProduct, + parsedRules, + currentDbEntry + }; + } else { + throw makeError(`Module with id ${id} does not exist`, 'moduleDoesNotExist', 404); + } + }; + return { marathonApollo, syncData, createList, - login + login, + fetchSingleProduct }; }; diff --git a/src/services/marathon/parsing/constants.ts b/src/services/marathon/parsing/constants.ts new file mode 100644 index 0000000..8efc8c8 --- /dev/null +++ b/src/services/marathon/parsing/constants.ts @@ -0,0 +1,49 @@ +import { GetProductListingQuery } from '../../../generated/graphql'; +import { NexusGenObjects } from '../../../generated/nexus'; +import { NoNullFields } from '../../../utils/types'; + +export const FEATURE_NAMES = { + DIMENSION_HEIGHT: 'height', + MM_ID: 'mm', + IN_ID: 'in', + MIN_WIDTH: 'width_min', + MAX_WIDTH: 'width_max', + MIN_DEPTH: 'depth_min', + MAX_DEPTH: 'depth_max', + TRIMMABLE: 'trimmable', + TRIM_OFFSET_BOTTOM: 'trim_offset_bottom', + TRIM_OFFSET_TOP: 'trim_offset_top', + TRIM_OFFSET_LEFT: 'trim_offset_left', + TRIM_OFFSET_RIGHT: 'trim_offset_right', + DIMENSION_ATTRIBUTE: 'Dimensions - Drawer Organizers', + QUEUE_MODULES_ATTRIBUTE: 'Queue Modules for SpiceRack', + QUEUE_APPEND_ATTRIBUTE: 'Queue Append for SpiceRack', + RIGHT_EXTENSION_ATTRIBUTE: 'Right Extensions for Imprint CT', + LEFT_EXTENSION_ATTRIBUTE: 'Left Extensions for Imprint CT', + RULES_ATTRIBUTE: 'Rules for Options', + EXT_PART: 'ext_part', + EXT_ID: 'ext_id', + EXT_FINISHES: 'ext_finishes', + ROTATION: 'rotation', + ANGLE: 'angle', + FULL_DEPTH: 'fullDepth', + IS_FILLER: 'isFiller', + EXT_SIDE_LEFT: 'imprint_ext_side_left', + EXT_SIDE_RIGHT: 'imprint_ext_side_right', + QUEUE_MODULES: 'queue_modules', + QUEUE_APPEND: 'queue_append', + PRODUCT_PICTURE_FULL_PATH: 'product_picture_full_path', + HAS_PEGS: 'has_pegs', + IS_MAT: 'is_mat' + // SHOULD_HIDE_BASED_ON_WIDTH: 'should_hide_based_on_width' +}; + +export type MarathonModule = NonNullable< + NonNullable['edges']>[0]>['node'] +>; + +export type ConfiguratorAttribute = NonNullable['configuratorAttributes']>[number]; + +export type FeatureList = NonNullable['features']; + +export type ModuleRules = NoNullFields; diff --git a/src/services/marathon/parsing/parseRules.ts b/src/services/marathon/parsing/parseRules.ts new file mode 100644 index 0000000..9c115c9 --- /dev/null +++ b/src/services/marathon/parsing/parseRules.ts @@ -0,0 +1,582 @@ +import deepmerge from 'deepmerge'; +import { helpers } from 'faker'; +import { isEqual } from 'lodash'; +import path from 'path'; +import { CsFeatureInput } from '../../../generated/graphql'; +import { NexusGenObjects } from '../../../generated/nexus'; +import { convertMmToInFormatted } from '../../../utils/conversion'; +import { makeError } from '../../../utils/exception'; +import { replaceExtension } from '../../../utils/file'; +import logging from '../../../utils/logging'; +import { FeatureList, FEATURE_NAMES, MarathonModule, ModuleRules } from './constants'; +import { + getBooleanSelectFeature, + getInputFeature, + getMultiSelectFeature, + getNumericFeature, + getQuantityValueFeature, + numberFromMaybe, + numberUndefinedFromMaybe +} from './parseValues'; + +/** + * Makes a dimension rule object from a given "configurator attribute" from their api + */ +export const makeDimensionRulesFromAttribute = (featureList?: FeatureList): ModuleRules['dimensions'] => { + // -------- Height + + const heightMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.DIMENSION_HEIGHT, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + // -------- Width + + const minWidthMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.MIN_WIDTH, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const maxWidthMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.MAX_WIDTH, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + // -------- Depth + + const minDepthMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.MIN_DEPTH, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const maxDepthMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.MAX_DEPTH, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + return { + height: { + millimeters: heightMM, + // Currently they don't provide in so we must convert from mm + inches: convertMmToInFormatted(`${heightMM}`) + }, + width: { + min: { + millimeters: minWidthMM, + // Currently they don't provide in so we must convert from mm + inches: convertMmToInFormatted(`${minWidthMM}`) + }, + max: { + millimeters: maxWidthMM, + // Currently they don't provide in so we must convert from mm + inches: convertMmToInFormatted(`${maxWidthMM}`) + } + }, + depth: { + min: { + millimeters: minDepthMM, + // Currently they don't provide in so we must convert from mm + inches: convertMmToInFormatted(`${minDepthMM}`) + }, + max: { + millimeters: maxDepthMM, + // Currently they don't provide in so we must convert from mm + inches: convertMmToInFormatted(`${maxDepthMM}`) + } + } + }; +}; + +export const makeRulesObjectFromAttribute = ( + featureList?: FeatureList, + getOptions?: () => NonNullable['options'] +): ModuleRules['rules'] => { + // -------- Trimmable + + const trimmable = getMultiSelectFeature(featureList, FEATURE_NAMES.TRIMMABLE); + + // -------- Trim offset + + const trimOffsetBottomMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.TRIM_OFFSET_BOTTOM, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const trimOffsetTopMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.TRIM_OFFSET_TOP, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const trimOffsetLeftMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.TRIM_OFFSET_LEFT, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const trimOffsetRightMM = getQuantityValueFeature( + featureList, + FEATURE_NAMES.TRIM_OFFSET_RIGHT, + FEATURE_NAMES.MM_ID, + numberFromMaybe + ); + + const trimOffset = { + // Force undefined if zero + bottom: trimOffsetBottomMM || undefined, + top: trimOffsetTopMM || undefined, + left: trimOffsetLeftMM || undefined, + right: trimOffsetRightMM || undefined + }; + + // -------- Angle/rotation + + const rotation = getNumericFeature(featureList, FEATURE_NAMES.ROTATION, numberUndefinedFromMaybe); + const angle = getNumericFeature(featureList, FEATURE_NAMES.ANGLE, numberUndefinedFromMaybe); + + // -------- Booleans + + const isFiller = getBooleanSelectFeature(featureList, FEATURE_NAMES.IS_FILLER); + const fullDepth = getBooleanSelectFeature(featureList, FEATURE_NAMES.FULL_DEPTH); + + const append = getInputFeature(featureList, FEATURE_NAMES.QUEUE_APPEND); + const queueModules = getMultiSelectFeature(featureList, FEATURE_NAMES.QUEUE_MODULES); + + return { + trimmable, + trimOffset: Object.entries(trimOffset).some((x) => x[1] !== undefined) ? trimOffset : undefined, + // requiredNetInterior, + rotation, + angle, + fullDepth, + isFiller, + queue: + append || queueModules + ? { + append, + // We know that if there's an append or queue modules, it's not undefined + modules: queueModules as string[] + } + : undefined, + options: + // If this module has extensions, its options will go under the extensions parent. So we ignore it here + !featureList?.some( + (feature) => feature?.name === FEATURE_NAMES.EXT_SIDE_LEFT || feature?.name === FEATURE_NAMES.EXT_SIDE_RIGHT + ) && getOptions + ? getOptions() + : undefined + }; +}; + +const makeRuleExtensionsFromAttribute = ( + featureList?: FeatureList, + getOptions?: () => NonNullable['options'] +): ModuleRules['extensions'] | undefined => { + // For some reason, there are TWO attributes with the same name, yay! + // So we remove the useless one, which only have 'left' or 'right' as its text value, instead of what we expect + const extensionFeatureList = featureList?.filter( + (x) => + !( + (x?.name === FEATURE_NAMES.EXT_SIDE_LEFT && (x as CsFeatureInput)?.text === 'left') || + (x?.name === FEATURE_NAMES.EXT_SIDE_RIGHT && (x as CsFeatureInput)?.text === 'right') + ) + ); + + // With the incorrect ones removed, we can grab the correct ones + const left = getInputFeature(extensionFeatureList, FEATURE_NAMES.EXT_SIDE_LEFT); + const right = getInputFeature(extensionFeatureList, FEATURE_NAMES.EXT_SIDE_RIGHT); + + if (!left && !right) return undefined; + + return { + left, + right, + options: getOptions && getOptions() + }; +}; + +export const makeRulesFromMarathonModule = ( + marathonModule: MarathonModule +): { + module: ModuleRules; + attachments?: ReturnType; + extensions?: ReturnType; + alternative?: ModuleRules; +} => { + const externalId = marathonModule.id; + if (!externalId) throw makeError(`Module ${marathonModule.partNumber} does not have an id`, 'ruleMergeMissingId'); + + const marathonFinish = marathonModule.spFinish; + if (!marathonFinish || !marathonFinish.id) + throw makeError( + `Module ${marathonModule.partNumber} ${externalId} does not have a finish`, + 'ruleMergeMissingFinish' + ); + + const marathonCollection = marathonModule.spCollection; + if (!marathonCollection || !marathonCollection.id) + throw makeError( + `Module ${marathonModule.partNumber} ${externalId} does not have a collection`, + 'ruleMergeMissingCollection' + ); + + const marathonDrawerTypes = marathonModule.spDrawerTypes; + + const specialAttributes = [ + FEATURE_NAMES.LEFT_EXTENSION_ATTRIBUTE, + FEATURE_NAMES.RIGHT_EXTENSION_ATTRIBUTE, + FEATURE_NAMES.QUEUE_MODULES_ATTRIBUTE, + FEATURE_NAMES.QUEUE_APPEND_ATTRIBUTE + ]; + + // Merge all attributes that aren't the special attributes into a single one for ease of use since they decided to make things complicated + // by "Special attributes" I mean whole attributes that contain an entire module in it, and not just rules. Like extensions and attachments + const catchAllFeatureList = marathonModule.configuratorAttributes + ?.filter( + (attribute) => !specialAttributes.some((specialAttribute) => attribute?.description?.includes(specialAttribute)) + ) + .flatMap((x) => x?.features) as FeatureList; + + const getOptionsFn = () => + marathonModule.options + ?.map((x) => x?.partNumber) + .filter((x) => !!x) // Remove nulls and undefined values IF they exist + .map((x) => x as string); // Cast to string because we know there are no null/undefined values since we filtered + + const dimensions = makeDimensionRulesFromAttribute(catchAllFeatureList); + + // If this module has extensions, its "options" goes under the extensions + const rules = makeRulesObjectFromAttribute(catchAllFeatureList, getOptionsFn); + + // This "extensions" is not the complete extension _object_ but rather the extension property that only references part numbers of those objects + const extensions = makeRuleExtensionsFromAttribute(catchAllFeatureList, getOptionsFn); + + const otherFinishes = marathonModule.finishes + ?.map((x) => x?.element?.partNumber) + .filter((x) => !!x) // Remove nulls and undefined values IF they exist + .map((x) => x as string); // Cast to string because we know there are no null/undefined values since we filtered + + const sourceThumbnail = + marathonModule.productPictures && marathonModule.productPictures.length > 0 + ? marathonModule.productPictures[0]?.fullpath?.trim() + : undefined; + + const module: ModuleRules = { + partNumber: marathonModule.partNumber || externalId, + externalId: externalId, + description: + marathonModule.shortDescription || marathonModule.titleDescription || marathonModule.itemDescription || undefined, + thumbnailUrl: sourceThumbnail, + // bundleUrl: module?.bundlePath?.fullpath?.trim() || undefined, + isSubmodule: marathonModule.isSubmodule || false, + hasPegs: marathonModule.hasPegs || false, + isMat: marathonModule.isMat || false, + shouldHideBasedOnWidth: marathonModule.shouldHideBasedOnWidth || false, + alwaysDisplay: marathonModule.alwaysDisplay || false, + isEdge: marathonModule.isEdge || false, + isExtension: false, // False in this case, we'll manually set to true on the method regarding extensions + finish: { + externalId: marathonFinish.id, + slug: marathonFinish.slug || undefined + }, + collection: { + externalId: marathonCollection.id, + slug: marathonCollection.slug || undefined + }, + drawerTypes: marathonDrawerTypes?.map((marathonDrawerType) => ({ + // Casting because we check previously right at the beginning and throw if it doesn't have an id + externalId: marathonDrawerType?.id as string, + slug: marathonDrawerType?.slug + })), + categories: marathonModule.spCategories + ?.filter((x) => x && !!x?.id) + .map((marathonCategory) => ({ + // Casting because we are filtering right above + externalId: marathonCategory?.id as string, + slug: marathonCategory?.slug + })), + otherFinishes, + dimensions, + rules, + extensions + }; + + return { + module, + attachments: makeAttachments(module, marathonModule), + extensions: makeExtensions(module, marathonModule), + alternative: marathonModule.alternative + ? { + ...module, + externalId: `${module.externalId}-alternative-${ + marathonModule.alternative.partNumber || `${module.partNumber}-B` + }`, + isVirtualProduct: true, + ownerExternalId: module.externalId, + hasPegs: marathonModule.alternative.hasPegs || false, + partNumber: marathonModule.alternative.partNumber || `${module.partNumber}-B` + } + : undefined + }; +}; + +export const makeAttachments = ( + parent: ModuleRules, + marathonModule: MarathonModule +): + | { + append: ModuleRules; + queueModules: ModuleRules[]; + } + | undefined => { + // ---- Queue + const queueModules = marathonModule?.configuratorAttributes // Of all configurator attributes + ?.filter((attribute) => attribute?.description?.includes(FEATURE_NAMES.QUEUE_MODULES_ATTRIBUTE)) // We grab only the ones that includes the queue modules description + ?.map((queueModuleAttribute) => { + const partNumber = + getInputFeature(queueModuleAttribute?.features, (feature) => feature?.name?.endsWith(FEATURE_NAMES.EXT_PART)) || + `${parent.externalId}-queue-module`; + + let isVirtualProduct = false; + + let externalId = getInputFeature(queueModuleAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_ID) + ); + + if (!externalId) { + externalId = helpers.slugify(partNumber).toLowerCase() + '-queue-module'; + isVirtualProduct = true; + } + + const otherFinishes = getMultiSelectFeature(queueModuleAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_FINISHES) + ); + + const dimensions = makeDimensionRulesFromAttribute(queueModuleAttribute?.features); + const rules = makeRulesObjectFromAttribute(queueModuleAttribute?.features); + + // const sourceThumbnail = getInputFeature(queueModuleAttribute?.features, FEATURE_NAMES.THUMBNAIL_URL); + const hasPegs = getBooleanSelectFeature(queueModuleAttribute?.features, FEATURE_NAMES.HAS_PEGS); + + return { + ...parent, + partNumber, + externalId, + isVirtualProduct, + description: undefined, // They don't provide descriptions for nested modules + thumbnailUrl: undefined, // Not really used for queue modules + isSubmodule: true, // Not really used for queue modules but they are kinda like submodules + hasPegs: hasPegs || false, // Not used for queue modules + shouldHideBasedOnWidth: false, // Not used for queue modules + alwaysDisplay: false, // Queue modules don't show up as pegboard(this isn't even used) + isEdge: false, // Queue modules are never edge + isExtension: false, + isMat: false, + otherFinishes, + + // Only those two are important for queue modules + dimensions, + rules + } as ModuleRules; + }); + + // ---- Append + // There should only be one append, as opposed of multiple queueModules + // so we grab the one that the description correctly match + const appendModulesAttribute = marathonModule?.configuratorAttributes?.find( + (attribute) => attribute?.description === FEATURE_NAMES.QUEUE_APPEND_ATTRIBUTE + ); + + // Bail if there's none + if (!queueModules || queueModules.length <= 0 || !appendModulesAttribute) return undefined; + + const partNumber = + getInputFeature(appendModulesAttribute?.features, (feature) => feature?.name?.endsWith(FEATURE_NAMES.EXT_PART)) || + parent.rules?.queue?.append || + `${parent.externalId}-append`; + + let isVirtualProduct = false; + + let externalId = getInputFeature(appendModulesAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_ID) + ); + + if (!externalId) { + externalId = helpers.slugify(partNumber).toLowerCase() + '-append'; + isVirtualProduct = true; + } + + const otherFinishes = getMultiSelectFeature(appendModulesAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_FINISHES) + ); + + const dimensions = makeDimensionRulesFromAttribute(appendModulesAttribute?.features); + const rules = makeRulesObjectFromAttribute(appendModulesAttribute?.features); + + // const sourceThumbnail = getInputFeature(appendModulesAttribute?.features, FEATURE_NAMES.THUMBNAIL_URL); + const hasPegs = getBooleanSelectFeature(appendModulesAttribute?.features, FEATURE_NAMES.HAS_PEGS); + + return { + append: { + ...parent, + partNumber, + externalId, + isVirtualProduct, + description: undefined, // They don't provide descriptions for nested modules + thumbnailUrl: undefined, // Not really used for queue modules + isSubmodule: true, // Not really used for queue modules but they are kinda like submodules + hasPegs: hasPegs || false, // Not used for queue modules + shouldHideBasedOnWidth: false, // Not used for queue modules + alwaysDisplay: false, // Queue modules don't show up as pegboard(this isn't even used) + isEdge: false, // Queue modules are never edge + isExtension: false, + isMat: false, + otherFinishes, + + // Only those two are important for queue modules + dimensions, + rules + }, + queueModules + }; +}; + +export const makeExtensions = ( + parent: ModuleRules, + marathonModule: MarathonModule +): + | { + left: ModuleRules; + right?: ModuleRules; + } + | undefined => { + // First, we grab the left and right extensions, using the expected attributes descriptions + + const leftExtensionAttribute = marathonModule?.configuratorAttributes?.find( + (attribute) => attribute?.description === FEATURE_NAMES.LEFT_EXTENSION_ATTRIBUTE + ); + + const rightExtensionAttribute = marathonModule?.configuratorAttributes?.find( + (attribute) => attribute?.description === FEATURE_NAMES.RIGHT_EXTENSION_ATTRIBUTE + ); + + // Bail if there's none + if (!leftExtensionAttribute || !rightExtensionAttribute) return undefined; + + // Then, for some reason, extensions finishes are not arrays but a single input like everything else 🤷 so lets grab them too + const leftPartNumber = + getInputFeature(leftExtensionAttribute?.features, (feature) => feature?.name?.endsWith(FEATURE_NAMES.EXT_PART)) || + parent.extensions?.left || + `${parent.externalId}-left-extension`; + let leftVirtualProduct = false; + + let leftExternalId = getInputFeature(leftExtensionAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_ID) + ); + + if (!leftExternalId) { + leftExternalId = helpers.slugify(leftPartNumber).toLowerCase(); + leftVirtualProduct = true; + } + + const leftFinish = getInputFeature(leftExtensionAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_FINISHES) + ); + const leftOtherFinishes = leftFinish ? [leftFinish] : undefined; + const leftDimensions = makeDimensionRulesFromAttribute(leftExtensionAttribute?.features); + const leftRules = makeRulesObjectFromAttribute(leftExtensionAttribute?.features); + const leftThumbnail = getInputFeature(leftExtensionAttribute?.features, FEATURE_NAMES.PRODUCT_PICTURE_FULL_PATH); + + const rightPartNumber = + getInputFeature(rightExtensionAttribute?.features, (feature) => feature?.name?.endsWith(FEATURE_NAMES.EXT_PART)) || + parent.extensions?.right || + `${parent.externalId}-right-extension`; + let rightVirtualProduct = false; + + let rightExternalId = getInputFeature(rightExtensionAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_ID) + ); + if (!rightExternalId) { + rightExternalId = helpers.slugify(rightPartNumber).toLowerCase(); + rightVirtualProduct = true; + } + const rightFinish = getInputFeature(rightExtensionAttribute?.features, (feature) => + feature?.name?.endsWith(FEATURE_NAMES.EXT_FINISHES) + ); + const rightOtherFinishes = rightFinish ? [rightFinish] : undefined; + const rightDimensions = makeDimensionRulesFromAttribute(rightExtensionAttribute?.features); + const rightRules = makeRulesObjectFromAttribute(rightExtensionAttribute?.features); + const rightThumbnail = getInputFeature(rightExtensionAttribute?.features, FEATURE_NAMES.PRODUCT_PICTURE_FULL_PATH); + + return { + // And convert them to the format we expect + left: { + ...parent, + extensions: undefined, + partNumber: leftPartNumber, + externalId: leftExternalId, + isVirtualProduct: leftVirtualProduct, + description: undefined, // They don't provide descriptions for nested modules + thumbnailUrl: leftThumbnail, + isSubmodule: false, // Extensions CANNOT be submodules, they are already extensions + hasPegs: false, // Not used for extensions + shouldHideBasedOnWidth: false, // Not used for extensions + alwaysDisplay: false, // extensions don't show up as pegboard(this isn't even used) + isEdge: false, // extensions are never edge, + isExtension: true, + isMat: false, + otherFinishes: leftOtherFinishes, + dimensions: leftDimensions, + rules: leftRules + }, + right: + rightPartNumber !== leftPartNumber + ? { + ...parent, + extensions: undefined, + partNumber: rightPartNumber, + externalId: rightExternalId, + isVirtualProduct: rightVirtualProduct, + description: undefined, // They don't provide descriptions for nested modules + thumbnailUrl: rightThumbnail, + isSubmodule: false, // Extensions CANNOT be submodules, they are already extensions + hasPegs: false, // Not used for extensions + shouldHideBasedOnWidth: false, // Not used for extensions + alwaysDisplay: false, // extensions don't show up as pegboard(this isn't even used) + isEdge: false, // extensions are never edge, + isExtension: true, + isMat: false, + otherFinishes: rightOtherFinishes, + dimensions: rightDimensions, + rules: rightRules + } + : undefined + }; +}; + +export const mergeRules = (marathonRules: ModuleRules, currentRules?: ModuleRules | null): ModuleRules | undefined => { + // If we already have rules, we merge ours with marathon but making sure marathon's will override ours. If not, we just return marathon's + return currentRules + ? deepmerge(currentRules, marathonRules, { + // combine arrays using object equality (like in sets) + arrayMerge: (destinationArray, sourceArray) => [ + ...sourceArray, + ...destinationArray.filter((d) => sourceArray.every((s) => !isEqual(d, s))) + ] + }) + : marathonRules; +}; diff --git a/src/services/marathon/parsing/parseValues.ts b/src/services/marathon/parsing/parseValues.ts new file mode 100644 index 0000000..4c50eae --- /dev/null +++ b/src/services/marathon/parsing/parseValues.ts @@ -0,0 +1,123 @@ +import { + CsFeatureQuantityValue, + CsFeatureMultiselect, + CsFeatureInput, + CsFeatureNumeric, + CsFeatureBooleanSelect +} from '../../../generated/graphql'; +import { convertInToMmFormatted, convertMmToInFormatted } from '../../../utils/conversion'; +import { makeError } from '../../../utils/exception'; +import { FeatureList, FEATURE_NAMES } from './constants'; + +/** + * Tries to grab a value of @param featureName from a feature list + */ +export const getQuantityValueFeature = ( + featureList: FeatureList, + featureName: string, + featureUnitId: string, + format?: (value?: unknown) => TResult +): TResult => { + // Get the feature with the name we want from the list + const feature = featureList?.find((feature) => feature?.name === featureName) as CsFeatureQuantityValue | undefined; + + // If unit is wrong + if (feature?.quantityvalue?.unit?.id && feature.quantityvalue.unit.id !== featureUnitId) { + if (featureUnitId === FEATURE_NAMES.MM_ID && feature.quantityvalue.unit.id === FEATURE_NAMES.IN_ID) { + const inchValue = convertInToMmFormatted(`${feature.quantityvalue.value || 0}`); + + return format ? format(inchValue) : (inchValue as unknown as TResult); + } else if (featureUnitId === FEATURE_NAMES.IN_ID && feature.quantityvalue.unit.id === FEATURE_NAMES.MM_ID) { + const mmValue = convertMmToInFormatted(`${feature.quantityvalue.value || 0}`); + + return format ? format(mmValue) : (mmValue as unknown as TResult); + } else { + throw makeError( + `Expected ${featureName} feature as ${featureUnitId}, but was returned as "${feature?.quantityvalue?.unit?.id}" with value "${feature.quantityvalue.value}"`, + 'ruleMergeFeatureQuantityUnit' + ); + } + } + + // Format or return plain + return format ? format(feature?.quantityvalue?.value) : (feature?.quantityvalue?.value as unknown as TResult); +}; + +export const getMultiSelectFeature = ( + featureList: FeatureList, + featureName: string | ((feature: NonNullable[number]) => boolean | undefined) +): string[] | undefined => + ( + featureList?.find((feature) => + typeof featureName === 'string' ? feature?.name === featureName : featureName(feature) + ) as CsFeatureMultiselect | undefined + )?.selections + ?.filter((x) => !!x) // Remove nulls and undefined values IF they exist + .map((x) => x as string); + +export const getInputFeature = ( + featureList: FeatureList, + featureName: string | ((feature: NonNullable[number]) => boolean | undefined) +): string | undefined => { + const stringValue = ( + featureList?.find((feature) => + typeof featureName === 'string' ? feature?.name === featureName : featureName(feature) + ) as CsFeatureInput | undefined + )?.text; + + return stringValue !== null ? stringValue : undefined; +}; + +export const getNumericFeature = ( + featureList: FeatureList, + featureName: string | ((feature: NonNullable[number]) => boolean | undefined), + format?: (value?: unknown) => TResult +) => { + const stringValue = ( + featureList?.find((feature) => + typeof featureName === 'string' ? feature?.name === featureName : featureName(feature) + ) as CsFeatureNumeric | undefined + )?.number as unknown as TResult; + + return format ? format(stringValue) : (stringValue as unknown as TResult); +}; + +export const getBooleanSelectFeature = ( + featureList: FeatureList, + featureName: string | ((feature: NonNullable[number]) => boolean | undefined) +): boolean | undefined => { + const boolValue = ( + featureList?.find((feature) => + typeof featureName === 'string' ? feature?.name === featureName : featureName(feature) + ) as CsFeatureBooleanSelect | undefined + )?.checked; + + return boolValue !== null ? boolValue : undefined; +}; + +/** + * Tries to safely convert a param to a number + */ +export const numberFromMaybe = (originalValue?: string | number | null | unknown): number => { + let value = originalValue; + + if (typeof value !== 'number') value = parseFloat(`${value}`); + + // Casting because we convert the value above + return value && !isNaN(value as number) ? (value as number) : 0; +}; + +export const numberUndefinedFromMaybe = (originalValue?: string | number | null | unknown): number | undefined => { + if (!originalValue) return undefined; + let value = originalValue; + + if (typeof value !== 'number') value = parseFloat(`${value}`); + + if (value && !isNaN(value as number)) { + // Casting because we convert the value above + return value as number; + } else { + // console.log(`Value ${originalValue} converted to unexpected ${value}`); + return undefined; + } +}; diff --git a/src/services/marathon/queries.ts b/src/services/marathon/queries.ts index ffda481..1bb28c4 100644 --- a/src/services/marathon/queries.ts +++ b/src/services/marathon/queries.ts @@ -132,3 +132,12 @@ export const GET_PRODUCT_STATUS = gql` } } `; + +export const GET_PRODUCT = gql` + query GetProduct($id: Int) { + getProduct(id: $id) { + ...Product + } + } + ${SP_PRODUCT_FRAGMENT} +`; diff --git a/src/services/project.ts b/src/services/project.ts index bd88f33..5a2a781 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,6 +1,5 @@ import { PrismaClient } from '@prisma/client'; import { groupBy, values } from 'lodash'; -import { NexusGenObjects } from '../generated/nexus'; type ProjectServiceDependencies = { db?: PrismaClient; diff --git a/src/utils/conversion.ts b/src/utils/conversion.ts index 75b2e8b..3400639 100644 --- a/src/utils/conversion.ts +++ b/src/utils/conversion.ts @@ -84,7 +84,11 @@ export const convertMmToIn = (mm_o: string) => { }; export const convertMmToInFormatted = (value: string) => { - const conversion = convertMmToIn(value); + let conversion = convertMmToIn(value); + + // Dirty fix to remove null entries + conversion = conversion.map((x) => (`${x}` === 'null' ? 0 : x)); + if (conversion[1] || conversion[2]) { return `${conversion[0]}" ${conversion[1]}/${conversion[2]}`; } else { diff --git a/src/utils/file.ts b/src/utils/file.ts index 94fbde8..d541a5f 100644 --- a/src/utils/file.ts +++ b/src/utils/file.ts @@ -1,4 +1,5 @@ import path from 'path'; +import fs from 'fs'; export const isSameExtesion = (...paths: string[]) => { if (!paths || paths.length <= 0) return false; @@ -17,3 +18,13 @@ export const replaceExtension = (original: string, replaceWith: string) => { return originalExt ? original.replace(originalExt, newExt) : original + newExt; }; + +export const makeFile = (dir: string, fileName: string, content: any) => { + fs.mkdir(dir, { recursive: true }, (err) => { + if (err) throw err; + + fs.writeFile(path.join(dir, fileName), JSON.stringify(content, null, 2), { flag: 'w' }, (err) => { + if (err) throw err; + }); + }); +}; diff --git a/src/utils/types.ts b/src/utils/types.ts new file mode 100644 index 0000000..5cd54d9 --- /dev/null +++ b/src/utils/types.ts @@ -0,0 +1,4 @@ +export type NoNullFields = { + // eslint-disable-next-line @typescript-eslint/ban-types + [K in keyof Ob]: Ob[K] extends object ? NoNullFields : NonNullable; +};