@osdk/maker 0.12.0-beta.2 → 0.12.0-beta.20

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/README.md +88 -62
  3. package/build/browser/api/defineAction.js +397 -89
  4. package/build/browser/api/defineAction.js.map +1 -1
  5. package/build/browser/api/defineLink.js +3 -3
  6. package/build/browser/api/defineLink.js.map +1 -1
  7. package/build/browser/api/defineObject.js +6 -2
  8. package/build/browser/api/defineObject.js.map +1 -1
  9. package/build/browser/api/defineOntology.js +100 -33
  10. package/build/browser/api/defineOntology.js.map +1 -1
  11. package/build/browser/api/defineSpt.js.map +1 -1
  12. package/build/browser/api/markingconstraint.test.js +108 -0
  13. package/build/browser/api/markingconstraint.test.js.map +1 -0
  14. package/build/browser/api/ontologyUtils.js +63 -0
  15. package/build/browser/api/ontologyUtils.js.map +1 -1
  16. package/build/browser/api/overall.test.js +5771 -2233
  17. package/build/browser/api/overall.test.js.map +1 -1
  18. package/build/browser/api/types.js +2 -0
  19. package/build/browser/api/types.js.map +1 -1
  20. package/build/browser/cli/main.js +2 -10
  21. package/build/browser/cli/main.js.map +1 -1
  22. package/build/browser/index.js +2 -2
  23. package/build/browser/index.js.map +1 -1
  24. package/build/cjs/index.cjs +561 -135
  25. package/build/cjs/index.cjs.map +1 -1
  26. package/build/cjs/index.d.cts +76 -20
  27. package/build/esm/api/defineAction.js +397 -89
  28. package/build/esm/api/defineAction.js.map +1 -1
  29. package/build/esm/api/defineLink.js +3 -3
  30. package/build/esm/api/defineLink.js.map +1 -1
  31. package/build/esm/api/defineObject.js +6 -2
  32. package/build/esm/api/defineObject.js.map +1 -1
  33. package/build/esm/api/defineOntology.js +100 -33
  34. package/build/esm/api/defineOntology.js.map +1 -1
  35. package/build/esm/api/defineSpt.js.map +1 -1
  36. package/build/esm/api/markingconstraint.test.js +108 -0
  37. package/build/esm/api/markingconstraint.test.js.map +1 -0
  38. package/build/esm/api/ontologyUtils.js +63 -0
  39. package/build/esm/api/ontologyUtils.js.map +1 -1
  40. package/build/esm/api/overall.test.js +5771 -2233
  41. package/build/esm/api/overall.test.js.map +1 -1
  42. package/build/esm/api/types.js +2 -0
  43. package/build/esm/api/types.js.map +1 -1
  44. package/build/esm/cli/main.js +2 -10
  45. package/build/esm/cli/main.js.map +1 -1
  46. package/build/esm/index.js +2 -2
  47. package/build/esm/index.js.map +1 -1
  48. package/build/types/api/defineAction.d.ts +7 -6
  49. package/build/types/api/defineAction.d.ts.map +1 -1
  50. package/build/types/api/defineObject.d.ts +2 -2
  51. package/build/types/api/defineObject.d.ts.map +1 -1
  52. package/build/types/api/defineOntology.d.ts.map +1 -1
  53. package/build/types/api/defineSpt.d.ts +2 -2
  54. package/build/types/api/defineSpt.d.ts.map +1 -1
  55. package/build/types/api/markingconstraint.test.d.ts +1 -0
  56. package/build/types/api/markingconstraint.test.d.ts.map +1 -0
  57. package/build/types/api/ontologyUtils.d.ts +5 -2
  58. package/build/types/api/ontologyUtils.d.ts.map +1 -1
  59. package/build/types/api/types.d.ts +67 -12
  60. package/build/types/api/types.d.ts.map +1 -1
  61. package/build/types/cli/main.d.ts.map +1 -1
  62. package/build/types/index.d.ts +3 -3
  63. package/build/types/index.d.ts.map +1 -1
  64. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,166 @@
1
1
  # @osdk/maker
2
2
 
