@osdk/maker 0.15.0-beta.4 → 0.15.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2587,5 +2587,406 @@ describe("Object Types", () => {
2587
2587
  }
2588
2588
  `);
2589
2589
  });
2590
+ it("Self-referential links on derived datasources work", () => {
2591
+ const link_person_to_parent = defineLink({
2592
+ apiName: "person-to-parent",
2593
+ manyForeignKeyProperty: "parentFk",
2594
+ one: {
2595
+ object: "com.palantir.person",
2596
+ metadata: {
2597
+ apiName: "parent",
2598
+ displayName: "Parent",
2599
+ pluralDisplayName: "Parents",
2600
+ visibility: "NORMAL"
2601
+ }
2602
+ },
2603
+ toMany: {
2604
+ object: "com.palantir.person",
2605
+ metadata: {
2606
+ apiName: "child",
2607
+ displayName: "Child",
2608
+ pluralDisplayName: "Children",
2609
+ visibility: "NORMAL"
2610
+ }
2611
+ }
2612
+ });
2613
+ defineObject({
2614
+ displayName: "Person",
2615
+ pluralDisplayName: "Persons",
2616
+ description: "person",
2617
+ apiName: "person",
2618
+ titlePropertyApiName: "pk",
2619
+ primaryKeyPropertyApiName: "pk",
2620
+ properties: {
2621
+ "pk": {
2622
+ displayName: "pk",
2623
+ type: "string",
2624
+ status: "experimental"
2625
+ },
2626
+ "parentFk": {
2627
+ displayName: "Parent FK",
2628
+ type: "string",
2629
+ status: "experimental"
2630
+ },
2631
+ "siblingIds": {
2632
+ displayName: "Sibling IDs",
2633
+ type: "string",
2634
+ array: true,
2635
+ status: "experimental"
2636
+ }
2637
+ },
2638
+ datasources: [{
2639
+ type: "dataset"
2640
+ }, {
2641
+ type: "derived",
2642
+ linkDefinition: [{
2643
+ linkType: link_person_to_parent,
2644
+ side: "TARGET"
2645
+ }, {
2646
+ linkType: link_person_to_parent,
2647
+ side: "SOURCE"
2648
+ }],
2649
+ propertyMapping: {
2650
+ siblingIds: {
2651
+ type: "collectList",
2652
+ property: "pk",
2653
+ limit: 100
2654
+ }
2655
+ }
2656
+ }]
2657
+ });
2658
+ expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
2659
+ {
2660
+ "importedOntology": {
2661
+ "actionTypes": {},
2662
+ "blockPermissionInformation": {
2663
+ "actionTypes": {},
2664
+ "linkTypes": {},
2665
+ "objectTypes": {},
2666
+ },
2667
+ "interfaceTypes": {},
2668
+ "linkTypes": {},
2669
+ "objectTypes": {},
2670
+ "sharedPropertyTypes": {},
2671
+ },
2672
+ "importedValueTypes": {
2673
+ "valueTypes": [],
2674
+ },
2675
+ "ontology": {
2676
+ "actionTypes": {},
2677
+ "blockPermissionInformation": {
2678
+ "actionTypes": {},
2679
+ "linkTypes": {},
2680
+ "objectTypes": {},
2681
+ },
2682
+ "interfaceTypes": {},
2683
+ "linkTypes": {
2684
+ "person-to-parent": {
2685
+ "datasources": [],
2686
+ "entityMetadata": {
2687
+ "arePatchesEnabled": false,
2688
+ },
2689
+ "linkType": {
2690
+ "definition": {
2691
+ "oneToMany": {
2692
+ "cardinalityHint": "ONE_TO_MANY",
2693
+ "manyToOneLinkMetadata": {
2694
+ "apiName": "child",
2695
+ "displayMetadata": {
2696
+ "displayName": "Child",
2697
+ "groupDisplayName": "",
2698
+ "pluralDisplayName": "Children",
2699
+ "visibility": "NORMAL",
2700
+ },
2701
+ "typeClasses": [],
2702
+ },
2703
+ "objectTypeRidManySide": "com.palantir.person",
2704
+ "objectTypeRidOneSide": "com.palantir.person",
2705
+ "oneSidePrimaryKeyToManySidePropertyMapping": [
2706
+ {
2707
+ "from": {
2708
+ "apiName": "pk",
2709
+ "object": "com.palantir.person",
2710
+ },
2711
+ "to": {
2712
+ "apiName": "parentFk",
2713
+ "object": "com.palantir.person",
2714
+ },
2715
+ },
2716
+ ],
2717
+ "oneToManyLinkMetadata": {
2718
+ "apiName": "parent",
2719
+ "displayMetadata": {
2720
+ "displayName": "Parent",
2721
+ "groupDisplayName": "",
2722
+ "pluralDisplayName": "Parents",
2723
+ "visibility": "NORMAL",
2724
+ },
2725
+ "typeClasses": [],
2726
+ },
2727
+ },
2728
+ "type": "oneToMany",
2729
+ },
2730
+ "id": "person-to-parent",
2731
+ "redacted": false,
2732
+ "status": {
2733
+ "active": {},
2734
+ "type": "active",
2735
+ },
2736
+ },
2737
+ },
2738
+ },
2739
+ "objectTypes": {
2740
+ "com.palantir.person": {
2741
+ "datasources": [
2742
+ {
2743
+ "datasource": {
2744
+ "derived": {
2745
+ "definition": {
2746
+ "aggregatedProperties": {
2747
+ "linkDefinition": {
2748
+ "multiHopLink": {
2749
+ "steps": [
2750
+ {
2751
+ "searchAround": {
2752
+ "linkTypeIdentifier": {
2753
+ "linkType": "person-to-parent",
2754
+ "type": "linkType",
2755
+ },
2756
+ "linkTypeSide": "TARGET",
2757
+ },
2758
+ "type": "searchAround",
2759
+ },
2760
+ {
2761
+ "searchAround": {
2762
+ "linkTypeIdentifier": {
2763
+ "linkType": "person-to-parent",
2764
+ "type": "linkType",
2765
+ },
2766
+ "linkTypeSide": "SOURCE",
2767
+ },
2768
+ "type": "searchAround",
2769
+ },
2770
+ ],
2771
+ },
2772
+ "type": "multiHopLink",
2773
+ },
2774
+ "propertyTypeMapping": {
2775
+ "siblingIds": {
2776
+ "collectList": {
2777
+ "limit": 100,
2778
+ "linkedProperty": {
2779
+ "propertyType": "pk",
2780
+ "type": "propertyType",
2781
+ },
2782
+ },
2783
+ "type": "collectList",
2784
+ },
2785
+ },
2786
+ },
2787
+ "type": "aggregatedProperties",
2788
+ },
2789
+ },
2790
+ "type": "derived",
2791
+ },
2792
+ "datasourceName": "com.palantir.person.derived.0",
2793
+ "editsConfiguration": {
2794
+ "onlyAllowPrivilegedEdits": false,
2795
+ },
2796
+ "redacted": false,
2797
+ },
2798
+ {
2799
+ "datasource": {
2800
+ "datasetV2": {
2801
+ "datasetRid": "com.palantir.person",
2802
+ "propertyMapping": {
2803
+ "parentFk": {
2804
+ "column": "parentFk",
2805
+ "type": "column",
2806
+ },
2807
+ "pk": {
2808
+ "column": "pk",
2809
+ "type": "column",
2810
+ },
2811
+ },
2812
+ },
2813
+ "type": "datasetV2",
2814
+ },
2815
+ "datasourceName": "com.palantir.person",
2816
+ "editsConfiguration": {
2817
+ "onlyAllowPrivilegedEdits": false,
2818
+ },
2819
+ "redacted": false,
2820
+ },
2821
+ ],
2822
+ "entityMetadata": {
2823
+ "arePatchesEnabled": false,
2824
+ },
2825
+ "objectType": {
2826
+ "allImplementsInterfaces": {},
2827
+ "apiName": "com.palantir.person",
2828
+ "displayMetadata": {
2829
+ "description": "person",
2830
+ "displayName": "Person",
2831
+ "groupDisplayName": undefined,
2832
+ "icon": {
2833
+ "blueprint": {
2834
+ "color": "#2D72D2",
2835
+ "locator": "cube",
2836
+ },
2837
+ "type": "blueprint",
2838
+ },
2839
+ "pluralDisplayName": "Persons",
2840
+ "visibility": "NORMAL",
2841
+ },
2842
+ "implementsInterfaces2": [],
2843
+ "primaryKeys": [
2844
+ "pk",
2845
+ ],
2846
+ "propertyTypes": {
2847
+ "parentFk": {
2848
+ "apiName": "parentFk",
2849
+ "baseFormatter": undefined,
2850
+ "dataConstraints": undefined,
2851
+ "displayMetadata": {
2852
+ "description": undefined,
2853
+ "displayName": "Parent FK",
2854
+ "visibility": "NORMAL",
2855
+ },
2856
+ "indexedForSearch": true,
2857
+ "inlineAction": undefined,
2858
+ "ruleSetBinding": undefined,
2859
+ "sharedPropertyTypeApiName": undefined,
2860
+ "sharedPropertyTypeRid": undefined,
2861
+ "status": {
2862
+ "experimental": {},
2863
+ "type": "experimental",
2864
+ },
2865
+ "type": {
2866
+ "string": {
2867
+ "analyzerOverride": undefined,
2868
+ "enableAsciiFolding": undefined,
2869
+ "isLongText": false,
2870
+ "supportsEfficientLeadingWildcard": false,
2871
+ "supportsExactMatching": true,
2872
+ },
2873
+ "type": "string",
2874
+ },
2875
+ "typeClasses": [
2876
+ {
2877
+ "kind": "render_hint",
2878
+ "name": "SELECTABLE",
2879
+ },
2880
+ {
2881
+ "kind": "render_hint",
2882
+ "name": "SORTABLE",
2883
+ },
2884
+ ],
2885
+ "valueType": undefined,
2886
+ },
2887
+ "pk": {
2888
+ "apiName": "pk",
2889
+ "baseFormatter": undefined,
2890
+ "dataConstraints": undefined,
2891
+ "displayMetadata": {
2892
+ "description": undefined,
2893
+ "displayName": "pk",
2894
+ "visibility": "NORMAL",
2895
+ },
2896
+ "indexedForSearch": true,
2897
+ "inlineAction": undefined,
2898
+ "ruleSetBinding": undefined,
2899
+ "sharedPropertyTypeApiName": undefined,
2900
+ "sharedPropertyTypeRid": undefined,
2901
+ "status": {
2902
+ "experimental": {},
2903
+ "type": "experimental",
2904
+ },
2905
+ "type": {
2906
+ "string": {
2907
+ "analyzerOverride": undefined,
2908
+ "enableAsciiFolding": undefined,
2909
+ "isLongText": false,
2910
+ "supportsEfficientLeadingWildcard": false,
2911
+ "supportsExactMatching": true,
2912
+ },
2913
+ "type": "string",
2914
+ },
2915
+ "typeClasses": [
2916
+ {
2917
+ "kind": "render_hint",
2918
+ "name": "SELECTABLE",
2919
+ },
2920
+ {
2921
+ "kind": "render_hint",
2922
+ "name": "SORTABLE",
2923
+ },
2924
+ ],
2925
+ "valueType": undefined,
2926
+ },
2927
+ "siblingIds": {
2928
+ "apiName": "siblingIds",
2929
+ "baseFormatter": undefined,
2930
+ "dataConstraints": undefined,
2931
+ "displayMetadata": {
2932
+ "description": undefined,
2933
+ "displayName": "Sibling IDs",
2934
+ "visibility": "NORMAL",
2935
+ },
2936
+ "indexedForSearch": true,
2937
+ "inlineAction": undefined,
2938
+ "ruleSetBinding": undefined,
2939
+ "sharedPropertyTypeApiName": undefined,
2940
+ "sharedPropertyTypeRid": undefined,
2941
+ "status": {
2942
+ "experimental": {},
2943
+ "type": "experimental",
2944
+ },
2945
+ "type": {
2946
+ "array": {
2947
+ "subtype": {
2948
+ "string": {
2949
+ "analyzerOverride": undefined,
2950
+ "enableAsciiFolding": undefined,
2951
+ "isLongText": false,
2952
+ "supportsEfficientLeadingWildcard": false,
2953
+ "supportsExactMatching": true,
2954
+ },
2955
+ "type": "string",
2956
+ },
2957
+ },
2958
+ "type": "array",
2959
+ },
2960
+ "typeClasses": [
2961
+ {
2962
+ "kind": "render_hint",
2963
+ "name": "SELECTABLE",
2964
+ },
2965
+ {
2966
+ "kind": "render_hint",
2967
+ "name": "SORTABLE",
2968
+ },
2969
+ ],
2970
+ "valueType": undefined,
2971
+ },
2972
+ },
2973
+ "redacted": false,
2974
+ "status": {
2975
+ "active": {},
2976
+ "type": "active",
2977
+ },
2978
+ "titlePropertyTypeRid": "pk",
2979
+ },
2980
+ },
2981
+ },
2982
+ "sharedPropertyTypes": {},
2983
+ },
2984
+ "randomnessKey": undefined,
2985
+ "valueTypes": {
2986
+ "valueTypes": [],
2987
+ },
2988
+ }
2989
+ `);
2990
+ });
2590
2991
  });
2591
2992
  //# sourceMappingURL=objects.test.js.map