@osdk/maker 0.10.0-beta.13 → 0.10.0-beta.14

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.
@@ -2584,6 +2584,389 @@ describe("Ontology Defining", () => {
2584
2584
  }
2585
2585
  `);
2586
2586
  });
2587
+ it("Explicit datasource definitions are properly defined", () => {
2588
+ defineObject({
2589
+ titlePropertyApiName: "bar",
2590
+ displayName: "datasetBackedObject",
2591
+ pluralDisplayName: "datasetBackedObject",
2592
+ apiName: "foo",
2593
+ primaryKeys: ["bar"],
2594
+ properties: [{
2595
+ apiName: "bar",
2596
+ type: "string",
2597
+ displayName: "Bar"
2598
+ }],
2599
+ datasource: {
2600
+ type: "dataset"
2601
+ }
2602
+ });
2603
+ defineObject({
2604
+ titlePropertyApiName: "fizz",
2605
+ displayName: "streamBackedObjectNoRetention",
2606
+ pluralDisplayName: "streamBackedObjectNoRetention",
2607
+ apiName: "fizz",
2608
+ primaryKeys: ["fizz"],
2609
+ properties: [{
2610
+ apiName: "fizz",
2611
+ type: "string",
2612
+ displayName: "Fizz"
2613
+ }, {
2614
+ apiName: "bar",
2615
+ type: "string",
2616
+ displayName: "Bar"
2617
+ }],
2618
+ datasource: {
2619
+ type: "stream"
2620
+ }
2621
+ });
2622
+ defineObject({
2623
+ titlePropertyApiName: "buzz",
2624
+ displayName: "streamBackedObjectWithRetention",
2625
+ pluralDisplayName: "streamBackedObjectWithRetention",
2626
+ apiName: "buzz",
2627
+ primaryKeys: ["buzz"],
2628
+ properties: [{
2629
+ apiName: "buzz",
2630
+ type: "string",
2631
+ displayName: "Buzz"
2632
+ }],
2633
+ datasource: {
2634
+ type: "stream",
2635
+ retentionPeriod: "PT1H"
2636
+ }
2637
+ });
2638
+ expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`
2639
+ {
2640
+ "blockPermissionInformation": {
2641
+ "actionTypes": {},
2642
+ "linkTypes": {},
2643
+ "objectTypes": {},
2644
+ },
2645
+ "interfaceTypes": {},
2646
+ "linkTypes": {},
2647
+ "objectTypes": {
2648
+ "com.palantir.buzz": {
2649
+ "datasources": [
2650
+ {
2651
+ "datasource": {
2652
+ "streamV2": {
2653
+ "propertyMapping": {
2654
+ "buzz": "buzz",
2655
+ },
2656
+ "propertySecurityGroups": undefined,
2657
+ "retentionPolicy": {
2658
+ "time": {
2659
+ "window": "PT1H",
2660
+ },
2661
+ "type": "time",
2662
+ },
2663
+ "streamLocator": "com.palantir.buzz",
2664
+ },
2665
+ "type": "streamV2",
2666
+ },
2667
+ "editsConfiguration": {
2668
+ "onlyAllowPrivilegedEdits": false,
2669
+ },
2670
+ "redacted": false,
2671
+ "rid": "ri.ontology.main.datasource.com.palantir.buzz",
2672
+ },
2673
+ ],
2674
+ "entityMetadata": {
2675
+ "arePatchesEnabled": false,
2676
+ },
2677
+ "objectType": {
2678
+ "allImplementsInterfaces": {},
2679
+ "apiName": "com.palantir.buzz",
2680
+ "displayMetadata": {
2681
+ "description": undefined,
2682
+ "displayName": "streamBackedObjectWithRetention",
2683
+ "groupDisplayName": undefined,
2684
+ "icon": {
2685
+ "blueprint": {
2686
+ "color": "#2D72D2",
2687
+ "locator": "cube",
2688
+ },
2689
+ "type": "blueprint",
2690
+ },
2691
+ "pluralDisplayName": "streamBackedObjectWithRetention",
2692
+ "visibility": "NORMAL",
2693
+ },
2694
+ "implementsInterfaces2": [],
2695
+ "primaryKeys": [
2696
+ "buzz",
2697
+ ],
2698
+ "propertyTypes": {
2699
+ "buzz": {
2700
+ "apiName": "buzz",
2701
+ "baseFormatter": undefined,
2702
+ "dataConstraints": undefined,
2703
+ "displayMetadata": {
2704
+ "description": undefined,
2705
+ "displayName": "Buzz",
2706
+ "visibility": "NORMAL",
2707
+ },
2708
+ "indexedForSearch": true,
2709
+ "inlineAction": undefined,
2710
+ "ruleSetBinding": undefined,
2711
+ "sharedPropertyTypeApiName": undefined,
2712
+ "sharedPropertyTypeRid": undefined,
2713
+ "status": {
2714
+ "active": {},
2715
+ "type": "active",
2716
+ },
2717
+ "type": {
2718
+ "string": {
2719
+ "analyzerOverride": undefined,
2720
+ "enableAsciiFolding": undefined,
2721
+ "isLongText": false,
2722
+ "supportsEfficientLeadingWildcard": false,
2723
+ "supportsExactMatching": true,
2724
+ },
2725
+ "type": "string",
2726
+ },
2727
+ "typeClasses": [],
2728
+ "valueType": undefined,
2729
+ },
2730
+ },
2731
+ "redacted": false,
2732
+ "status": {
2733
+ "active": {},
2734
+ "type": "active",
2735
+ },
2736
+ "titlePropertyTypeRid": "buzz",
2737
+ },
2738
+ },
2739
+ "com.palantir.fizz": {
2740
+ "datasources": [
2741
+ {
2742
+ "datasource": {
2743
+ "streamV2": {
2744
+ "propertyMapping": {
2745
+ "bar": "bar",
2746
+ "fizz": "fizz",
2747
+ },
2748
+ "propertySecurityGroups": undefined,
2749
+ "retentionPolicy": {
2750
+ "none": {},
2751
+ "type": "none",
2752
+ },
2753
+ "streamLocator": "com.palantir.fizz",
2754
+ },
2755
+ "type": "streamV2",
2756
+ },
2757
+ "editsConfiguration": {
2758
+ "onlyAllowPrivilegedEdits": false,
2759
+ },
2760
+ "redacted": false,
2761
+ "rid": "ri.ontology.main.datasource.com.palantir.fizz",
2762
+ },
2763
+ ],
2764
+ "entityMetadata": {
2765
+ "arePatchesEnabled": false,
2766
+ },
2767
+ "objectType": {
2768
+ "allImplementsInterfaces": {},
2769
+ "apiName": "com.palantir.fizz",
2770
+ "displayMetadata": {
2771
+ "description": undefined,
2772
+ "displayName": "streamBackedObjectNoRetention",
2773
+ "groupDisplayName": undefined,
2774
+ "icon": {
2775
+ "blueprint": {
2776
+ "color": "#2D72D2",
2777
+ "locator": "cube",
2778
+ },
2779
+ "type": "blueprint",
2780
+ },
2781
+ "pluralDisplayName": "streamBackedObjectNoRetention",
2782
+ "visibility": "NORMAL",
2783
+ },
2784
+ "implementsInterfaces2": [],
2785
+ "primaryKeys": [
2786
+ "fizz",
2787
+ ],
2788
+ "propertyTypes": {
2789
+ "bar": {
2790
+ "apiName": "bar",
2791
+ "baseFormatter": undefined,
2792
+ "dataConstraints": undefined,
2793
+ "displayMetadata": {
2794
+ "description": undefined,
2795
+ "displayName": "Bar",
2796
+ "visibility": "NORMAL",
2797
+ },
2798
+ "indexedForSearch": true,
2799
+ "inlineAction": undefined,
2800
+ "ruleSetBinding": undefined,
2801
+ "sharedPropertyTypeApiName": undefined,
2802
+ "sharedPropertyTypeRid": undefined,
2803
+ "status": {
2804
+ "active": {},
2805
+ "type": "active",
2806
+ },
2807
+ "type": {
2808
+ "string": {
2809
+ "analyzerOverride": undefined,
2810
+ "enableAsciiFolding": undefined,
2811
+ "isLongText": false,
2812
+ "supportsEfficientLeadingWildcard": false,
2813
+ "supportsExactMatching": true,
2814
+ },
2815
+ "type": "string",
2816
+ },
2817
+ "typeClasses": [],
2818
+ "valueType": undefined,
2819
+ },
2820
+ "fizz": {
2821
+ "apiName": "fizz",
2822
+ "baseFormatter": undefined,
2823
+ "dataConstraints": undefined,
2824
+ "displayMetadata": {
2825
+ "description": undefined,
2826
+ "displayName": "Fizz",
2827
+ "visibility": "NORMAL",
2828
+ },
2829
+ "indexedForSearch": true,
2830
+ "inlineAction": undefined,
2831
+ "ruleSetBinding": undefined,
2832
+ "sharedPropertyTypeApiName": undefined,
2833
+ "sharedPropertyTypeRid": undefined,
2834
+ "status": {
2835
+ "active": {},
2836
+ "type": "active",
2837
+ },
2838
+ "type": {
2839
+ "string": {
2840
+ "analyzerOverride": undefined,
2841
+ "enableAsciiFolding": undefined,
2842
+ "isLongText": false,
2843
+ "supportsEfficientLeadingWildcard": false,
2844
+ "supportsExactMatching": true,
2845
+ },
2846
+ "type": "string",
2847
+ },
2848
+ "typeClasses": [],
2849
+ "valueType": undefined,
2850
+ },
2851
+ },
2852
+ "redacted": false,
2853
+ "status": {
2854
+ "active": {},
2855
+ "type": "active",
2856
+ },
2857
+ "titlePropertyTypeRid": "fizz",
2858
+ },
2859
+ },
2860
+ "com.palantir.foo": {
2861
+ "datasources": [
2862
+ {
2863
+ "datasource": {
2864
+ "datasetV2": {
2865
+ "datasetRid": "com.palantir.foo",
2866
+ "propertyMapping": {
2867
+ "bar": {
2868
+ "column": "bar",
2869
+ "type": "column",
2870
+ },
2871
+ },
2872
+ },
2873
+ "type": "datasetV2",
2874
+ },
2875
+ "editsConfiguration": {
2876
+ "onlyAllowPrivilegedEdits": false,
2877
+ },
2878
+ "redacted": false,
2879
+ "rid": "ri.ontology.main.datasource.com.palantir.foo",
2880
+ },
2881
+ ],
2882
+ "entityMetadata": {
2883
+ "arePatchesEnabled": false,
2884
+ },
2885
+ "objectType": {
2886
+ "allImplementsInterfaces": {},
2887
+ "apiName": "com.palantir.foo",
2888
+ "displayMetadata": {
2889
+ "description": undefined,
2890
+ "displayName": "datasetBackedObject",
2891
+ "groupDisplayName": undefined,
2892
+ "icon": {
2893
+ "blueprint": {
2894
+ "color": "#2D72D2",
2895
+ "locator": "cube",
2896
+ },
2897
+ "type": "blueprint",
2898
+ },
2899
+ "pluralDisplayName": "datasetBackedObject",
2900
+ "visibility": "NORMAL",
2901
+ },
2902
+ "implementsInterfaces2": [],
2903
+ "primaryKeys": [
2904
+ "bar",
2905
+ ],
2906
+ "propertyTypes": {
2907
+ "bar": {
2908
+ "apiName": "bar",
2909
+ "baseFormatter": undefined,
2910
+ "dataConstraints": undefined,
2911
+ "displayMetadata": {
2912
+ "description": undefined,
2913
+ "displayName": "Bar",
2914
+ "visibility": "NORMAL",
2915
+ },
2916
+ "indexedForSearch": true,
2917
+ "inlineAction": undefined,
2918
+ "ruleSetBinding": undefined,
2919
+ "sharedPropertyTypeApiName": undefined,
2920
+ "sharedPropertyTypeRid": undefined,
2921
+ "status": {
2922
+ "active": {},
2923
+ "type": "active",
2924
+ },
2925
+ "type": {
2926
+ "string": {
2927
+ "analyzerOverride": undefined,
2928
+ "enableAsciiFolding": undefined,
2929
+ "isLongText": false,
2930
+ "supportsEfficientLeadingWildcard": false,
2931
+ "supportsExactMatching": true,
2932
+ },
2933
+ "type": "string",
2934
+ },
2935
+ "typeClasses": [],
2936
+ "valueType": undefined,
2937
+ },
2938
+ },
2939
+ "redacted": false,
2940
+ "status": {
2941
+ "active": {},
2942
+ "type": "active",
2943
+ },
2944
+ "titlePropertyTypeRid": "bar",
2945
+ },
2946
+ },
2947
+ },
2948
+ "sharedPropertyTypes": {},
2949
+ }
2950
+ `);
2951
+ });
2952
+ it("Fail if stream retention period is not ISO 8601 compliant", () => {
2953
+ expect(() => defineObject({
2954
+ titlePropertyApiName: "buzz",
2955
+ displayName: "streamBackedObjectWithRetention",
2956
+ pluralDisplayName: "streamBackedObjectWithRetention",
2957
+ apiName: "buzz",
2958
+ primaryKeys: ["buzz"],
2959
+ properties: [{
2960
+ apiName: "buzz",
2961
+ type: "string",
2962
+ displayName: "Buzz"
2963
+ }],
2964
+ datasource: {
2965
+ type: "stream",
2966
+ retentionPeriod: "bad retention period string"
2967
+ }
2968
+ })).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Retention period "bad retention period string" on object "buzz" is not a valid ISO 8601 duration string]`);
2969
+ });
2587
2970
  });
2588
2971
  });
2589
2972
  //# sourceMappingURL=overall.test.js.map