@fluid-experimental/property-common 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (127) hide show
  1. package/.eslintrc.js +9 -11
  2. package/.mocharc.json +6 -6
  3. package/README.md +1 -0
  4. package/api-extractor.json +2 -2
  5. package/dist/chronometer.d.ts.map +1 -1
  6. package/dist/chronometer.js.map +1 -1
  7. package/dist/consoleUtils.d.ts.map +1 -1
  8. package/dist/consoleUtils.js +4 -1
  9. package/dist/consoleUtils.js.map +1 -1
  10. package/dist/constants.d.ts +6 -6
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +16 -26
  13. package/dist/constants.js.map +1 -1
  14. package/dist/datastructures/collection.d.ts.map +1 -1
  15. package/dist/datastructures/collection.js +5 -4
  16. package/dist/datastructures/collection.js.map +1 -1
  17. package/dist/datastructures/dataArray.d.ts.map +1 -1
  18. package/dist/datastructures/dataArray.js +18 -9
  19. package/dist/datastructures/dataArray.js.map +1 -1
  20. package/dist/datastructures/integer64.d.ts.map +1 -1
  21. package/dist/datastructures/integer64.js +1 -1
  22. package/dist/datastructures/integer64.js.map +1 -1
  23. package/dist/datastructures/sortedCollection.d.ts.map +1 -1
  24. package/dist/datastructures/sortedCollection.js +3 -1
  25. package/dist/datastructures/sortedCollection.js.map +1 -1
  26. package/dist/deferredPromise.d.ts +1 -1
  27. package/dist/deferredPromise.d.ts.map +1 -1
  28. package/dist/deferredPromise.js +9 -3
  29. package/dist/deferredPromise.js.map +1 -1
  30. package/dist/deterministicRandomGenerator.d.ts.map +1 -1
  31. package/dist/deterministicRandomGenerator.js +6 -6
  32. package/dist/deterministicRandomGenerator.js.map +1 -1
  33. package/dist/error_objects/flaggedError.d.ts.map +1 -1
  34. package/dist/error_objects/flaggedError.js.map +1 -1
  35. package/dist/error_objects/httpError.d.ts.map +1 -1
  36. package/dist/error_objects/httpError.js +9 -9
  37. package/dist/error_objects/httpError.js.map +1 -1
  38. package/dist/error_objects/httpErrorNoStack.d.ts.map +1 -1
  39. package/dist/error_objects/httpErrorNoStack.js.map +1 -1
  40. package/dist/error_objects/operationError.d.ts +7 -7
  41. package/dist/error_objects/operationError.d.ts.map +1 -1
  42. package/dist/error_objects/operationError.js +7 -7
  43. package/dist/error_objects/operationError.js.map +1 -1
  44. package/dist/guidUtils.d.ts.map +1 -1
  45. package/dist/guidUtils.js +10 -9
  46. package/dist/guidUtils.js.map +1 -1
  47. package/dist/hashCalculator.d.ts.map +1 -1
  48. package/dist/hashCalculator.js.map +1 -1
  49. package/dist/joinPaths.d.ts.map +1 -1
  50. package/dist/joinPaths.js.map +1 -1
  51. package/dist/packageVersion.d.ts +1 -1
  52. package/dist/packageVersion.js +1 -1
  53. package/dist/packageVersion.js.map +1 -1
  54. package/lib/chronometer.d.ts.map +1 -1
  55. package/lib/chronometer.js.map +1 -1
  56. package/lib/consoleUtils.d.ts.map +1 -1
  57. package/lib/consoleUtils.js +4 -1
  58. package/lib/consoleUtils.js.map +1 -1
  59. package/lib/constants.d.ts +6 -6
  60. package/lib/constants.d.ts.map +1 -1
  61. package/lib/constants.js +16 -26
  62. package/lib/constants.js.map +1 -1
  63. package/lib/datastructures/collection.d.ts.map +1 -1
  64. package/lib/datastructures/collection.js +5 -4
  65. package/lib/datastructures/collection.js.map +1 -1
  66. package/lib/datastructures/dataArray.d.ts.map +1 -1
  67. package/lib/datastructures/dataArray.js +18 -9
  68. package/lib/datastructures/dataArray.js.map +1 -1
  69. package/lib/datastructures/integer64.d.ts.map +1 -1
  70. package/lib/datastructures/integer64.js +1 -1
  71. package/lib/datastructures/integer64.js.map +1 -1
  72. package/lib/datastructures/sortedCollection.d.ts.map +1 -1
  73. package/lib/datastructures/sortedCollection.js +3 -1
  74. package/lib/datastructures/sortedCollection.js.map +1 -1
  75. package/lib/deferredPromise.d.ts +1 -1
  76. package/lib/deferredPromise.d.ts.map +1 -1
  77. package/lib/deferredPromise.js +9 -3
  78. package/lib/deferredPromise.js.map +1 -1
  79. package/lib/deterministicRandomGenerator.d.ts.map +1 -1
  80. package/lib/deterministicRandomGenerator.js +6 -6
  81. package/lib/deterministicRandomGenerator.js.map +1 -1
  82. package/lib/error_objects/flaggedError.d.ts.map +1 -1
  83. package/lib/error_objects/flaggedError.js.map +1 -1
  84. package/lib/error_objects/httpError.d.ts.map +1 -1
  85. package/lib/error_objects/httpError.js +9 -9
  86. package/lib/error_objects/httpError.js.map +1 -1
  87. package/lib/error_objects/httpErrorNoStack.d.ts.map +1 -1
  88. package/lib/error_objects/httpErrorNoStack.js.map +1 -1
  89. package/lib/error_objects/operationError.d.ts +7 -7
  90. package/lib/error_objects/operationError.d.ts.map +1 -1
  91. package/lib/error_objects/operationError.js +7 -7
  92. package/lib/error_objects/operationError.js.map +1 -1
  93. package/lib/guidUtils.d.ts.map +1 -1
  94. package/lib/guidUtils.js +10 -9
  95. package/lib/guidUtils.js.map +1 -1
  96. package/lib/hashCalculator.d.ts.map +1 -1
  97. package/lib/hashCalculator.js.map +1 -1
  98. package/lib/joinPaths.d.ts.map +1 -1
  99. package/lib/joinPaths.js.map +1 -1
  100. package/lib/packageVersion.d.ts +1 -1
  101. package/lib/packageVersion.js +1 -1
  102. package/lib/packageVersion.js.map +1 -1
  103. package/package.json +42 -40
  104. package/platform-dependent/README.md +1 -0
  105. package/platform-dependent/browser.js +5 -5
  106. package/platform-dependent/package.json +14 -14
  107. package/platform-dependent/server.js +5 -5
  108. package/prettier.config.cjs +1 -1
  109. package/src/chronometer.ts +174 -169
  110. package/src/consoleUtils.ts +16 -11
  111. package/src/constants.ts +1683 -1640
  112. package/src/datastructures/collection.ts +417 -416
  113. package/src/datastructures/dataArray.ts +516 -492
  114. package/src/datastructures/integer64.ts +102 -99
  115. package/src/datastructures/sortedCollection.ts +155 -145
  116. package/src/deferredPromise.ts +43 -42
  117. package/src/deterministicRandomGenerator.ts +59 -59
  118. package/src/error_objects/flaggedError.ts +29 -29
  119. package/src/error_objects/httpError.ts +45 -42
  120. package/src/error_objects/httpErrorNoStack.ts +17 -17
  121. package/src/error_objects/operationError.ts +62 -62
  122. package/src/guidUtils.ts +182 -171
  123. package/src/hashCalculator.ts +5 -2
  124. package/src/joinPaths.ts +15 -9
  125. package/src/packageVersion.ts +1 -1
  126. package/tsconfig.esnext.json +6 -6
  127. package/tsconfig.json +9 -13
package/src/constants.ts CHANGED
@@ -3,1684 +3,1727 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- /* eslint-disable max-len */
7
-
8
6
  /**
9
7
  * Error messages for the Schema Validator
10
8
  */
11
9
  const SchemaValidatorError = {
12
- /**
13
- * methods: PropertyFactory.register
14
- *
15
- * The context ‘set’ is only valid for properties that are instances of NamedProperties. If you want to
16
- * use a context of ‘set’, make sure your template includes:
17
- * Inherits: ‘NamedProperty’
18
- * Or
19
- * Inherits: [‘NamedProperty’, …]
20
- */
21
- SET_ONLY_NAMED_PROPS:
22
- 'SV-001: Only properties that inherit from NamedProperty can have a context of "set". typeid: ',
23
-
24
- /**
25
- * You updated an existing template but the change to the version number was not as expected.
26
- * Make sure you updated your version number correctly. You may have violated one of the following rules:
27
- * - Adding one or more template attributes is a MINOR change.
28
- * - Removing one or more template attributes is a MAJOR change.
29
- */
30
- CHANGE_LEVEL_TOO_LOW_1:
31
- "SV-002: Template mutation requires a higher version change level: ",
32
-
33
- /**
34
- * methods: PropertyFactory.register
35
- *
36
- * The template version number is not valid. A valid version number should look like: ‘1.0.0’
37
- */
38
- INVALID_VERSION_1:
39
- "SV-003: Invalid template version in 'typeid' attribute: ",
40
-
41
- /**
42
- * methods: PropertyFactory.register
43
- *
44
- * Your property template should include a typeid attribute.
45
- *
46
- * @example
47
- *```json
48
- * {
49
- * "typeid": "my.example:point2d-1.0.0",
50
- * "properties": [
51
- * {"id": "x", "typeid": "Float64"},
52
- * {"id": "y", "typeid": "Float64"}
53
- * ]
54
- *}
55
- *```
56
- */
57
- MISSING_TYPE_ID:
58
- "SV-004: Template is missing the mandatory 'typeid' attribute. This is not a valid template: ",
59
-
60
- /**
61
- * methods: PropertyFactory.register
62
- *
63
- * Typeid should contain a template version number.
64
- *
65
- * @example typeid: my.example:point2d-1.0.0”
66
- */
67
- MISSING_VERSION:
68
- "SV-005: Missing template version in 'typeid' attribute: ",
69
-
70
- /**
71
- * methods: PropertyFactory.register
72
- *
73
- * The template you are using is different from the previous version and you did not update the version number.
74
- * If any changes were made to the template, you should update the version number to a higher number.
75
- *
76
- * - Major change: removing one or more attribute (e.g. 1.0.0 -\> 2.0.0)
77
- *
78
- * - Minor change: adding one or more attribute (e.g. 1.0.0 -\> 1.1.0)
79
- *
80
- * - Patch: template description changes (e.g. 1.0.0 -\> 1.0.1)
81
- */
82
- MODIFIED_TEMPLATE_1:
83
- "SV-006: Template has changed at path: ",
84
-
85
- /**
86
- * methods: PropertyFactory.register
87
- *
88
- * When changing your template, you need to increase its version number. For example, if the previous version
89
- * number was 1.0.0, it should increase to 1.0.1 for a patch (if the template description has changed),
90
- * to 1.1.0 for a minor change (if you added one or more attributes) or to 2.0.0 for a major change (if you
91
- * removed one or more attributes).
92
- */
93
- MODIFIED_TEMPLATE_SAME_VERSION_1:
94
- "SV-007: Template has changed but its version was not increased. Path: ",
95
-
96
- /**
97
- * methods: PropertyFactory.register
98
- *
99
- * PropertyFactory.register requires a template as a parameter.
100
- */
101
- NO_TEMPLATE:
102
- "SV-008: Template cannot be null or undefined.",
103
-
104
- /**
105
- * methods: PropertyFactory.register
106
- *
107
- * When updating a template’s version number, the version number can only increase, never decrease.
108
- */
109
- VERSION_REGRESSION_1:
110
- "SV-009: New template version is older than the previously registered version: ",
111
-
112
- /**
113
- * Your template contains a typeid that is not a string.
114
- */
115
- TYPEID_MUST_BE_STRING:
116
- "SV-010: typeid must be a string. This is not valid: ",
117
-
118
- /**
119
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
120
- * The TemplateValidator constructor should have in its parameters param.inheritsFrom and params.hasSchema.
121
- * Neither of them can be undefined.
122
- */
123
- MISSING_INHERITSFROM_OR_HASSCHEMA:
124
- "SV-011: Internal error: TemplateValidator constructor missing one of inheritsFrom or hasSchema function",
125
-
126
- /**
127
- * Your template has an invalid key for the kind of map it is.
128
- */
129
- KEY_MUST_BE_TYPEID:
130
- "SV-012: A key of a typeid key map must be a valid typeids. Key: ",
131
-
132
- /**
133
- * Your template has an invalid contextKeyType parameter.
134
- */
135
- INVALID_OPTION_NONE_CONSTANTS:
136
- "SV-013: A map with typeids as keys must be constant",
137
-
138
- /**
139
- * You tried to use draft as a versoin when it is not enabled.
140
- */
141
- DRAFT_AS_VERSION_TYPEID:
142
- "SV-014: By default, draft is not a valid version for a typeId. Set allowDraft to true to support this.",
10
+ /**
11
+ * methods: PropertyFactory.register
12
+ *
13
+ * The context ‘set’ is only valid for properties that are instances of NamedProperties. If you want to
14
+ * use a context of ‘set’, make sure your template includes:
15
+ * Inherits: ‘NamedProperty’
16
+ * Or
17
+ * Inherits: [‘NamedProperty’, …]
18
+ */
19
+ SET_ONLY_NAMED_PROPS:
20
+ 'SV-001: Only properties that inherit from NamedProperty can have a context of "set". typeid: ',
21
+
22
+ /**
23
+ * You updated an existing template but the change to the version number was not as expected.
24
+ * Make sure you updated your version number correctly. You may have violated one of the following rules:
25
+ * - Adding one or more template attributes is a MINOR change.
26
+ * - Removing one or more template attributes is a MAJOR change.
27
+ */
28
+ CHANGE_LEVEL_TOO_LOW_1: "SV-002: Template mutation requires a higher version change level: ",
29
+
30
+ /**
31
+ * methods: PropertyFactory.register
32
+ *
33
+ * The template version number is not valid. A valid version number should look like: ‘1.0.0’
34
+ */
35
+ INVALID_VERSION_1: "SV-003: Invalid template version in 'typeid' attribute: ",
36
+
37
+ /**
38
+ * methods: PropertyFactory.register
39
+ *
40
+ * Your property template should include a typeid attribute.
41
+ *
42
+ * @example
43
+ *```json
44
+ * {
45
+ * "typeid": "my.example:point2d-1.0.0",
46
+ * "properties": [
47
+ * {"id": "x", "typeid": "Float64"},
48
+ * {"id": "y", "typeid": "Float64"}
49
+ * ]
50
+ *}
51
+ *```
52
+ */
53
+ MISSING_TYPE_ID:
54
+ "SV-004: Template is missing the mandatory 'typeid' attribute. This is not a valid template: ",
55
+
56
+ /**
57
+ * methods: PropertyFactory.register
58
+ *
59
+ * Typeid should contain a template version number.
60
+ *
61
+ * @example “typeid: my.example:point2d-1.0.0”
62
+ */
63
+ MISSING_VERSION: "SV-005: Missing template version in 'typeid' attribute: ",
64
+
65
+ /**
66
+ * methods: PropertyFactory.register
67
+ *
68
+ * The template you are using is different from the previous version and you did not update the version number.
69
+ * If any changes were made to the template, you should update the version number to a higher number.
70
+ *
71
+ * - Major change: removing one or more attribute (e.g. 1.0.0 -\> 2.0.0)
72
+ *
73
+ * - Minor change: adding one or more attribute (e.g. 1.0.0 -\> 1.1.0)
74
+ *
75
+ * - Patch: template description changes (e.g. 1.0.0 -\> 1.0.1)
76
+ */
77
+ MODIFIED_TEMPLATE_1: "SV-006: Template has changed at path: ",
78
+
79
+ /**
80
+ * methods: PropertyFactory.register
81
+ *
82
+ * When changing your template, you need to increase its version number. For example, if the previous version
83
+ * number was 1.0.0, it should increase to 1.0.1 for a patch (if the template description has changed),
84
+ * to 1.1.0 for a minor change (if you added one or more attributes) or to 2.0.0 for a major change (if you
85
+ * removed one or more attributes).
86
+ */
87
+ MODIFIED_TEMPLATE_SAME_VERSION_1:
88
+ "SV-007: Template has changed but its version was not increased. Path: ",
89
+
90
+ /**
91
+ * methods: PropertyFactory.register
92
+ *
93
+ * PropertyFactory.register requires a template as a parameter.
94
+ */
95
+ NO_TEMPLATE: "SV-008: Template cannot be null or undefined.",
96
+
97
+ /**
98
+ * methods: PropertyFactory.register
99
+ *
100
+ * When updating a template’s version number, the version number can only increase, never decrease.
101
+ */
102
+ VERSION_REGRESSION_1:
103
+ "SV-009: New template version is older than the previously registered version: ",
104
+
105
+ /**
106
+ * Your template contains a typeid that is not a string.
107
+ */
108
+ TYPEID_MUST_BE_STRING: "SV-010: typeid must be a string. This is not valid: ",
109
+
110
+ /**
111
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
112
+ * The TemplateValidator constructor should have in its parameters param.inheritsFrom and params.hasSchema.
113
+ * Neither of them can be undefined.
114
+ */
115
+ MISSING_INHERITSFROM_OR_HASSCHEMA:
116
+ "SV-011: Internal error: TemplateValidator constructor missing one of inheritsFrom or hasSchema function",
117
+
118
+ /**
119
+ * Your template has an invalid key for the kind of map it is.
120
+ */
121
+ KEY_MUST_BE_TYPEID: "SV-012: A key of a typeid key map must be a valid typeids. Key: ",
122
+
123
+ /**
124
+ * Your template has an invalid contextKeyType parameter.
125
+ */
126
+ INVALID_OPTION_NONE_CONSTANTS: "SV-013: A map with typeids as keys must be constant",
127
+
128
+ /**
129
+ * You tried to use draft as a versoin when it is not enabled.
130
+ */
131
+ DRAFT_AS_VERSION_TYPEID:
132
+ "SV-014: By default, draft is not a valid version for a typeId. Set allowDraft to true to support this.",
143
133
  };
144
134
 
145
135
  const TypeidHelperError = {
146
- /**
147
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
148
- */
149
- TYPEID_NOT_DEFINED: "TH-001: extractVersion requires a typeid parameter",
136
+ /**
137
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
138
+ */
139
+ TYPEID_NOT_DEFINED: "TH-001: extractVersion requires a typeid parameter",
150
140
  };
151
141
 