3
+ ## 0.12.0-beta.20
4
+
5
+ ### Minor Changes
6
+
7
+ - 45ed433: Target objects are configurable and default parameter ordering is better in OAC actions
8
+
9
+ ## 0.12.0-beta.19
10
+
11
+ ### Patch Changes
12
+
13
+ - @osdk/api@2.4.0-beta.16
14
+
15
+ ## 0.12.0-beta.18
16
+
17
+ ### Patch Changes
18
+
19
+ - @osdk/api@2.4.0-beta.15
20
+
21
+ ## 0.12.0-beta.17
22
+
23
+ ### Minor Changes
24
+
25
+ - f1f587b: Support custom parameters in OAC actions
26
+ - 641bc0c: Fix create-or-modify non parameter mapped property bug
27
+ - 25bae67: OAC modify object actions set parameter defaults to match the selected object
28
+ - 5c76e33: Trim value type before putting it in SPT IR
29
+
30
+ ### Patch Changes
31
+
32
+ - @osdk/api@2.4.0-beta.14
33
+
34
+ ## 0.12.0-beta.16
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [4bc848b]
39
+ - @osdk/api@2.4.0-beta.13
40
+
41
+ ## 0.12.0-beta.15
42
+
43
+ ### Minor Changes
44
+
45
+ - a1736f3: Actions can have properties that are not mapped to parameters
46
+ - c621638: Create or Modify actions in OAC
47
+
48
+ ### Patch Changes
49
+
50
+ - @osdk/api@2.4.0-beta.12
51
+
52
+ ## 0.12.0-beta.14
53
+
54
+ ### Minor Changes
55
+
56
+ - d384b4c: Add custom display names and descriptions for action parameters in OAC
57
+ - 02be685: Remove jiti
58
+
59
+ ### Patch Changes
60
+
61
+ - @osdk/api@2.4.0-beta.11
62
+
63
+ ## 0.12.0-beta.13
64
+
65
+ ### Minor Changes
66
+
67
+ - ed41359: Action sections in OAC
68
+
69
+ ## 0.12.0-beta.12
70
+
71
+ ### Minor Changes
72
+
73
+ - 666787f: fix text allowed values name
74
+
75
+ ### Patch Changes
76
+
77
+ - @osdk/api@2.4.0-beta.10
78
+
79
+ ## 0.12.0-beta.11
80
+
81
+ ### Minor Changes
82
+
83
+ - b0955ef: Action parameter defaults and table forms
84
+ - defc2cf: change parameterLevelValidations to parameterConfiguration
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [9101bad]
89
+ - @osdk/api@2.4.0-beta.9
90
+
91
+ ## 0.12.0-beta.10
92
+
93
+ ### Minor Changes
94
+
95
+ - 4dffba1: Support extended string params in actions
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [9f4fe9e]
100
+ - @osdk/api@2.4.0-beta.8
101
+
102
+ ## 0.12.0-beta.9
103
+
104
+ ### Minor Changes
105
+
106
+ - ac0029e: Improve CRUD actions customization
107
+
108
+ ### Patch Changes
109
+
110
+ - @osdk/api@2.4.0-beta.7
111
+
112
+ ## 0.12.0-beta.8
113
+
114
+ ### Minor Changes
115
+
116
+ - 764e5f1: Add marking constraints
117
+
118
+ ### Patch Changes
119
+
120
+ - @osdk/api@2.4.0-beta.6
121
+
122
+ ## 0.12.0-beta.7
123
+
124
+ ### Minor Changes
125
+
126
+ - 75fbd09: Type classes and list validation for object actions
127
+
128
+ ### Patch Changes
129
+
130
+ - @osdk/api@2.4.0-beta.5
131
+
132
+ ## 0.12.0-beta.6
133
+
134
+ ### Minor Changes
135
+
136
+ - 3dcd9b1: Modify object actions cannot modify pk
137
+
138
+ ## 0.12.0-beta.5
139
+
140
+ ### Minor Changes
141
+
142
+ - a01b8d4: Revert import block data changes
143
+
144
+ ### Patch Changes
145
+
146
+ - @osdk/api@2.4.0-beta.4
147
+
148
+ ## 0.12.0-beta.4
149
+
150
+ ### Minor Changes
151
+
152
+ - e647175: Skip struct props for object create + modify actions
153
+
154
+ ## 0.12.0-beta.3
155
+
156
+ ### Minor Changes
157
+
158
+ - 988bf66: Use block data type for imports
159
+
160
+ ### Patch Changes
161
+
162
+ - @osdk/api@2.4.0-beta.3
163
+
3
164
  ## 0.12.0-beta.2
4
165
 
5
166
  ### Minor Changes
