@progress/sitefinity-webservices-sdk 1.0.4 → 1.1.3

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 (172) hide show
  1. package/.eslintrc.js +30 -9
  2. package/README.md +28 -11
  3. package/config/helpers.ts +8 -0
  4. package/config/webpack.common.ts +39 -0
  5. package/config/webpack.dev.ts +37 -0
  6. package/config/webpack.prod.ts +17 -0
  7. package/dist/docs/assets/highlight.css +23 -9
  8. package/dist/docs/assets/main.js +58 -52
  9. package/dist/docs/assets/search.js +1 -1
  10. package/dist/docs/assets/style.css +488 -621
  11. package/dist/docs/classes/BlobBuilder.BlobBuilder.html +137 -0
  12. package/dist/docs/classes/Data.Data.html +387 -0
  13. package/dist/docs/classes/Expression.BinaryExpression.html +184 -1
  14. package/dist/docs/classes/Expression.ComplexExpression.html +146 -1
  15. package/dist/docs/classes/Expression.ExpressionBase.html +125 -1
  16. package/dist/docs/classes/OrderProperty.OrderProperty.html +151 -0
  17. package/dist/docs/classes/Query.Query.html +353 -0
  18. package/dist/docs/classes/QueryBase.QueryBase.html +185 -0
  19. package/dist/docs/classes/QueryBuilder.QueryBuilder.html +204 -0
  20. package/dist/docs/classes/Requests_BatchRequest.BatchRequest.html +731 -17
  21. package/dist/docs/classes/Requests_BatchRequest.Transaction.html +332 -17
  22. package/dist/docs/classes/Requests_ExecutableRequest.ExecutableRequest.html +340 -1
  23. package/dist/docs/classes/Requests_Request.CommitChunksRequest.html +303 -0
  24. package/dist/docs/classes/Requests_Request.CreateRelatedRequest.html +310 -1
  25. package/dist/docs/classes/Requests_Request.CreateRequest.html +307 -1
  26. package/dist/docs/classes/Requests_Request.DeleteRelatedByIdRequest.html +309 -1
  27. package/dist/docs/classes/Requests_Request.DeleteRelatedRequest.html +302 -1
  28. package/dist/docs/classes/Requests_Request.DeleteRequest.html +298 -1
  29. package/dist/docs/classes/Requests_Request.GetByIdRequest.html +298 -1
  30. package/dist/docs/classes/Requests_Request.GetRelatedByIdRequest.html +309 -1
  31. package/dist/docs/classes/Requests_Request.GetRelatedRequest.html +302 -1
  32. package/dist/docs/classes/Requests_Request.GetRequest.html +295 -1
  33. package/dist/docs/classes/Requests_Request.UpdateRequest.html +309 -1
  34. package/dist/docs/classes/Requests_Request.UploadChunkRequest.html +352 -0
  35. package/dist/docs/classes/Requests_Request.UploadRequest.html +329 -1
  36. package/dist/docs/classes/Requests_RequestBase.RequestBase.html +275 -1
  37. package/dist/docs/classes/Requests_RequestFactory.RequestFactory.html +344 -1
  38. package/dist/docs/classes/Sitefinity.Sitefinity.html +188 -0
  39. package/dist/docs/classes/WhereQuery.WhereQuery.html +417 -0
  40. package/dist/docs/classes/chunk_upload_chunk_upload_sdk.ChunkUploadSdk.html +231 -0
  41. package/dist/docs/classes/chunk_upload_chunked_file_upload_utilities.ChunkedFileUploadUtilities.html +131 -0
  42. package/dist/docs/classes/utils.utils.html +303 -0
  43. package/dist/docs/index.html +84 -15
  44. package/dist/docs/interfaces/Data.CreateRelatedRequestOptions.html +155 -1
  45. package/dist/docs/interfaces/Data.CreateRequestOptions.html +153 -1
  46. package/dist/docs/interfaces/Data.OperationsRequestOptions.html +145 -1
  47. package/dist/docs/interfaces/Data.PropertyRequestOptions.html +149 -1
  48. package/dist/docs/interfaces/Data.RequestOptionsBase.html +136 -1
  49. package/dist/docs/interfaces/Data.SingleRelatedItemRequestOptions.html +155 -1
  50. package/dist/docs/interfaces/Data.UpdateRequestOptions.html +155 -1
  51. package/dist/docs/interfaces/Data.UploadRequestOptions.html +169 -1
  52. package/dist/docs/interfaces/Requests_BatchRequest.BatchCreateRelatedRequestOptions.html +161 -1
  53. package/dist/docs/interfaces/Requests_BatchRequest.BatchCreateRequestOptions.html +153 -1
  54. package/dist/docs/interfaces/Requests_BatchRequest.BatchPropertyRequestOptions.html +153 -1
  55. package/dist/docs/interfaces/Requests_BatchRequest.BatchRequestOptionsBase.html +145 -1
  56. package/dist/docs/interfaces/Requests_BatchRequest.BatchRequestOptionsExtended.html +153 -1
  57. package/dist/docs/interfaces/Requests_BatchRequest.BatchSingleItemRequestOptions.html +145 -1
  58. package/dist/docs/interfaces/Requests_BatchRequest.BatchSingleRelatedItemRequestOptions.html +161 -1
  59. package/dist/docs/interfaces/Requests_BatchRequest.BatchUpdateRequestOptions.html +161 -1
  60. package/dist/docs/interfaces/Requests_ExecutableRequest.ResponseHandlers.html +98 -5
  61. package/dist/docs/interfaces/Requests_Request.CommitChunksRequestOptionsExtended.html +215 -0
  62. package/dist/docs/interfaces/Requests_Request.PostRequestOptionsExtended.html +159 -1
  63. package/dist/docs/interfaces/Requests_Request.PutRequestOptionsExtended.html +161 -1
  64. package/dist/docs/interfaces/Requests_Request.RelatedByIdRequestOptionsExtended.html +169 -1
  65. package/dist/docs/interfaces/Requests_Request.RelatedRequestOptionsExtended.html +163 -1
  66. package/dist/docs/interfaces/Requests_Request.UploadChunkRequestOptionsExtended.html +210 -0
  67. package/dist/docs/interfaces/Requests_Request.UploadRequestOptionsExtended.html +180 -1
  68. package/dist/docs/interfaces/Requests_RequestBase.RequestOptionsBaseExtended.html +148 -1
  69. package/dist/docs/interfaces/Sitefinity.SDKOptions.html +128 -9
  70. package/dist/docs/interfaces/Sitefinity.Token.html +94 -1
  71. package/dist/docs/interfaces/Sitefinity.TypeOptions.html +144 -13
  72. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.ChunkUploadInfoDTO.html +159 -0
  73. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.ChunkUploadResult.html +111 -0
  74. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.CleanUpChunksRequestOptions.html +171 -0
  75. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.CommitChunksRequestOptions.html +204 -0
  76. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.GetChunkUploadInfoRequestOptions.html +166 -0
  77. package/dist/docs/interfaces/chunk_upload_chunk_upload_sdk.UploadChunkRequestOptions.html +201 -0
  78. package/dist/docs/interfaces/chunk_upload_chunked_file_upload_utilities.ChunkFileResult.html +101 -0
  79. package/dist/docs/interfaces/chunk_upload_chunked_file_upload_utilities.FileUploadChunk.html +94 -0
  80. package/dist/docs/modules/BlobBuilder.html +73 -1
  81. package/dist/docs/modules/Data.html +92 -1
  82. package/dist/docs/modules/Expression.html +77 -1
  83. package/dist/docs/modules/OrderProperty.html +73 -1
  84. package/dist/docs/modules/Query.html +73 -1
  85. package/dist/docs/modules/QueryBase.html +73 -1
  86. package/dist/docs/modules/QueryBuilder.html +73 -1
  87. package/dist/docs/modules/Requests_BatchRequest.html +94 -1
  88. package/dist/docs/modules/Requests_ExecutableRequest.html +78 -1
  89. package/dist/docs/modules/Requests_Request.html +114 -1
  90. package/dist/docs/modules/Requests_RequestBase.html +78 -1
  91. package/dist/docs/modules/Requests_RequestFactory.html +73 -1
  92. package/dist/docs/modules/Sitefinity.html +82 -1
  93. package/dist/docs/modules/WhereQuery.html +73 -1
  94. package/dist/docs/modules/chunk_upload_chunk_upload_sdk.html +88 -0
  95. package/dist/docs/modules/chunk_upload_chunked_file_upload_utilities.html +80 -0
  96. package/dist/docs/modules/constants.html +83 -1
  97. package/dist/docs/modules/utils.html +73 -1
  98. package/dist/docs/modules.html +80 -1
  99. package/dist/docs/variables/constants.CONTENT_TYPES.html +76 -0
  100. package/dist/docs/variables/constants.EXPRESSION_TYPE.html +104 -0
  101. package/dist/docs/variables/constants.HEADER_NAMES.html +102 -0
  102. package/dist/docs/variables/constants.HTTP_METHODS.html +84 -0
  103. package/dist/docs/variables/constants.ODATA_PARAMS.html +90 -0
  104. package/dist/docs/variables/constants.SF_PARAMS.html +84 -0
  105. package/dist/samples.html +237 -38
  106. package/dist/sitefinity-webservices-sdk.d.ts +0 -1
  107. package/dist/sitefinity-webservices-sdk.js +524 -119
  108. package/dist/sitefinity-webservices-sdk.js.map +1 -1
  109. package/dist/sitefinity-webservices-sdk.min.js +1 -2
  110. package/dist/src/Data.d.ts +10 -0
  111. package/dist/src/Data.spec.d.ts +1 -0
  112. package/dist/src/Query.d.ts +3 -3
  113. package/dist/src/Requests/ExecutableRequest.d.ts +3 -1
  114. package/dist/src/Requests/Request.d.ts +42 -0
  115. package/dist/src/Requests/RequestBase.d.ts +1 -2
  116. package/dist/src/Requests/RequestFactory.d.ts +3 -1
  117. package/dist/src/Requests/request.spec.d.ts +1 -0
  118. package/dist/src/Sitefinity.d.ts +2 -2
  119. package/dist/src/Sitefinity.spec.d.ts +1 -0
  120. package/dist/src/WhereQuery.d.ts +2 -2
  121. package/dist/src/chunk-upload/chunk-upload.sdk.d.ts +290 -0
  122. package/dist/src/chunk-upload/chunk-upload.sdk.spec.d.ts +1 -0
  123. package/dist/src/chunk-upload/chunked-file-upload.utilities.d.ts +13 -0
  124. package/dist/src/constants.d.ts +5 -0
  125. package/package.json +24 -22
  126. package/sitefinity-webservices-sdk.ts +0 -1
  127. package/src/Data.spec.ts +12 -12
  128. package/src/Data.ts +19 -4
  129. package/src/OrderProperty.ts +7 -7
  130. package/src/Query.ts +4 -4
  131. package/src/QueryBase.ts +4 -4
  132. package/src/QueryBuilder.ts +38 -38
  133. package/src/Requests/BatchRequest.ts +25 -25
  134. package/src/Requests/ExecutableRequest.ts +30 -24
  135. package/src/Requests/Request.ts +109 -2
  136. package/src/Requests/RequestBase.ts +3 -4
  137. package/src/Requests/RequestFactory.ts +9 -1
  138. package/src/Requests/request.spec.ts +10 -10
  139. package/src/Sitefinity.spec.ts +6 -6
  140. package/src/Sitefinity.ts +5 -5
  141. package/src/WhereQuery.ts +2 -2
  142. package/src/chunk-upload/chunk-upload.sdk.spec.ts +340 -0
  143. package/src/chunk-upload/chunk-upload.sdk.ts +436 -0
  144. package/src/chunk-upload/chunked-file-upload.utilities.ts +64 -0
  145. package/src/constants.ts +35 -30
  146. package/src/utils.ts +10 -10
  147. package/template.html +191 -38
  148. package/tsconfig.json +11 -3
  149. package/.npmignore +0 -92
  150. package/ci/pipelines/ci.yml +0 -219
  151. package/config/helpers.js +0 -10
  152. package/config/webpack.common.js +0 -39
  153. package/config/webpack.dev.js +0 -19
  154. package/config/webpack.prod.js +0 -25
  155. package/dist/docs/assets/icons.css +0 -1043
  156. package/dist/docs/assets/icons.png +0 -0
  157. package/dist/docs/assets/icons@2x.png +0 -0
  158. package/dist/docs/assets/widgets.png +0 -0
  159. package/dist/docs/assets/widgets@2x.png +0 -0
  160. package/dist/docs/classes/BlobBuilder.BlobBuilder-1.html +0 -7
  161. package/dist/docs/classes/Data.Data-1.html +0 -65
  162. package/dist/docs/classes/OrderProperty.OrderProperty-1.html +0 -1
  163. package/dist/docs/classes/Query.Query-1.html +0 -33
  164. package/dist/docs/classes/QueryBase.QueryBase-1.html +0 -7
  165. package/dist/docs/classes/QueryBuilder.QueryBuilder-1.html +0 -1
  166. package/dist/docs/classes/Sitefinity.Sitefinity-1.html +0 -5
  167. package/dist/docs/classes/WhereQuery.WhereQuery-1.html +0 -31
  168. package/dist/docs/classes/utils.utils-1.html +0 -1
  169. package/dist/sitefinity-webservices-sdk.min.js.LICENSE.txt +0 -14
  170. package/package-lock.json +0 -17487
  171. package/type.txt +0 -1
  172. package/version.txt +0 -1