152
142
  const PropertyError = {
153
- TYPEID_NOT_NATIVE: "TYPEID_NOT_NATIVE",
154
- /**
155
- * methods: ArrayProperty.length.set, StringProperty.length.set
156
- *
157
- * Cannot directly set the array.length or string.length. This is a read-only property.
158
- */
159
- MODIFY_READ_ONLY: "PR-001: Trying to modify read only property value (array.length).",
160
-
161
- /**
162
- * methods: Property.getRelativePath
163
- *
164
- * There is no path between the property and the ancestor you passed in to .getRelativePath.
165
- */
166
- NO_PATH_BETWEEN: "PR-002: No path between ",
167
-
168
- /**
169
- * methods: Property.applyChangeSet
170
- *
171
- * One of the paths included in your changeSet is not valid for this property.
172
- * Check that the modifications in the changeSet match the structure of the template.
173
- */
174
- INVALID_PATH: "PR-003: Invalid path in ChangeSet: ",
175
-
176
- /**
177
- * methods: NodeProperty.insert
178
- *
179
- * The property you inserted into a NodeProperty has a parent.
180
- * If your property has a parent, changing the property’s id will break the parent.
181
- * Make the change to the parent first.
182
- */
183
- ID_CHANGE_FOR_PROPERTY_WITH_PARENT: "PR-004: Cannot change the ID of a property that has a parent. Could not change id: ",
184
-
185
- /**
186
- * methods: Property.resolvePath
187
- *
188
- * Part of the path entered to Property.resolvePath was not valid.
189
- */
190
- INVALID_PATH_TOKEN: "PR-005: ResolvePath error: accessed a child via an invalid path syntax: ",
191
-
192
- /**
193
- * methods: MapProperty.insert, NodeProperty.insert, ReferenceMapProperty.insert, Workspace.insert,
194
- * SetProperty.insert
195
- *
196
- * Your map, set or nodeproperty already contains an entry under in_key.
197
- */
198
- PROPERTY_ALREADY_EXISTS: "PR-006: The property already exists in this collection: ",
199
-
200
- /**
201
- * methods: MapProperty.applyChangeset, NodeProperty.applyChangeset, SetProperty.applyChangeset
202
- *
203
- * The changeset you applied contains properties that have already been inserted.
204
- * Check the ‘insert’ fields in your changeSet for properties that might already exist.
205
- */
206
- INSERTED_EXISTING_ENTRY: "PR-007: Inserted an already existing entry: ",
207
-
208
- /**
209
- * methods: MapProperty.remove, SetProperty.remove
210
- *
211
- * Tried to remove an entry that does not exist.
212
- * This can be caused indirectly by deserialize / applyChangeset methods.
213
- * One of the ‘remove’ fields in your changeSet must contain a property that does not exist.
214
- */
215
- REMOVED_NON_EXISTING_ENTRY: "PR-008: Trying to remove a non-existing entry: ",
216
-
217
- /**
218
- * methods: MapProperty.applyChangeset, NodeProperty.applyChangeset, SetProperty.applyChangeset
219
- *
220
- * One of the key you are trying to modify in your changeSet does not exist.
221
- * One of the ‘modify’ fields in your changeSet refers to a property that does not exist.
222
- */
223
- MODIFY_NON_EXISTING_ENTRY: "PR-009: Trying to modify a not existing entry: ",
224
-
225
- /**
226
- * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
227
- *
228
- * The value you are trying to insert in your map property, set property or node property has a parent.
229
- * You cannot insert a property that has a parent.
230
- */
231
- INSERTED_ENTRY_WITH_PARENT: "PR-010: Trying to insert into a collection a property that already has " +
232
- "a parent.",
233
-
234
- /**
235
- * methods: Property.resolvePath, Workspace.resolvePath
236
- *
237
- * Paths should not contain empty sections such as ‘..’, ‘//’ or ‘[], etc.
238
- * Sections in the path are delimited by ‘.’ ‘[ ]’, ‘/’ .
239
- * There should always be a path between any two delimiters.
240
- */
241
- EMPTY_TOKEN: "PR-011: ResolvePath error: Encountered empty token in path: ",
242
-
243
- /**
244
- * methods: Property.resolvePath, Workspace.resolvePath
245
- *
246
- * Paths should not contain quotes except at the beginning and end of the path.
247
- * For example: resolvePath('my"path.nested".other') is not valid because the first quote is in front of ‘path
248
- * but after the ‘.nested’ which is part of the subsequent path.
249
- */
250
- QUOTES_WITHIN_TOKEN: "PR-012: ResolvePath error: Quotes must only be at the start and the " +
251
- "end of a path. Error in path: ",
252
-
253
- /**
254
- * methods: Property.resolvePath, Workspace.resolvePath
255
- *
256
- * Paths should not end with a ‘.’
257
- */
258
- DOT_AT_END: "PR-013: ResolvePath error: Encountered a dot at the end of path: ",
259
-
260
- /**
261
- * methods: Property.resolvePath, Workspace.resolvePath
262
- * Paths using square brackets should not contain ‘.’ within those square brackets.
263
- * If your path contains any dots, these should be escaped e.g. [my\.path] instead of [my.path].
264
- */
265
- DOTS_IN_SQUARE_BRACKETS: "PR-014: ResolvePath error: Encountered a dot within a square bracket. " +
266
- "These have to be escaped. Error in path: ",
267
-
268
- /**
269
- * methods: Property.resolvePath, Workspace.resolvePath
270
- *
271
- * resolvePath error while parsing your string.
272
- * It encountered an end to a path segment that was not
273
- * followed by a “.” or a “[“ indicating the beginning of a new segment.
274
- */
275
- MISSING_DOT_AT_SEGMENT_START: "PR-015: Missing . or [ at segment start in path: ",
276
-
277
- /**
278
- * methods: Property.resolvePath, Workspace.resolvePath
279
- *
280
- * Closing square bracket not followed by the correct character (., [ or *).
281
- * For example, this is not valid: resolvePath(myArray[2]nested).
282
- * This is valid: resolvePath(myArray[2].nested).
283
- */
284
- INVALID_END_OF_SQUARE_BRACKETS: "PR-016: ResolvePath error: Square brackets have to be followed either " +
285
- 'by "." or by "[" or by "*". Error in path: ',
286
-
287
- /**
288
- * methods: Property.resolvePath, Workspace.resolvePath
289
- *
290
- * Every opening bracket ([) needs a matching closing bracket (])
291
- */
292
- UNCLOSED_BRACKETS: "PR-017: ResolvePath error: Unclosed brackets at the end of path: ",
293
-
294
- /**
295
- * methods: Property.resolvePath, Workspace.resolvePath
296
- *
297
- * Any closing bracket (]) must be preceded by a matching opening bracket ([).
298
- */
299
- CLOSING_BRACKET_WITHOUT_OPENING: "PR-018: ResolvePath error: Encountered closing bracket without " +
300
- "corresponding opening one in path: ",
301
-
302
- /**
303
- * methods: Property.resolvePath, Workspace.resolvePath
304
- */
305
- INVALID_ESCAPE_SEQUENCE: "PR-019: Encountered an invalid escape sequence in path: ",
306
-
307
- /**
308
- * methods: Property.resolvePath, Workspace.resolvePath
309
- *
310
- * A quotation mark at the beginning of a path must have a matching closing quotation mark
311
- * at the end of the same path.
312
- */
313
- UNCLOSED_QUOTATION_MARKS: "PR-020: ResolvePath error: Encountered unclosed quotation marks in path: ",
314
-
315
- /**
316
- * methods: SetProperty.insert, SetProperty.set, SetProperty.setValues
317
- *
318
- * The property you insert in a setProperty must be an instance of NamedProperty.
319
- * When creating the property to be inserted, make sure it inherits from NamedProperty.
320
- *
321
- * @example Creating a property that inherits from NamedProperty
322
- *
323
- * ```json
324
- * {
325
- * typeid:”my.example:myprop-1.0.0”,
326
- * inherits:’NamedProperty’ (or [‘NamedProperty’, …]
327
- * ...
328
- * }
329
- *```
330
- */
331
- CANT_INSERT_NON_NAMED_PROPERTIES: "PR-021: Set can only contain named properties",
332
-
333
- /**
334
- * methods: NodeProperty.insert, Workspace.insert
335
- *
336
- * The property you inserted does not have an id.
337
- * Unless the property is an instance of NamedProperty, you must pass in an id as the first parameter
338
- * (and the property second)
339
- */
340
- ADDED_CHILD_WITHOUT_ID: "PR-022: Added child without id.",
341
-
342
- /**
343
- * methods: ArrayProperty.resolvePath
344
- *
345
- * Cannot use .resolvePath on a primitive array, only on a Custom type array.
346
- * For a primitive array, use .getValue instead.
347
- * For example, instead of MyValueArray.resolvePath(1), use MyValueArray.getValue(1)
348
- */
349
- NO_PATHS_FOR_NON_PRIMITIVE_ARRAYS: "PR-023: Path resolution is not supported for primitive type arrays.",
350
-
351
- /**
352
- * methods: ArrayProperty.resolvePath
353
- *
354
- * When using an array index as part of your path, it needs to have a numeric value.
355
- */
356
- INVALID_NON_NUMERIC_SEGMENT_IN_PATH: "PR-024: ResolvePath error: Accessed an array via an non numeric index: ",
357
-
358
- /**
359
- * methods: ArrayProperty.getRelativePath, ArrayProperty.getAbsolutePath
360
- *
361
- * INTERNAL ERROR
362
- * If you encounter this error, please contact the development team.
363
- * Part of the path you are trying to find points to a non-existing array item.
364
- */
365
- GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY: "PR-025: Internal error: _getPathSegmentForChildNode has been called " +
366
- "for an entry that is not an entry of the collection. ",
367
-
368
- /**
369
- * The changeSet passed to .deserialize was not a valid non-normalized changeset.
370
- */
371
- NO_NORMALIZED_CHANGESET: "PR-026: deserialize was called with a non-normalized ChangeSet.",
372
-
373
- /**
374
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
375
- * One of your changesets contained a NamedProperty without a GUID.
376
- * This should not happen and should have been validated already.
377
- */
378
- MISSING_GUID_IN_NORMALIZED_CHANGESET: "PR-027: Missing GUID in a normalized ChangeSet with named properties",
379
-
380
- /**
381
- * methods: EnumProperty.getEnumString, EnumProperty.setValue, EnumProperty.setEnumByString,
382
- * EnumProperty.getEnumString, EnumArrayProperty.getEnumStrings
383
- *
384
- * This Enum Property does not have any entry with that value.
385
- * EnumProperty.getEnumByString -\> the EnumProperty you used to pass this function does not have an entry.
386
- * EnumProperty.setValue -\> no entry exists for in_value
387
- * EnumProperty.setEnumByString -\> no entry exists for in_stringId
388
- * EnumArrayProperty.getEnumString -\> the value found at in_position does not correspond to an entry.
389
- * EnumArrayProperty.getEnumStrings -\> one of the values found at one of the positions sought does
390
- * not correspond to an entry.
391
- */
392
- UNKNOWN_ENUM: "PR-028: enum value unknown: ",
393
-
394
- /**
395
- * methods: Property.applyChangeSet
396
- *
397
- * Changeset contains an operation that is unknown.
398
- * Valid operations are insert, modify and remove.
399
- */
400
- UNKNOWN_OPERATION: "PR-029: Unknown ChangeSet operation: ",
401
-
402
- /**
403
- * methods: Workspace.remove, NodeProperty.remove
404
- *
405
- * The property you passed to workspace.remove or nodeProperty.remove does not exist.
406
- * Check that you passed the correct property, and that it has not yet been removed.
407
- */
408
- REMOVING_NON_EXISTING_KEY: "PR-033: Trying to remove something that does not exist: ",
409
-
410
- /**
411
- * methods: Workspace.get, Property.get
412
- *
413
- * Workspace.get and Property.get take in an id (string or number) or an array of ids.
414
- *
415
- * @example
416
- * ```typescript
417
- *.get(‘position’).get(‘x’) or .get([‘property’, ‘x’])
418
- * ```
419
- */
420
- STRING_OR_ARRAY_STRINGS: "PR-034: in_id must be a string, a number or an array of these. This is not valid: ",
421
-
422
- /**
423
- * methods: Property.serialize
424
- *
425
- * Property.serialize only takes in one parameter: an options object. That parameter is optional.
426
- */
427
- SERIALIZE_TAKES_OBJECT: "PR-035: Argument of serialize() should be an object.",
428
-
429
- /**
430
- * methods: ArrayProperty.insert, ArrayProperty.insertRange
431
- *
432
- * The in_position (for .insert) or in_offset (for .insertRange) should not be smaller than 0
433
- * or larger than the length of the array.
434
- */
435
- START_OFFSET_INVALID: "PR-036: ArrayProperty: insert range - Start offset is invalid: ",
436
-
437
- // PR-037 removed
438
-
439
- /**
440
- * ArrayProperty.remove, ArrayProperty.removeRange, ArrayProperty.pop
441
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
442
- * The item (or one of the items) you are trying to remove from the array has a parent that is not the array.
443
- * This should not happen because you should not have been able to insert the item in the array in the first place.
444
- */
445
- CANNOT_REMOVE_WITH_DIFFERENT_PARENT: "PR-038: Internal error: Trying to remove from an array a property that " +
446
- "has not the array as parent.",
447
-
448
- /**
449
- * methods ArrayProperty.set, ArrayProperty.setRange
450
- *
451
- * Your first parameter: in_position (for .set) and in_offset (for .setRange) cannot have a negative value.
452
- */
453
- START_OFFSET_NEGATIVE: "PR-039: ArrayProperty: Modify range - Start offset cannot be negative: ",
454
-
455
- /**
456
- * methods: ArrayProperty.removeRange, ArrayProperty.setRange, ArrayProperty.insertRange,
457
- * ArrayProperty.insert, EnumArrayProperty.getEnumStrings
458
- *
459
- * The parameter needs to be a number.
460
- * For .removeRange: in_offset and in_deleteCount
461
- * For .setRange: in_offset
462
- * For .insertRange: in_offset
463
- * For .getEnumStrings: in_offset, in_length
464
- * For StringProperty.insert: in_position
465
- */
466
- NOT_NUMBER: "PR-049: This parameter must be a number: parameter: ",
467
-
468
- /**
469
- * methods: Property.traverseUp, Property.traverseDown
470
- *
471
- * Property.traverseUp and Property.traverseDown take one parameter: a callback function
472
- */
473
- CALLBACK_NOT_FCT: "PR-050: traverseUp / traverseDown parameter: in_callback must " +
474
- "be a function.",
475
-
476
- /**
477
- * methods: ArrayProperty.insertRange
478
- *
479
- * Array.insertRange takes two parameters. The second one (in_array) must be an array.
480
- * To pass in only one item, either use .insert(index, item)
481
- * or put that item into an array: .insertRange(index, [item])
482
- */
483
- IN_ARRAY_NOT_ARRAY: "PR-051: Parameter error: in_array must be an array for method: ",
484
-
485
- /**
486
- * methods: EnumProperty.setEnumByString
487
- *
488
- * EnumProperty.setEnumByString takes one parameter: a string id. It must be a string.
489
- */
490
- STRING_ID_MUST_BE_STRING: "PR-052: EnumProperty.setEnumByString parameter: in_stringId must " +
491
- "be a string. This is not valid: ",
492
-
493
- /**
494
- * methods: Integer64Property.setValueHigh
495
- *
496
- * Integer64Property.setValueHigh takes one parameter: a number.
497
- */
498
- IN_HIGH_MUST_BE_NUMBER: "PR-053: Integer64Property.setValueHigh parameter: in_high must " +
499
- "be a number. This is not valid: ",
500
-
501
- /**
502
- * methods: Integer64Property.setValueLow
503
- *
504
- * Integer64Property.setValueLow takes one parameter: a number.
505
- */
506
- IN_LOW_MUST_BE_NUMBER: "PR-054: Integer64Property.setValueLow parameter: in_low must " +
507
- "be a number. This is not valid: ",
508
-
509
- /**
510
- * methods: IntegerProperty.toString
511
- *
512
- * Integer64Property.toString takes one optional parameter: a number (in_radix).
513
- * If no value is passed, will default to 10.
514
- */
515
- IN_RADIX_MUST_BE_NUMBER: "PR-055: Integer64Property.toString parameter: in_radix must be a number. This is not valid: ",
516
-
517
- /**
518
- * methods: IntegerProperty.fromString
519
- *
520
- * Integer64Property.fromString takes two parameters. The first parameter (in_string) must be a string.
521
- * (the second parameter is in_radix, a number. It is optional: defaults to 10).
522
- */
523
- IN_STRING_MUST_BE_STRING: "PR-056: Integer64Property.fromString parameter: in_string must " +
524
- "be a string. This is not valid: ",
525
-
526
- /**
527
- * methods: Integer64Property.fromString
528
- *
529
- * Integer64Property.fromString takes two parameters. The second parameter is optional but if passed,
530
- * it must be a number between 2 and 36. If not passed, it defaults to 10. (the first parameter is
531
- * in_string and must be a string).
532
- */
533
- IN_RADIX_BETWEEN_2_36: "PR-057: Integer64Property.fromString parameter: in_radix must be a " +
534
- "number between 2 and 36. This is not valid: ",
535
-
536
- /**
537
- * methods MapProperty.insert, ReferenceMapProperty.set
538
- *
539
- * MapProperty.insert and ReferenceMapProperty.set both take two parameters.
540
- * The first parameter (in_key) must be a string.
541
- */
542
- KEY_NOT_STRING: "PR-058: MapProperty.insert / ReferenceMapProperty.set parameter: " +
543
- "in_key must be a string. This is not valid: ",
544
-
545
- /**
546
- * methods: NodeProperty.insert, Workspace.insert
547
- *
548
- * The second parameter (in_property) must be a valid property (it must be an instance of BaseProperty).
549
- */
550
- NOT_A_PROPERTY: "PR-059: NodeProperty.insert parameter in_property is not a property. " +
551
- "The property you passed is not a valid property.",
552
-
553
- /**
554
- * methods: ReferenceProperty.set / setValue, ReferenceMapProperty.insert / set / setValue / setValues,
555
- * ReferenceArrayProperty.enqueue / push / unshift / insert / insertRange / set / setRange / setValue / setValues
556
- *
557
- * The provided value (or values) must be a valid property (an instance of BaseProperty), be undefined or a string (a path).
558
- */
559
- PROPERTY_OR_UNDEFINED:
560
- "PR-060: Parameter for setting a Reference should be a path to a property, a property or undefined. This is not valid: ",
561
-
562
- /**
563
- * ArrayProperty.insertRange, ArrayProperty.insert, ArrayProperty.push
564
- *
565
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
566
- * The item (or one of the items) you are trying to insert in this array has a parent that is not the array.
567
- */
568
- NO_INSERT_WITH_PARENT: "PR-088: Internal error: Trying to insert a property into an array or " +
569
- "string that already has a parent.",
570
-
571
- /**
572
- * methods: ArrayProperty.get
573
- *
574
- * ArrayProperty.get takes in one parameter: in_position, which can a single position or an array.
575
- * If it is a single position, it is the numerical position of the item in the array.
576
- * It must be a number or a string that parses into a number (e.g. '2').
577
- * If you pass in an array, the first item of the array must be a number or a string that parses into a number.
578
- * (other items in the array are child paths within the array item at this position).
579
- * This error happens only when in_position is an array.
580
- */
581
- FIRST_ITEM_MUST_BE_NUMBER: "PR-092: The first item in the in_position array must be an array " +
582
- "position (a number). This is not valid: ",
583
-
584
- /**
585
- * methods: ArrayProperty.get
586
- *
587
- * ArrayProperty.get takes in one parameter: in_position, which can a single position or an array.
588
- * If it is a single position, it is the numerical position of the item in the array.
589
- * It must be a number or a string that parses into a number (e.g. '2').
590
- * If you pass in an array, the first item of the array must be a number or a string that parses into a number
591
- * (other items in the array are child paths within the array item at this position).
592
- * This error happens only when in_position is a single position.
593
- */
594
- IN_POSITION_MUST_BE_NUMBER: "PR-093: in_position must be a number. This is not valid: ",
595
-
596
- /**
597
- * methods: Property.getValue
598
- *
599
- * Property.getValue takes one parameter: in_id.
600
- * It can either be a string or an array of strings. It cannot be an empty array.
601
- */
602
- CANNOT_BE_EMPTY_ARRAY: "PR-095: Property.getValue parameter: in_id cannot be an empty array.",
603
-
604
- /**
605
- * methods: EnumArrayProperty.set
606
- *
607
- * EnumArrayProperty.set takes two parameters: in_index and in_value.
608
- * In_value should be a number. setValue cannot be used to set enum by string.
609
- * Use .setEnumByString instead.
610
- */
611
- VALUE_SHOULD_BE_NUMBER: "PR-096: EnumArrayProperty.set parameter: in_value should be " +
612
- "a number. To set the value of an enum string, use .setEnumByString " +
613
- "instead.",
614
-
615
- /**
616
- * methods: EnumArrayProperty.setEnumByString
617
- *
618
- * EnumArrayProperty.setEnumByString cannot be use to set enum by number. Use .set instead.
619
- */
620
- VALUE_SHOULD_BE_STRING: "PR-098: EnumArrayProperty.setEnumByString parameter: in_value should be " +
621
- "a string. To set a number, use .set instead.",
622
-
623
- /**
624
- * methods: ArrayProperty.get
625
- *
626
- * In_position or in_offset is either lower than 0 or higher than the length of the array.
627
- * Make sure that the property you are trying to get from the array exists and that the position is correct.
628
- */
629
- GET_OUT_OF_RANGE: "PR-106: Trying to access out of bounds at index: ",
630
-
631
- /**
632
- * methods: ArrayProperty.setRange, ArrayProperty.set
633
- *
634
- * setRange: Either in_offset is lower than zero or in_offset + length of in_array is higher than
635
- * the length of the array. If you need to add items that were not there before, add those using
636
- * .push, .insert or .insertRange.
637
- */
638
- SET_OUT_OF_BOUNDS: "PR-107: Trying to set out of bounds. ",
639
-
640
- /**
641
- * methods: ArrayProperty.removeRange, ArrayProperty.remove
642
- *
643
- * RemoveRange: Either in_offset is smaller than zero or in_offset + in_deleteCount is higher than
644
- * the length of the array. Make sure that the properties you are trying to remove exist in that
645
- * array and that you entered the positions correctly.
646
- * Remove: in_offset is either smaller than zero or larger than the length of the array.
647
- */
648
- REMOVE_OUT_OF_BOUNDS: "PR-110: Trying to remove out of bounds. ",
649
-
650
- /**
651
- * methods: PropertyFactory.create
652
- *
653
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
654
- * Warning: Something went wrong when creating your property: it did not successfully create
655
- * the property and then tried to set its value.
656
- */
657
- NON_EXISTING_PROPERTY_REPOSITORY_REFERENCE: "PR-111: Internal error: PropertyFactory.create failed to create " +
658
- "this property.",
659
-
660
- /**
661
- * methods: Property.setValues
662
- *
663
- * One of the path you used in .setValues leads to a property.
664
- * When passing an object to setValues, make sure that all paths lead to a primitive value.
665
- */
666
- SET_VALUES_PATH_PROPERTY: "PR-115: trying to set value to a path leading to a property: ",
667
-
668
- /**
669
- * methods: Property.setValues
670
- *
671
- * One of the path in the object you passed to .setValues does not match the structure of this property.
672
- */
673
- SET_VALUES_PATH_INVALID: "PR-116: trying to set value to an invalid path: ",
674
-
675
- /**
676
- * methods: Property.setValues
677
- *
678
- * .setValues takes one parameter: an object containing paths to the values to be changed.
679
- * It should be an object (or in the case of ArrayProperty, an array)
680
- */
681
- SET_VALUES_PARAM_NOT_OBJECT: "PR-117: setValues parameter: in_properties must be an object.",
682
-
683
- /**
684
- * methods: PropertyFactory.create
685
- *
686
- * The array you tried to create had a typeid that was no recognized.
687
- * It was not a custom type array or one of the following: ‘String’, ‘Int64’, ‘Uint64’ or ‘Bool’.
688
- */
689
- UNKNOWN_ARRAY_TYPEID: "PR-118: Unknown typeid in array: ",
690
-
691
- /**
692
- * methods: MapProperty.insert, MapProperty.set
693
- *
694
- * .insert and .set take two parameters. The first one is in_id (or in_key), which is the id under
695
- * which the property is added. It can only be a string or a number. Only in the case of named
696
- * property can it be omitted.
697
- */
698
- ID_STRING_OR_NUMBER: "PR-119: id should be a string or a number. This is not valid: ",
699
-
700
- /**
701
- * methods: ValueProperty.deserialize
702
- *
703
- * .deserialize takes on parameter: a serialized object. It cannot be undefined.
704
- */
705
- DESERIALIZE_EMPTY_CHANGESET: "PR-121: ValueProperty.deserialize() called on an empty changeset",
706
-
707
- /**
708
- * methods: IntMapProperty.insert, UintMapProperty.insert
709
- *
710
- * You tried to insert into a (u)Int64MapProperty or (u)Int64ArrayProperty properties that
711
- * were not Int64 or UInt64 properties or properties that can be casted to the correct type.
712
- */
713
- INT_64_NON_INT64_TYPE: "PR-122: Tried to use (u)Int64MapProperty or (u)Int64ArrayProperty with an invalid type.",
714
-
715
- /**
716
- * methods: Integer64.toString, Integer64.fromString
717
- */
718
- BASE_OUT_OF_RANGE: "PR-123: Base is out of range. Base should be in range [2,36]. This is not valid: ",
719
-
720
- /**
721
- * methods: Integer64.fromString
722
- *
723
- * If your property is an instance of Uint64, you cannot set it to a negative number.
724
- * Uint64 does not support negative numbers. Use Int64 if you need to support negative numbers.
725
- */
726
- CANNOT_UPDATE_TO_NEGATIVE: "PR-124: Cannot update value to negative: ",
727
-
728
- /**
729
- * methods: Integer64.fromString
730
- *
731
- * The string you passed as a first parameter to .fromString contains non-numerical characters.
732
- */
733
- CANNOT_PARSE_INVALID_CHARACTERS: "PR-125: Cannot parse. String contains invalid characters: ",
734
-
735
- /**
736
- * methods: Property constructor
737
- *
738
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
739
- * Something went wrong while the property constructor was creating a property.
740
- * The parameters it received were not objects.
741
- */
742
- PROP_CONSTRUCTOR_EXPECTS_OBJECTS: "PR-126: Internal error: Object expected as parameters to " +
743
- "BaseProperty constructor",
744
-
745
- /**
746
- * methods: Property.applyChangeSet
747
- *
748
- * One of the ‘modify’ field in your changeset points to an index in the array that does not exist.
749
- * Check that the changeset you passed to applyChangeSet is valid. If you did not enter the changeSet yourself,
750
- * this is an internal error and you should contact the development team.
751
- */
752
- INDEX_INVALID: "PR-131: modified property - index invalid: ",
753
-
754
- /**
755
- * methods: Property.isAncestorOf, Property.isDescendantOf
756
- *
757
- * Property.isAncestorOf and .isDescendantOf take one parameter: a property. It cannot be undefined.
758
- */
759
- MISSING_IN_OTHERPROP: "PR-132: isAncestorOf parameter: in_otherProperty must be specified.",
760
-
761
- /**
762
- * methods: StringProperty.insert, StringProperty.push
763
- *
764
- * StringProperty.insert takes two parameters: in_position and in_value.
765
- * The second one (in_value) must be a string.
766
- * StringProperty.push takes only one parameter (in_value), which must be a string.
767
- */
768
- IN_VALUE_MUST_BE_STRING: "PR-133: parameter error: in_value must be a string. This is not valid: ",
769
-
770
- /**
771
- * methods: ValueProperty.getValues
772
- *
773
- * You cannot use the method .getValues on value properties. getValues is used to get multiple nested
774
- * values from a custom property. To get the value of a primitive property, use .getValue instead.
775
- */
776
- NO_VALUE_PROPERTY_GETVALUES: "PR-134: Cannot use .getValues on value properties or strings. " +
777
- "Use .getValue instead.",
778
-
779
- /**
780
- * methods: Property.setValues, ArrayProperty.insertRange, ArrayProperty.removeRange,
781
- * ArrayProperty.setRange, EnumArrayProperty.setEnumByString, ArrayProperty.insert, ArrayProperty.set,
782
- * ArrayProperty.clear
783
- *
784
- * If a property is created as a constant, it cannot be changed.
785
- */
786
- MODIFICATION_OF_CONSTANT_PROPERTY: "PR-140: Modifications of constants are not allowed.",
787
-
788
- /**
789
- * methods: ArrayProperty.insert, ArrayProperty.insertRange
790
- *
791
- * In a non-primitive array, you can only insert instances of properties. You should use PropertyFactory.create
792
- * to create an instance of your property before inserting it into the array.
793
- */
794
- INSERT_NOT_A_PROP: "PR-141: In an array of properties, you can only insert instances of " +
795
- "properties. This value is not valid: ",
796
-
797
- /**
798
- * If a property is a reference, it cannot be changed.
799
- */
800
- MODIFICATION_OF_REFERENCED_PROPERTY: "PR-142: Modifications of referenced properties are not allowed.",
801
-
802
- /**
803
- * methods: Property.getValue
804
- *
805
- * Property.getValue(in_ids) is a shortcut for Property.get(in_ids).getValue().
806
- * Property.get(in_ids) must resolve to a ValueProperty.
807
- */
808
- GET_VALUE_NOT_A_VALUE: "PR-160: in_ids does not resolve to a ValueProperty: ",
809
-
810
- /**
811
- * methods: MapProperty.insert
812
- *
813
- * If your map is not a ValueMap, in_property must be an instance of BaseProperty.
814
- * Use PropertyFactory.create to create an instance of a property.
815
- */
816
- NONVALUE_MAP_INSERT_PROP: "PR-161: In a map of properties, you can only insert properties.",
817
-
818
- /**
819
- * methods: PropertyFactory.create
820
- *
821
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
822
- * This error is thrown while creating a Property, when the actual context
823
- * ('array', 'map', 'set' or 'single') is different than what was expected.
824
- */
825
- CONTEXT_NOT_AS_EXPECTED: "PR-163: Property context is different than expected: ",
826
-
827
- /**
828
- * methods: Property.deserialize
829
- *
830
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
831
- * This error is thrown by .deserialize but is caused by an invalid changeSet. A serialized ChangeSet for an
832
- * Integer64Property must be an array of 2 integers: the low and the high values. Since users cannot yet supply
833
- * their changesets directly, this should not happen.
834
- */
835
- INVALID_INT64_CHANGESET: "PR-164: Cannot deserialize invalid change set for Int64 property",
836
-
837
- /**
838
- * methods: StringProperty.set
839
- *
840
- * StringProperty.set takes two parameters: in_index (a number, the index of the string that you wish to change)
841
- * and in_string (the string you want to insert at that index). To set the value of the whole string, use
842
- * setValue.
843
- */
844
- STRING_SET_NEEDS_INDEX: "PR-165: String.set first parameter should be an index (number). This is not valid: ",
845
-
846
- /**
847
- * methods: Property.get
848
- *
849
- * The token DEREFERENCE_TOKEN should only be used with .get when the in_ids passed to .get is an array.
850
- * the DEREFERENCE_TOKEN should follow a path to a reference.
851
- *
852
- * @example Valid:
853
- * ```typescript
854
- * myProp.get(['myReference', TOKENS.DEREFERENCE_TOKEN])
855
- * ```
856
- *
857
- * @example Not valid:
858
- * ```typescript
859
- * myProp.get('myReference').get(TOKENS.DEREFERENCE_TOKEN)
860
- * ```
861
- */
862
- NO_GET_DEREFERENCE_ONLY: "PR-166: Cannot use a dereference token only with .get",
863
-
864
- /**
865
- * methods: StringProperty.setValues
866
- *
867
- * You cannot call .setValues on a StringProperty. To set the value of the string, use .setValue
868
- * instead.
869
- */
870
- NO_VALUE_PROPERTY_SETVALUES: "PR-167: setValues is not a valid method for String Properties",
871
-
872
- /**
873
- * methods: Property.getRelativePath
874
- *
875
- * In cases where you have more than one repository reference property pointing to the same repository, finding a path
876
- * between a properties in different repositories can lead to more than one valid results. In that case, .getRelativePath
877
- * will return the first valid path it finds. If you want to control how which path is used, you should construct the
878
- * string path by concatenating the absolute path for the prop in the nested repository and the relative path between your
879
- * repository reference and the target property.
880
- */
881
- MORE_THAN_ONE_PATH: "PR-169: More than one paths exist between ",
882
-
883
- /**
884
- * methods: Property.getRelativePath
885
- *
886
- * getRelativePath takes one parameter: the property from which the path will start. This must be an instance of
887
- * BaseProperty. The method will return the path from that property to the property on which it was called ('this')
888
- */
889
- IN_FROMPROPERTY_MUST_BE_PROPERTY: "PR-170: getRelativePath parameter error: in_fromProperty must be a property",
890
-
891
- /**
892
- * methods: Property.getRelativePath
893
- *
894
- * getRelativePath does not return a path between a property that is inside a child repository to one that is in
895
- * a parent repository. A path like this could not be used with .resolvePath or be used in a reference property
896
- * because neither method can go from the root of a referenced repository to a reference property.
897
- */
898
- NO_PATH_FROM_CHILD_REPO: "PR-171: cannot get a path from a child repository to a parent repository",
899
-
900
- /**
901
- * methods: getReferencedWorkspace
902
- *
903
- * This repository reference is in read-only mode. Call enableWrite() to access the workspace.
904
- */
905
- REPOSITORY_REFERENCE_WORKSPACE_READ_ONLY:
906
- "PR-173: This repository reference is in read-only mode. Call enableWrite() to access the workspace.",
907
-
908
- /**
909
- * methods: Property.enableWrite
910
- *
911
- * Repository reference is already in writable mode.
912
- */
913
- REPOSITORY_REFERENCE_WORKSPACE_EXIST_ALREADY: "PR-174: Repository reference is already in writable mode",
914
-
915
- /**
916
- * methods: Property.enableWrite
917
- *
918
- * Can't enable write on an empty repository reference without at least a repositoryGUID and branchGUID.
919
- */
920
- WRITABLE_REPOSITORY_REFERENCE_NEED_GUIDS:
921
- "PR-176: Can't enable write on an empty repository reference without at least a repositoryGUID and branchGUID",
922
-
923
- /**
924
- * methods: Property.enableWrite
925
- *
926
- * Repository reference failed to automatically commit the new commitGUID.
927
- */
928
- WRITABLE_REPOSITORY_AUTO_COMMIT_FAIL: "PR-177: Repository reference failed to automatically commit the new commitGUID",
929
-
930
- /**
931
- * methods: Property._setFollowBranch
932
- *
933
- * An unexpected error occurred while trying to switch a repository reference followBranch property
934
- */
935
- WRITABLE_REPOSITORY_SET_FOLLOW_BRANCH_FAILED:
936
- "PR-178: An unexpected error occurred while trying to switch a repository reference followBranch property to ",
937
-
938
- /**
939
- * methods: MapProperty.insert, MapProperty.set
940
- *
941
- * .insert and .set take two parameters. The first one is in_id (or in_key), which is the id under
942
- * which the property is added. It can not be an empty string.
943
- */
944
- ID_SHOULD_NOT_BE_EMPTY_STRING:
945
- "PR-179: id should not be an empty string.",
946
-
947
- /**
948
- * methods: StringProperty.set
949
- *
950
- * StringProperty.set: in_character must have a length of 1.
951
- */
952
- STRING_SET_ONE_CHAR: "PR-180: String.set, only one character can be set (in_character must have a length of 1).",
953
-
954
- /**
955
- * methods: EnumArrayProperty.set
956
- *
957
- * EnumArrayProperty.set only accepts a string or number as input for in_value
958
- */
959
- VALUE_STRING_OR_NUMBER:
960
- "PR-181: in_value should be a string or a number. This is not valid: ",
961
-
962
- /**
963
- * methods: ArrayProperty.set
964
- *
965
- * The in_value input of ArrayProperty.set should not be an array.
966
- */
967
- ARRAY_SET_ONE_ELEMENT:
968
- "PR-182: in_value should be a single element. This is not valid: ",
969
-
970
- CANT_DIRTY_MISSING_PROPERTY: "PR-183: Can't dirty missing property: ",
971
-
972
- /**
973
- * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
974
- *
975
- * The property you are trying to insert in your map property, set property or node property is a root.
976
- */
977
- INSERTED_ROOT_ENTRY: "PR-184: Trying to insert a root property into a collection.",
978
-
979
- /**
980
- * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
981
- *
982
- * The property you are trying to insert in your map property, set property or node property is already
983
- * a parent of the map, set, or node property. You cannot insert this property there or you would create
984
- * a cycle in your data tree.
985
- */
986
- INSERTED_IN_OWN_CHILDREN:
987
- "PR-185: Trying to insert a property in itself or in one of its children.",
988
-
989
- /**
990
- * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
991
- *
992
- * The property you are trying to insert (or at least one if its children) in your map property, set
993
- * property or node property is not covered by the paths of the partial checkout.
994
- * You cannot insert this property because you would not receive updates for this path after the
995
- * insertion and you could corrupt your data by doing subsequent modifications.
996
- */
997
- INSERTED_OUTSIDE_PATHS:
998
- "PR-186: Trying to insert a property outside the paths covered by the partial checkout.",
999
-
1000
- SHARED_BEFORE_INSERTED: "PR-187: Property must be inserted in the workspace before sharing.",
1001
-
1002
- CUSTOM_ID_NOT_ALLOWED: "PR-188: The following property does not support custom id: ",
143
+ TYPEID_NOT_NATIVE: "TYPEID_NOT_NATIVE",
144
+ /**
145
+ * methods: ArrayProperty.length.set, StringProperty.length.set
146
+ *
147
+ * Cannot directly set the array.length or string.length. This is a read-only property.
148
+ */
149
+ MODIFY_READ_ONLY: "PR-001: Trying to modify read only property value (array.length).",
150
+
151
+ /**
152
+ * methods: Property.getRelativePath
153
+ *
154
+ * There is no path between the property and the ancestor you passed in to .getRelativePath.
155
+ */
156
+ NO_PATH_BETWEEN: "PR-002: No path between ",
157
+
158
+ /**
159
+ * methods: Property.applyChangeSet
160
+ *
161
+ * One of the paths included in your changeSet is not valid for this property.
162
+ * Check that the modifications in the changeSet match the structure of the template.
163
+ */
164
+ INVALID_PATH: "PR-003: Invalid path in ChangeSet: ",
165
+
166
+ /**
167
+ * methods: NodeProperty.insert
168
+ *
169
+ * The property you inserted into a NodeProperty has a parent.
170
+ * If your property has a parent, changing the property’s id will break the parent.
171
+ * Make the change to the parent first.
172
+ */
173
+ ID_CHANGE_FOR_PROPERTY_WITH_PARENT:
174
+ "PR-004: Cannot change the ID of a property that has a parent. Could not change id: ",
175
+
176
+ /**
177
+ * methods: Property.resolvePath
178
+ *
179
+ * Part of the path entered to Property.resolvePath was not valid.
180
+ */
181
+ INVALID_PATH_TOKEN: "PR-005: ResolvePath error: accessed a child via an invalid path syntax: ",
182
+
183
+ /**
184
+ * methods: MapProperty.insert, NodeProperty.insert, ReferenceMapProperty.insert, Workspace.insert,
185
+ * SetProperty.insert
186
+ *
187
+ * Your map, set or nodeproperty already contains an entry under in_key.
188
+ */
189
+ PROPERTY_ALREADY_EXISTS: "PR-006: The property already exists in this collection: ",
190
+
191
+ /**
192
+ * methods: MapProperty.applyChangeset, NodeProperty.applyChangeset, SetProperty.applyChangeset
193
+ *
194
+ * The changeset you applied contains properties that have already been inserted.
195
+ * Check the ‘insert’ fields in your changeSet for properties that might already exist.
196
+ */
197
+ INSERTED_EXISTING_ENTRY: "PR-007: Inserted an already existing entry: ",
198
+
199
+ /**
200
+ * methods: MapProperty.remove, SetProperty.remove
201
+ *
202
+ * Tried to remove an entry that does not exist.
203
+ * This can be caused indirectly by deserialize / applyChangeset methods.
204
+ * One of the ‘remove’ fields in your changeSet must contain a property that does not exist.
205
+ */
206
+ REMOVED_NON_EXISTING_ENTRY: "PR-008: Trying to remove a non-existing entry: ",
207
+
208
+ /**
209
+ * methods: MapProperty.applyChangeset, NodeProperty.applyChangeset, SetProperty.applyChangeset
210
+ *
211
+ * One of the key you are trying to modify in your changeSet does not exist.
212
+ * One of the ‘modify’ fields in your changeSet refers to a property that does not exist.
213
+ */
214
+ MODIFY_NON_EXISTING_ENTRY: "PR-009: Trying to modify a not existing entry: ",
215
+
216
+ /**
217
+ * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
218
+ *
219
+ * The value you are trying to insert in your map property, set property or node property has a parent.
220
+ * You cannot insert a property that has a parent.
221
+ */
222
+ INSERTED_ENTRY_WITH_PARENT:
223
+ "PR-010: Trying to insert into a collection a property that already has " + "a parent.",
224
+
225
+ /**
226
+ * methods: Property.resolvePath, Workspace.resolvePath
227
+ *
228
+ * Paths should not contain empty sections such as ‘..’, ‘//’ or ‘[], etc.
229
+ * Sections in the path are delimited by ‘.’ ‘[ ]’, ‘/’ .
230
+ * There should always be a path between any two delimiters.
231
+ */
232
+ EMPTY_TOKEN: "PR-011: ResolvePath error: Encountered empty token in path: ",
233
+
234
+ /**
235
+ * methods: Property.resolvePath, Workspace.resolvePath
236
+ *
237
+ * Paths should not contain quotes except at the beginning and end of the path.
238
+ * For example: resolvePath('my"path.nested".other') is not valid because the first quote is in front of path
239
+ * but after the ‘.nested’ which is part of the subsequent path.
240
+ */
241
+ QUOTES_WITHIN_TOKEN:
242
+ "PR-012: ResolvePath error: Quotes must only be at the start and the " +
243
+ "end of a path. Error in path: ",
244
+
245
+ /**
246
+ * methods: Property.resolvePath, Workspace.resolvePath
247
+ *
248
+ * Paths should not end with a ‘.’
249
+ */
250
+ DOT_AT_END: "PR-013: ResolvePath error: Encountered a dot at the end of path: ",
251
+
252
+ /**
253
+ * methods: Property.resolvePath, Workspace.resolvePath
254
+ * Paths using square brackets should not contain ‘.’ within those square brackets.
255
+ * If your path contains any dots, these should be escaped e.g. [my\.path] instead of [my.path].
256
+ */
257
+ DOTS_IN_SQUARE_BRACKETS:
258
+ "PR-014: ResolvePath error: Encountered a dot within a square bracket. " +
259
+ "These have to be escaped. Error in path: ",
260
+
261
+ /**
262
+ * methods: Property.resolvePath, Workspace.resolvePath
263
+ *
264
+ * resolvePath error while parsing your string.
265
+ * It encountered an end to a path segment that was not
266
+ * followed by a “.” or a “[“ indicating the beginning of a new segment.
267
+ */
268
+ MISSING_DOT_AT_SEGMENT_START: "PR-015: Missing . or [ at segment start in path: ",
269
+
270
+ /**
271
+ * methods: Property.resolvePath, Workspace.resolvePath
272
+ *
273
+ * Closing square bracket not followed by the correct character (., [ or *).
274
+ * For example, this is not valid: resolvePath(myArray[2]nested).
275
+ * This is valid: resolvePath(myArray[2].nested).
276
+ */
277
+ INVALID_END_OF_SQUARE_BRACKETS:
278
+ "PR-016: ResolvePath error: Square brackets have to be followed either " +
279
+ 'by "." or by "[" or by "*". Error in path: ',
280
+
281
+ /**
282
+ * methods: Property.resolvePath, Workspace.resolvePath
283
+ *
284
+ * Every opening bracket ([) needs a matching closing bracket (])
285
+ */
286
+ UNCLOSED_BRACKETS: "PR-017: ResolvePath error: Unclosed brackets at the end of path: ",
287
+
288
+ /**
289
+ * methods: Property.resolvePath, Workspace.resolvePath
290
+ *
291
+ * Any closing bracket (]) must be preceded by a matching opening bracket ([).
292
+ */
293
+ CLOSING_BRACKET_WITHOUT_OPENING:
294
+ "PR-018: ResolvePath error: Encountered closing bracket without " +
295
+ "corresponding opening one in path: ",
296
+
297
+ /**
298
+ * methods: Property.resolvePath, Workspace.resolvePath
299
+ */
300
+ INVALID_ESCAPE_SEQUENCE: "PR-019: Encountered an invalid escape sequence in path: ",
301
+
302
+ /**
303
+ * methods: Property.resolvePath, Workspace.resolvePath
304
+ *
305
+ * A quotation mark at the beginning of a path must have a matching closing quotation mark
306
+ * at the end of the same path.
307
+ */
308
+ UNCLOSED_QUOTATION_MARKS:
309
+ "PR-020: ResolvePath error: Encountered unclosed quotation marks in path: ",
310
+
311
+ /**
312
+ * methods: SetProperty.insert, SetProperty.set, SetProperty.setValues
313
+ *
314
+ * The property you insert in a setProperty must be an instance of NamedProperty.
315
+ * When creating the property to be inserted, make sure it inherits from NamedProperty.
316
+ *
317
+ * @example Creating a property that inherits from NamedProperty
318
+ *
319
+ * ```json
320
+ * {
321
+ * typeid:”my.example:myprop-1.0.0”,
322
+ * inherits:’NamedProperty’ (or [‘NamedProperty’, …]
323
+ * ...
324
+ * }
325
+ *```
326
+ */
327
+ CANT_INSERT_NON_NAMED_PROPERTIES: "PR-021: Set can only contain named properties",
328
+
329
+ /**
330
+ * methods: NodeProperty.insert, Workspace.insert
331
+ *
332
+ * The property you inserted does not have an id.
333
+ * Unless the property is an instance of NamedProperty, you must pass in an id as the first parameter
334
+ * (and the property second)
335
+ */
336
+ ADDED_CHILD_WITHOUT_ID: "PR-022: Added child without id.",
337
+
338
+ /**
339
+ * methods: ArrayProperty.resolvePath
340
+ *
341
+ * Cannot use .resolvePath on a primitive array, only on a Custom type array.
342
+ * For a primitive array, use .getValue instead.
343
+ * For example, instead of MyValueArray.resolvePath(1), use MyValueArray.getValue(1)
344
+ */
345
+ NO_PATHS_FOR_NON_PRIMITIVE_ARRAYS:
346
+ "PR-023: Path resolution is not supported for primitive type arrays.",
347
+
348
+ /**
349
+ * methods: ArrayProperty.resolvePath
350
+ *
351
+ * When using an array index as part of your path, it needs to have a numeric value.
352
+ */
353
+ INVALID_NON_NUMERIC_SEGMENT_IN_PATH:
354
+ "PR-024: ResolvePath error: Accessed an array via an non numeric index: ",
355
+
356
+ /**
357
+ * methods: ArrayProperty.getRelativePath, ArrayProperty.getAbsolutePath
358
+ *
359
+ * INTERNAL ERROR
360
+ * If you encounter this error, please contact the development team.
361
+ * Part of the path you are trying to find points to a non-existing array item.
362
+ */
363
+ GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY:
364
+ "PR-025: Internal error: _getPathSegmentForChildNode has been called " +
365
+ "for an entry that is not an entry of the collection. ",
366
+
367
+ /**
368
+ * The changeSet passed to .deserialize was not a valid non-normalized changeset.
369
+ */
370
+ NO_NORMALIZED_CHANGESET: "PR-026: deserialize was called with a non-normalized ChangeSet.",
371
+
372
+ /**
373
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
374
+ * One of your changesets contained a NamedProperty without a GUID.
375
+ * This should not happen and should have been validated already.
376
+ */
377
+ MISSING_GUID_IN_NORMALIZED_CHANGESET:
378
+ "PR-027: Missing GUID in a normalized ChangeSet with named properties",
379
+
380
+ /**
381
+ * methods: EnumProperty.getEnumString, EnumProperty.setValue, EnumProperty.setEnumByString,
382
+ * EnumProperty.getEnumString, EnumArrayProperty.getEnumStrings
383
+ *
384
+ * This Enum Property does not have any entry with that value.
385
+ * EnumProperty.getEnumByString -\> the EnumProperty you used to pass this function does not have an entry.
386
+ * EnumProperty.setValue -\> no entry exists for in_value
387
+ * EnumProperty.setEnumByString -\> no entry exists for in_stringId
388
+ * EnumArrayProperty.getEnumString -\> the value found at in_position does not correspond to an entry.
389
+ * EnumArrayProperty.getEnumStrings -\> one of the values found at one of the positions sought does
390
+ * not correspond to an entry.
391
+ */
392
+ UNKNOWN_ENUM: "PR-028: enum value unknown: ",
393
+
394
+ /**
395
+ * methods: Property.applyChangeSet
396
+ *
397
+ * Changeset contains an operation that is unknown.
398
+ * Valid operations are insert, modify and remove.
399
+ */
400
+ UNKNOWN_OPERATION: "PR-029: Unknown ChangeSet operation: ",
401
+
402
+ /**
403
+ * methods: Workspace.remove, NodeProperty.remove
404
+ *
405
+ * The property you passed to workspace.remove or nodeProperty.remove does not exist.
406
+ * Check that you passed the correct property, and that it has not yet been removed.
407
+ */
408
+ REMOVING_NON_EXISTING_KEY: "PR-033: Trying to remove something that does not exist: ",
409
+
410
+ /**
411
+ * methods: Workspace.get, Property.get
412
+ *
413
+ * Workspace.get and Property.get take in an id (string or number) or an array of ids.
414
+ *
415
+ * @example
416
+ * ```typescript
417
+ *.get(‘position’).get(‘x’) or .get([‘property’, ‘x’])
418
+ * ```
419
+ */
420
+ STRING_OR_ARRAY_STRINGS:
421
+ "PR-034: in_id must be a string, a number or an array of these. This is not valid: ",
422
+
423
+ /**
424
+ * methods: Property.serialize
425
+ *
426
+ * Property.serialize only takes in one parameter: an options object. That parameter is optional.
427
+ */
428
+ SERIALIZE_TAKES_OBJECT: "PR-035: Argument of serialize() should be an object.",
429
+
430
+ /**
431
+ * methods: ArrayProperty.insert, ArrayProperty.insertRange
432
+ *
433
+ * The in_position (for .insert) or in_offset (for .insertRange) should not be smaller than 0
434
+ * or larger than the length of the array.
435
+ */
436
+ START_OFFSET_INVALID: "PR-036: ArrayProperty: insert range - Start offset is invalid: ",
437
+
438
+ // PR-037 removed
439
+
440
+ /**
441
+ * ArrayProperty.remove, ArrayProperty.removeRange, ArrayProperty.pop
442
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
443
+ * The item (or one of the items) you are trying to remove from the array has a parent that is not the array.
444
+ * This should not happen because you should not have been able to insert the item in the array in the first place.
445
+ */
446
+ CANNOT_REMOVE_WITH_DIFFERENT_PARENT:
447
+ "PR-038: Internal error: Trying to remove from an array a property that " +
448
+ "has not the array as parent.",
449
+
450
+ /**
451
+ * methods ArrayProperty.set, ArrayProperty.setRange
452
+ *
453
+ * Your first parameter: in_position (for .set) and in_offset (for .setRange) cannot have a negative value.
454
+ */
455
+ START_OFFSET_NEGATIVE:
456
+ "PR-039: ArrayProperty: Modify range - Start offset cannot be negative: ",
457
+
458
+ /**
459
+ * methods: ArrayProperty.removeRange, ArrayProperty.setRange, ArrayProperty.insertRange,
460
+ * ArrayProperty.insert, EnumArrayProperty.getEnumStrings
461
+ *
462
+ * The parameter needs to be a number.
463
+ * For .removeRange: in_offset and in_deleteCount
464
+ * For .setRange: in_offset
465
+ * For .insertRange: in_offset
466
+ * For .getEnumStrings: in_offset, in_length
467
+ * For StringProperty.insert: in_position
468
+ */
469
+ NOT_NUMBER: "PR-049: This parameter must be a number: parameter: ",
470
+
471
+ /**
472
+ * methods: Property.traverseUp, Property.traverseDown
473
+ *
474
+ * Property.traverseUp and Property.traverseDown take one parameter: a callback function
475
+ */
476
+ CALLBACK_NOT_FCT:
477
+ "PR-050: traverseUp / traverseDown parameter: in_callback must " + "be a function.",
478
+
479
+ /**
480
+ * methods: ArrayProperty.insertRange
481
+ *
482
+ * Array.insertRange takes two parameters. The second one (in_array) must be an array.
483
+ * To pass in only one item, either use .insert(index, item)
484
+ * or put that item into an array: .insertRange(index, [item])
485
+ */
486
+ IN_ARRAY_NOT_ARRAY: "PR-051: Parameter error: in_array must be an array for method: ",
487
+
488
+ /**
489
+ * methods: EnumProperty.setEnumByString
490
+ *
491
+ * EnumProperty.setEnumByString takes one parameter: a string id. It must be a string.
492
+ */
493
+ STRING_ID_MUST_BE_STRING:
494
+ "PR-052: EnumProperty.setEnumByString parameter: in_stringId must " +
495
+ "be a string. This is not valid: ",
496
+
497
+ /**
498
+ * methods: Integer64Property.setValueHigh
499
+ *
500
+ * Integer64Property.setValueHigh takes one parameter: a number.
501
+ */
502
+ IN_HIGH_MUST_BE_NUMBER:
503
+ "PR-053: Integer64Property.setValueHigh parameter: in_high must " +
504
+ "be a number. This is not valid: ",
505
+
506
+ /**
507
+ * methods: Integer64Property.setValueLow
508
+ *
509
+ * Integer64Property.setValueLow takes one parameter: a number.
510
+ */
511
+ IN_LOW_MUST_BE_NUMBER:
512
+ "PR-054: Integer64Property.setValueLow parameter: in_low must " +
513
+ "be a number. This is not valid: ",
514
+
515
+ /**
516
+ * methods: IntegerProperty.toString
517
+ *
518
+ * Integer64Property.toString takes one optional parameter: a number (in_radix).
519
+ * If no value is passed, will default to 10.
520
+ */
521
+ IN_RADIX_MUST_BE_NUMBER:
522
+ "PR-055: Integer64Property.toString parameter: in_radix must be a number. This is not valid: ",
523
+
524
+ /**
525
+ * methods: IntegerProperty.fromString
526
+ *
527
+ * Integer64Property.fromString takes two parameters. The first parameter (in_string) must be a string.
528
+ * (the second parameter is in_radix, a number. It is optional: defaults to 10).
529
+ */
530
+ IN_STRING_MUST_BE_STRING:
531
+ "PR-056: Integer64Property.fromString parameter: in_string must " +
532
+ "be a string. This is not valid: ",
533
+
534
+ /**
535
+ * methods: Integer64Property.fromString
536
+ *
537
+ * Integer64Property.fromString takes two parameters. The second parameter is optional but if passed,
538
+ * it must be a number between 2 and 36. If not passed, it defaults to 10. (the first parameter is
539
+ * in_string and must be a string).
540
+ */
541
+ IN_RADIX_BETWEEN_2_36:
542
+ "PR-057: Integer64Property.fromString parameter: in_radix must be a " +
543
+ "number between 2 and 36. This is not valid: ",
544
+
545
+ /**
546
+ * methods MapProperty.insert, ReferenceMapProperty.set
547
+ *
548
+ * MapProperty.insert and ReferenceMapProperty.set both take two parameters.
549
+ * The first parameter (in_key) must be a string.
550
+ */
551
+ KEY_NOT_STRING:
552
+ "PR-058: MapProperty.insert / ReferenceMapProperty.set parameter: " +
553
+ "in_key must be a string. This is not valid: ",
554
+
555
+ /**
556
+ * methods: NodeProperty.insert, Workspace.insert
557
+ *
558
+ * The second parameter (in_property) must be a valid property (it must be an instance of BaseProperty).
559
+ */
560
+ NOT_A_PROPERTY:
561
+ "PR-059: NodeProperty.insert parameter in_property is not a property. " +
562
+ "The property you passed is not a valid property.",
563
+
564
+ /**
565
+ * methods: ReferenceProperty.set / setValue, ReferenceMapProperty.insert / set / setValue / setValues,
566
+ * ReferenceArrayProperty.enqueue / push / unshift / insert / insertRange / set / setRange / setValue / setValues
567
+ *
568
+ * The provided value (or values) must be a valid property (an instance of BaseProperty), be undefined or a string (a path).
569
+ */
570
+ PROPERTY_OR_UNDEFINED:
571
+ "PR-060: Parameter for setting a Reference should be a path to a property, a property or undefined. This is not valid: ",
572
+
573
+ /**
574
+ * ArrayProperty.insertRange, ArrayProperty.insert, ArrayProperty.push
575
+ *
576
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
577
+ * The item (or one of the items) you are trying to insert in this array has a parent that is not the array.
578
+ */
579
+ NO_INSERT_WITH_PARENT:
580
+ "PR-088: Internal error: Trying to insert a property into an array or " +
581
+ "string that already has a parent.",
582
+
583
+ /**
584
+ * methods: ArrayProperty.get
585
+ *
586
+ * ArrayProperty.get takes in one parameter: in_position, which can a single position or an array.
587
+ * If it is a single position, it is the numerical position of the item in the array.
588
+ * It must be a number or a string that parses into a number (e.g. '2').
589
+ * If you pass in an array, the first item of the array must be a number or a string that parses into a number.
590
+ * (other items in the array are child paths within the array item at this position).
591
+ * This error happens only when in_position is an array.
592
+ */
593
+ FIRST_ITEM_MUST_BE_NUMBER:
594
+ "PR-092: The first item in the in_position array must be an array " +
595
+ "position (a number). This is not valid: ",
596
+
597
+ /**
598
+ * methods: ArrayProperty.get
599
+ *
600
+ * ArrayProperty.get takes in one parameter: in_position, which can a single position or an array.
601
+ * If it is a single position, it is the numerical position of the item in the array.
602
+ * It must be a number or a string that parses into a number (e.g. '2').
603
+ * If you pass in an array, the first item of the array must be a number or a string that parses into a number
604
+ * (other items in the array are child paths within the array item at this position).
605
+ * This error happens only when in_position is a single position.
606
+ */
607
+ IN_POSITION_MUST_BE_NUMBER: "PR-093: in_position must be a number. This is not valid: ",
608
+
609
+ /**
610
+ * methods: Property.getValue
611
+ *
612
+ * Property.getValue takes one parameter: in_id.
613
+ * It can either be a string or an array of strings. It cannot be an empty array.
614
+ */
615
+ CANNOT_BE_EMPTY_ARRAY: "PR-095: Property.getValue parameter: in_id cannot be an empty array.",
616
+
617
+ /**
618
+ * methods: EnumArrayProperty.set
619
+ *
620
+ * EnumArrayProperty.set takes two parameters: in_index and in_value.
621
+ * In_value should be a number. setValue cannot be used to set enum by string.
622
+ * Use .setEnumByString instead.
623
+ */
624
+ VALUE_SHOULD_BE_NUMBER:
625
+ "PR-096: EnumArrayProperty.set parameter: in_value should be " +
626
+ "a number. To set the value of an enum string, use .setEnumByString " +
627
+ "instead.",
628
+
629
+ /**
630
+ * methods: EnumArrayProperty.setEnumByString
631
+ *
632
+ * EnumArrayProperty.setEnumByString cannot be use to set enum by number. Use .set instead.
633
+ */
634
+ VALUE_SHOULD_BE_STRING:
635
+ "PR-098: EnumArrayProperty.setEnumByString parameter: in_value should be " +
636
+ "a string. To set a number, use .set instead.",
637
+
638
+ /**
639
+ * methods: ArrayProperty.get
640
+ *
641
+ * In_position or in_offset is either lower than 0 or higher than the length of the array.
642
+ * Make sure that the property you are trying to get from the array exists and that the position is correct.
643
+ */
644
+ GET_OUT_OF_RANGE: "PR-106: Trying to access out of bounds at index: ",
645
+
646
+ /**
647
+ * methods: ArrayProperty.setRange, ArrayProperty.set
648
+ *
649
+ * setRange: Either in_offset is lower than zero or in_offset + length of in_array is higher than
650
+ * the length of the array. If you need to add items that were not there before, add those using
651
+ * .push, .insert or .insertRange.
652
+ */
653
+ SET_OUT_OF_BOUNDS: "PR-107: Trying to set out of bounds. ",
654
+
655
+ /**
656
+ * methods: ArrayProperty.removeRange, ArrayProperty.remove
657
+ *
658
+ * RemoveRange: Either in_offset is smaller than zero or in_offset + in_deleteCount is higher than
659
+ * the length of the array. Make sure that the properties you are trying to remove exist in that
660
+ * array and that you entered the positions correctly.
661
+ * Remove: in_offset is either smaller than zero or larger than the length of the array.
662
+ */
663
+ REMOVE_OUT_OF_BOUNDS: "PR-110: Trying to remove out of bounds. ",
664
+
665
+ /**
666
+ * methods: PropertyFactory.create
667
+ *
668
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
669
+ * Warning: Something went wrong when creating your property: it did not successfully create
670
+ * the property and then tried to set its value.
671
+ */
672
+ NON_EXISTING_PROPERTY_REPOSITORY_REFERENCE:
673
+ "PR-111: Internal error: PropertyFactory.create failed to create " + "this property.",
674
+
675
+ /**
676
+ * methods: Property.setValues
677
+ *
678
+ * One of the path you used in .setValues leads to a property.
679
+ * When passing an object to setValues, make sure that all paths lead to a primitive value.
680
+ */
681
+ SET_VALUES_PATH_PROPERTY: "PR-115: trying to set value to a path leading to a property: ",
682
+
683
+ /**
684
+ * methods: Property.setValues
685
+ *
686
+ * One of the path in the object you passed to .setValues does not match the structure of this property.
687
+ */
688
+ SET_VALUES_PATH_INVALID: "PR-116: trying to set value to an invalid path: ",
689
+
690
+ /**
691
+ * methods: Property.setValues
692
+ *
693
+ * .setValues takes one parameter: an object containing paths to the values to be changed.
694
+ * It should be an object (or in the case of ArrayProperty, an array)
695
+ */
696
+ SET_VALUES_PARAM_NOT_OBJECT: "PR-117: setValues parameter: in_properties must be an object.",
697
+
698
+ /**
699
+ * methods: PropertyFactory.create
700
+ *
701
+ * The array you tried to create had a typeid that was no recognized.
702
+ * It was not a custom type array or one of the following: ‘String’, ‘Int64’, ‘Uint64’ or ‘Bool’.
703
+ */
704
+ UNKNOWN_ARRAY_TYPEID: "PR-118: Unknown typeid in array: ",
705
+
706
+ /**
707
+ * methods: MapProperty.insert, MapProperty.set
708
+ *
709
+ * .insert and .set take two parameters. The first one is in_id (or in_key), which is the id under
710
+ * which the property is added. It can only be a string or a number. Only in the case of named
711
+ * property can it be omitted.
712
+ */
713
+ ID_STRING_OR_NUMBER: "PR-119: id should be a string or a number. This is not valid: ",
714
+
715
+ /**
716
+ * methods: ValueProperty.deserialize
717
+ *
718
+ * .deserialize takes on parameter: a serialized object. It cannot be undefined.
719
+ */
720
+ DESERIALIZE_EMPTY_CHANGESET: "PR-121: ValueProperty.deserialize() called on an empty changeset",
721
+
722
+ /**
723
+ * methods: IntMapProperty.insert, UintMapProperty.insert
724
+ *
725
+ * You tried to insert into a (u)Int64MapProperty or (u)Int64ArrayProperty properties that
726
+ * were not Int64 or UInt64 properties or properties that can be casted to the correct type.
727
+ */
728
+ INT_64_NON_INT64_TYPE:
729
+ "PR-122: Tried to use (u)Int64MapProperty or (u)Int64ArrayProperty with an invalid type.",
730
+
731
+ /**
732
+ * methods: Integer64.toString, Integer64.fromString
733
+ */
734
+ BASE_OUT_OF_RANGE:
735
+ "PR-123: Base is out of range. Base should be in range [2,36]. This is not valid: ",
736
+
737
+ /**
738
+ * methods: Integer64.fromString
739
+ *
740
+ * If your property is an instance of Uint64, you cannot set it to a negative number.
741
+ * Uint64 does not support negative numbers. Use Int64 if you need to support negative numbers.
742
+ */
743
+ CANNOT_UPDATE_TO_NEGATIVE: "PR-124: Cannot update value to negative: ",
744
+
745
+ /**
746
+ * methods: Integer64.fromString
747
+ *
748
+ * The string you passed as a first parameter to .fromString contains non-numerical characters.
749
+ */
750
+ CANNOT_PARSE_INVALID_CHARACTERS: "PR-125: Cannot parse. String contains invalid characters: ",
751
+
752
+ /**
753
+ * methods: Property constructor
754
+ *
755
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
756
+ * Something went wrong while the property constructor was creating a property.
757
+ * The parameters it received were not objects.
758
+ */
759
+ PROP_CONSTRUCTOR_EXPECTS_OBJECTS:
760
+ "PR-126: Internal error: Object expected as parameters to " + "BaseProperty constructor",
761
+
762
+ /**
763
+ * methods: Property.applyChangeSet
764
+ *
765
+ * One of the ‘modify’ field in your changeset points to an index in the array that does not exist.
766
+ * Check that the changeset you passed to applyChangeSet is valid. If you did not enter the changeSet yourself,
767
+ * this is an internal error and you should contact the development team.
768
+ */
769
+ INDEX_INVALID: "PR-131: modified property - index invalid: ",
770
+
771
+ /**
772
+ * methods: Property.isAncestorOf, Property.isDescendantOf
773
+ *
774
+ * Property.isAncestorOf and .isDescendantOf take one parameter: a property. It cannot be undefined.
775
+ */
776
+ MISSING_IN_OTHERPROP: "PR-132: isAncestorOf parameter: in_otherProperty must be specified.",
777
+
778
+ /**
779
+ * methods: StringProperty.insert, StringProperty.push
780
+ *
781
+ * StringProperty.insert takes two parameters: in_position and in_value.
782
+ * The second one (in_value) must be a string.
783
+ * StringProperty.push takes only one parameter (in_value), which must be a string.
784
+ */
785
+ IN_VALUE_MUST_BE_STRING:
786
+ "PR-133: parameter error: in_value must be a string. This is not valid: ",
787
+
788
+ /**
789
+ * methods: ValueProperty.getValues
790
+ *
791
+ * You cannot use the method .getValues on value properties. getValues is used to get multiple nested
792
+ * values from a custom property. To get the value of a primitive property, use .getValue instead.
793
+ */
794
+ NO_VALUE_PROPERTY_GETVALUES:
795
+ "PR-134: Cannot use .getValues on value properties or strings. " + "Use .getValue instead.",
796
+
797
+ /**
798
+ * methods: Property.setValues, ArrayProperty.insertRange, ArrayProperty.removeRange,
799
+ * ArrayProperty.setRange, EnumArrayProperty.setEnumByString, ArrayProperty.insert, ArrayProperty.set,
800
+ * ArrayProperty.clear
801
+ *
802
+ * If a property is created as a constant, it cannot be changed.
803
+ */
804
+ MODIFICATION_OF_CONSTANT_PROPERTY: "PR-140: Modifications of constants are not allowed.",
805
+
806
+ /**
807
+ * methods: ArrayProperty.insert, ArrayProperty.insertRange
808
+ *
809
+ * In a non-primitive array, you can only insert instances of properties. You should use PropertyFactory.create
810
+ * to create an instance of your property before inserting it into the array.
811
+ */
812
+ INSERT_NOT_A_PROP:
813
+ "PR-141: In an array of properties, you can only insert instances of " +
814
+ "properties. This value is not valid: ",
815
+
816
+ /**
817
+ * If a property is a reference, it cannot be changed.
818
+ */
819
+ MODIFICATION_OF_REFERENCED_PROPERTY:
820
+ "PR-142: Modifications of referenced properties are not allowed.",
821
+
822
+ /**
823
+ * methods: Property.getValue
824
+ *
825
+ * Property.getValue(in_ids) is a shortcut for Property.get(in_ids).getValue().
826
+ * Property.get(in_ids) must resolve to a ValueProperty.
827
+ */
828
+ GET_VALUE_NOT_A_VALUE: "PR-160: in_ids does not resolve to a ValueProperty: ",
829
+
830
+ /**
831
+ * methods: MapProperty.insert
832
+ *
833
+ * If your map is not a ValueMap, in_property must be an instance of BaseProperty.
834
+ * Use PropertyFactory.create to create an instance of a property.
835
+ */
836
+ NONVALUE_MAP_INSERT_PROP: "PR-161: In a map of properties, you can only insert properties.",
837
+
838
+ /**
839
+ * methods: PropertyFactory.create
840
+ *
841
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
842
+ * This error is thrown while creating a Property, when the actual context
843
+ * ('array', 'map', 'set' or 'single') is different than what was expected.
844
+ */
845
+ CONTEXT_NOT_AS_EXPECTED: "PR-163: Property context is different than expected: ",
846
+
847
+ /**
848
+ * methods: Property.deserialize
849
+ *
850
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
851
+ * This error is thrown by .deserialize but is caused by an invalid changeSet. A serialized ChangeSet for an
852
+ * Integer64Property must be an array of 2 integers: the low and the high values. Since users cannot yet supply
853
+ * their changesets directly, this should not happen.
854
+ */
855
+ INVALID_INT64_CHANGESET: "PR-164: Cannot deserialize invalid change set for Int64 property",
856
+
857
+ /**
858
+ * methods: StringProperty.set
859
+ *
860
+ * StringProperty.set takes two parameters: in_index (a number, the index of the string that you wish to change)
861
+ * and in_string (the string you want to insert at that index). To set the value of the whole string, use
862
+ * setValue.
863
+ */
864
+ STRING_SET_NEEDS_INDEX:
865
+ "PR-165: String.set first parameter should be an index (number). This is not valid: ",
866
+
867
+ /**
868
+ * methods: Property.get
869
+ *
870
+ * The token DEREFERENCE_TOKEN should only be used with .get when the in_ids passed to .get is an array.
871
+ * the DEREFERENCE_TOKEN should follow a path to a reference.
872
+ *
873
+ * @example Valid:
874
+ * ```typescript
875
+ * myProp.get(['myReference', TOKENS.DEREFERENCE_TOKEN])
876
+ * ```
877
+ *
878
+ * @example Not valid:
879
+ * ```typescript
880
+ * myProp.get('myReference').get(TOKENS.DEREFERENCE_TOKEN)
881
+ * ```
882
+ */
883
+ NO_GET_DEREFERENCE_ONLY: "PR-166: Cannot use a dereference token only with .get",
884
+
885
+ /**
886
+ * methods: StringProperty.setValues
887
+ *
888
+ * You cannot call .setValues on a StringProperty. To set the value of the string, use .setValue
889
+ * instead.
890
+ */
891
+ NO_VALUE_PROPERTY_SETVALUES: "PR-167: setValues is not a valid method for String Properties",
892
+
893
+ /**
894
+ * methods: Property.getRelativePath
895
+ *
896
+ * In cases where you have more than one repository reference property pointing to the same repository, finding a path
897
+ * between a properties in different repositories can lead to more than one valid results. In that case, .getRelativePath
898
+ * will return the first valid path it finds. If you want to control how which path is used, you should construct the
899
+ * string path by concatenating the absolute path for the prop in the nested repository and the relative path between your
900
+ * repository reference and the target property.
901
+ */
902
+ MORE_THAN_ONE_PATH: "PR-169: More than one paths exist between ",
903
+
904
+ /**
905
+ * methods: Property.getRelativePath
906
+ *
907
+ * getRelativePath takes one parameter: the property from which the path will start. This must be an instance of
908
+ * BaseProperty. The method will return the path from that property to the property on which it was called ('this')
909
+ */
910
+ IN_FROMPROPERTY_MUST_BE_PROPERTY:
911
+ "PR-170: getRelativePath parameter error: in_fromProperty must be a property",
912
+
913
+ /**
914
+ * methods: Property.getRelativePath
915
+ *
916
+ * getRelativePath does not return a path between a property that is inside a child repository to one that is in
917
+ * a parent repository. A path like this could not be used with .resolvePath or be used in a reference property
918
+ * because neither method can go from the root of a referenced repository to a reference property.
919
+ */
920
+ NO_PATH_FROM_CHILD_REPO:
921
+ "PR-171: cannot get a path from a child repository to a parent repository",
922
+
923
+ /**
924
+ * methods: getReferencedWorkspace
925
+ *
926
+ * This repository reference is in read-only mode. Call enableWrite() to access the workspace.
927
+ */
928
+ REPOSITORY_REFERENCE_WORKSPACE_READ_ONLY:
929
+ "PR-173: This repository reference is in read-only mode. Call enableWrite() to access the workspace.",
930
+
931
+ /**
932
+ * methods: Property.enableWrite
933
+ *
934
+ * Repository reference is already in writable mode.
935
+ */
936
+ REPOSITORY_REFERENCE_WORKSPACE_EXIST_ALREADY:
937
+ "PR-174: Repository reference is already in writable mode",
938
+
939
+ /**
940
+ * methods: Property.enableWrite
941
+ *
942
+ * Can't enable write on an empty repository reference without at least a repositoryGUID and branchGUID.
943
+ */
944
+ WRITABLE_REPOSITORY_REFERENCE_NEED_GUIDS:
945
+ "PR-176: Can't enable write on an empty repository reference without at least a repositoryGUID and branchGUID",
946
+
947
+ /**
948
+ * methods: Property.enableWrite
949
+ *
950
+ * Repository reference failed to automatically commit the new commitGUID.
951
+ */
952
+ WRITABLE_REPOSITORY_AUTO_COMMIT_FAIL:
953
+ "PR-177: Repository reference failed to automatically commit the new commitGUID",
954
+
955
+ /**
956
+ * methods: Property._setFollowBranch
957
+ *
958
+ * An unexpected error occurred while trying to switch a repository reference followBranch property
959
+ */
960
+ WRITABLE_REPOSITORY_SET_FOLLOW_BRANCH_FAILED:
961
+ "PR-178: An unexpected error occurred while trying to switch a repository reference followBranch property to ",
962
+
963
+ /**
964
+ * methods: MapProperty.insert, MapProperty.set
965
+ *
966
+ * .insert and .set take two parameters. The first one is in_id (or in_key), which is the id under
967
+ * which the property is added. It can not be an empty string.
968
+ */
969
+ ID_SHOULD_NOT_BE_EMPTY_STRING: "PR-179: id should not be an empty string.",
970
+
971
+ /**
972
+ * methods: StringProperty.set
973
+ *
974
+ * StringProperty.set: in_character must have a length of 1.
975
+ */
976
+ STRING_SET_ONE_CHAR:
977
+ "PR-180: String.set, only one character can be set (in_character must have a length of 1).",
978
+
979
+ /**
980
+ * methods: EnumArrayProperty.set
981
+ *
982
+ * EnumArrayProperty.set only accepts a string or number as input for in_value
983
+ */
984
+ VALUE_STRING_OR_NUMBER: "PR-181: in_value should be a string or a number. This is not valid: ",
985
+
986
+ /**
987
+ * methods: ArrayProperty.set
988
+ *
989
+ * The in_value input of ArrayProperty.set should not be an array.
990
+ */
991
+ ARRAY_SET_ONE_ELEMENT: "PR-182: in_value should be a single element. This is not valid: ",
992
+
993
+ CANT_DIRTY_MISSING_PROPERTY: "PR-183: Can't dirty missing property: ",
994
+
995
+ /**
996
+ * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
997
+ *
998
+ * The property you are trying to insert in your map property, set property or node property is a root.
999
+ */
1000
+ INSERTED_ROOT_ENTRY: "PR-184: Trying to insert a root property into a collection.",
1001
+
1002
+ /**
1003
+ * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
1004
+ *
1005
+ * The property you are trying to insert in your map property, set property or node property is already
1006
+ * a parent of the map, set, or node property. You cannot insert this property there or you would create
1007
+ * a cycle in your data tree.
1008
+ */
1009
+ INSERTED_IN_OWN_CHILDREN:
1010
+ "PR-185: Trying to insert a property in itself or in one of its children.",
1011
+
1012
+ /**
1013
+ * methods: MapProperty.insert, MapProperty.set, SetProperty.insert, NodeProperty.insert
1014
+ *
1015
+ * The property you are trying to insert (or at least one if its children) in your map property, set
1016
+ * property or node property is not covered by the paths of the partial checkout.
1017
+ * You cannot insert this property because you would not receive updates for this path after the
1018
+ * insertion and you could corrupt your data by doing subsequent modifications.
1019
+ */
1020
+ INSERTED_OUTSIDE_PATHS:
1021
+ "PR-186: Trying to insert a property outside the paths covered by the partial checkout.",
1022
+
1023
+ SHARED_BEFORE_INSERTED: "PR-187: Property must be inserted in the workspace before sharing.",
1024
+
1025
+ CUSTOM_ID_NOT_ALLOWED: "PR-188: The following property does not support custom id: ",
1003
1026
  };
