@progress/sitefinity-webservices-sdk 1.1.16 → 2.0.0

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 (233) hide show
  1. package/README.md +84 -51
  2. package/esm/chunks/chunk-2ID24RPE.mjs +179 -0
  3. package/esm/chunks/chunk-2ID24RPE.mjs.map +7 -0
  4. package/esm/chunks/chunk-AHDZ2CWQ.mjs +93 -0
  5. package/esm/chunks/chunk-AHDZ2CWQ.mjs.map +7 -0
  6. package/esm/chunks/chunk-BFLQBM7R.mjs +136 -0
  7. package/esm/chunks/chunk-BFLQBM7R.mjs.map +7 -0
  8. package/esm/chunks/chunk-CMGV26CS.mjs +66 -0
  9. package/esm/chunks/chunk-CMGV26CS.mjs.map +7 -0
  10. package/esm/chunks/chunk-DHWDJAGV.mjs +180 -0
  11. package/esm/chunks/chunk-DHWDJAGV.mjs.map +7 -0
  12. package/esm/chunks/chunk-EH4CERVO.mjs +82 -0
  13. package/esm/chunks/chunk-EH4CERVO.mjs.map +7 -0
  14. package/esm/chunks/chunk-F4CWOE7M.mjs +57 -0
  15. package/esm/chunks/chunk-F4CWOE7M.mjs.map +7 -0
  16. package/esm/chunks/chunk-FUFBYOIF.mjs +98 -0
  17. package/esm/chunks/chunk-FUFBYOIF.mjs.map +7 -0
  18. package/esm/chunks/chunk-J2B7UDVZ.mjs +132 -0
  19. package/esm/chunks/chunk-J2B7UDVZ.mjs.map +7 -0
  20. package/esm/chunks/chunk-L3IMDFA5.mjs +1 -0
  21. package/esm/chunks/chunk-L3IMDFA5.mjs.map +7 -0
  22. package/esm/chunks/chunk-NNYY2VBC.mjs +383 -0
  23. package/esm/chunks/chunk-NNYY2VBC.mjs.map +7 -0
  24. package/esm/chunks/chunk-PI55MBSL.mjs +256 -0
  25. package/esm/chunks/chunk-PI55MBSL.mjs.map +7 -0
  26. package/esm/chunks/chunk-PXPK2IV6.mjs +568 -0
  27. package/esm/chunks/chunk-PXPK2IV6.mjs.map +7 -0
  28. package/esm/chunks/chunk-QPSEKUOI.mjs +35 -0
  29. package/esm/chunks/chunk-QPSEKUOI.mjs.map +7 -0
  30. package/esm/chunks/chunk-RQAAYOY6.mjs +72 -0
  31. package/esm/chunks/chunk-RQAAYOY6.mjs.map +7 -0
  32. package/esm/chunks/chunk-TTVNTTW5.mjs +145 -0
  33. package/esm/chunks/chunk-TTVNTTW5.mjs.map +7 -0
  34. package/esm/chunks/chunk-VLDX2FH2.mjs +235 -0
  35. package/esm/chunks/chunk-VLDX2FH2.mjs.map +7 -0
  36. package/esm/chunks/chunk-VWT2RJET.mjs +102 -0
  37. package/esm/chunks/chunk-VWT2RJET.mjs.map +7 -0
  38. package/esm/chunks/chunk-W2OWM3L7.mjs +19 -0
  39. package/esm/chunks/chunk-W2OWM3L7.mjs.map +7 -0
  40. package/esm/chunks/chunk-WX5J7F5D.mjs +43 -0
  41. package/esm/chunks/chunk-WX5J7F5D.mjs.map +7 -0
  42. package/esm/chunks/chunk-YB2LMPUX.mjs +54 -0
  43. package/esm/chunks/chunk-YB2LMPUX.mjs.map +7 -0
  44. package/package.json +67 -36
  45. package/sitefinity-webservices-sdk.cjs +2761 -0
  46. package/sitefinity-webservices-sdk.cjs.map +7 -0
  47. package/sitefinity-webservices-sdk.d.mts +1 -0
  48. package/{dist/sitefinity-webservices-sdk.d.ts → sitefinity-webservices-sdk.d.ts} +6 -0
  49. package/sitefinity-webservices-sdk.global.d.ts +5 -0
  50. package/sitefinity-webservices-sdk.js +2764 -0
  51. package/sitefinity-webservices-sdk.js.map +7 -0
  52. package/sitefinity-webservices-sdk.min.js +3 -0
  53. package/sitefinity-webservices-sdk.mjs +124 -0
  54. package/sitefinity-webservices-sdk.mjs.map +7 -0
  55. package/src/BlobBuilder.d.ts +12 -0
  56. package/src/Data.d.ts +259 -0
  57. package/src/Expression.d.ts +37 -0
  58. package/src/OrderProperty.d.ts +24 -0
  59. package/src/Query.d.ts +104 -0
  60. package/src/QueryBase.d.ts +40 -0
  61. package/src/QueryBuilder.d.ts +29 -0
  62. package/src/Requests/BatchRequest.d.ts +174 -0
  63. package/src/Requests/ExecutableRequest.d.ts +43 -0
  64. package/src/Requests/Request.d.ts +225 -0
  65. package/src/Requests/RequestBase.d.ts +58 -0
  66. package/{dist/src → src}/Requests/RequestFactory.d.ts +24 -2
  67. package/src/Sitefinity.d.ts +141 -0
  68. package/src/Transport/FetchTransport.d.ts +17 -0
  69. package/src/Transport/HttpTransport.d.ts +69 -0
  70. package/src/Transport/XhrTransport.d.ts +8 -0
  71. package/src/WhereQuery.d.ts +88 -0
  72. package/src/chunk-upload/chunk-upload.sdk.d.ts +305 -0
  73. package/src/chunk-upload/chunked-file-upload.utilities.d.ts +58 -0
  74. package/{dist/src → src}/constants.d.ts +21 -0
  75. package/src/utils.d.ts +103 -0
  76. package/.editorconfig +0 -29
  77. package/.eslintignore +0 -4
  78. package/.eslintrc.js +0 -40
  79. package/.github/copilot-instructions.md +0 -72
  80. package/.github/instructions/sitefinity-webservices-sdk.instructions.md +0 -53
  81. package/config/helpers.ts +0 -8
  82. package/config/webpack.common.ts +0 -39
  83. package/config/webpack.dev.ts +0 -37
  84. package/config/webpack.prod.ts +0 -17
  85. package/dist/docs/.nojekyll +0 -1
  86. package/dist/docs/assets/highlight.css +0 -71
  87. package/dist/docs/assets/main.js +0 -58
  88. package/dist/docs/assets/search.js +0 -1
  89. package/dist/docs/assets/style.css +0 -1280
  90. package/dist/docs/classes/BlobBuilder.BlobBuilder.html +0 -137
  91. package/dist/docs/classes/Data.Data.html +0 -387
  92. package/dist/docs/classes/Expression.BinaryExpression.html +0 -184
  93. package/dist/docs/classes/Expression.ComplexExpression.html +0 -146
  94. package/dist/docs/classes/Expression.ExpressionBase.html +0 -125
  95. package/dist/docs/classes/OrderProperty.OrderProperty.html +0 -151
  96. package/dist/docs/classes/Query.Query.html +0 -353
  97. package/dist/docs/classes/QueryBase.QueryBase.html +0 -185
  98. package/dist/docs/classes/QueryBuilder.QueryBuilder.html +0 -206
  99. package/dist/docs/classes/Requests_BatchRequest.BatchRequest.html +0 -731
  100. package/dist/docs/classes/Requests_BatchRequest.Transaction.html +0 -332
  101. package/dist/docs/classes/Requests_ExecutableRequest.ExecutableRequest.html +0 -340
  102. package/dist/docs/classes/Requests_Request.CommitChunksRequest.html +0 -303
  103. package/dist/docs/classes/Requests_Request.CreateRelatedRequest.html +0 -310
  104. package/dist/docs/classes/Requests_Request.CreateRequest.html +0 -307
  105. package/dist/docs/classes/Requests_Request.DeleteRelatedByIdRequest.html +0 -309
  106. package/dist/docs/classes/Requests_Request.DeleteRelatedRequest.html +0 -302
  107. package/dist/docs/classes/Requests_Request.DeleteRequest.html +0 -298
  108. package/dist/docs/classes/Requests_Request.GetByIdRequest.html +0 -298
  109. package/dist/docs/classes/Requests_Request.GetRelatedByIdRequest.html +0 -309
  110. package/dist/docs/classes/Requests_Request.GetRelatedRequest.html +0 -302
  111. package/dist/docs/classes/Requests_Request.GetRequest.html +0 -295
  112. package/dist/docs/classes/Requests_Request.UpdateRequest.html +0 -309
  113. package/dist/docs/classes/Requests_Request.UploadChunkRequest.html +0 -359
  114. package/dist/docs/classes/Requests_Request.UploadRequest.html +0 -329
  115. package/dist/docs/classes/Requests_RequestBase.RequestBase.html +0 -275
  116. package/dist/docs/classes/Requests_RequestFactory.RequestFactory.html +0 -344
  117. package/dist/docs/classes/Sitefinity.Sitefinity.html +0 -188
  118. package/dist/docs/classes/WhereQuery.WhereQuery.html +0 -436
  119. package/dist/docs/classes/chunk_upload_chunk_upload_sdk.ChunkUploadSdk.html +0 -231
  120. package/dist/docs/classes/chunk_upload_chunked_file_upload_utilities.ChunkedFileUploadUtilities.html +0 -131
  121. package/dist/docs/classes/utils.utils.html +0 -303
  122. package/dist/docs/index.html +0 -129
  123. package/dist/docs/interfaces/Data.CreateRelatedRequestOptions.html +0 -155
  124. package/dist/docs/interfaces/Data.CreateRequestOptions.html +0 -153
  125. package/dist/docs/interfaces/Data.OperationsRequestOptions.html +0 -145
  126. package/dist/docs/interfaces/Data.PropertyRequestOptions.html +0 -149
  127. package/dist/docs/interfaces/Data.RequestOptionsBase.html +0 -136
  128. package/dist/docs/interfaces/Data.SingleRelatedItemRequestOptions.html +0 -155
  129. package/dist/docs/interfaces/Data.UpdateRequestOptions.html +0 -155
  130. package/dist/docs/interfaces/Data.UploadRequestOptions.html +0 -169
  131. package/dist/docs/interfaces/Requests_BatchRequest.BatchCreateRelatedRequestOptions.html +0 -161
  132. package/dist/docs/interfaces/Requests_BatchRequest.BatchCreateRequestOptions.html +0 -153
  133. package/dist/docs/interfaces/Requests_BatchRequest.BatchPropertyRequestOptions.html +0 -153
  134. package/dist/docs/interfaces/Requests_BatchRequest.BatchRequestOptionsBase.html +0 -145
  135. package/dist/docs/interfaces/Requests_BatchRequest.BatchRequestOptionsExtended.html +0 -153
  136. package/dist/docs/interfaces/Requests_BatchRequest.BatchSingleItemRequestOptions.html +0 -145
  137. package/dist/docs/interfaces/Requests_BatchRequest.BatchSingleRelatedItemRequestOptions.html +0 -161
  138. package/dist/docs/interfaces/Requests_BatchRequest.BatchUpdateRequestOptions.html +0 -161
  139. package/dist/docs/interfaces/Requests_ExecutableRequest.ResponseHandlers.html +0 -98
  140. package/dist/docs/interfaces/Requests_Request.CommitChunksRequestOptionsExtended.html +0 -215
  141. package/dist/docs/interfaces/Requests_Request.PostRequestOptionsExtended.html +0 -159
  142. package/dist/docs/interfaces/Requests_Request.PutRequestOptionsExtended.html +0 -161
  143. package/dist/docs/interfaces/Requests_Request.RelatedByIdRequestOptionsExtended.html +0 -169
  144. package/dist/docs/interfaces/Requests_Request.RelatedRequestOptionsExtended.html +0 -163
  145. package/dist/docs/interfaces/Requests_Request.UploadChunkRequestOptionsExtended.html +0 -217
  146. package/dist/docs/interfaces/Requests_Request.UploadRequestOptionsExtended.html +0 -180
  147. package/dist/docs/interfaces/Requests_RequestBase.RequestOptionsBaseExtended.html +0 -148
  148. package/dist/docs/interfaces/Sitefinity.SDKOptions.html +0 -128
  149. package/dist/docs/interfaces/Sitefinity.Token.html +0 -94
  150. package/dist/docs/interfaces/Sitefinity.TypeOptions.html +0 -160
  151. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.ChunkUploadInfoDTO.html +0 -159
  152. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.ChunkUploadResult.html +0 -111
  153. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.CleanUpChunksRequestOptions.html +0 -171
  154. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.CommitChunksRequestOptions.html +0 -204
  155. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.GetChunkUploadInfoRequestOptions.html +0 -166
  156. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.UploadChunkRequestOptions.html +0 -206
  157. package/dist/docs/interfaces/chunk_upload_chunked_file_upload_utilities.ChunkFileResult.html +0 -101
  158. package/dist/docs/interfaces/chunk_upload_chunked_file_upload_utilities.FileUploadChunk.html +0 -94
  159. package/dist/docs/modules/BlobBuilder.html +0 -73
  160. package/dist/docs/modules/Data.html +0 -92
  161. package/dist/docs/modules/Expression.html +0 -77
  162. package/dist/docs/modules/OrderProperty.html +0 -73
  163. package/dist/docs/modules/Query.html +0 -73
  164. package/dist/docs/modules/QueryBase.html +0 -73
  165. package/dist/docs/modules/QueryBuilder.html +0 -73
  166. package/dist/docs/modules/Requests_BatchRequest.html +0 -94
  167. package/dist/docs/modules/Requests_ExecutableRequest.html +0 -78
  168. package/dist/docs/modules/Requests_Request.html +0 -114
  169. package/dist/docs/modules/Requests_RequestBase.html +0 -78
  170. package/dist/docs/modules/Requests_RequestFactory.html +0 -73
  171. package/dist/docs/modules/Sitefinity.html +0 -82
  172. package/dist/docs/modules/WhereQuery.html +0 -73
  173. package/dist/docs/modules/chunk_upload_chunk_upload_sdk.html +0 -88
  174. package/dist/docs/modules/chunk_upload_chunked_file_upload_utilities.html +0 -80
  175. package/dist/docs/modules/constants.html +0 -83
  176. package/dist/docs/modules/utils.html +0 -73
  177. package/dist/docs/modules.html +0 -80
  178. package/dist/docs/variables/constants.CONTENT_TYPES.html +0 -76
  179. package/dist/docs/variables/constants.EXPRESSION_TYPE.html +0 -106
  180. package/dist/docs/variables/constants.HEADER_NAMES.html +0 -102
  181. package/dist/docs/variables/constants.HTTP_METHODS.html +0 -84
  182. package/dist/docs/variables/constants.ODATA_PARAMS.html +0 -90
  183. package/dist/docs/variables/constants.SF_PARAMS.html +0 -84
  184. package/dist/samples.html +0 -625
  185. package/dist/sitefinity-webservices-sdk.js +0 -3243
  186. package/dist/sitefinity-webservices-sdk.js.map +0 -1
  187. package/dist/sitefinity-webservices-sdk.min.js +0 -1
  188. package/dist/src/BlobBuilder.d.ts +0 -14
  189. package/dist/src/Data.d.ts +0 -154
  190. package/dist/src/Data.spec.d.ts +0 -1
  191. package/dist/src/Expression.d.ts +0 -19
  192. package/dist/src/OrderProperty.d.ts +0 -8
  193. package/dist/src/Query.d.ts +0 -59
  194. package/dist/src/QueryBase.d.ts +0 -18
  195. package/dist/src/QueryBuilder.d.ts +0 -13
  196. package/dist/src/Requests/BatchRequest.d.ts +0 -146
  197. package/dist/src/Requests/ExecutableRequest.d.ts +0 -22
  198. package/dist/src/Requests/Request.d.ts +0 -132
  199. package/dist/src/Requests/RequestBase.d.ts +0 -27
  200. package/dist/src/Requests/request.spec.d.ts +0 -1
  201. package/dist/src/Sitefinity.d.ts +0 -75
  202. package/dist/src/Sitefinity.spec.d.ts +0 -1
  203. package/dist/src/WhereQuery.d.ts +0 -72
  204. package/dist/src/chunk-upload/chunk-upload.sdk.d.ts +0 -295
  205. package/dist/src/chunk-upload/chunk-upload.sdk.spec.d.ts +0 -1
  206. package/dist/src/chunk-upload/chunked-file-upload.utilities.d.ts +0 -13
  207. package/dist/src/utils.d.ts +0 -16
  208. package/karma.conf.js +0 -29
  209. package/sitefinity-webservices-sdk.ts +0 -15
  210. package/src/BlobBuilder.ts +0 -20
  211. package/src/Data.spec.ts +0 -160
  212. package/src/Data.ts +0 -418
  213. package/src/Expression.ts +0 -36
  214. package/src/OrderProperty.ts +0 -39
  215. package/src/Query.ts +0 -106
  216. package/src/QueryBase.ts +0 -57
  217. package/src/QueryBuilder.ts +0 -180
  218. package/src/Requests/BatchRequest.ts +0 -807
  219. package/src/Requests/ExecutableRequest.ts +0 -117
  220. package/src/Requests/Request.ts +0 -327
  221. package/src/Requests/RequestBase.ts +0 -163
  222. package/src/Requests/RequestFactory.ts +0 -75
  223. package/src/Requests/request.spec.ts +0 -154
  224. package/src/Sitefinity.spec.ts +0 -483
  225. package/src/Sitefinity.ts +0 -125
  226. package/src/WhereQuery.ts +0 -145
  227. package/src/chunk-upload/chunk-upload.sdk.spec.ts +0 -347
  228. package/src/chunk-upload/chunk-upload.sdk.ts +0 -439
  229. package/src/chunk-upload/chunked-file-upload.utilities.ts +0 -64
  230. package/src/constants.ts +0 -66
  231. package/src/utils.ts +0 -125
  232. package/template.html +0 -625
  233. package/tsconfig.json +0 -38
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Operator names used by the fluent query-expression API.
3
+ *
4
+ * Most consumers should use {@link Query} and {@link WhereQuery} instead of constructing
5
+ * expressions from these values directly.
6
+ */
1
7
  export declare const EXPRESSION_TYPE: {
2
8
  query: number;
3
9
  where: number;
@@ -16,6 +22,9 @@ export declare const EXPRESSION_TYPE: {
16
22
  startsWith: string;
17
23
  endsWith: string;
18
24
  };
25
+ /**
26
+ * OData query parameter names emitted by {@link QueryBuilder}.
27
+ */
19
28
  export declare const ODATA_PARAMS: {
20
29
  $filter: string;
21
30
  $select: string;
@@ -26,6 +35,9 @@ export declare const ODATA_PARAMS: {
26
35
  $count: string;
27
36
  $search: string;
28
37
  };
38
+ /**
39
+ * Sitefinity-specific query parameter names supported by SDK requests.
40
+ */
29
41
  export declare const SF_PARAMS: {
30
42
  provider: string;
31
43
  culture: string;
@@ -33,6 +45,9 @@ export declare const SF_PARAMS: {
33
45
  fallbackParams: string;
34
46
  parentId: string;
35
47
  };
48
+ /**
49
+ * Standard and Sitefinity-specific HTTP header names used by SDK requests.
50
+ */
36
51
  export declare const HEADER_NAMES: {
37
52
  contentType: string;
38
53
  authorization: string;
@@ -49,6 +64,9 @@ export declare const HEADER_NAMES: {
49
64
  chunkedFileUploadSessionId: string;
50
65
  blobStorageProviderName: string;
51
66
  };
67
+ /**
68
+ * HTTP method names used by the request classes.
69
+ */
52
70
  export declare const HTTP_METHODS: {
53
71
  get: string;
54
72
  put: string;
@@ -56,6 +74,9 @@ export declare const HTTP_METHODS: {
56
74
  patch: string;
57
75
  delete: string;
58
76
  };
77
+ /**
78
+ * Content types emitted by SDK requests.
79
+ */
59
80
  export declare const CONTENT_TYPES: {
60
81
  json: string;
61
82
  };
package/src/utils.d.ts ADDED
@@ -0,0 +1,103 @@
1
+ /**
2
+ * General-purpose value, URL, serialization, and response conversion helpers used by the SDK.
3
+ *
4
+ * These helpers are exported for backward compatibility. Application code should normally use
5
+ * the higher-level {@link Sitefinity}, {@link Data}, and {@link Query} APIs.
6
+ */
7
+ export declare class utils {
8
+ /**
9
+ * Determines whether a value is a primitive or boxed string.
10
+ *
11
+ * @param obj Value to inspect.
12
+ * @returns `true` when the value is a string.
13
+ */
14
+ static isString(obj: any): boolean;
15
+ /**
16
+ * Determines whether a value is a boolean.
17
+ *
18
+ * @param obj Value to inspect.
19
+ * @returns `true` for primitive boolean values.
20
+ */
21
+ static isBoolean(obj: any): boolean;
22
+ /**
23
+ * Determines whether a value is a {@link Blob}.
24
+ *
25
+ * @param obj Value to inspect.
26
+ * @returns `true` when the value is a `Blob`.
27
+ */
28
+ static isBlob(obj: any): boolean;
29
+ /**
30
+ * Determines whether a value is a finite number.
31
+ *
32
+ * @param value Value to inspect.
33
+ * @returns `true` for finite numeric values.
34
+ */
35
+ static isNumber(value: any): boolean;
36
+ /**
37
+ * Determines whether a value is callable.
38
+ *
39
+ * @param func Value to inspect.
40
+ * @returns `true` when the value is a function.
41
+ */
42
+ static isFunction(func: any): boolean;
43
+ /**
44
+ * Converts request data to its wire representation.
45
+ *
46
+ * Strings and blobs are returned unchanged. Other values are serialized with `JSON.stringify`.
47
+ *
48
+ * @param data Request body value.
49
+ * @returns The original string or blob, or a JSON string for other values.
50
+ */
51
+ static serializeToJSON(data: any): string;
52
+ /**
53
+ * Parses a response string as a number or JSON value.
54
+ *
55
+ * ISO 8601 date strings in parsed objects and arrays are converted to {@link Date} instances.
56
+ * Non-JSON text returns `null`.
57
+ *
58
+ * @param data Response text to parse.
59
+ * @returns The parsed value, or `null` when the input is empty or not valid JSON.
60
+ */
61
+ static parseStringToJson(data: any): any;
62
+ /**
63
+ * Converts top-level {@link Date} properties to ISO 8601 strings in place.
64
+ *
65
+ * @param data Object that will be sent in a request.
66
+ * @returns The same object instance after conversion.
67
+ */
68
+ static convertDateFieldToISOString(data: object): object;
69
+ /**
70
+ * Generates a four-character hexadecimal segment.
71
+ *
72
+ * @returns A pseudo-random lowercase hexadecimal string.
73
+ */
74
+ static hex16(): string;
75
+ /**
76
+ * Ensures that a URL ends with exactly one slash.
77
+ *
78
+ * @param url URL to normalize.
79
+ * @returns The normalized URL.
80
+ */
81
+ static addTrailingSlash(url: string): string;
82
+ /**
83
+ * Removes one trailing slash from a URL.
84
+ *
85
+ * @param url URL to normalize.
86
+ * @returns The URL without a trailing slash.
87
+ */
88
+ static removeSlashes(url: string): string;
89
+ /**
90
+ * Performs the SDK's backward-compatible shallow clone operation.
91
+ *
92
+ * The optional action is called while properties are copied and is used by fluent query
93
+ * objects to update the cloned instance.
94
+ *
95
+ * @param from Source object.
96
+ * @param to Optional target object.
97
+ * @param action Optional callback invoked with the target during copying.
98
+ * @returns The populated target object.
99
+ */
100
+ static clone(from: any, to?: {}, action?: Function): any;
101
+ private static _parseDateProperties;
102
+ private static _tryFormatFieldToDate;
103
+ }
package/.editorconfig DELETED
@@ -1,29 +0,0 @@
1
- # Manage common editor configurations
2
- # set for example indentation tab and space
3
- # VS Extension: https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328
4
- # more extensions and plugins for your favorite editor here: http://editorconfig.org/#download
5
-
6
- ; Top-most EditorConfig file
7
- root = true
8
-
9
- ; 4-column space indentation
10
- [*]
11
- indent_size = 4
12
- indent_style = space
13
- insert_final_newline = true
14
- trim_trailing_whitespace = true
15
-
16
- [*.md]
17
- indent_size = 4
18
- indent_style = space
19
- trim_trailing_whitespace = false
20
-
21
- [*.json]
22
- indent_size = 2
23
- indent_style = space
24
- trim_trailing_whitespace = false
25
-
26
- [*.min.*]
27
- indent_style = ignore
28
- trim_trailing_whitespace = false
29
- insert_final_newline = ignore
package/.eslintignore DELETED
@@ -1,4 +0,0 @@
1
- node_modules
2
- dist
3
- config
4
- coverage
package/.eslintrc.js DELETED
@@ -1,40 +0,0 @@
1
- module.exports = {
2
- "env": {
3
- "browser": true,
4
- "es2021": true
5
- },
6
- "extends": [
7
- "eslint:recommended",
8
- "plugin:@typescript-eslint/recommended"
9
- ],
10
- "overrides": [
11
- ],
12
- "parser": "@typescript-eslint/parser",
13
- "parserOptions": {
14
- "ecmaVersion": "latest",
15
- "sourceType": "module"
16
- },
17
- "plugins": [
18
- "@typescript-eslint"
19
- ],
20
- "rules": {
21
- "indent": [
22
- "error",
23
- 4
24
- ],
25
- "quotes": [
26
- "error",
27
- "double"
28
- ],
29
- "semi": [
30
- "error",
31
- "always"
32
- ],
33
- "@typescript-eslint/no-explicit-any": "off",
34
- "@typescript-eslint/ban-types": "off",
35
- "no-useless-escape": "off",
36
- "no-prototype-builtins": "off",
37
- "@typescript-eslint/no-empty-function": "off",
38
- "no-constant-condition": "off"
39
- }
40
- };
@@ -1,72 +0,0 @@
1
- # sitefinity-webservices-sdk — TypeScript SDK
2
-
3
- ## Shared Conventions (Sitefinity DX Monorepo)
4
-
5
- This project is part of the Sitefinity DX monorepo (6 independent projects: `admin-app`, `nextjs-renderer`, `netcore-renderer`, `sitefinity-webservices-sdk`, `sitefinity-widget-designers`, `e2e-tests`). The rules below apply to all projects; project-specific rules follow.
6
-
7
- ### Formatting
8
- - **4-space** indent for source; **2-space** for YAML.
9
- - Trim trailing whitespace (except `.md` and `.min.*`); final newline on every file.
10
- - Max line width: **120 chars**.
11
-
12
- ### Naming
13
- - Files: `kebab-case` (TS/JS). C# filenames: `PascalCase` matching class.
14
- - Classes / interfaces / types / enums: `PascalCase`.
15
- - Variables, functions, methods: `camelCase`.
16
- - Constants: `UPPER_SNAKE_CASE`.
17
- - C# private fields: `_camelCase`.
18
-
19
- ### TypeScript
20
- - Prefer `strict: true` patterns in new code. Avoid `any` — use generics or `unknown`.
21
- - `const` by default; `let` only when reassigning; never `var`.
22
- - `interface` for object shapes; `type` for unions, intersections, mapped types.
23
- - Use `?.` and `??` over manual null checks.
24
- - Prefer named exports over default exports, unless the framework requires default (Next.js pages/layouts).
25
-
26
- ### Imports
27
- - Use configured path aliases (`@progress/sitefinity-*`) where available; follow the project's existing style when aliases aren't configured.
28
- - Order: (1) framework/library, (2) project/alias, (3) relative. Blank line between groups.
29
- - Don't import whole modules when only specific members are needed.
30
-
31
- ### Error Handling
32
- - Never silently swallow exceptions — at minimum, log.
33
- - Use typed errors / specific error classes where applicable.
34
- - Never leave floating promises.
35
-
36
- ### Avoiding Duplication (critical)
37
- - **Before creating a new utility, helper, or shared function**, search the current project AND sibling projects for equivalents.
38
- - **Before adding a dependency**, check if an existing one already provides the functionality.
39
- - Follow existing patterns (base classes, services, decorators) rather than inventing alternatives.
40
- - Don't create parallel abstractions. Extend or reuse; only introduce a new shared abstraction when there is a clear owner and reuse path.
41
-
42
- ### Cross-Project Ownership
43
- Where shared logic belongs:
44
- - **SDK / client-side data access** → `sitefinity-webservices-sdk`
45
- - **Widget metadata / property decorators** → `sitefinity-widget-designers`
46
- - **Angular UI / admin features** → `admin-app`
47
- - **Next.js rendering / SSR** → `nextjs-renderer`
48
- - **Server-side rendering (.NET)** → `netcore-renderer`
49
- - **Shared test helpers / fixtures** → `e2e-tests`
50
-
51
- Don't duplicate logic across projects — put it in the owner.
52
-
53
- ### Testing
54
- - Co-locate unit tests with source using the project's test-suffix convention, unless the project section says otherwise. Cypress e2e tests are organized by feature under `e2e/`, not co-located.
55
- - Tests must be deterministic — no external services, network, or timing (exception: Cypress e2e against hosted envs).
56
- - Arrange/act/assert structure; descriptive names; mock external dependencies.
57
-
58
- ### Generated / Build Output
59
- - Never edit: `dist/`, `lib/`, `.next/`, `node_modules/`, `bin/`, `obj/`, auto-generated docs.
60
- - Don't commit build artifacts.
61
-
62
- ### Documentation
63
- - JSDoc / XML doc for **public APIs only**.
64
- - No trivial comments. For complex logic, comment **why**, not **what**.
65
-
66
- ### Git
67
- - Imperative-mood commit messages ("Add widget registry", not "Added…").
68
- - One logical change per commit.
69
-
70
- ---
71
-
72
- Project-specific rules: see [`instructions/sitefinity-webservices-sdk.instructions.md`](instructions/sitefinity-webservices-sdk.instructions.md).
@@ -1,53 +0,0 @@
1
- ---
2
- applyTo: "**"
3
- ---
4
- <!-- The two `<service>.instructions.md` files (repo-root and per-service) share the SAME body; only the `applyTo` frontmatter differs. Keep them in sync manually. -->
5
-
6
- # sitefinity-webservices-sdk — TypeScript SDK
7
-
8
- ## Tech Stack
9
- - **Language**: TypeScript (vanilla — no framework)
10
- - **Target**: ES5 for broad browser compatibility
11
- - **Build**: Webpack 5 (separate dev and prod configs in `config/webpack.*.ts` — TypeScript-authored)
12
- - **Output**: UMD library bundle (global `Sitefinity` in browser, CommonJS in Node)
13
- - **Testing**: Karma + Jasmine (browser-based) with `jasmine-ajax` for HTTP mocking
14
-
15
- ## Conventions
16
-
17
- - **Quote style**: Double quotes (`"`).
18
- - **Semicolons**: Always required.
19
- - **Indentation**: 4 spaces for code, **2 spaces for JSON** (project-specific override).
20
- - **HTTP implementation**: Uses `XMLHttpRequest` (NOT Fetch or Axios). Check `readyState === 4` before processing. 200–206 = success, 400+ = error.
21
- - **Callback pattern**: The SDK uses callbacks (`successCb`, `failureCb`, `progressCb`), NOT Promises. Follow this for new API methods.
22
- - **API design**: Fluent/chainable API (see `src/Sitefinity.ts`):
23
- ```typescript
24
- sdk.data(options).get({ query, successCb, failureCb });
25
-
26
- // Batch: methods mutate internal state and return void, not the batch for further chaining
27
- const batch = sdk.batch(success, failure, progress, options);
28
- batch.get({...});
29
- batch.create({...});
30
- // Transactional grouping for atomic data modifications:
31
- const tx = batch.beginTransaction();
32
- tx.create({...});
33
- batch.endTransaction(tx);
34
- batch.execute();
35
- ```
36
- - **Data class methods**: `.get()`, `.getSingle()`, `.create()`, `.update()`, `.destroy()`, `.operation()`, `.getProperty()`, `.getOperations()`, and `.chunkUpload` (file upload service).
37
- - **Request hierarchy**: `RequestBase` → `ExecutableRequest` (HTTP execution) → specific request types (`GetRequest`, `CreateRequest`, `UpdateRequest`, `DeleteRequest`). New request types must extend this hierarchy.
38
- - **Query builder**: Fluent OData: `query.where().eq('Title', 'test').and().contains('Content', 'text').done().order('Title desc')`. Supports `$filter`, `$select`, `$expand`, `$orderby`, `$skip`, `$top`, `$count`, `$search`.
39
- - **URL handling**: Always normalize with `utils.addTrailingSlash()`. Convert dates to ISO 8601 via `utils.convertDateFieldToISOString()` when sending; incoming responses auto-parse dates via `_parseDateProperties()`.
40
- - **Sitefinity headers**: Core — `X-Operation`, `X-File-Name`, `X-Sf-Properties` (note: camelCase `Sf`). Upload/advanced — `X-SF-Service-Request`, `X-SF-Integration-Mode`, `X-SF-Binary-Choice-Representation`, `X-SF-Chunk-Ordinal`, `X-SF-Chunk-Size`, `X-SF-File-Size`, `X-SF-Chunked-File-Upload-Session-Id`, `X-SF-Blob-Storage-Provider-Name`. OData params: `sf_provider`, `sf_culture`, `sf_site`, `sf_fallback_prop_names`, `parentId`.
41
- - **Class naming**: PascalCase (e.g., `RequestFactory`, `BatchRequest`).
42
- - **Test naming**: `*.spec.ts`. Use Jasmine `describe`/`it`.
43
- - **HTTP mocking**: `jasmine.Ajax.install()` / `jasmine.Ajax.uninstall()` in `beforeEach` / `afterEach`. Assert against `jasmine.Ajax.requests.mostRecent()`.
44
- - **Linting**: ESLint with `@typescript-eslint/parser`. `npm run lint`.
45
-
46
- ## Key Build Commands
47
- ```
48
- npm start # Dev server (webpack-dev-server)
49
- npm run build:dev # Development build (with source maps)
50
- npm run build:prod # Production build (minified)
51
- npm run test # Run tests
52
- npm run docs # Generate documentation
53
- ```
package/config/helpers.ts DELETED
@@ -1,8 +0,0 @@
1
- const path = require("path");
2
-
3
- // Helper functions
4
- const ROOT = path.resolve(__dirname, "..");
5
-
6
- export function root(...args) {
7
- return path.join.apply(path, [ROOT].concat(args));
8
- }
@@ -1,39 +0,0 @@
1
- // For instructions about this file refer to
2
- // webpack and webpack-hot-middleware documentation
3
- import { Configuration } from "webpack";
4
- import { root } from "./helpers";
5
-
6
- export default (
7
- config: Configuration
8
- ) => {
9
- delete config["WEBPACK_BUILD"];
10
- delete config["WEBPACK_BUNDLE"];
11
- delete config["WEBPACK_SERVE"];
12
-
13
- config.name = "Sitefinity";
14
- config.mode = "development";
15
- config.entry = {
16
- "sitefinity-webservices-sdk": root("sitefinity-webservices-sdk")
17
- };
18
- config.output = {
19
- path: root("dist"),
20
- filename: "[name].js",
21
- chunkFilename: "[name].js",
22
- libraryTarget: "umd",
23
- library: "Sitefinity",
24
- globalObject: "this"
25
- };
26
- config.resolve = {
27
- extensions: [".ts", ".js", ".json", ".html"]
28
- };
29
- config.module = {
30
- rules: [
31
- {
32
- test: /\.ts$/,
33
- use: ["ts-loader"]
34
- }
35
- ]
36
- };
37
-
38
- return config;
39
- };
@@ -1,37 +0,0 @@
1
- import { Configuration as DevServerConfiguration } from "webpack-dev-server";
2
- import { Configuration, NoEmitOnErrorsPlugin } from "webpack";
3
- import commonConfig from "./webpack.common";
4
-
5
- const HtmlWebpackPlugin = require("html-webpack-plugin");
6
-
7
-
8
- export default (
9
- config: Configuration
10
- ) => {
11
- config = commonConfig(config);
12
-
13
- const devServer: DevServerConfiguration = {
14
- port: 4000,
15
- historyApiFallback: true,
16
- open: ["/samples.html"],
17
- liveReload: true,
18
- };
19
-
20
- config.mode = "development";
21
- config.devtool = "source-map";
22
- config.devServer = devServer;
23
-
24
- const plugins = [
25
- new NoEmitOnErrorsPlugin(),
26
- new HtmlWebpackPlugin({
27
- filename: "../dist/samples.html",
28
- template: "./template.html",
29
- inject: "head",
30
- scriptLoading: "blocking"
31
- })
32
- ];
33
-
34
- config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins;
35
-
36
- return config;
37
- }
@@ -1,17 +0,0 @@
1
- import { Configuration } from "webpack";
2
- import commonConfig from "./webpack.common";
3
-
4
- export default (
5
- config: Configuration
6
- ) => {
7
- config = commonConfig(config);
8
- config.mode = "production";
9
- config.output = {
10
- filename: "[name].min.js"
11
- };
12
- config.optimization = {
13
- minimize: true
14
- }
15
-
16
- return config;
17
- };
@@ -1 +0,0 @@
1
- TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -1,71 +0,0 @@
1
- :root {
2
- --light-hl-0: #000000;
3
- --dark-hl-0: #D4D4D4;
4
- --light-hl-1: #A31515;
5
- --dark-hl-1: #CE9178;
6
- --light-hl-2: #0000FF;
7
- --dark-hl-2: #569CD6;
8
- --light-hl-3: #001080;
9
- --dark-hl-3: #9CDCFE;
10
- --light-hl-4: #795E26;
11
- --dark-hl-4: #DCDCAA;
12
- --light-hl-5: #0070C1;
13
- --dark-hl-5: #4FC1FF;
14
- --light-hl-6: #008000;
15
- --dark-hl-6: #6A9955;
16
- --light-code-background: #FFFFFF;
17
- --dark-code-background: #1E1E1E;
18
- }
19
-
20
- @media (prefers-color-scheme: light) { :root {
21
- --hl-0: var(--light-hl-0);
22
- --hl-1: var(--light-hl-1);
23
- --hl-2: var(--light-hl-2);
24
- --hl-3: var(--light-hl-3);
25
- --hl-4: var(--light-hl-4);
26
- --hl-5: var(--light-hl-5);
27
- --hl-6: var(--light-hl-6);
28
- --code-background: var(--light-code-background);
29
- } }
30
-
31
- @media (prefers-color-scheme: dark) { :root {
32
- --hl-0: var(--dark-hl-0);
33
- --hl-1: var(--dark-hl-1);
34
- --hl-2: var(--dark-hl-2);
35
- --hl-3: var(--dark-hl-3);
36
- --hl-4: var(--dark-hl-4);
37
- --hl-5: var(--dark-hl-5);
38
- --hl-6: var(--dark-hl-6);
39
- --code-background: var(--dark-code-background);
40
- } }
41
-
42
- :root[data-theme='light'] {
43
- --hl-0: var(--light-hl-0);
44
- --hl-1: var(--light-hl-1);
45
- --hl-2: var(--light-hl-2);
46
- --hl-3: var(--light-hl-3);
47
- --hl-4: var(--light-hl-4);
48
- --hl-5: var(--light-hl-5);
49
- --hl-6: var(--light-hl-6);
50
- --code-background: var(--light-code-background);
51
- }
52
-
53
- :root[data-theme='dark'] {
54
- --hl-0: var(--dark-hl-0);
55
- --hl-1: var(--dark-hl-1);
56
- --hl-2: var(--dark-hl-2);
57
- --hl-3: var(--dark-hl-3);
58
- --hl-4: var(--dark-hl-4);
59
- --hl-5: var(--dark-hl-5);
60
- --hl-6: var(--dark-hl-6);
61
- --code-background: var(--dark-code-background);
62
- }
63
-
64
- .hl-0 { color: var(--hl-0); }
65
- .hl-1 { color: var(--hl-1); }
66
- .hl-2 { color: var(--hl-2); }
67
- .hl-3 { color: var(--hl-3); }
68
- .hl-4 { color: var(--hl-4); }
69
- .hl-5 { color: var(--hl-5); }
70
- .hl-6 { color: var(--hl-6); }
71
- pre, code { background: var(--code-background); }