@@ -0,0 +1,290 @@
1
+ import { CreateRequestOptions } from "../Data";
2
+ import { RequestFactory } from "../Requests/RequestFactory";
3
+ import { TypeOptions } from "../Sitefinity";
4
+ import { ChunkFileResult } from "./chunked-file-upload.utilities";
5
+ /**
6
+ * @description Entry point for all chunk upload related tasks
7
+ * @export
8
+ * @class ChunkUploadSdk
9
+ */
10
+ export declare class ChunkUploadSdk {
11
+ private urlOptions;
12
+ private factory;
13
+ constructor(urlOptions: TypeOptions, factory: RequestFactory);
14
+ /**
15
+ * @description Gets the needed information to start uploading chunks to the server
16
+ * @param {GetChunkUploadInfoRequestOptions} parameters
17
+ * @memberof ChunkUploadSdk
18
+ */
19
+ getChunkUploadInfo(parameters: GetChunkUploadInfoRequestOptions): void;
20
+ /**
21
+ * @description Sends a single chunk request to the server
22
+ * @param {UploadChunkRequestOptions} parameters
23
+ * @memberof ChunkUploadSdk
24
+ */
25
+ uploadChunk(parameters: UploadChunkRequestOptions): void;
26
+ /**
27
+ * @description Sends the commit chunks request to the server
28
+ * @param {CommitChunksRequestOptions} parameters
29
+ * @memberof ChunkUploadSdk
30
+ */
31
+ commitChunks(parameters: CommitChunksRequestOptions): void;
32
+ /**
33
+ * @description This request is intended to be used when something in the chunk upload process fails to delete the sent chunks
34
+ * @param {CleanUpChunksRequestOptions} parameters
35
+ * @memberof ChunkUploadSdk
36
+ */
37
+ cleanUpChunks(parameters: CleanUpChunksRequestOptions): void;
38
+ /**
39
+ * Chunks the provided file. If the file is a base64 string this method will convert it to a blob and then chunk it.
40
+ *
41
+ * @param {(Blob | string)} file
42
+ * @param {number} chunkSize
43
+ * @param {string} contentTypeMime
44
+ * @return {*} {ChunkFileResult}
45
+ * @memberof ChunkUploadService
46
+ */
47
+ chunkFile(file: Blob | string, chunkSize: number, contentTypeMime: string): ChunkFileResult;
48
+ }
49
+ /**
50
+ * @description This interface shows the minimum data needed to create a single chunk upload request
51
+ * @export
52
+ * @interface UploadChunkRequestOptions
53
+ * @extends {CreateRequestOptions}
54
+ */
55
+ export interface UploadChunkRequestOptions extends CreateRequestOptions {
56
+ /**
57
+ * @description the data needed to construct the request
58
+ * @type {{
59
+ * fileMimeType: string;
60
+ * chunkedFileUploadSessionId: string;
61
+ * chunkSize: number;
62
+ * chunkOrdinal: number;
63
+ * numberOfChunks: number;
64
+ * positionOfChunkInQueue?: number;
65
+ * chunkBlob: Blob;
66
+ * blobStorageProviderName: string;
67
+ * }}
68
+ * @memberof UploadChunkRequestOptions
69
+ */
70
+ data: {
71
+ /**
72
+ * @description the file's mime type
73
+ * @type {string}
74
+ */
75
+ fileMimeType: string;
76
+ /**
77
+ * @description the current chunk upload session Id
78
+ * @type {string}
79
+ */
80
+ chunkedFileUploadSessionId: string;
81
+ /**
82
+ * @description the chunk size in bytes
83
+ * @type {number}
84
+ */
85
+ chunkSize: number;
86
+ /**
87
+ * @description the chunk's ordinal
88
+ * @type {number}
89
+ */
90
+ chunkOrdinal: number;
91
+ /**
92
+ * @description the total number of chunks
93
+ * @type {number}
94
+ */
95
+ numberOfChunks: number;
96
+ /**
97
+ * @description Optional. The position of the chunk in the request queue, this property is used to calculate the progress of the upload
98
+ * @type {number}
99
+ */
100
+ positionOfChunkInQueue?: number;
101
+ /**
102
+ * @description The chunk data
103
+ * @type {Blob}
104
+ */
105
+ chunkBlob: Blob;
106
+ /**
107
+ * @description the target blob storage provider's name
108
+ * @type {string}
109
+ */
110
+ blobStorageProviderName: string;
111
+ };
112
+ }
113
+ /**
114
+ * @description This interface shows the minimum data needed to create a commit chunks request
115
+ * @export
116
+ * @interface CommitChunksRequestOptions
117
+ * @extends {CreateRequestOptions}
118
+ */
119
+ export interface CommitChunksRequestOptions extends CreateRequestOptions {
120
+ /**
121
+ * @description the data needed to construct the request
122
+ * @type {{
123
+ * chunkedFileUploadSessionId: string;
124
+ * contentType: string;
125
+ * fileTotalSize: number;
126
+ * numberOfChunks: number;
127
+ * name: string;
128
+ * blobStorageProviderName: string;
129
+ * uploadProperties: { [key: string]: string };
130
+ * itemId?: string;
131
+ * }}
132
+ * @memberof CommitChunksRequestOptions
133
+ */
134
+ data: {
135
+ /**
136
+ * @description the current chunk upload session Id
137
+ * @type {string}
138
+ */
139
+ chunkedFileUploadSessionId: string;
140
+ /**
141
+ * @description the file's mime type
142
+ * @type {string}
143
+ */
144
+ contentType: string;
145
+ /**
146
+ * @description the total size of the file
147
+ * @type {number}
148
+ */
149
+ fileTotalSize: number;
150
+ /**
151
+ * @description the total number of chunks
152
+ * @type {number}
153
+ */
154
+ numberOfChunks: number;
155
+ /**
156
+ * @description the file's name
157
+ * @type {string}
158
+ */
159
+ name: string;
160
+ /**
161
+ * @description the target blob storage provider's name
162
+ * @type {string}
163
+ */
164
+ blobStorageProviderName: string;
165
+ /**
166
+ * @description the properties of the uploaded file like the Title, UrlName, etc
167
+ * @type {{ [key: string]: string }}
168
+ */
169
+ uploadProperties: {
170
+ [key: string]: string;
171
+ };
172
+ /**
173
+ * @description Optional. Used when updating a media item, can be null when used to create a new media file.
174
+ * @type {string}
175
+ */
176
+ itemId?: string;
177
+ };
178
+ }
179
+ /**
180
+ * @description This interface shows the minimum data needed to create request to get the chunk upload information for the current library from the server
181
+ * @export
182
+ * @interface GetChunkUploadInfoRequestOptions
183
+ * @extends {CreateRequestOptions}
184
+ */
185
+ export interface GetChunkUploadInfoRequestOptions extends CreateRequestOptions {
186
+ /**
187
+ * @description the data needed to construct the request
188
+ * @type {{
189
+ * libraryId: string;
190
+ * }}
191
+ * @memberof GetChunkUploadInfoRequestOptions
192
+ */
193
+ data: {
194
+ /**
195
+ * @description the parent library (not folder) in which the file will be uploaded to
196
+ * @type {string}
197
+ */
198
+ libraryId: string;
199
+ };
200
+ }
201
+ /**
202
+ * @description This interface show the minimum data needed to create a request to delete all chunk from a chunk upload session
203
+ * @export
204
+ * @interface CleanUpChunksRequestOptions
205
+ * @extends {CreateRequestOptions}
206
+ */
207
+ export interface CleanUpChunksRequestOptions extends CreateRequestOptions {
208
+ /**
209
+ * @description the data needed to construct the request
210
+ * @type {{
211
+ * chunkedFileUploadSessionId: string;
212
+ * blobStorageProviderName: string;
213
+ * }}
214
+ * @memberof CleanUpChunksRequestOptions
215
+ */
216
+ data: {
217
+ /**
218
+ * @description the current chunk upload session Id
219
+ * @type {string}
220
+ */
221
+ chunkedFileUploadSessionId: string;
222
+ /**
223
+ * @description the target blob storage provider's name
224
+ * @type {string}
225
+ */
226
+ blobStorageProviderName: string;
227
+ };
228
+ }
229
+ /**
230
+ * @description This is a data transfer object that shows the information provided by the getChunkUploadInfo request
231
+ * @export
232
+ * @interface ChunkUploadInfoDTO
233
+ */
234
+ export interface ChunkUploadInfoDTO {
235
+ /**
236
+ * @description shows wether the current blob storage provider supports uploading in chunks
237
+ * @type {boolean}
238
+ * @memberof ChunkUploadInfoDTO
239
+ */
240
+ ProviderSupportsChunkUpload: boolean;
241
+ /**
242
+ * @description the target blob storage provider's name
243
+ * @type {string}
244
+ * @memberof ChunkUploadInfoDTO
245
+ */
246
+ BlobStorageProviderName: string;
247
+ /**
248
+ * @description the current chunk upload session Id
249
+ * @type {string}
250
+ * @memberof ChunkUploadInfoDTO
251
+ */
252
+ ChunkedFileUploadSessionId: string;
253
+ /**
254
+ * @description the chunk size in bytes
255
+ * @type {number}
256
+ * @memberof ChunkUploadInfoDTO
257
+ */
258
+ ChunkSize: number;
259
+ /**
260
+ * @description the maximum amount of time a chunk should be retired
261
+ * @type {number}
262
+ * @memberof ChunkUploadInfoDTO
263
+ */
264
+ MaxRetryCountForChunk: number;
265
+ /**
266
+ * @description the maximum simultaneous requests that should be sent to the server
267
+ * @type {number}
268
+ * @memberof ChunkUploadInfoDTO
269
+ */
270
+ MaxSimultaneousChunkUploadRequestsPerSession: number;
271
+ }
272
+ /**
273
+ * @description A DTO containing the data that the server responds with when a chunk is uploaded
274
+ * @export
275
+ * @interface ChunkUploadResult
276
+ */
277
+ export interface ChunkUploadResult {
278
+ /**
279
+ * @description indicates whether the chunk has been successfully uploaded
280
+ * @type {boolean}
281
+ * @memberof ChunkUploadResult
282
+ */
283
+ SuccessfullyUploaded: boolean;
284
+ /**
285
+ * @description the current chunk upload session Id
286
+ * @type {string}
287
+ * @memberof ChunkUploadResult
288
+ */
289
+ ChunkedFileUploadSessionId: string;
290
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare class ChunkedFileUploadUtilities {
2
+ chunkFile(file: Blob | string, chunkSize: number, contentTypeMime: string): ChunkFileResult;
3
+ private base64ToBlob;
4
+ }
5
+ export interface FileUploadChunk {
6
+ ordinal: number;
7
+ content: Blob;
8
+ }
9
+ export interface ChunkFileResult {
10
+ chunks: Array<FileUploadChunk>;
11
+ totalChunksCount: number;
12
+ fileTotalSize: number;
13
+ }
@@ -42,6 +42,11 @@ export declare const HEADER_NAMES: {
42
42
  serviceRequest: string;
43
43
  choicesBinaryRepresentation: string;
44
44
  integrationMode: string;
45
+ chunkOrdinal: string;
46
+ chunkSize: string;
47
+ fileSize: string;
48
+ chunkedFileUploadSessionId: string;
49
+ blobStorageProviderName: string;
45
50
  };
46
51
  export declare const HTTP_METHODS: {
47
52
  get: string;
package/package.json CHANGED
@@ -1,39 +1,41 @@
1
1
  {
2
2
  "name": "@progress/sitefinity-webservices-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.1.3",
4
4
  "scripts": {
5
- "start": "webpack-dev-server --config config/webpack.dev.js",
6
- "build:dev": "webpack --config config/webpack.dev.js --progress --profile",
7
- "build:prod": "webpack --config config/webpack.prod.js --progress --profile",
8
- "build:release": "npm run build:prod & npm run build:dev & npm run docs",
5
+ "start": "webpack-dev-server --config config/webpack.dev.ts",
6
+ "build:dev": "webpack --config config/webpack.dev.ts --progress --profile",
7
+ "build:prod": "webpack --config config/webpack.prod.ts --progress --profile",
8
+ "build:release": "npm run build:dev & npm run build:prod & npm run docs",
9
9
  "test": "karma start --single_run",
10
10
  "test:debug": "karma start",
11
11
  "docs": "typedoc",
12
- "lint": "eslint . --ext .ts"
12
+ "lint": "eslint . --ext .ts",
13
+ "lint:fix": "eslint . --ext .ts --fix"
13
14
  },
14
15
  "devDependencies": {
15
- "@types/jasmine": "3.10.3",
16
+ "@types/jasmine": "4.3.1",
16
17
  "@types/jasmine-ajax": "3.3.3",
17
- "@types/node": "17.0.21",
18
- "@typescript-eslint/eslint-plugin": "5.13.0",
19
- "@typescript-eslint/parser": "5.13.0",
20
- "awesome-typescript-loader": "5.2.1",
21
- "eslint": "8.10.0",
18
+ "@types/node": "18.13.0",
19
+ "@typescript-eslint/eslint-plugin": "5.51.0",
20
+ "@typescript-eslint/parser": "5.51.0",
21
+ "eslint": "8.33.0",
22
22
  "html-webpack-plugin": "5.5.0",
23
- "jasmine": "4.0.2",
23
+ "jasmine": "4.3.0",
24
24
  "jasmine-ajax": "4.0.0",
25
25
  "jasmine-spec-reporter": "7.0.0",
26
- "karma": "6.3.17",
27
- "karma-chrome-launcher": "3.1.0",
28
- "karma-jasmine": "4.0.1",
26
+ "karma": "6.4.1",
27
+ "karma-chrome-launcher": "3.1.1",
28
+ "karma-jasmine": "5.1.0",
29
29
  "karma-jasmine-ajax": "0.1.13",
30
- "karma-spec-reporter": "0.0.33",
30
+ "karma-spec-reporter": "0.0.34",
31
31
  "karma-typescript": "5.5.3",
32
- "typedoc": "0.22.12",
33
- "typescript": "4.6.2",
34
- "webpack": "5.69.1",
35
- "webpack-cli": "4.9.2",
36
- "webpack-dev-server": "4.7.4",
32
+ "ts-loader": "9.4.2",
33
+ "ts-node": "10.9.1",
34
+ "typedoc": "0.23.24",
35
+ "typescript": "4.8.2",
36
+ "webpack": "5.75.0",
37
+ "webpack-cli": "4.10.0",
38
+ "webpack-dev-server": "4.10.1",
37
39
  "webpack-merge": "5.8.0"
38
40
  }
39
41
  }
@@ -4,7 +4,6 @@ export * from "./src/utils";
4
4
  export * from "./src/WhereQuery";
5
5
  export * from "./src/Sitefinity";
6
6
  export * from "./src/QueryBuilder";
7
- export * from "./src/QueryBase";
8
7
  export * from "./src/Query";
9
8
  export * from "./src/OrderProperty";
10
9
  export * from "./src/Expression";
package/src/Data.spec.ts CHANGED
@@ -44,11 +44,11 @@ describe("Data class tests", () => {
44
44
  const request = jasmine.Ajax.requests.mostRecent();
45
45
  expect(request.url).toContain(`${ODATA_PARAMS.$filter}=${queryResult}`);
46
46
  expect(request.url).toContain(`${baseUrl}${action}`);
47
- expect(request.url).toContain(`${SF_PARAMS.fallbackParams}=${fallbackProperties.join(',')}`);
47
+ expect(request.url).toContain(`${SF_PARAMS.fallbackParams}=${fallbackProperties.join(",")}`);
48
48
 
49
49
  request.respondWith({
50
50
  status: 200,
51
- responseText: '{"message":"test"}'
51
+ responseText: "{\"message\":\"test\"}"
52
52
  });
53
53
 
54
54
  expect(successCbSpy).toHaveBeenCalledOnceWith({ message: "test" });
@@ -64,10 +64,10 @@ describe("Data class tests", () => {
64
64
  const request = jasmine.Ajax.requests.mostRecent();
65
65
  request.respondWith({
66
66
  status: 400,
67
- responseText: '{"message":"test"}'
67
+ responseText: "{\"message\":\"test\"}"
68
68
  });
69
69
 
70
- expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 })
70
+ expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 });
71
71
  expect(successCbSpy).not.toHaveBeenCalled();
72
72
  });