1004
1027
 
1005
1028
  const PropertyFactoryError = {
1006
- /**
1007
- * methods: PropertyFactory.create
1008
- *
1009
- * Each property created with PropertyFactory.create should have a unique id. You should make sure your
1010
- * code generates a unique id for each property created, or make your property an instanced of NamedProperties
1011
- * (which are identified by a unique Urn)
1012
- */
1013
- OVERWRITING_ID: "PF-001: Id already exists: ",
1014
-
1015
- /**
1016
- * methods: PropertyFactory.register
1017
- *
1018
- * Warning: The template passed into the register method does not match the expected structure for this type.
1019
- */
1020
- TEMPLATE_MISMATCH: "PF-004: Template structures do not match for typeid: ",
1021
-
1022
- /**
1023
- * methods: PropertyFactory.register
1024
- *
1025
- * The typeid assigned to your property template should include a version.
1026
- * E.g. 1.0.0 - an example of a valid typeid: “my.example:point2d-1.0.0”
1027
- */
1028
- UNVERSIONED_TEMPLATE: "PF-005: Templates must be versioned.",
1029
-
1030
- /**
1031
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1032
- * Error occurs when a template has been inserted into the branch without a SEMVER version.
1033
- * This can occur when registering templates through the commit REST interface. At this point
1034
- * the data is corrupted and should be reported to the development team
1035
- */
1036
- UNVERSIONED_REMOTE_TEMPLATE: "PF-006: Internal error: Remote template is not versioned.",
1037
-
1038
- /**
1039
- * methods: PropertyFactory.create
1040
- *
1041
- * RepositoryReferences are not yet fully implemented. They will be soon.
1042
- */
1043
- REPOSITORY_REF_NOT_FULLY_IMPLEMENTED: "PF-007: Repository references are not yet fully implemented and may not " +
1044
- "yet be used",
1045
-
1046
- /**
1047
- * methods: PropertyFactory.create
1048
- *
1049
- * When using ‘inherits’ in your property template, it must be a string or an array.
1050
- *
1051
- * @example
1052
- * ```json
1053
- * {
1054
- * typeid:'my.example:point2d-1.0.0',
1055
- * inherits: ‘ another property’
1056
- * }
1057
- * ```
1058
- *
1059
- * or :
1060
- *
1061
- * ```json
1062
- * {
1063
- * typeid:'my.example:point2d-1.0.0',
1064
- * inherits: [‘another property’, ‘property2’]
1065
- * }
1066
- * ```
1067
- */
1068
- INHERITS_ARRAY_OR_STRING: "PF-008: Internal error: Inherits must be an Array or a String. This is not valid: ",
1069
-
1070
- /**
1071
- * methods: PropertyFactory.create
1072
- *
1073
- * Context can be ‘array, ‘set’, ‘map’, ‘enum’ or ‘single’. If not specified, will default to ‘single’.
1074
- */
1075
- UNKNOWN_CONTEXT_SPECIFIED: "PF-009: Unknown context specified: ",
1076
-
1077
- /**
1078
- * methods: PropertyFactory.create
1079
- *
1080
- * The property you entered into PropertyFactory.create has a typeid that is not registered.
1081
- * Make sure you register the template before creating an instance of that property. This could
1082
- * also be caused by a failure in the registration process.
1083
- */
1084
- UNKNOWN_TYPEID_SPECIFIED: "PF-010: Unknown typeid specified: ",
1085
-
1086
- /**
1087
- * methods: PropertyFactory.getAllParentsForTemplate, PropertyFactory.inheritsFrom
1088
- *
1089
- * Cannot find a template for this typeid. Make sure you registered the template and that the typeid
1090
- * is entered correctly. This can be an error with the template you are trying to insert or one of the
1091
- * templates it inherits from.
1092
- */
1093
- NON_EXISTING_TYPEID: "PF-011: Missing template for the property you entered or one of the templates it inherits from: ",
1094
-
1095
- /**
1096
- * methods: PropertyFactory.register
1097
- *
1098
- * The property you passed in to .register is a primitive property. These do not need to be registered with a
1099
- * typeid. It can be created without being registered. E.g. PropertyFactory.create(‘String’)
1100
- */
1101
- CANNOT_REGISTER_PRIMITIVE: "PF-012: Cannot register a primitive property with the public `register` " +
1102
- "function typeid = ",
1103
-
1104
- /**
1105
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1106
- *
1107
- * Your template’s id field must be a string.
1108
- */
1109
- DEFINITION_ID_MUST_BE_STRING: 'PF-024: Value "id" of a definition should be a string. "',
1110
-
1111
- /**
1112
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1113
- *
1114
- * The "$ref" keyword is used to reference a schema, and provides the ability to validate recursive structures
1115
- * through self-reference.
1116
- * An object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref"
1117
- * property MUST be a URI Reference (a string)
1118
- */
1119
- REF_SHOULD_BE_STRING: 'PF-025: Value of "$ref" should be a string. "',
1120
-
1121
- /**
1122
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1123
- *
1124
- * The identifier passed to $ref does not point to any schema.
1125
- */
1126
- COULD_NOT_FIND_REFERENCE: 'PF-026: Couldn\'t find reference "',
1127
-
1128
- /**
1129
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1130
- *
1131
- * The identifier passed to $ref does not point to an object.
1132
- */
1133
- REFERENCED_DEFINITION_SHOULD_BE_OBJECT: 'PF-027: A referenced definition should be an object. "',
1134
-
1135
- /**
1136
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1137
- *
1138
- * In a JSON schema, the properties field must be an object.
1139
- */
1140
- PROPERTIES_SHOULD_BE_OBJECT: 'PF-028: The "properties" value should be an object. "',
1141
-
1142
- /**
1143
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1144
- *
1145
- * oneOf’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1146
- * An instance validates successfully against this keyword if it validates successfully against exactly one
1147
- * schema defined by this keyword's value.
1148
- */
1149
- ONE_OF_ONLY_FOR_ARRAYS_OF_ONE_OBJECT: 'PF-029: The "oneOf" object is supported only for arrays of one object.',
1150
-
1151
- /**
1152
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1153
- *
1154
- * oneOf’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1155
- */
1156
- ONE_OF_SHOULD_CONTAIN_OBJECTS: 'PF-030: The "oneOf" array should contain objects. "',
1157
-
1158
- /**
1159
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1160
- *
1161
- * This keyword's value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1162
- */
1163
- ALL_OF_SHOULD_BE_ARRAY: 'PF-031: The "allOf" object should be an array.',
1164
-
1165
- /**
1166
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1167
- *
1168
- * This keyword's value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1169
- */
1170
- ALL_OF_SHOULD_CONTAIN_OBJECTS: 'PF-032: The "allOf" array should contain objects. Element ',
1171
-
1172
- /**
1173
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1174
- *
1175
- * Your schema definition contains infinite recursion. For example, if your definition ‘a’ refers to definition
1176
- * ‘b’ as being one of its children and ‘b’ refers to ‘a’ as one of its children.
1177
- */
1178
- INFINITE_RECURSION: "PF-033: Infinite recursion detected in path: ",
1179
-
1180
- /**
1181
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1182
- *
1183
- * One part of your template object might contain something that is not of type ‘object’, ‘string’,
1184
- * ‘number’ or ‘integer’.
1185
- */
1186
- UNSUPPORTED_VALUE_TYPE: 'PF-034: Unsupported value of field "type": ',
1187
-
1188
- REQUIRED_PROPERTY_NAME_NOT_STRING: 'PF-035: Required property name should be a string, "',
1189
-
1190
- /**
1191
- * This property is required but it is not listed in the properties field.
1192
- */
1193
- PROPERTY_NAME_DOES_NOT_MATCH: "PF-036: Required property name does not match any property in object: ",
1194
-
1195
- /**
1196
- * The ‘inherits’ field in your template object should be a string or an array of strings.
1197
- */
1198
- INHERITS_SHOULD_BE_STRING: 'PF-037: The "inherits" object should be a string or an array of strings. This is not valid: ',
1199
-
1200
- /**
1201
- * The ‘context’ field in your template should be a string.
1202
- */
1203
- CONTEXT_SHOULD_BE_STRING: 'PF-038: The "context" value should be a string. This is not valid: ',
1204
-
1205
- /**
1206
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1207
- *
1208
- * Warning: If you have a length’ field in your template and the context is not set to ‘array’,
1209
- * ‘length’ will be ignored.
1210
- */
1211
- IGNORING_LENGTH_NOT_ARRAY: 'PF-039: ignoring "length" value since "context" is not "array".',
1212
-
1213
- /**
1214
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1215
- *
1216
- * In your template, the field ‘length’ should be a number.
1217
- */
1218
- LENGTH_SHOULD_BE_NUMBER: 'PF-040: The "length" value should be a number. This is not valid: ',
1219
-
1220
- /**
1221
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1222
- *
1223
- * Your template contains more than one definition field for this field.
1224
- */
1225
- DUPLICATE_DEFINITION: "PF-041: Duplicate definition for ",
1226
-
1227
- /**
1228
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1229
- *
1230
- * The field ‘id’ is missing from your JSON schema.
1231
- */
1232
- FIELD_ID_IS_REQUIRED: 'PF-042: Field "id" is required.',
1233
-
1234
- /**
1235
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1236
- *
1237
- * You need a typeidfield in your template schema.
1238
- *
1239
- * @example
1240
- * ```json
1241
- * {
1242
- * ‘typeid’: 'autodesk.test:set.set-1.0.0',
1243
- * ‘properties’: [
1244
- * {‘typeid’: 'String',
1245
- * ‘context’: 'set',
1246
- * ‘id’: 'DummySet',
1247
- * ‘inherits’:['NamedProperty']}
1248
- * ]
1249
- * }
1250
- *```
1251
- */
1252
- FIELD_TYPEID_IS_REQUIRED: 'PF-043: Field "typeid" is required. It is the "typeid" of the resulting ' +
1253
- "PropertySets Template.",
1254
-
1255
- /**
1256
- * methods: PropertyFactory.register
1257
- *
1258
- * The ‘length’ field in your template must be a number.
1259
- */
1260
- LENGTH_MUST_BE_NUMBER: "PF-045: length must be a number. This is not valid: ",
1261
-
1262
- /**
1263
- * methods: PropertyFactory.register
1264
- *
1265
- * Each entry in your enum property array must have an id.
1266
- *
1267
- * @example
1268
- * ```json
1269
- * {
1270
- * "typeid": "Adsk.Core:Units.Metric-1.0.0",
1271
- * "inherits": "Enum",
1272
- * "annotation": { "description": "The metric units" },
1273
- * "properties": [
1274
- * { "id": "m" , "value": 1, "annotation": { "description": "meter" }},
1275
- * { "id": "cm", "value": 2, "annotation": { "description": "centimeter" }},
1276
- * { "id": "mm", "value": 3, "annotation": { "description": "millimeter" }}
1277
- * ]
1278
- * }
1279
- * ```
1280
- */
1281
- ENUM_TYPEID_MISSING: "PF-046: Enum: typeid missing",
1282
-
1283
- /**
1284
- * methods: PropertyTemplate constructor
1285
- *
1286
- * Each entry in your enum property must have a value that is a number.
1287
- *
1288
- * @example
1289
- * ```json
1290
- * {
1291
- * "typeid": "Adsk.Core:Units.Metric-1.0.0",
1292
- * "inherits": "Enum",
1293
- * "annotation": { "description": "The metric units" },
1294
- * "properties": [
1295
- * { "id": "m" , "value": 1, "annotation": { "description": "meter" }},
1296
- * { "id": "cm", "value": 2, "annotation": { "description": "centimeter" }},
1297
- * { "id": "mm", "value": 3, "annotation": { "description": "millimeter" }}
1298
- * ]
1299
- * }
1300
- * ```
1301
- */
1302
- ENUM_VALUE_NOT_NUMBER: "PF-047: Enum: value must be a number. This is not valid: ",
1303
-
1304
- /**
1305
- * methods: PropertyTemplate.getVersion
1306
- *
1307
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1308
- * Warning: you that the template on which you are calling the .getVersion method is not versioned.
1309
- * The method will return undefined. This should not happen as we now validate that all templates are
1310
- * versioned when registering them.
1311
- */
1312
- TEMPLATE_NOT_VERSIONED: "PF-048: Internal error: Template is not versioned.",
1313
-
1314
- /**
1315
- * methods: PropertyFactory.register
1316
- *
1317
- * Warning: Template already exists. The incoming template MUST match what is currently registered.
1318
- * If they do not match, an error will be thrown letting you know that the templates are incompatible.
1319
- * See error PF-004
1320
- */
1321
- REGISTERING_EXISTING_TYPEID: "PF-049: Registering a typeid that already exists typeid = ",
1322
-
1323
- /**
1324
- * methods: PropertyFactory.register
1325
- *
1326
- * There were errors validating the template you are trying to register. See detailed errors attached.
1327
- */
1328
- FAILED_TO_REGISTER: "PF-050: Failed to register typeid = ",
1329
-
1330
- /**
1331
- * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1332
- *
1333
- * So far, these methods can only convert from a JSON schema. The first parameter (in_fromType)
1334
- * must be ‘JSONSchema’.
1335
- */
1336
- UNKNOWN_TYPE: "PF-051: Unknown type: ",
1337
-
1338
- /**
1339
- * methods: PropertyTemplate.serializeCanonical
1340
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1341
- * This error shouldn’t occur. The underlying private function that is called is a close cousin of the
1342
- * deepCopy function which could have an arbitrary target specified. This doesn’t happen in the case of
1343
- * the serializeCanonical.
1344
- */
1345
- INVALID_TARGET_PROPERTY_TEMPLATE: "PF-053 Copying into incompatible target property template: ",
1346
-
1347
- /**
1348
- * methods: PropertyFactory.loadTemplate
1349
- *
1350
- * In order for the PropertyFactory to retrieve templates from remote store it has to have at least one store
1351
- * interface to interact with. This is accomplished by making the PropertyFactory.addStore call.
1352
- */
1353
- MISSING_CASE_IN_TEMPLATE_SERIALIZATION: "PF-054 Missing case in template canonical serialization: ",
1354
-
1355
- OVERRIDDING_INHERITED_TYPES: "PF-057: Overriding of inherited typed properties is not allowed: ",
1356
-
1357
- /**
1358
- * methods: PropertyFactory.register
1359
- *
1360
- * PropertyFactory.register takes one parameter, which can be a string (typeid), a json object (a template) or an
1361
- * array of these.
1362
- */
1363
- ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT: "PF-058: register only accepts strings, json structures or array of those",
1364
-
1365
- /**
1366
- * methods: PropertyFactory.resolve
1367
- *
1368
- * No store has been added yet to the PropertyFactory. A template store has to be instantiated then added with
1369
- * propertyFactory.addStore()
1370
- */
1371
- NO_STORE_HAS_BEEN_INITIALIZED_YET: "PF-059: No store has been initialized yet to the PropertyFactory.",
1372
-
1373
- /**
1374
- * methods: PropertyFactory.resolve
1375
- *
1376
- * resolve cannot be called until previous call to resolve has completed.
1377
- */
1378
- DEPENDENCIES_RESOLUTION_IN_PROGRESS: "PF-060: Dependencies resolution already in progress",
1379
-
1380
- /**
1381
- * methods: PropertyFactory.create
1382
- *
1383
- * Typed values must contain properties that inherit from the base type.
1384
- */
1385
- TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE: "PF-061: Typed values must be derived from base type: ",
1386
-
1387
- /**
1388
- * methods: PropertyFactory.create
1389
- *
1390
- * The field ‘value’ is missing from your JSON schema.
1391
- */
1392
- FIELD_VALUE_IS_REQUIRED: 'PF-062: Field "value" is required: ',
1393
-
1394
- /**
1395
- * methods: PropertyFactory.register
1396
- *
1397
- * Warning: The structure of the template passed into the register method does not match the structure of a
1398
- * remote template registered under the same typeid.
1399
- */
1400
- REMOTE_TEMPLATE_MISMATCH: "PF-064: Template structures do not match an already registered remote template with the same typeid for typeid: ",
1401
-
1402
- /**
1403
- * methods: PropertyFactory.initializeSchemaStore
1404
- *
1405
- * Warning: The initializeSchemaStore method must be provided with an options object
1406
- * containing a getBearerToken function and the url to the ForgeSchemaService.
1407
- */
1408
- MISSING_FSS_INIT_OPTIONS: "PF-065: The initializeSchemaStore method must be provided with an options object " +
1409
- "containing a getBearerToken function and the url to the ForgeSchemaService.",
1410
-
1411
- /**
1412
- * methods: PropertyFactory.initializeSchemaStore
1413
- *
1414
- * Warning: The initializeSchemaStore method url option must be passed a valid base url.
1415
- */
1416
- FSS_BASEURL_WRONG: "PF-066: The initializeSchemaStore method url option must be passed a valid base url.",
1417
-
1418
- /**
1419
- * methods: PropertyFactory.create
1420
- *
1421
- * Overridden properties must have same context as the base type.
1422
- */
1423
- OVERRIDEN_PROP_MUST_HAVE_SAME_CONTEXT_AS_BASE_TYPE: "PF-067: Overridden properties must have same context as the base type: ",
1424
-
1425
- /**
1426
- * methods: PropertyFactory.create
1427
- *
1428
- * Primitive types does not support typedValues.
1429
- */
1430
- TYPED_VALUES_FOR_PRIMITIVES_NOT_SUPPORTED: "PF-068: Primitive types does not support typedValues: ",
1431
-
1432
- /**
1433
- * methods: PropertyFactory.inheritsFrom
1434
- */
1435
- TYPEID_IS_NOT_ENUM: "PF-069: The provided type does not inherit from Enum: ",
1029
+ /**
1030
+ * methods: PropertyFactory.create
1031
+ *
1032
+ * Each property created with PropertyFactory.create should have a unique id. You should make sure your
1033
+ * code generates a unique id for each property created, or make your property an instanced of NamedProperties
1034
+ * (which are identified by a unique Urn)
1035
+ */
1036
+ OVERWRITING_ID: "PF-001: Id already exists: ",
1037
+
1038
+ /**
1039
+ * methods: PropertyFactory.register
1040
+ *
1041
+ * Warning: The template passed into the register method does not match the expected structure for this type.
1042
+ */
1043
+ TEMPLATE_MISMATCH: "PF-004: Template structures do not match for typeid: ",
1044
+
1045
+ /**
1046
+ * methods: PropertyFactory.register
1047
+ *
1048
+ * The typeid assigned to your property template should include a version.
1049
+ * E.g. 1.0.0 - an example of a valid typeid: “my.example:point2d-1.0.0”
1050
+ */
1051
+ UNVERSIONED_TEMPLATE: "PF-005: Templates must be versioned.",
1052
+
1053
+ /**
1054
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1055
+ * Error occurs when a template has been inserted into the branch without a SEMVER version.
1056
+ * This can occur when registering templates through the commit REST interface. At this point
1057
+ * the data is corrupted and should be reported to the development team
1058
+ */
1059
+ UNVERSIONED_REMOTE_TEMPLATE: "PF-006: Internal error: Remote template is not versioned.",
1060
+
1061
+ /**
1062
+ * methods: PropertyFactory.create
1063
+ *
1064
+ * RepositoryReferences are not yet fully implemented. They will be soon.
1065
+ */
1066
+ REPOSITORY_REF_NOT_FULLY_IMPLEMENTED:
1067
+ "PF-007: Repository references are not yet fully implemented and may not " + "yet be used",
1068
+
1069
+ /**
1070
+ * methods: PropertyFactory.create
1071
+ *
1072
+ * When using ‘inherits’ in your property template, it must be a string or an array.
1073
+ *
1074
+ * @example
1075
+ * ```json
1076
+ * {
1077
+ * typeid:'my.example:point2d-1.0.0',
1078
+ * inherits: ‘ another property’
1079
+ * }
1080
+ * ```
1081
+ *
1082
+ * or :
1083
+ *
1084
+ * ```json
1085
+ * {
1086
+ * typeid:'my.example:point2d-1.0.0',
1087
+ * inherits: [‘another property’, ‘property2’]
1088
+ * }
1089
+ * ```
1090
+ */
1091
+ INHERITS_ARRAY_OR_STRING:
1092
+ "PF-008: Internal error: Inherits must be an Array or a String. This is not valid: ",
1093
+
1094
+ /**
1095
+ * methods: PropertyFactory.create
1096
+ *
1097
+ * Context can be ‘array, ‘set’, ‘map’, ‘enum’ or ‘single’. If not specified, will default to ‘single’.
1098
+ */
1099
+ UNKNOWN_CONTEXT_SPECIFIED: "PF-009: Unknown context specified: ",
1100
+
1101
+ /**
1102
+ * methods: PropertyFactory.create
1103
+ *
1104
+ * The property you entered into PropertyFactory.create has a typeid that is not registered.
1105
+ * Make sure you register the template before creating an instance of that property. This could
1106
+ * also be caused by a failure in the registration process.
1107
+ */
1108
+ UNKNOWN_TYPEID_SPECIFIED: "PF-010: Unknown typeid specified: ",
1109
+
1110
+ /**
1111
+ * methods: PropertyFactory.getAllParentsForTemplate, PropertyFactory.inheritsFrom
1112
+ *
1113
+ * Cannot find a template for this typeid. Make sure you registered the template and that the typeid
1114
+ * is entered correctly. This can be an error with the template you are trying to insert or one of the
1115
+ * templates it inherits from.
1116
+ */
1117
+ NON_EXISTING_TYPEID:
1118
+ "PF-011: Missing template for the property you entered or one of the templates it inherits from: ",
1119
+
1120
+ /**
1121
+ * methods: PropertyFactory.register
1122
+ *
1123
+ * The property you passed in to .register is a primitive property. These do not need to be registered with a
1124
+ * typeid. It can be created without being registered. E.g. PropertyFactory.create(‘String’)
1125
+ */
1126
+ CANNOT_REGISTER_PRIMITIVE:
1127
+ "PF-012: Cannot register a primitive property with the public `register` " +
1128
+ "function typeid = ",
1129
+
1130
+ /**
1131
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1132
+ *
1133
+ * Your template’s id field must be a string.
1134
+ */
1135
+ DEFINITION_ID_MUST_BE_STRING: 'PF-024: Value "id" of a definition should be a string. "',
1136
+
1137
+ /**
1138
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1139
+ *
1140
+ * The "$ref" keyword is used to reference a schema, and provides the ability to validate recursive structures
1141
+ * through self-reference.
1142
+ * An object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref"
1143
+ * property MUST be a URI Reference (a string)
1144
+ */
1145
+ REF_SHOULD_BE_STRING: 'PF-025: Value of "$ref" should be a string. "',
1146
+
1147
+ /**
1148
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1149
+ *
1150
+ * The identifier passed to $ref does not point to any schema.
1151
+ */
1152
+ COULD_NOT_FIND_REFERENCE: "PF-026: Couldn't find reference \"",
1153
+
1154
+ /**
1155
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1156
+ *
1157
+ * The identifier passed to $ref does not point to an object.
1158
+ */
1159
+ REFERENCED_DEFINITION_SHOULD_BE_OBJECT:
1160
+ 'PF-027: A referenced definition should be an object. "',
1161
+
1162
+ /**
1163
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1164
+ *
1165
+ * In a JSON schema, the properties field must be an object.
1166
+ */
1167
+ PROPERTIES_SHOULD_BE_OBJECT: 'PF-028: The "properties" value should be an object. "',
1168
+
1169
+ /**
1170
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1171
+ *
1172
+ * oneOf’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1173
+ * An instance validates successfully against this keyword if it validates successfully against exactly one
1174
+ * schema defined by this keyword's value.
1175
+ */
1176
+ ONE_OF_ONLY_FOR_ARRAYS_OF_ONE_OBJECT:
1177
+ 'PF-029: The "oneOf" object is supported only for arrays of one object.',
1178
+
1179
+ /**
1180
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1181
+ *
1182
+ * oneOf’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1183
+ */
1184
+ ONE_OF_SHOULD_CONTAIN_OBJECTS: 'PF-030: The "oneOf" array should contain objects. "',
1185
+
1186
+ /**
1187
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1188
+ *
1189
+ * This keyword's value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1190
+ */
1191
+ ALL_OF_SHOULD_BE_ARRAY: 'PF-031: The "allOf" object should be an array.',
1192
+
1193
+ /**
1194
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1195
+ *
1196
+ * This keyword's value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
1197
+ */
1198
+ ALL_OF_SHOULD_CONTAIN_OBJECTS: 'PF-032: The "allOf" array should contain objects. Element ',
1199
+
1200
+ /**
1201
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1202
+ *
1203
+ * Your schema definition contains infinite recursion. For example, if your definition ‘a’ refers to definition
1204
+ * ‘b’ as being one of its children and ‘b’ refers to ‘a’ as one of its children.
1205
+ */
1206
+ INFINITE_RECURSION: "PF-033: Infinite recursion detected in path: ",
1207
+
1208
+ /**
1209
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1210
+ *
1211
+ * One part of your template object might contain something that is not of type ‘object’, ‘string’,
1212
+ * ‘number’ or ‘integer’.
1213
+ */
1214
+ UNSUPPORTED_VALUE_TYPE: 'PF-034: Unsupported value of field "type": ',
1215
+
1216
+ REQUIRED_PROPERTY_NAME_NOT_STRING: 'PF-035: Required property name should be a string, "',
1217
+
1218
+ /**
1219
+ * This property is required but it is not listed in the properties field.
1220
+ */
1221
+ PROPERTY_NAME_DOES_NOT_MATCH:
1222
+ "PF-036: Required property name does not match any property in object: ",
1223
+
1224
+ /**
1225
+ * The ‘inherits’ field in your template object should be a string or an array of strings.
1226
+ */
1227
+ INHERITS_SHOULD_BE_STRING:
1228
+ 'PF-037: The "inherits" object should be a string or an array of strings. This is not valid: ',
1229
+
1230
+ /**
1231
+ * Thecontext’ field in your template should be a string.
1232
+ */
1233
+ CONTEXT_SHOULD_BE_STRING: 'PF-038: The "context" value should be a string. This is not valid: ',
1234
+
1235
+ /**
1236
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1237
+ *
1238
+ * Warning: If you have a ‘length’ field in your template and the context is not set to ‘array’,
1239
+ * ‘length’ will be ignored.
1240
+ */
1241
+ IGNORING_LENGTH_NOT_ARRAY: 'PF-039: ignoring "length" value since "context" is not "array".',
1242
+
1243
+ /**
1244
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1245
+ *
1246
+ * In your template, the field ‘length’ should be a number.
1247
+ */
1248
+ LENGTH_SHOULD_BE_NUMBER: 'PF-040: The "length" value should be a number. This is not valid: ',
1249
+
1250
+ /**
1251
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1252
+ *
1253
+ * Your template contains more than one definition field for this field.
1254
+ */
1255
+ DUPLICATE_DEFINITION: "PF-041: Duplicate definition for ",
1256
+
1257
+ /**
1258
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1259
+ *
1260
+ * The fieldidis missing from your JSON schema.
1261
+ */
1262
+ FIELD_ID_IS_REQUIRED: 'PF-042: Field "id" is required.',
1263
+
1264
+ /**
1265
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1266
+ *
1267
+ * You need a ‘typeid field in your template schema.
1268
+ *
1269
+ * @example
1270
+ * ```json
1271
+ * {
1272
+ * ‘typeid’: 'autodesk.test:set.set-1.0.0',
1273
+ * ‘properties’: [
1274
+ * {‘typeid’: 'String',
1275
+ * ‘context’: 'set',
1276
+ * ‘id’: 'DummySet',
1277
+ * ‘inherits’:['NamedProperty']}
1278
+ * ]
1279
+ * }
1280
+ *```
1281
+ */
1282
+ FIELD_TYPEID_IS_REQUIRED:
1283
+ 'PF-043: Field "typeid" is required. It is the "typeid" of the resulting ' +
1284
+ "PropertySets Template.",
1285
+
1286
+ /**
1287
+ * methods: PropertyFactory.register
1288
+ *
1289
+ * The ‘length’ field in your template must be a number.
1290
+ */
1291
+ LENGTH_MUST_BE_NUMBER: "PF-045: length must be a number. This is not valid: ",
1292
+
1293
+ /**
1294
+ * methods: PropertyFactory.register
1295
+ *
1296
+ * Each entry in your enum property array must have an id.
1297
+ *
1298
+ * @example
1299
+ * ```json
1300
+ * {
1301
+ * "typeid": "Adsk.Core:Units.Metric-1.0.0",
1302
+ * "inherits": "Enum",
1303
+ * "annotation": { "description": "The metric units" },
1304
+ * "properties": [
1305
+ * { "id": "m" , "value": 1, "annotation": { "description": "meter" }},
1306
+ * { "id": "cm", "value": 2, "annotation": { "description": "centimeter" }},
1307
+ * { "id": "mm", "value": 3, "annotation": { "description": "millimeter" }}
1308
+ * ]
1309
+ * }
1310
+ * ```
1311
+ */
1312
+ ENUM_TYPEID_MISSING: "PF-046: Enum: typeid missing",
1313
+
1314
+ /**
1315
+ * methods: PropertyTemplate constructor
1316
+ *
1317
+ * Each entry in your enum property must have a value that is a number.
1318
+ *
1319
+ * @example
1320
+ * ```json
1321
+ * {
1322
+ * "typeid": "Adsk.Core:Units.Metric-1.0.0",
1323
+ * "inherits": "Enum",
1324
+ * "annotation": { "description": "The metric units" },
1325
+ * "properties": [
1326
+ * { "id": "m" , "value": 1, "annotation": { "description": "meter" }},
1327
+ * { "id": "cm", "value": 2, "annotation": { "description": "centimeter" }},
1328
+ * { "id": "mm", "value": 3, "annotation": { "description": "millimeter" }}
1329
+ * ]
1330
+ * }
1331
+ * ```
1332
+ */
1333
+ ENUM_VALUE_NOT_NUMBER: "PF-047: Enum: value must be a number. This is not valid: ",
1334
+
1335
+ /**
1336
+ * methods: PropertyTemplate.getVersion
1337
+ *
1338
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1339
+ * Warning: you that the template on which you are calling the .getVersion method is not versioned.
1340
+ * The method will return undefined. This should not happen as we now validate that all templates are
1341
+ * versioned when registering them.
1342
+ */
1343
+ TEMPLATE_NOT_VERSIONED: "PF-048: Internal error: Template is not versioned.",
1344
+
1345
+ /**
1346
+ * methods: PropertyFactory.register
1347
+ *
1348
+ * Warning: Template already exists. The incoming template MUST match what is currently registered.
1349
+ * If they do not match, an error will be thrown letting you know that the templates are incompatible.
1350
+ * See error PF-004
1351
+ */
1352
+ REGISTERING_EXISTING_TYPEID: "PF-049: Registering a typeid that already exists typeid = ",
1353
+
1354
+ /**
1355
+ * methods: PropertyFactory.register
1356
+ *
1357
+ * There were errors validating the template you are trying to register. See detailed errors attached.
1358
+ */
1359
+ FAILED_TO_REGISTER: "PF-050: Failed to register typeid = ",
1360
+
1361
+ /**
1362
+ * methods: PropertyFactory.convertToTemplates, PropertyFactory.registerFrom
1363
+ *
1364
+ * So far, these methods can only convert from a JSON schema. The first parameter (in_fromType)
1365
+ * must be ‘JSONSchema’.
1366
+ */
1367
+ UNKNOWN_TYPE: "PF-051: Unknown type: ",
1368
+
1369
+ /**
1370
+ * methods: PropertyTemplate.serializeCanonical
1371
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1372
+ * This error shouldn’t occur. The underlying private function that is called is a close cousin of the
1373
+ * deepCopy function which could have an arbitrary target specified. This doesn’t happen in the case of
1374
+ * the serializeCanonical.
1375
+ */
1376
+ INVALID_TARGET_PROPERTY_TEMPLATE: "PF-053 Copying into incompatible target property template: ",
1377
+
1378
+ /**
1379
+ * methods: PropertyFactory.loadTemplate
1380
+ *
1381
+ * In order for the PropertyFactory to retrieve templates from remote store it has to have at least one store
1382
+ * interface to interact with. This is accomplished by making the PropertyFactory.addStore call.
1383
+ */
1384
+ MISSING_CASE_IN_TEMPLATE_SERIALIZATION:
1385
+ "PF-054 Missing case in template canonical serialization: ",
1386
+
1387
+ OVERRIDDING_INHERITED_TYPES:
1388
+ "PF-057: Overriding of inherited typed properties is not allowed: ",
1389
+
1390
+ /**
1391
+ * methods: PropertyFactory.register
1392
+ *
1393
+ * PropertyFactory.register takes one parameter, which can be a string (typeid), a json object (a template) or an
1394
+ * array of these.
1395
+ */
1396
+ ATTEMPT_TO_REGISTER_WITH_BAD_ARGUMENT:
1397
+ "PF-058: register only accepts strings, json structures or array of those",
1398
+
1399
+ /**
1400
+ * methods: PropertyFactory.resolve
1401
+ *
1402
+ * No store has been added yet to the PropertyFactory. A template store has to be instantiated then added with
1403
+ * propertyFactory.addStore()
1404
+ */
1405
+ NO_STORE_HAS_BEEN_INITIALIZED_YET:
1406
+ "PF-059: No store has been initialized yet to the PropertyFactory.",
1407
+
1408
+ /**
1409
+ * methods: PropertyFactory.resolve
1410
+ *
1411
+ * resolve cannot be called until previous call to resolve has completed.
1412
+ */
1413
+ DEPENDENCIES_RESOLUTION_IN_PROGRESS: "PF-060: Dependencies resolution already in progress",
1414
+
1415
+ /**
1416
+ * methods: PropertyFactory.create
1417
+ *
1418
+ * Typed values must contain properties that inherit from the base type.
1419
+ */
1420
+ TYPED_VALUES_MUST_DERIVE_FROM_BASE_TYPE:
1421
+ "PF-061: Typed values must be derived from base type: ",
1422
+
1423
+ /**
1424
+ * methods: PropertyFactory.create
1425
+ *
1426
+ * The field ‘value’ is missing from your JSON schema.
1427
+ */
1428
+ FIELD_VALUE_IS_REQUIRED: 'PF-062: Field "value" is required: ',
1429
+
1430
+ /**
1431
+ * methods: PropertyFactory.register
1432
+ *
1433
+ * Warning: The structure of the template passed into the register method does not match the structure of a
1434
+ * remote template registered under the same typeid.
1435
+ */
1436
+ REMOTE_TEMPLATE_MISMATCH:
1437
+ "PF-064: Template structures do not match an already registered remote template with the same typeid for typeid: ",
1438
+
1439
+ /**
1440
+ * methods: PropertyFactory.initializeSchemaStore
1441
+ *
1442
+ * Warning: The initializeSchemaStore method must be provided with an options object
1443
+ * containing a getBearerToken function and the url to the ForgeSchemaService.
1444
+ */
1445
+ MISSING_FSS_INIT_OPTIONS:
1446
+ "PF-065: The initializeSchemaStore method must be provided with an options object " +
1447
+ "containing a getBearerToken function and the url to the ForgeSchemaService.",
1448
+
1449
+ /**
1450
+ * methods: PropertyFactory.initializeSchemaStore
1451
+ *
1452
+ * Warning: The initializeSchemaStore method url option must be passed a valid base url.
1453
+ */
1454
+ FSS_BASEURL_WRONG:
1455
+ "PF-066: The initializeSchemaStore method url option must be passed a valid base url.",
1456
+
1457
+ /**
1458
+ * methods: PropertyFactory.create
1459
+ *
1460
+ * Overridden properties must have same context as the base type.
1461
+ */
1462
+ OVERRIDEN_PROP_MUST_HAVE_SAME_CONTEXT_AS_BASE_TYPE:
1463
+ "PF-067: Overridden properties must have same context as the base type: ",
1464
+
1465
+ /**
1466
+ * methods: PropertyFactory.create
1467
+ *
1468
+ * Primitive types does not support typedValues.
1469
+ */
1470
+ TYPED_VALUES_FOR_PRIMITIVES_NOT_SUPPORTED:
1471
+ "PF-068: Primitive types does not support typedValues: ",
1472
+
1473
+ /**
1474
+ * methods: PropertyFactory.inheritsFrom
1475
+ */
1476
+ TYPEID_IS_NOT_ENUM: "PF-069: The provided type does not inherit from Enum: ",
1436
1477
  };
