finite_state_sdk.queries

GraphQL queries for the Finite State Platform

  1"""
  2GraphQL queries for the Finite State Platform
  3"""
  4DEFAULT_PAGE_SIZE = 100
  5
  6ALL_BUSINESS_UNITS = {
  7    "query": """
  8    query GetBusinessUnits_SDK(
  9        $after: String,
 10        $first: Int
 11    ) {
 12        allGroups(
 13            after: $after,
 14            first: $first
 15        ) {
 16            _cursor
 17            id
 18            name
 19            __typename
 20        }
 21    }
 22    """,
 23    "variables": {"after": None, "first": DEFAULT_PAGE_SIZE},
 24}
 25
 26ALL_USERS = {
 27    "query": """
 28    query GetUsers_SDK(
 29        $after: String,
 30        $first: Int
 31    ) {
 32        allUsers(
 33            after: $after,
 34            first: $first
 35        ) {
 36            _cursor
 37            id
 38            email
 39            __typename
 40        }
 41    }
 42    """,
 43    "variables": {"after": None, "first": DEFAULT_PAGE_SIZE},
 44}
 45
 46ALL_ORGANIZATIONS = {
 47    "query": """
 48    query GetOrganizations_SDK(
 49        $after: String,
 50        $first: Int
 51    ) {
 52        allOrganizations(
 53            after: $after,
 54            first: $first
 55        ) {
 56            _cursor
 57            id
 58            name
 59            __typename
 60        }
 61    }
 62    """,
 63    "variables": {"after": None, "first": DEFAULT_PAGE_SIZE},
 64}
 65
 66
 67def _create_GET_ASSET_VERSION_VARIABLES(asset_version_id=None, asset_id=None, business_unit_id=None):
 68    variables = {
 69        "filter": {},
 70        "after": None,
 71        "first": 1000
 72    }
 73
 74    if asset_version_id is not None:
 75        variables["filter"]["id"] = asset_version_id
 76
 77    if asset_id is not None:
 78        variables["filter"]["asset"] = {
 79            "id": asset_id
 80        }
 81
 82    if business_unit_id is not None:
 83        variables["filter"]["group"] = {
 84            "id": business_unit_id
 85        }
 86
 87    return variables
 88
 89
 90ALL_ASSET_VERSIONS = {
 91    "query": """
 92    query GetAllAssetVersions_SDK(
 93        $filter: AssetVersionFilter!,
 94        $after: String,
 95        $first: Int
 96    ) {
 97        allAssetVersions(
 98            filter: $filter,
 99            after: $after,
100            first: $first
101        ) {
102            _cursor
103            id
104            createdAt
105            createdBy {
106                id
107                email
108                __typename
109            }
110            name
111            relativeRiskScore
112            uniqueTestTypes {
113                id
114                name
115                __typename
116            }
117            testStatuses
118            asset {
119                id
120                name
121                group {
122                    id
123                    name
124                    __typename
125                }
126            }
127            __typename
128        }
129    }
130    """,
131    "variables": lambda asset_version_id=None, asset_id=None, business_unit_id=None: _create_GET_ASSET_VERSION_VARIABLES(asset_version_id=asset_version_id, asset_id=asset_id, business_unit_id=business_unit_id)
132}
133
134
135def asset_variables(asset_id=None, business_unit_id=None):
136    variables = {"filter": {}, "after": None, "first": DEFAULT_PAGE_SIZE}
137
138    if asset_id is not None:
139        variables["filter"]["id"] = asset_id
140
141    if business_unit_id is not None:
142        variables["filter"]["group"] = {
143            "id": business_unit_id
144        }
145
146    return variables
147
148
149ALL_ASSETS = {
150    "query": """
151        query GetAllAssets_SDK(
152            $filter: AssetFilter!,
153            $after: String,
154            $first: Int
155            ) {
156                allAssets(
157                    filter: $filter,
158                    after: $after,
159                    first: $first
160                ) {
161                    _cursor
162                    id
163                    name
164                    createdAt
165                    createdBy {
166                        id
167                        email
168                        __typename
169                    }
170                    group {
171                        id
172                        name
173                    }
174                    ctx {
175                        asset
176                        businessUnits
177                        products
178                    }
179                    defaultVersion {
180                        id
181                        name
182                        relativeRiskScore
183                    }
184                    versions {
185                        id
186                        name
187                        relativeRiskScore
188                        testStatuses
189                        __typename
190                    }
191                    __typename
192                }
193            }
194        """,
195    "variables": asset_variables
196}
197
198
199def artifact_variables(artifact_id=None, business_unit_id=None):
200    variables = {"filter": {}, "after": None, "first": DEFAULT_PAGE_SIZE, "orderBy": ["name_ASC"]}
201
202    if artifact_id is not None:
203        variables["filter"]["id"] = artifact_id
204
205    if business_unit_id is not None:
206        variables["filter"]["group"] = {
207            "id": business_unit_id
208        }
209
210    return variables
211
212
213ALL_ARTIFACTS = {
214    "query": """
215        query GetAllArtifacts_SDK(
216            $filter: AssetFilter!,
217            $after: String,
218            $first: Int,
219            $orderBy: [AssetOrderBy!]
220            ) {
221                allAssets(
222                    filter: $filter,
223                    after: $after,
224                    first: $first,
225                    orderBy: $orderBy
226                ) {
227                    _cursor
228                    id
229                    name
230                    createdAt
231                    createdBy {
232                        id
233                        email
234                        __typename
235                    }
236                    deletedAt
237                    ctx {
238                        asset
239                        businessUnits
240                        products
241                    }
242                    defaultVersion {
243                        name
244                        createdAt
245                        __typename
246                    }
247                    _versionsMeta {
248                        count
249                    }
250                    __typename
251                }
252            }
253        """,
254    "variables": artifact_variables
255}
256
257ALL_PRODUCTS = {
258    "query": """
259        query GetAllProducts_SDK(
260            $filter: ProductFilter!,
261            $after: String,
262            $first: Int
263            ) {
264                allProducts(
265                    filter: $filter,
266                    after: $after,
267                    first: $first
268                ) {
269                    _cursor
270                    id
271                    name
272                    createdAt
273                    createdBy {
274                        id
275                        email
276                        __typename
277                    }
278                    relativeRiskScore
279                    group {
280                        id
281                        name
282                    }
283                    assets {
284                        id
285                        name
286                        _findingsMeta {
287                            count
288                        }
289                        __typename
290                    }
291                    __typename
292                }
293            }
294        """,
295    "variables": {"filter": {}, "after": None, "first": DEFAULT_PAGE_SIZE},
296}
297
298GENERATE_EXPORT_DOWNLOAD_PRESIGNED_URL = {
299    "query": """
300query GenerateExportDownloadPresignedUrl_SDK($exportId: ID!) {
301  generateExportDownloadPresignedUrl(exportId: $exportId) {
302    downloadLink
303    status
304  }
305}
306""",
307    "variables": lambda export_id: {"exportId": export_id}
308}
309
310
311GET_PRODUCT_ASSET_VERSIONS = {
312    "query": """
313query GetProductAssetVersions_SDK(
314    $filter: ProductFilter!,
315    $after: String,
316    $first: Int
317    ) {
318    allProducts(
319        filter: $filter,
320        after: $after,
321        first: $first
322    ) {
323        _cursor
324        id
325        name
326        createdAt
327        assets {
328            id
329            name
330            relativeRiskScore
331            asset {
332                id
333                name
334            }
335        }
336        __typename
337    }
338}""",
339    "variables": lambda product_id: {"filter": {"id": product_id}, "after": None, "first": DEFAULT_PAGE_SIZE},
340}
341
342
343def _create_GET_FINDINGS_VARIABLES(asset_version_id=None, category=None, cve_id=None, finding_id=None, status=None, severity=None, limit=1000, count=False):
344    variables = {
345        "filter": {
346            "mergedFindingRefId": None,
347            "deletedAt": None
348        }
349    }
350
351    # if not counting, set the pagination and ordering
352    if not count:
353        variables["after"] = None
354        variables["first"] = limit if limit else DEFAULT_PAGE_SIZE
355        variables["orderBy"] = ["title_ASC"]
356
357    if finding_id is not None:
358        # if finding_id is a list, use the "in" operator
359        if isinstance(finding_id, list):
360            variables["filter"]["id_in"] = finding_id
361        else:
362            variables["filter"]["id"] = str(finding_id)
363
364    if asset_version_id is not None:
365        # if asset_version_id is a list, use the "in" operator
366        if isinstance(asset_version_id, list):
367            variables["filter"]["assetVersionRefId_in"] = asset_version_id
368        else:
369            variables["filter"]["assetVersionRefId"] = str(asset_version_id)
370
371    # if category is a string, make it a list
372    if isinstance(category, str):
373        category = [category]
374
375    if category is not None:
376        variables["filter"]["AND"] = [
377            {
378                "OR": [
379                    {
380                        "category_in": category
381                    }
382                ]
383            },
384            {
385                "OR": [
386                    {
387                        "title_like": "%%"
388                    },
389                    {
390                        "description_like": "%%"
391                    }
392                ]
393            }
394        ]
395
396    if severity is not None:
397        variables["filter"]["severity"] = severity
398
399    if cve_id is not None:
400        if "AND" not in variables["filter"]:
401            variables["filter"]["AND"] = []
402
403        variables["filter"]["AND"].append(
404            {
405                "OR": [
406                    {
407                        "cves_every": {
408                            "cveId": cve_id
409                        }
410                    }
411                ]
412            }
413        )
414
415    if status is not None:
416        variables["filter"]["currentStatus"] = {
417            "status_in": [
418                status
419            ]
420        }
421
422    return variables
423
424
425GET_FINDINGS_COUNT = {
426    "query": """
427query GetFindingsCount_SDK($filter: FindingFilter)
428{
429    _allFindingsMeta(filter: $filter) {
430        count
431    }
432}
433""",
434    "variables": lambda asset_version_id=None, category=None, cve_id=None, finding_id=None, status=None, severity=None, limit=None: _create_GET_FINDINGS_VARIABLES(asset_version_id=asset_version_id, category=category, cve_id=cve_id, finding_id=finding_id, status=status, severity=severity, limit=limit, count=True)
435}
436
437GET_FINDINGS = {
438    "query": """
439query GetFindingsForAnAssetVersion_SDK (
440    $filter: FindingFilter,
441    $after: String,
442    $first: Int,
443    $orderBy: [FindingOrderBy!]
444) {
445    allFindings(filter: $filter,
446                after: $after,
447                first: $first,
448                orderBy: $orderBy
449    ) {
450        _cursor
451        id
452        title
453        date
454        createdAt
455        updatedAt
456        deletedAt
457        cvssScore
458        cvssSeverity
459        vulnIdFromTool
460        description
461        severity
462        riskScore
463        affects {
464            id
465            name
466            version
467            __typename
468        }
469        sourceTypes
470        category
471        subcategory
472        regression
473        currentStatus {
474            comment
475            createdAt
476            createdBy {
477                id
478                email
479                __typename
480            }
481            id
482            justification
483            responses
484            status
485            updatedAt
486            __typename
487        }
488        cwes {
489            id
490            cweId
491            name
492            __typename
493        }
494        cves {
495            id
496            cveId
497            epss {
498                epssPercentile
499                epssScore
500            }
501            cvssScore
502            cvssBaseMetricV3 {
503                cvssv3 {
504                    baseScore
505                    vectorString
506                }
507            }
508            exploitsInfo {
509                exploitProofOfConcept
510                reportedInTheWild
511                weaponized
512                exploitedByNamedThreatActors
513                exploitedByBotnets
514                exploitedByRansomware
515                exploits {
516                    id
517                    __typename
518                }
519                __typename
520            }
521            __typename
522        }
523        origin
524        originalFindings {
525            id
526            vulnIdFromTool
527            origin
528            cvssScore
529            cvssSeverity
530            __typename
531        }
532        originalFindingsSources {
533            id
534            name
535            __typename
536        }
537        test {
538            id
539            tools {
540                id
541                name
542                __typename
543            }
544            __typename
545        }
546        __typename
547    }
548}""",
549    "variables": lambda asset_version_id=None, category=None, cve_id=None, finding_id=None, status=None, severity=None, limit=None: _create_GET_FINDINGS_VARIABLES(asset_version_id=asset_version_id, category=category, cve_id=cve_id, finding_id=finding_id, severity=severity, status=status, limit=limit)
550}
551
552
553def _create_GET_SOFTWARE_COMPONENTS_VARIABLES(asset_version_id=None, type=None):
554    variables = {
555        "filter": {
556            "mergedComponentRefId": None,
557            "deletedAt": None
558        },
559        "after": None,
560        "first": DEFAULT_PAGE_SIZE,
561        "orderBy": ["absoluteRiskScore_DESC"]
562    }
563
564    if asset_version_id is not None:
565        variables["filter"]["assetVersionRefId"] = asset_version_id
566
567    if type is not None:
568        variables["filter"]["type_in"] = [type]
569
570    return variables
571
572
573GET_SOFTWARE_COMPONENTS = {
574    "query": """
575query GetSoftwareComponentsForAnAssetVersion_SDK (
576    $filter: SoftwareComponentInstanceFilter,
577    $after: String,
578    $first: Int,
579    $orderBy: [SoftwareComponentInstanceOrderBy!]
580) {
581    allSoftwareComponentInstances(filter: $filter,
582                                  after: $after,
583                                  first: $first,
584                                  orderBy: $orderBy
585    ) {
586        _cursor
587        id
588        name
589        type
590        version
591        hashes {
592            alg
593            content
594        }
595        author
596        licenses {
597            id
598            name
599            copyLeft
600            isFsfLibre
601            isOsiApproved
602            url
603            __typename
604        }
605        copyrights {
606            name
607            text
608            url
609        }
610        softwareIdentifiers {
611            cpes
612            purl
613            __typename
614        }
615        absoluteRiskScore
616        softwareComponent {
617            id
618            name
619            version
620            type
621            url
622            licenses {
623                id
624                name
625                copyLeft
626                isFsfLibre
627                isOsiApproved
628                url
629                __typename
630            }
631            softwareIdentifiers {
632                cpes
633                purl
634                __typename
635            }
636            __typename
637        }
638        supplier {
639            name
640        }
641        currentStatus {
642            id
643            status
644            comment
645            createdBy {
646                email
647            }
648            __typename
649        }
650        test {
651            name
652            tools {
653                name
654            }
655        }
656        origin
657        __typename
658    }
659}
660""",
661    "variables": lambda asset_version_id=None, type=None: _create_GET_SOFTWARE_COMPONENTS_VARIABLES(asset_version_id=asset_version_id, type=type)
662}
663
664
665def _create_GET_PRODUCTS_VARIABLES(product_id=None, business_unit_id=None):
666    variables = {"filter": {}, "after": None, "first": DEFAULT_PAGE_SIZE}
667
668    if product_id:
669        variables["filter"]["id"] = product_id
670
671    if business_unit_id:
672        variables["filter"]["group"] = {
673            "id": business_unit_id
674        }
675
676    return variables
677
678
679GET_PRODUCTS = {
680    "query": """
681        query GetAllProducts_SDK(
682            $filter: ProductFilter!,
683            $after: String,
684            $first: Int
685            ) {
686                allProducts(
687                    filter: $filter,
688                    after: $after,
689                    first: $first
690                ) {
691                    _cursor
692                    id
693                    name
694                    createdAt
695                    createdBy {
696                        id
697                        email
698                        __typename
699                    }
700                    group {
701                        id
702                        name
703                    }
704                    __typename
705                }
706            }
707        """,
708    "variables": lambda product_id=None, business_unit_id=None: _create_GET_PRODUCTS_VARIABLES(product_id=product_id, business_unit_id=business_unit_id)
709}
710
711
712GET_PRODUCTS_BUSINESS_UNIT = {
713    "query": """
714        query GetAllProducts_SDK(
715            $filter: ProductFilter!,
716            $after: String,
717            $first: Int
718            ) {
719                allProducts(
720                    filter: $filter,
721                    after: $after,
722                    first: $first
723                ) {
724                    _cursor
725                    id
726                    name
727                    createdAt
728                    createdBy {
729                        id
730                        email
731                        __typename
732                    }
733                    __typename
734                }
735            }
736        """,
737    "variables": lambda business_unit_id: {
738        "filter": {
739            "group": {
740                "id": business_unit_id
741            }
742        },
743        "after": None,
744        "first": DEFAULT_PAGE_SIZE,
745    },
746}
747
748
749def _create_LAUNCH_CYCLONEDX_EXPORT_VARIABLES(cdx_subtype, asset_version_id):
750    variables = {
751        "cdxSubtype": cdx_subtype,
752        "assetVersionId": asset_version_id
753    }
754
755    return variables
756
757
758LAUNCH_CYCLONEDX_EXPORT = {
759    "mutation": """
760mutation LaunchCycloneDxExport_SDK($cdxSubtype: CycloneDxExportSubtype!, $assetVersionId: ID!) {
761  launchCycloneDxExport(cdxSubtype: $cdxSubtype, assetVersionId: $assetVersionId) {
762    exportJobId
763  }
764}
765""",
766    "variables": lambda cdx_subtype, asset_version_id: _create_LAUNCH_CYCLONEDX_EXPORT_VARIABLES(cdx_subtype, asset_version_id)
767}
768
769
770def _create_LAUNCH_REPORT_EXPORT_MUTATION(asset_version_id=None, product_id=None, report_type=None, report_subtype=None):
771    if not asset_version_id and not product_id:
772        raise Exception("Must specify either asset_version_id or product_id")
773
774    if asset_version_id and product_id:
775        raise Exception("Cannot specify both asset_version_id and product_id")
776
777    if asset_version_id:
778        if report_type == "CSV":
779            mutation = """
780mutation LaunchArtifactCSVExport_SDK($artifactCsvSubtype: ArtifactCSVExportSubtype!, $assetVersionId: ID!) {
781    launchArtifactCSVExport(artifactCsvSubtype: $artifactCsvSubtype, assetVersionId: $assetVersionId) {
782        exportJobId
783    }
784}
785"""
786        elif report_type == "PDF":
787            mutation = """
788mutation LaunchArtifactPDFExport_SDK($artifactPdfSubtype: ArtifactPdfExportSubtype!, $assetVersionId: ID!) {
789    launchArtifactPdfExport(artifactPdfSubtype: $artifactPdfSubtype, assetVersionId: $assetVersionId) {
790        exportJobId
791    }
792}
793"""
794
795    if product_id:
796        if report_type == "CSV":
797            mutation = """
798mutation LaunchProductCSVExport_SDK($productCsvSubtype: ProductCSVExportSubtype!, $productId: ID!) {
799    launchProductCSVExport(productCsvSubtype: $productCsvSubtype, productId: $productId) {
800        exportJobId
801    }
802}
803"""
804
805    return mutation
806
807
808def _create_LAUNCH_REPORT_EXPORT_VARIABLES(asset_version_id=None, product_id=None, report_type=None, report_subtype=None):
809    variables = {}
810
811    if not asset_version_id and not product_id:
812        raise Exception("Must specify either asset_version_id or product_id")
813
814    if asset_version_id and product_id:
815        raise Exception(f"Cannot specify both asset_version_id and product_id: specified {asset_version_id} and {product_id}")
816
817    if asset_version_id:
818        if report_type == "CSV":
819            variables = {
820                "artifactCsvSubtype": report_subtype,
821                "assetVersionId": asset_version_id
822            }
823        elif report_type == "PDF":
824            variables = {
825                "artifactPdfSubtype": report_subtype,
826                "assetVersionId": asset_version_id
827            }
828
829    if product_id:
830        if report_type == "CSV":
831            variables = {
832                "productCsvSubtype": report_subtype,
833                "productId": product_id
834            }
835
836    return variables
837
838
839LAUNCH_REPORT_EXPORT = {
840    "mutation": lambda asset_version_id, product_id, report_type, report_subtype: _create_LAUNCH_REPORT_EXPORT_MUTATION(asset_version_id=asset_version_id, product_id=product_id, report_type=report_type, report_subtype=report_subtype),
841    "variables": lambda asset_version_id, product_id, report_type, report_subtype: _create_LAUNCH_REPORT_EXPORT_VARIABLES(asset_version_id=asset_version_id, product_id=product_id, report_type=report_type, report_subtype=report_subtype)
842}
843
844
845def _create_LAUNCH_SPDX_EXPORT_VARIABLES(spdx_subtype, asset_version_id):
846    variables = {
847        "spdxSubtype": spdx_subtype,
848        "assetVersionId": asset_version_id
849    }
850
851    return variables
852
853
854LAUNCH_SPDX_EXPORT = {
855    "mutation": """
856mutation LaunchSpdxExport_SDK($spdxSubtype: SpdxExportSubtype!, $assetVersionId: ID!) {
857  launchSpdxExport(spdxSubtype: $spdxSubtype, assetVersionId: $assetVersionId) {
858    exportJobId
859  }
860}
861""",
862    "variables": lambda spdx_subtype, asset_version_id: _create_LAUNCH_SPDX_EXPORT_VARIABLES(spdx_subtype, asset_version_id)
863}
864
865
866ONE_PRODUCT_ALL_ASSET_VERSIONS = {
867    "query": """
868        query GetProductAssetVersions_SDK(
869            $filter: ProductFilter!,
870            $after: String,
871            $first: Int
872            ) {
873                allProducts(
874                    filter: $filter,
875                    after: $after,
876                    first: $first
877                ) {
878                    _cursor
879                    id
880                    name
881                    createdAt
882                    assets {
883                        id
884                        name
885                        relativeRiskScore
886                        asset {
887                            id
888                            name
889                        }
890                    }
891                }
892            }
893        """,
894    "variables": lambda product_id: {"filter": {"id": product_id}, "after": None, "first": DEFAULT_PAGE_SIZE},
895}
896
897
898def __create_UPDATE_FINDING_STATUSES_VARIABLES(user_id=None, finding_ids=None, status=None, justification=None, response=None, comment=None):
899    if not isinstance(finding_ids, list):
900        finding_ids = [finding_ids]
901
902    if status == "AFFECTED":
903        if justification is not None:
904            raise Exception("justification pertains to status NOT AFFECTED. Specify response instead.")
905    elif status == "NOT_AFFECTED":
906        if response is not None:
907            raise Exception("response pertains to status AFFECTED. Specify justification instead.")
908
909    return {
910        "ids": finding_ids,
911        "updateStatusInput": {
912            "comment": comment,
913            "status": status,
914            "justification": justification,
915            "responses": response
916        },
917        "userId": user_id
918    }
919
920
921UPDATE_FINDING_STATUSES = {
922    "mutation": """
923mutation UpdateFindingsStatuses_SDK($ids: [ID!]!, $updateStatusInput: UpdateFindingStatusesInput!, $userId: ID!) {
924    updateFindingsStatuses(ids: $ids, updateStatusInput: $updateStatusInput, userId: $userId) {
925        ids
926    }
927}
928    """,
929    "variables": lambda user_id=None, finding_ids=None, status=None, justification=None, response=None, comment=None: __create_UPDATE_FINDING_STATUSES_VARIABLES(user_id=user_id, finding_ids=finding_ids, status=status, justification=justification, response=response, comment=comment)
930}
931
932
933__all__ = [
934    "ALL_BUSINESS_UNITS",
935    "ALL_USERS",
936    "ALL_ORGANIZATIONS",
937    "ALL_ASSET_VERSIONS",
938    "ALL_ARTIFACTS",
939    "ALL_PRODUCTS",
940    "ONE_PRODUCT_ALL_ASSET_VERSIONS"
941]
ALL_BUSINESS_UNITS = {'query': '\n query GetBusinessUnits_SDK(\n $after: String,\n $first: Int\n ) {\n allGroups(\n after: $after,\n first: $first\n ) {\n _cursor\n id\n name\n __typename\n }\n }\n ', 'variables': {'after': None, 'first': 100}}
ALL_USERS = {'query': '\n query GetUsers_SDK(\n $after: String,\n $first: Int\n ) {\n allUsers(\n after: $after,\n first: $first\n ) {\n _cursor\n id\n email\n __typename\n }\n }\n ', 'variables': {'after': None, 'first': 100}}
ALL_ORGANIZATIONS = {'query': '\n query GetOrganizations_SDK(\n $after: String,\n $first: Int\n ) {\n allOrganizations(\n after: $after,\n first: $first\n ) {\n _cursor\n id\n name\n __typename\n }\n }\n ', 'variables': {'after': None, 'first': 100}}
ALL_ASSET_VERSIONS = {'query': '\n query GetAllAssetVersions_SDK(\n $filter: AssetVersionFilter!,\n $after: String,\n $first: Int\n ) {\n allAssetVersions(\n filter: $filter,\n after: $after,\n first: $first\n ) {\n _cursor\n id\n createdAt\n createdBy {\n id\n email\n __typename\n }\n name\n relativeRiskScore\n uniqueTestTypes {\n id\n name\n __typename\n }\n testStatuses\n asset {\n id\n name\n group {\n id\n name\n __typename\n }\n }\n __typename\n }\n }\n ', 'variables': <function <lambda>>}
ALL_ARTIFACTS = {'query': '\n query GetAllArtifacts_SDK(\n $filter: AssetFilter!,\n $after: String,\n $first: Int,\n $orderBy: [AssetOrderBy!]\n ) {\n allAssets(\n filter: $filter,\n after: $after,\n first: $first,\n orderBy: $orderBy\n ) {\n _cursor\n id\n name\n createdAt\n createdBy {\n id\n email\n __typename\n }\n deletedAt\n ctx {\n asset\n businessUnits\n products\n }\n defaultVersion {\n name\n createdAt\n __typename\n }\n _versionsMeta {\n count\n }\n __typename\n }\n }\n ', 'variables': <function artifact_variables>}
ALL_PRODUCTS = {'query': '\n query GetAllProducts_SDK(\n $filter: ProductFilter!,\n $after: String,\n $first: Int\n ) {\n allProducts(\n filter: $filter,\n after: $after,\n first: $first\n ) {\n _cursor\n id\n name\n createdAt\n createdBy {\n id\n email\n __typename\n }\n relativeRiskScore\n group {\n id\n name\n }\n assets {\n id\n name\n _findingsMeta {\n count\n }\n __typename\n }\n __typename\n }\n }\n ', 'variables': {'filter': {}, 'after': None, 'first': 100}}
ONE_PRODUCT_ALL_ASSET_VERSIONS = {'query': '\n query GetProductAssetVersions_SDK(\n $filter: ProductFilter!,\n $after: String,\n $first: Int\n ) {\n allProducts(\n filter: $filter,\n after: $after,\n first: $first\n ) {\n _cursor\n id\n name\n createdAt\n assets {\n id\n name\n relativeRiskScore\n asset {\n id\n name\n }\n }\n }\n }\n ', 'variables': <function <lambda>>}