73
73
 
@@ -85,7 +85,7 @@ describe("Data class tests", () => {
85
85
 
86
86
  request.respondWith({
87
87
  status: 200,
88
- responseText: '{"message":"test"}'
88
+ responseText: "{\"message\":\"test\"}"
89
89
  });
90
90
 
91
91
  expect(successCbSpy).toHaveBeenCalledOnceWith({ message: "test" });
@@ -110,10 +110,10 @@ describe("Data class tests", () => {
110
110
  const request = jasmine.Ajax.requests.mostRecent();
111
111
  request.respondWith({
112
112
  status: 400,
113
- responseText: '{"message":"test"}'
113
+ responseText: "{\"message\":\"test\"}"
114
114
  });
115
115
 
116
- expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 })
116
+ expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 });
117
117
  expect(successCbSpy).not.toHaveBeenCalled();
118
118
  });
119
119
 
@@ -130,11 +130,11 @@ describe("Data class tests", () => {
130
130
  const request = jasmine.Ajax.requests.mostRecent();
131
131
  expect(request.url).toContain(`${ODATA_PARAMS.$filter}=${queryResult}`);
132
132
  expect(request.url).toContain(`${baseUrl}(${key})/${action}`);
133
- expect(request.url).toContain(`${SF_PARAMS.fallbackParams}=${fallbackProperties.join(',')}`);
133
+ expect(request.url).toContain(`${SF_PARAMS.fallbackParams}=${fallbackProperties.join(",")}`);
134
134
 
135
135
  request.respondWith({
136
136
  status: 200,
137
- responseText: '{"message":"test"}'
137
+ responseText: "{\"message\":\"test\"}"
138
138
  });
139
139
 
140
140
  expect(successCbSpy).toHaveBeenCalledOnceWith({ message: "test" });
@@ -151,10 +151,10 @@ describe("Data class tests", () => {
151
151
  const request = jasmine.Ajax.requests.mostRecent();
152
152
  request.respondWith({
153
153
  status: 400,
154
- responseText: '{"message":"test"}'
154
+ responseText: "{\"message\":\"test\"}"
155
155
  });
156
156
 
157
- expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 })
157
+ expect(failureCbSpy).toHaveBeenCalledOnceWith({ message: "test", status: 400 });
158
158
  expect(successCbSpy).not.toHaveBeenCalled();
159
159
  });