1437
1478
 
1438
1479
  const RepositoryError = {
1439
-
1440
- /**
1441
- * methods: NodeProperty.remove
1442
- *
1443
- * The property you tried to remove does not exist (its id was not found) - check that the id is correct
1444
- * and that the property has not already been removed.
1445
- */
1446
- REMOVING_NON_EXISTING_ID: "RE-001: Removing non existing id: ",
1447
-
1448
- /**
1449
- * methods: BranchNode.isEqual, CommitNode.isEqual
1450
- *
1451
- * In_node parameter is required. In_node is the branch or commit you wish to compare to ‘this’ branch/commit
1452
- * node to check for equality.
1453
- */
1454
- MISSING_IN_NODE_PARAM: "RE-004: BranchNode.isEqual / CommitNode.isEqual missing " +
1455
- "parameter: in_node",
1456
-
1457
- /**
1458
- * methods: BranchNode, CommitNode, Workspace.commit
1459
- *
1460
- * The BranchNode or CommitNode constructor was called without in_params.guid or we tried to send a commit
1461
- * without a guid.
1462
- */
1463
- MISSING_GUID_FIELD: "RE-006: Missing guid field",
1464
-
1465
- /**
1466
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1467
- */
1468
- LOCAL_AND_REMOTE_BRANCH_NOT_EQUAL: "RE-007: Remote branch urn must equal the local branch urn",
1469
-
1470
- /**
1471
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1472
- */
1473
- BRANCH_NOT_REMOTE_BRANCH: "RE-008: Branch is not a remote branch ",
1474
-
1475
- /**
1476
- * now rebasing to \<commit guid\>'
1477
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1478
- * A commit node already rebased has been rebased again.
1479
- */
1480
- COMMIT_ALREADY_REBASED: "RE-009: Should not rebase commit more than once: ",
1481
-
1482
- /**
1483
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1484
- * A new commit has been received from the server but was not expected. See specific message for more details.
1485
- */
1486
- UNEXPECTED_COMMIT_FROM_SERVER: "RE-010: Adding commit to remote branch ",
1487
-
1488
- /**
1489
- * This error will occur if the repository associated to a branch hasn't been found.
1490
- */
1491
- REPOSITORY_NOT_FOUND: "RE-011: Internal Error: The repository hasn't been found.",
1492
-
1493
- /**
1494
- * This error will occur if the branch within a repository hasn't been found.
1495
- */
1496
- BRANCH_NOT_FOUND: "RE-012: The branch hasn't been found.",
1480
+ /**
1481
+ * methods: NodeProperty.remove
1482
+ *
1483
+ * The property you tried to remove does not exist (its id was not found) - check that the id is correct
1484
+ * and that the property has not already been removed.
1485
+ */
1486
+ REMOVING_NON_EXISTING_ID: "RE-001: Removing non existing id: ",
1487
+
1488
+ /**
1489
+ * methods: BranchNode.isEqual, CommitNode.isEqual
1490
+ *
1491
+ * In_node parameter is required. In_node is the branch or commit you wish to compare to ‘this’ branch/commit
1492
+ * node to check for equality.
1493
+ */
1494
+ MISSING_IN_NODE_PARAM:
1495
+ "RE-004: BranchNode.isEqual / CommitNode.isEqual missing " + "parameter: in_node",
1496
+
1497
+ /**
1498
+ * methods: BranchNode, CommitNode, Workspace.commit
1499
+ *
1500
+ * The BranchNode or CommitNode constructor was called without in_params.guid or we tried to send a commit
1501
+ * without a guid.
1502
+ */
1503
+ MISSING_GUID_FIELD: "RE-006: Missing guid field",
1504
+
1505
+ /**
1506
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1507
+ */
1508
+ LOCAL_AND_REMOTE_BRANCH_NOT_EQUAL: "RE-007: Remote branch urn must equal the local branch urn",
1509
+
1510
+ /**
1511
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1512
+ */
1513
+ BRANCH_NOT_REMOTE_BRANCH: "RE-008: Branch is not a remote branch ",
1514
+
1515
+ /**
1516
+ * now rebasing to \<commit guid\>'
1517
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1518
+ * A commit node already rebased has been rebased again.
1519
+ */
1520
+ COMMIT_ALREADY_REBASED: "RE-009: Should not rebase commit more than once: ",
1521
+
1522
+ /**
1523
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1524
+ * A new commit has been received from the server but was not expected. See specific message for more details.
1525
+ */
1526
+ UNEXPECTED_COMMIT_FROM_SERVER: "RE-010: Adding commit to remote branch ",
1527
+
1528
+ /**
1529
+ * This error will occur if the repository associated to a branch hasn't been found.
1530
+ */
1531
+ REPOSITORY_NOT_FOUND: "RE-011: Internal Error: The repository hasn't been found.",
1532
+
1533
+ /**
1534
+ * This error will occur if the branch within a repository hasn't been found.
1535
+ */
1536
+ BRANCH_NOT_FOUND: "RE-012: The branch hasn't been found.",
1497
1537
  };