package/README.md CHANGED
@@ -567,72 +567,15 @@ const personToAddressLink = defineInterfaceLinkConstraint({
567
567
 
568
568
  Actions define operations that can be performed on objects and interfaces.
569
569
 
570
- ### Custom Action
571
-
572
- ```typescript
573
- import { defineAction } from "@osdk/maker";
574
-
575
- // Define a custom action
576
- const markAsInactiveAction = defineAction({
577
- apiName: "mark-as-inactive",
578
- displayName: "Mark as Inactive",
579
- parameters: [
580
- {
581
- id: "reason",
582
- displayName: "Reason",
583
- type: "string",
584
- validation: {
585
- required: true,
586
- allowedValues: { type: "text" },
587
- },
588
- },
589
- {
590
- id: "effectiveDate",
591
- displayName: "Effective Date",
592
- type: "date",
593
- validation: {
594
- required: true,
595
- allowedValues: { type: "datetime" },
596
- },
597
- },
598
- ],
599
- status: "active",
600
- rules: [
601
- {
602
- type: "addOrModifyObjectRuleV2",
603
- addOrModifyObjectRuleV2: {
604
- objectToModify: "objectToModifyParameter",
605
- propertyValues: {
606
- "isActive": {
607
- type: "staticValue",
608
- staticValue: {
609
- type: "boolean",
610
- boolean: false,
611
- },
612
- },
613
- "inactiveReason": {
614
- type: "parameterId",
615
- parameterId: "reason",
616
- },
617
- "inactiveDate": {
618
- type: "parameterId",
619
- parameterId: "effectiveDate",
620
- },
621
- },
622
- structFieldValues: {},
623
- },
624
- },
625
- ],
626
- });
627
- ```
628
-
629
570
  ### Create Object Action
630
571
 
631
572
  ```typescript
632
573
  import { defineCreateObjectAction } from "@osdk/maker";
633
574
 
634
575
  // Define an action to create an employee
635
- const createEmployeeAction = defineCreateObjectAction(employeeObject);
576
+ const createEmployeeAction = defineCreateObjectAction({
577
+ objectType: employeeObject,
578
+ });
636
579
  ```
637
580
 
638
581
  ### Modify Object Action
@@ -641,7 +584,9 @@ const createEmployeeAction = defineCreateObjectAction(employeeObject);
641
584
  import { defineModifyObjectAction } from "@osdk/maker";
642
585
 
643
586
  // Define an action to modify an employee
644
- const modifyEmployeeAction = defineModifyObjectAction(employeeObject);
587
+ const modifyEmployeeAction = defineModifyObjectAction({
588
+ objectType: employeeObject,
589
+ });
645
590
  ```
646
591
 
647
592
  ### Delete Object Action
@@ -650,7 +595,9 @@ const modifyEmployeeAction = defineModifyObjectAction(employeeObject);
650
595
  import { defineDeleteObjectAction } from "@osdk/maker";
651
596
 
652
597
  // Define an action to delete an employee
653
- const deleteEmployeeAction = defineDeleteObjectAction(employeeObject);
598
+ const deleteEmployeeAction = defineDeleteObjectAction({
599
+ objectType: employeeObject,
600
+ });
654
601
  ```
655
602
 
656
603
  ### Interface Actions
@@ -673,3 +620,82 @@ const createEmployeePersonAction = defineCreateInterfaceObjectAction(
673
620
  // Define an action to modify objects implementing an interface
674
621
  const modifyPersonAction = defineModifyInterfaceObjectAction(personInterface);
675
622
  ```
623
+
624
+ ### Custom Action
625
+
626
+ More customization such as security/submission criteria, constraints on parameter values, parameter overrides, etc.
627
+ can also be added.
628
+
629
+ ```typescript
630
+ import {
631
+ ActionParameterConditionalOverride,
632
+ ConditionDefinition,
633
+ defineModifyObjectAction,
634
+ defineObject,
635
+ } from "@osdk/maker";
636
+
637
+ const employeeObject = defineObject({
638
+ apiName: "employee",
639
+ displayName: "Employee",
640
+ pluralDisplayName: "Employees",
641
+ titlePropertyApiName: "id",
642
+ primaryKeyPropertyApiName: "id",
643
+ properties: {
644
+ "id": { type: "string", displayName: "ID" },
645
+ "team": { type: "string" },
646
+ "numDeals": { type: "integer" },
647
+ "experience": { type: "integer" },
648
+ },
649
+ });
650
+
651
+ const mustBeManagerCondition: ConditionDefinition = {
652
+ type: "group",
653
+ name: "managerGroup", // Actual group assigned during installation
654
+ };
655
+
656
+ const mustBeInTeamCondition: ConditionDefinition = {
657
+ type: "group",
658
+ name: "teamGroup",
659
+ };
660
+
661
+ const teamEqualsSalesParameterCondition: ConditionDefinition = {
662
+ type: "parameter",
663
+ parameterId: "team",
664
+ matches: {
665
+ type: "staticValue",
666
+ staticValue: {
667
+ type: "string",
668
+ string: "sales",
669
+ },
670
+ },
671
+ };
672
+
673
+ const makeDealsVisible: ActionParameterConditionalOverride = {
674
+ type: "visibility",
675
+ condition: {
676
+ type: "and",
677
+ conditions: [
678
+ mustBeInTeamCondition,
679
+ teamEqualsSalesParameterCondition,
680
+ ],
681
+ },
682
+ };
683
+
684
+ const modifyObjectActionType = defineModifyObjectAction(
685
+ {
686
+ objectType: employeeObject,
687
+ actionLevelValidation: {
688
+ condition: mustBeManagerCondition,
689
+ },
690
+ parameterConfiguration: {
691
+ "numDeals": {
692
+ defaultVisibility: "hidden",
693
+ conditionalOverrides: [
694
+ makeDealsVisible,
695
+ ],
696
+ },
697
+ },
698
+ excludedProperties: ["experience"],
699
+ },
700
+ );
701
+ ```