160
- });
160
+ });
package/src/Data.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { SF_PARAMS } from "./constants";
1
+ import { ChunkUploadSdk } from "./chunk-upload/chunk-upload.sdk";
2
+ import { SF_PARAMS } from "./constants";
2
3
  import { Query } from "./Query";
3
4
  import { ExecutableRequest } from "./Requests/ExecutableRequest";
4
5
  import { RequestFactory } from "./Requests/RequestFactory";
@@ -16,6 +17,19 @@ export class Data {
16
17
  this.factory = factory;
17
18
  }
18
19
 
20
+
21
+ /**
22
+ * Returns an instance of the @type {ChunkUploadService}
23
+ *
24
+ * @readonly
25
+ * @type {ChunkUploadSdk}
26
+ * @memberof Data
27
+ */
28
+ public get chunkUpload(): ChunkUploadSdk {
29
+ const service = new ChunkUploadSdk(this.urlOptions, this.factory);
30
+ return service;
31
+ }
32
+
19
33
  /**
20
34
  * Executes a GET request to retrieve a collection of items.
21
35
  */
@@ -275,7 +289,7 @@ export class Data {
275
289
 
276
290
  const data = {
277
291
  "@odata.id": parameters.link
278
- }
292
+ };
279
293
 
280
294
  const request = this.factory.createRelated({
281
295
  urlOptions: this.urlOptions,
@@ -322,7 +336,7 @@ export class Data {
322
336
  _factory: this.factory,
323
337
  successCb: parameters.successCb,
324
338
  failureCb: parameters.failureCb
325
- }
339
+ };
326
340
 
327
341
  const batch = this.factory.batch(options);
328
342
  const transaction = batch.beginTransaction();
@@ -353,7 +367,7 @@ export class Data {
353
367
  }
354
368
 
355
369
  batch.endTransaction(transaction);
356
- batch.execute();
370
+ return batch.execute();
357
371
  }