1498
1538
 
1499
1539
  const ServerError = {
1500
- /**
1501
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1502
- */
1503
- URL_MUST_BE_STRING: "SE-001: Url must be a string.",
1504
-
1505
- /**
1506
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1507
- */
1508
- PORT_MUST_BE_NUMBER: "SE-002: Port must be a number",
1540
+ /**
1541
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1542
+ */
1543
+ URL_MUST_BE_STRING: "SE-001: Url must be a string.",
1544
+
1545
+ /**
1546
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1547
+ */
1548
+ PORT_MUST_BE_NUMBER: "SE-002: Port must be a number",
1509
1549
  };
1510
1550
 
1511
1551
  const ChangeSetError = {
1512
- /**
1513
- * Context can only be ‘single’, ‘array’, ‘map’, ‘set’ or ‘enum’. All other values are invalid.
1514
- */
1515
- UNKNOWN_CONTEXT: "CS-001: Unknown context: ",
1552
+ /**
1553
+ * Context can only be ‘single’, ‘array’, ‘map’, ‘set’ or ‘enum’. All other values are invalid.
1554
+ */
1555
+ UNKNOWN_CONTEXT: "CS-001: Unknown context: ",
1516
1556
 
1517
- /**
1518
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1519
- */
1520
- ALREADY_EXISTING_ENTRY: "CS-003: Internal error: Added an already existing entry: ",
1557
+ /**
1558
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1559
+ */
1560
+ ALREADY_EXISTING_ENTRY: "CS-003: Internal error: Added an already existing entry: ",
1521
1561
 
1522
- /**
1523
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1524
- * The ChangeSet did not include an oldValue member which is computed when making the ChangeSet reversible.
1525
- */
1526
- OLD_VALUE_NOT_FOUND: "CS-004: Internal error: Old value not found while inverting a change set. The change set is probably not reversible.",
1562
+ /**
1563
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1564
+ * The ChangeSet did not include an oldValue member which is computed when making the ChangeSet reversible.
1565
+ */
1566
+ OLD_VALUE_NOT_FOUND:
1567
+ "CS-004: Internal error: Old value not found while inverting a change set. The change set is probably not reversible.",
1527
1568
 
1528
- CONTEXT_VALIDATION_IN_PROGRESS: "CONTEXT_VALIDATION_IN_PROGRESS",
1569
+ CONTEXT_VALIDATION_IN_PROGRESS: "CONTEXT_VALIDATION_IN_PROGRESS",
1529
1570
 
1530
- NOT_A_VALID_CONTEXT: "NOT_A_VALID_CONTEXT",
1571
+ NOT_A_VALID_CONTEXT: "NOT_A_VALID_CONTEXT",
1531
1572
 
1532
- MISSING_PRE_POST_CALLBACK: "Missing callback. Either pre- or postcallback must be provided.",
1573
+ MISSING_PRE_POST_CALLBACK: "Missing callback. Either pre- or postcallback must be provided.",
1533
1574
  };
1534
1575
 
1535
1576
  const UtilsError = {
1536
- INVALID_PATH_IN_REFERENCE: "UT-001: References may only contain absolute repository references " +
1537
- "or empty strings",
1538
-
1539
- /**
1540
- * methods: Utils.traverseChangesetRecursively
1541
- *
1542
- * Your changeset contains an operator other than MODIFY, INSERT or REMOVE. If you created the changeset youserlf,
1543
- * check that you only use valid operators. Otherwise, this is an internal error. Please contact the development team.
1544
- */
1545
- UNKNOWN_OPERATOR: "UT-004: ArrayChangeSetIterator: unknown operator ",
1546
-
1547
- /**
1548
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1549
- */
1550
- NON_PRIMITIVE_ARRAY_NO_TYPEID: "UT-005: Found a non primitive type array without typeids. " +
1551
- "This should never happen.",
1552
-
1553
- /**
1554
- * Filtering paths within arrays are not supported.
1555
- */
1556
- FILTER_PATH_WITHIN_ARRAY: "UT-006: Filtering paths within arrays are not supported",
1557
-
1558
- /**
1559
- * INTERNAL ERROR - If you encounter this error, please contact the development team.
1560
- * See specific message for more details.
1561
- */
1562
- ASSERTION_FAILED: "UT-007: INTERNAL ERROR. Failed assertion. ",
1563
-
1564
- /**
1565
- * You used a deprecated function. It will likely be removed in the next major version.
1566
- * See the custom information if provided.
1567
- */
1568
- DEPRECATED_FUNCTION: "UT-008: Deprecated function %s.",
1569
-
1570
- /**
1571
- * You used a deprecated function parameter. It will likely be removed in the next major version.
1572
- * See the custom information if provided.
1573
- */
1574
- DEPRECATED_PARAMETER: "UT-009: Deprecated function parameter %s of %s.",
1575
-
1576
- /**
1577
- * You used an experimental feature. It will likely changed in future releases.
1578
- * See the custom information if provided.
1579
- */
1580
- EXPERIMENTAL_FEATURE: "UT-010: Feature %s is experimental and subject to future changes.",
1577
+ INVALID_PATH_IN_REFERENCE:
1578
+ "UT-001: References may only contain absolute repository references " + "or empty strings",
1579
+
1580
+ /**
1581
+ * methods: Utils.traverseChangesetRecursively
1582
+ *
1583
+ * Your changeset contains an operator other than MODIFY, INSERT or REMOVE. If you created the changeset youserlf,
1584
+ * check that you only use valid operators. Otherwise, this is an internal error. Please contact the development team.
1585
+ */
1586
+ UNKNOWN_OPERATOR: "UT-004: ArrayChangeSetIterator: unknown operator ",
1587
+
1588
+ /**
1589
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1590
+ */
1591
+ NON_PRIMITIVE_ARRAY_NO_TYPEID:
1592
+ "UT-005: Found a non primitive type array without typeids. " + "This should never happen.",
1593
+
1594
+ /**
1595
+ * Filtering paths within arrays are not supported.
1596
+ */
1597
+ FILTER_PATH_WITHIN_ARRAY: "UT-006: Filtering paths within arrays are not supported",
1598
+
1599
+ /**
1600
+ * INTERNAL ERROR - If you encounter this error, please contact the development team.
1601
+ * See specific message for more details.
1602
+ */
1603
+ ASSERTION_FAILED: "UT-007: INTERNAL ERROR. Failed assertion. ",
1604
+
1605
+ /**
1606
+ * You used a deprecated function. It will likely be removed in the next major version.
1607
+ * See the custom information if provided.
1608
+ */
1609
+ DEPRECATED_FUNCTION: "UT-008: Deprecated function %s.",
1610
+
1611
+ /**
1612
+ * You used a deprecated function parameter. It will likely be removed in the next major version.
1613
+ * See the custom information if provided.
1614
+ */
1615
+ DEPRECATED_PARAMETER: "UT-009: Deprecated function parameter %s of %s.",
1616
+
1617
+ /**
1618
+ * You used an experimental feature. It will likely changed in future releases.
1619
+ * See the custom information if provided.
1620
+ */
1621
+ EXPERIMENTAL_FEATURE: "UT-010: Feature %s is experimental and subject to future changes.",
1581
1622
  };