358
372
  }
359
373
 
@@ -362,6 +376,7 @@ export interface RequestOptionsBase {
362
376
  action?: string;
363
377
  successCb?: Function;
364
378
  failureCb?: Function;
379
+ progressCb?: Function;
365
380
  fallbackProperties?: string[];
366
381
  key?: string | number;
367
382
  }
@@ -1,19 +1,19 @@
1
- import { utils } from './utils';
1
+ import { utils } from "./utils";
2
2
 
3
3
  export class OrderProperty {
4
4
  constructor(private propertyPath: string, private isDesc: boolean = null) {
5
5
  if (!utils.isString(propertyPath))
6
- throw new Error('Property name is not a valid string');
6
+ throw new Error("Property name is not a valid string");
7
7
 
8
8
  propertyPath = propertyPath.trim();
9
9
 
10
- const parts = propertyPath.split(' ');
10
+ const parts = propertyPath.split(" ");
11
11
  // parts[0] is the propertyPath; [1] would be whether descending or not.
12
12
  if (parts.length > 1 && isDesc !== true && isDesc !== false) {
13
- isDesc = parts[1].toLowerCase() == 'desc';
13
+ isDesc = parts[1].toLowerCase() == "desc";
14
14
  if (!isDesc) {
15
15
  // isDesc is false but check to make sure its intended.
16
- const isAsc = parts[1].toLowerCase() == 'asc';
16
+ const isAsc = parts[1].toLowerCase() == "asc";
17
17
  if (!isAsc) {
18
18
  throw new Error("the second word in the propertyPath must begin with 'desc' or 'asc'");
19
19
  }
@@ -33,7 +33,7 @@ export class OrderProperty {
33
33
  }
34
34
 
35
35
  getValue(): string {
36
- const direction = (this.isDesc) ? 'desc' : 'asc';
37
- return this.propertyPath + ' ' + direction;
36
+ const direction = (this.isDesc) ? "desc" : "asc";
37
+ return this.propertyPath + " " + direction;
38
38
  }
39
39
  }
package/src/Query.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { QueryBase } from './QueryBase';
2
- import { WhereQuery } from './WhereQuery';
3
- import { OrderProperty } from './OrderProperty';
4
- import { QueryBuilder } from './QueryBuilder';
1
+ import { QueryBase } from "./QueryBase";
2
+ import { WhereQuery } from "./WhereQuery";
3
+ import { OrderProperty } from "./OrderProperty";
4
+ import { QueryBuilder } from "./QueryBuilder";
5
5
 
6
6
  /**
7
7
  * The query class is used for constructing queries.
package/src/QueryBase.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { utils } from './utils';
1
+ import { utils } from "./utils";
2
2
 
3
3
  /**
4
4
  * The base class for dealing with queries.
@@ -41,11 +41,11 @@ export class QueryBase {
41
41
  for (let i = 0; i < propPaths.length; i++) {
42
42
  const member = propPaths[i];
43
43
  if (!utils.isString(member)) {
44
- throw new Error('Invalid argument in clause');
44
+ throw new Error("Invalid argument in clause");
45
45
  }
46
46
 
47
- if (!allowNested && member.indexOf('.') > -1) {
48
- throw new Error('Invalid argument in clause');
47
+ if (!allowNested && member.indexOf(".") > -1) {
48
+ throw new Error("Invalid argument in clause");
49
49
  }
50
50
  }
51
51
  }