1582
1623
 
1583
1624
  const PssClientError = {
1584
- /**
1585
- * This error message will be displayed when a repository creation fails
1586
- */
1587
- FAILED_REPOSITORY_CREATION:
1588
- "PC-001: Server error: Failed to create a repository. ",
1589
-
1590
- /**
1591
- * This error message will be displayed when the deletion of a repository fails
1592
- */
1593
- FAILED_REPOSITORY_DELETION:
1594
- "PC-002: Server error: Failed to delete a repository. Repository guid: ",
1595
-
1596
- /**
1597
- * This error message will be displayed when the undelete operation of a repository fails
1598
- */
1599
- FAILED_REPOSITORY_UNDELETION:
1600
- "PC-003: Server error: Failed to undelete a repository. Repository guid: ",
1601
-
1602
- /**
1603
- * This error message will be displayed when getting the expiry of a repository fails
1604
- */
1605
- FAILED_GET_EXPIRY_REQUEST:
1606
- "PC-004: Server error: Failed to get the expiry of a repository. Repository guid: ",
1607
-
1608
- /**
1609
- * This error message will be displayed when setting the expiry of a repository fails
1610
- */
1611
- FAILED_SET_EXPIRY_REQUEST:
1612
- "PC-005: Server error: Failed to set the expiry of a repository. Repository guid: ",
1613
-
1614
- /**
1615
- * This error message will be displayed when squashing commit history fails
1616
- */
1617
- FAILED_SQUASH_COMMIT_HISTORY: "PC-006: Server error: Failed to squash the commit history. Branch guid: ",
1618
-
1619
- /**
1620
- * This error message will be displayed when fetching a commit fails
1621
- */
1622
- FAILED_FETCH_COMMIT: "PC-007: Server error: Failed to fetch a commit. Commit guid: ",
1623
-
1624
- /**
1625
- * This error message will be displayed when containers creation fails
1626
- */
1627
- FAILED_CONTAINER_CREATION: "PC-008: Server error: Failed to create containers. ",
1628
-
1629
- /**
1630
- * This error message will be displayed when a branch creation fails
1631
- */
1632
- FAILED_BRANCH_CREATION: "PC-009: Server error: Failed to create a branch. ",
1633
-
1634
- /**
1635
- * This error message will be displayed when a commit fails
1636
- */
1637
- FAILED_TO_COMMIT: "PC-011: Server error: Failed to commit. ",
1638
-
1639
- /**
1640
- * This error message will be displayed when a share operation fails
1641
- */
1642
- FAILED_SHARE: "PC-013: Server error: Failed to share or unshare resources. ",
1643
-
1644
- /**
1645
- * This error message will be displayed when getting the branches of a repository fails
1646
- */
1647
- FAILED_GET_ENUMERATE_BRANCHES: "PC-014: Server error: Failed to get the branches of a repository. Repository guid: ",
1648
-
1649
- /**
1650
- * This error message will be displayed when a request to get an lca fails
1651
- */
1652
- FAILED_GET_LCA: "PC-015: Server error: Failed to get the lca.",
1653
-
1654
- /**
1655
- * This error message will be displayed when a commit fails because of an internal error while committing
1656
- */
1657
- FAILED_TO_COMMIT_INTERNAL: "PC-016: internal error: Failed to commit.",
1658
-
1659
- /**
1660
- * This error message will be displayed when getting a feature flag fails
1661
- */
1662
- FAILED_TO_GET_FEATURE: "PC-017: Server error: Failed to get feature flag from PSS. ",
1663
-
1664
- /**
1665
- * This error message will be displayed when getting squashed commit range fails
1666
- */
1667
- FAILED_TO_GET_SQUASHED_COMMIT_RANGE: "PC-018: Server error: Failed to get squashed commit range. Branch guid: ",
1625
+ /**
1626
+ * This error message will be displayed when a repository creation fails
1627
+ */
1628
+ FAILED_REPOSITORY_CREATION: "PC-001: Server error: Failed to create a repository. ",
1629
+
1630
+ /**
1631
+ * This error message will be displayed when the deletion of a repository fails
1632
+ */
1633
+ FAILED_REPOSITORY_DELETION:
1634
+ "PC-002: Server error: Failed to delete a repository. Repository guid: ",
1635
+
1636
+ /**
1637
+ * This error message will be displayed when the undelete operation of a repository fails
1638
+ */
1639
+ FAILED_REPOSITORY_UNDELETION:
1640
+ "PC-003: Server error: Failed to undelete a repository. Repository guid: ",
1641
+
1642
+ /**
1643
+ * This error message will be displayed when getting the expiry of a repository fails
1644
+ */
1645
+ FAILED_GET_EXPIRY_REQUEST:
1646
+ "PC-004: Server error: Failed to get the expiry of a repository. Repository guid: ",
1647
+
1648
+ /**
1649
+ * This error message will be displayed when setting the expiry of a repository fails
1650
+ */
1651
+ FAILED_SET_EXPIRY_REQUEST:
1652
+ "PC-005: Server error: Failed to set the expiry of a repository. Repository guid: ",
1653
+
1654
+ /**
1655
+ * This error message will be displayed when squashing commit history fails
1656
+ */
1657
+ FAILED_SQUASH_COMMIT_HISTORY:
1658
+ "PC-006: Server error: Failed to squash the commit history. Branch guid: ",
1659
+
1660
+ /**
1661
+ * This error message will be displayed when fetching a commit fails
1662
+ */
1663
+ FAILED_FETCH_COMMIT: "PC-007: Server error: Failed to fetch a commit. Commit guid: ",
1664
+
1665
+ /**
1666
+ * This error message will be displayed when containers creation fails
1667
+ */
1668
+ FAILED_CONTAINER_CREATION: "PC-008: Server error: Failed to create containers. ",
1669
+
1670
+ /**
1671
+ * This error message will be displayed when a branch creation fails
1672
+ */
1673
+ FAILED_BRANCH_CREATION: "PC-009: Server error: Failed to create a branch. ",
1674
+
1675
+ /**
1676
+ * This error message will be displayed when a commit fails
1677
+ */
1678
+ FAILED_TO_COMMIT: "PC-011: Server error: Failed to commit. ",
1679
+
1680
+ /**
1681
+ * This error message will be displayed when a share operation fails
1682
+ */
1683
+ FAILED_SHARE: "PC-013: Server error: Failed to share or unshare resources. ",
1684
+
1685
+ /**
1686
+ * This error message will be displayed when getting the branches of a repository fails
1687
+ */
1688
+ FAILED_GET_ENUMERATE_BRANCHES:
1689
+ "PC-014: Server error: Failed to get the branches of a repository. Repository guid: ",
1690
+
1691
+ /**
1692
+ * This error message will be displayed when a request to get an lca fails
1693
+ */
1694
+ FAILED_GET_LCA: "PC-015: Server error: Failed to get the lca.",
1695
+
1696
+ /**
1697
+ * This error message will be displayed when a commit fails because of an internal error while committing
1698
+ */
1699
+ FAILED_TO_COMMIT_INTERNAL: "PC-016: internal error: Failed to commit.",
1700
+
1701
+ /**
1702
+ * This error message will be displayed when getting a feature flag fails
1703
+ */
1704
+ FAILED_TO_GET_FEATURE: "PC-017: Server error: Failed to get feature flag from PSS. ",
1705
+
1706
+ /**
1707
+ * This error message will be displayed when getting squashed commit range fails
1708
+ */
1709
+ FAILED_TO_GET_SQUASHED_COMMIT_RANGE:
1710
+ "PC-018: Server error: Failed to get squashed commit range. Branch guid: ",
1668
1711
  };
1669
1712
 
1670
1713
  const PROPERTY_PATH_DELIMITER = ".";
1671
1714
  const MESSAGE_CONSTANTS = {
1672
- ...ChangeSetError,
1673
- ...PropertyError,
1674
- ...PropertyFactoryError,
1675
- ...RepositoryError,
1676
- ...SchemaValidatorError,
1677
- ...PssClientError,
1678
- ...UtilsError,
1679
- ...TypeidHelperError,
1680
- ...ServerError,
1715
+ ...ChangeSetError,
1716
+ ...PropertyError,
1717
+ ...PropertyFactoryError,
1718
+ ...RepositoryError,
1719
+ ...SchemaValidatorError,
1720
+ ...PssClientError,
1721
+ ...UtilsError,
1722
+ ...TypeidHelperError,
1723
+ ...ServerError,
1681
1724
  };
1682
1725
 
1683
1726
  export const constants = {
1684
- MSG: MESSAGE_CONSTANTS,
1685
- PROPERTY_PATH_DELIMITER,
1727
+ MSG: MESSAGE_CONSTANTS,
1728
+ PROPERTY_PATH_DELIMITER,
1686
1729
  };