spitfirepm 23.9700.7 → 23.9700.8

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.
package/README.md CHANGED
@@ -25,6 +25,7 @@ apiResult.then( (a) => {
25
25
  ### Change Log
26
26
 
27
27
  ```
28
+ 23.9700.8 - Improved ContactClient endpoints
28
29
  23.9700.7 - GetDV method clarifications
29
30
  23.9700.6 - Audit History Model enhanced
30
31
  23.9700.5 - Lookup Editor Endpoints
@@ -1310,7 +1310,7 @@ export declare class ConfigClient extends APIClientBase {
1310
1310
  private processTestLookupResultWithCallbacks;
1311
1311
  protected processTestLookupResult(xhr: any): LookupTestResult | null | null;
1312
1312
  /**
1313
- * Returns the Lookups (pickers)
1313
+ * Returns the Lookups (pickers). Users without LookupEditor permission only see 'Agent' lookups.
1314
1314
  */
1315
1315
  getLookups(): Promise<Lookup[] | null>;
1316
1316
  private getLookupsWithCallbacks;
@@ -1342,7 +1342,7 @@ export declare class ConfigClient extends APIClientBase {
1342
1342
  private processCopyLookupWithCallbacks;
1343
1343
  protected processCopyLookup(xhr: any): Lookup | null | null;
1344
1344
  /**
1345
- * Returns the fields of one Lookup
1345
+ * Returns the fields of one Lookup. Non LookupEditor users only see PredicateMode=I.
1346
1346
  * @param lookupKey Lookup key
1347
1347
  */
1348
1348
  getLookupFields(lookupKey: string): Promise<LookupField[] | null>;
@@ -1685,8 +1685,8 @@ export declare class DocumentToolsClient extends APIClientBase {
1685
1685
  * @param id Document Key (use empty for auto assign)
1686
1686
  * @param typeKey Type
1687
1687
  * @param forProject (optional) Project
1688
- * @param forParent (optional) Parent Doc Key (NextDocFlow rules apply; See https://support.spitfirepm.com/kba-01517/)
1689
- * @param forBatch (optional) Batch/Subcontract
1688
+ * @param forParent (optional) Parent Doc Key (NextDocFlow rules apply; See https://support.spitfirepm.com/kba-01517/). When the parent is a commitment, its subcontract number is used and its lines are brought in
1689
+ * @param forBatch (optional) Batch/Subcontract. Naming a commitment here brings in its lines, same as forParent
1690
1690
  * @param forSourceContact (optional) Source Contact
1691
1691
  */
1692
1692
  createDocument(id: string, typeKey: string, forProject?: string | null | undefined, forParent?: string | null | undefined, forBatch?: string | null | undefined, forSourceContact?: string | null | undefined): Promise<string>;
@@ -1751,6 +1751,15 @@ export declare class DocumentToolsClient extends APIClientBase {
1751
1751
  private patchDocAddressWithCallbacks;
1752
1752
  private processPatchDocAddressWithCallbacks;
1753
1753
  protected processPatchDocAddress(xhr: any): string | null;
1754
+ /**
1755
+ * Inserts an attachment on the specified document, optionally from a template
1756
+ * @param id Document Key
1757
+ * @param newData New attachment data. To copy a template use DocKey:TemplateKey
1758
+ */
1759
+ addDocAttachments(id: string, newData: DocAttachment[]): Promise<DocAttachment | null>;
1760
+ private addDocAttachmentsWithCallbacks;
1761
+ private processAddDocAttachmentsWithCallbacks;
1762
+ protected processAddDocAttachments(xhr: any): DocAttachment | null | null;
1754
1763
  /**
1755
1764
  * Returns the attachments for the specified document
1756
1765
  * @param id Document Key
@@ -1780,15 +1789,6 @@ export declare class DocumentToolsClient extends APIClientBase {
1780
1789
  private updateDocAttachmentsWithCallbacks;
1781
1790
  private processUpdateDocAttachmentsWithCallbacks;
1782
1791
  protected processUpdateDocAttachments(xhr: any): string | null;
1783
- /**
1784
- * Inserts an attachment on the specified document, optionally from a template
1785
- * @param id Document Key
1786
- * @param newData New attachment data. To copy a template use DocKey:TemplateKey
1787
- */
1788
- addDocAttachments(id: string, newData: DocAttachment[]): Promise<DocAttachment | null>;
1789
- private addDocAttachmentsWithCallbacks;
1790
- private processAddDocAttachmentsWithCallbacks;
1791
- protected processAddDocAttachments(xhr: any): DocAttachment | null | null;
1792
1792
  /**
1793
1793
  * Creates a PDF from the Assembled Attachments specified on this document; returns a task key
1794
1794
  * @param id Document Key
@@ -1948,7 +1948,7 @@ export declare class DocumentToolsClient extends APIClientBase {
1948
1948
  private processGetChangedItemsWithCallbacks;
1949
1949
  protected processGetChangedItems(xhr: any): DataDifferential | null;
1950
1950
  /**
1951
- * Returns the comments for the specified document
1951
+ * Returns the comments for the specified document, most recent first.
1952
1952
  * @param id Document Key
1953
1953
  */
1954
1954
  getDocComments(id: string): Promise<Comment[] | null>;
@@ -1976,7 +1976,7 @@ export declare class DocumentToolsClient extends APIClientBase {
1976
1976
  private processUpdateDocCommentsWithCallbacks;
1977
1977
  protected processUpdateDocComments(xhr: any): string | null;
1978
1978
  /**
1979
- * Inserts Comments on the specified document
1979
+ * Inserts Comments on the specified document. Typically TopicKey=DocRevKey because comments are associated with the Doc Revision. You can specify the empty GUID for TopicKey and/or FromUser, the correct defaults will be supplied (the current Revision and the current user). Other values for TopicKey must resolve to this document (for example, a prior revision comment). Any value for created more than 5 days ago stamps the comment with the server time. FromUser is set automatically.
1980
1980
  * @param id Document Key
1981
1981
  * @param newData New comment data
1982
1982
  */
@@ -4710,6 +4710,8 @@ export interface ContactSummary {
4710
4710
  Company?: string | undefined;
4711
4711
  /** For Vendors, indicate related CSI */
4712
4712
  CSIList?: string | undefined;
4713
+ /** Readonly. Specifies when this user last logged in. Kept for inactive and former users. */
4714
+ LastLogin?: Date;
4713
4715
  /** When false, this row is ignored and ineffective */
4714
4716
  Active?: boolean;
4715
4717
  /** When true, there are no references to this contact */
@@ -12003,7 +12003,7 @@ class ConfigClient extends APIClientBase_1.APIClientBase {
12003
12003
  return null;
12004
12004
  }
12005
12005
  /**
12006
- * Returns the Lookups (pickers)
12006
+ * Returns the Lookups (pickers). Users without LookupEditor permission only see 'Agent' lookups.
12007
12007
  */
12008
12008
  getLookups() {
12009
12009
  return new Promise((resolve, reject) => {
@@ -12336,7 +12336,7 @@ class ConfigClient extends APIClientBase_1.APIClientBase {
12336
12336
  return null;
12337
12337
  }
12338
12338
  /**
12339
- * Returns the fields of one Lookup
12339
+ * Returns the fields of one Lookup. Non LookupEditor users only see PredicateMode=I.
12340
12340
  * @param lookupKey Lookup key
12341
12341
  */
12342
12342
  getLookupFields(lookupKey) {
@@ -14913,6 +14913,12 @@ class ContactClient extends APIClientBase_1.APIClientBase {
14913
14913
  result403 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
14914
14914
  return throwException("Not allowed", status, _responseText, _headers, result403);
14915
14915
  }
14916
+ else if (status === 500) {
14917
+ const _responseText = xhr.responseText;
14918
+ let result500 = null;
14919
+ result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
14920
+ return throwException("Failed", status, _responseText, _headers, result500);
14921
+ }
14916
14922
  else if (status !== 200 && status !== 204) {
14917
14923
  const _responseText = xhr.responseText;
14918
14924
  return throwException("An unexpected server error occurred.", status, _responseText, _headers);
@@ -15066,6 +15072,12 @@ class ContactClient extends APIClientBase_1.APIClientBase {
15066
15072
  result403 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
15067
15073
  return throwException("Not allowed", status, _responseText, _headers, result403);
15068
15074
  }
15075
+ else if (status === 500) {
15076
+ const _responseText = xhr.responseText;
15077
+ let result500 = null;
15078
+ result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
15079
+ return throwException("Failed", status, _responseText, _headers, result500);
15080
+ }
15069
15081
  else if (status !== 200 && status !== 204) {
15070
15082
  const _responseText = xhr.responseText;
15071
15083
  return throwException("An unexpected server error occurred.", status, _responseText, _headers);
@@ -15510,8 +15522,8 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
15510
15522
  * @param id Document Key (use empty for auto assign)
15511
15523
  * @param typeKey Type
15512
15524
  * @param forProject (optional) Project
15513
- * @param forParent (optional) Parent Doc Key (NextDocFlow rules apply; See https://support.spitfirepm.com/kba-01517/)
15514
- * @param forBatch (optional) Batch/Subcontract
15525
+ * @param forParent (optional) Parent Doc Key (NextDocFlow rules apply; See https://support.spitfirepm.com/kba-01517/). When the parent is a commitment, its subcontract number is used and its lines are brought in
15526
+ * @param forBatch (optional) Batch/Subcontract. Naming a commitment here brings in its lines, same as forParent
15515
15527
  * @param forSourceContact (optional) Source Contact
15516
15528
  */
15517
15529
  createDocument(id, typeKey, forProject, forParent, forBatch, forSourceContact) {
@@ -16118,38 +16130,41 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16118
16130
  return null;
16119
16131
  }
16120
16132
  /**
16121
- * Returns the attachments for the specified document
16133
+ * Inserts an attachment on the specified document, optionally from a template
16122
16134
  * @param id Document Key
16123
- * @return No changes
16135
+ * @param newData New attachment data. To copy a template use DocKey:TemplateKey
16124
16136
  */
16125
- getDocAttachments(id) {
16137
+ addDocAttachments(id, newData) {
16126
16138
  return new Promise((resolve, reject) => {
16127
- this.getDocAttachmentsWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception));
16139
+ this.addDocAttachmentsWithCallbacks(id, newData, (result) => resolve(result), (exception, _reason) => reject(exception));
16128
16140
  });
16129
16141
  }
16130
- getDocAttachmentsWithCallbacks(id, onSuccess, onFail) {
16142
+ addDocAttachmentsWithCallbacks(id, newData, onSuccess, onFail) {
16131
16143
  let url_ = this.baseUrl + "/api/document/{id}/attachments";
16132
16144
  if (id === undefined || id === null)
16133
16145
  throw new globalThis.Error("The parameter 'id' must be defined.");
16134
16146
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
16135
16147
  url_ = url_.replace(/[?&]$/, "");
16148
+ const content_ = JSON.stringify(newData);
16136
16149
  jQuery.ajax({
16137
16150
  url: url_,
16138
16151
  beforeSend: this.beforeSend,
16139
- type: "get",
16152
+ type: "post",
16153
+ data: content_,
16140
16154
  dataType: "text",
16141
16155
  headers: {
16156
+ "Content-Type": "application/json",
16142
16157
  "Accept": "application/json"
16143
16158
  }
16144
16159
  }).done((_data, _textStatus, xhr) => {
16145
- this.processGetDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16160
+ this.processAddDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16146
16161
  }).fail((xhr) => {
16147
- this.processGetDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16162
+ this.processAddDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16148
16163
  });
16149
16164
  }
16150
- processGetDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16165
+ processAddDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16151
16166
  try {
16152
- let result = this.transformResult(_url, xhr, (xhr) => this.processGetDocAttachments(xhr));
16167
+ let result = this.transformResult(_url, xhr, (xhr) => this.processAddDocAttachments(xhr));
16153
16168
  if (onSuccess !== undefined)
16154
16169
  onSuccess(result);
16155
16170
  }
@@ -16158,14 +16173,20 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16158
16173
  onFail(e, "http_service_exception");
16159
16174
  }
16160
16175
  }
16161
- processGetDocAttachments(xhr) {
16176
+ processAddDocAttachments(xhr) {
16162
16177
  const status = xhr.status;
16163
16178
  let _headers = {};
16164
- if (status === 204) {
16179
+ if (status === 200) {
16165
16180
  const _responseText = xhr.responseText;
16166
- let result204 = null;
16167
- result204 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16168
- return result204;
16181
+ let result200 = null;
16182
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16183
+ return result200;
16184
+ }
16185
+ else if (status === 400) {
16186
+ const _responseText = xhr.responseText;
16187
+ let result400 = null;
16188
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16189
+ return throwException("Missing or invalid data", status, _responseText, _headers, result400);
16169
16190
  }
16170
16191
  else if (status === 403) {
16171
16192
  const _responseText = xhr.responseText;
@@ -16189,7 +16210,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16189
16210
  const _responseText = xhr.responseText;
16190
16211
  let result409 = null;
16191
16212
  result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16192
- return throwException("Could not persist the document", status, _responseText, _headers, result409);
16213
+ return throwException("Could not persist the insert", status, _responseText, _headers, result409);
16193
16214
  }
16194
16215
  else if (status === 500) {
16195
16216
  const _responseText = xhr.responseText;
@@ -16204,42 +16225,38 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16204
16225
  return null;
16205
16226
  }
16206
16227
  /**
16207
- * Removes the specified attachment from the specified document
16228
+ * Returns the attachments for the specified document
16208
16229
  * @param id Document Key
16209
- * @param attachKeys Doc Attachment Keys
16210
- * @return Specified addresses not found
16230
+ * @return No changes
16211
16231
  */
16212
- deleteDocAttachments(id, attachKeys) {
16232
+ getDocAttachments(id) {
16213
16233
  return new Promise((resolve, reject) => {
16214
- this.deleteDocAttachmentsWithCallbacks(id, attachKeys, (result) => resolve(result), (exception, _reason) => reject(exception));
16234
+ this.getDocAttachmentsWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception));
16215
16235
  });
16216
16236
  }
16217
- deleteDocAttachmentsWithCallbacks(id, attachKeys, onSuccess, onFail) {
16237
+ getDocAttachmentsWithCallbacks(id, onSuccess, onFail) {
16218
16238
  let url_ = this.baseUrl + "/api/document/{id}/attachments";
16219
16239
  if (id === undefined || id === null)
16220
16240
  throw new globalThis.Error("The parameter 'id' must be defined.");
16221
16241
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
16222
16242
  url_ = url_.replace(/[?&]$/, "");
16223
- const content_ = JSON.stringify(attachKeys);
16224
16243
  jQuery.ajax({
16225
16244
  url: url_,
16226
16245
  beforeSend: this.beforeSend,
16227
- type: "delete",
16228
- data: content_,
16246
+ type: "get",
16229
16247
  dataType: "text",
16230
16248
  headers: {
16231
- "Content-Type": "application/json",
16232
16249
  "Accept": "application/json"
16233
16250
  }
16234
16251
  }).done((_data, _textStatus, xhr) => {
16235
- this.processDeleteDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16252
+ this.processGetDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16236
16253
  }).fail((xhr) => {
16237
- this.processDeleteDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16254
+ this.processGetDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16238
16255
  });
16239
16256
  }
16240
- processDeleteDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16257
+ processGetDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16241
16258
  try {
16242
- let result = this.transformResult(_url, xhr, (xhr) => this.processDeleteDocAttachments(xhr));
16259
+ let result = this.transformResult(_url, xhr, (xhr) => this.processGetDocAttachments(xhr));
16243
16260
  if (onSuccess !== undefined)
16244
16261
  onSuccess(result);
16245
16262
  }
@@ -16248,7 +16265,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16248
16265
  onFail(e, "http_service_exception");
16249
16266
  }
16250
16267
  }
16251
- processDeleteDocAttachments(xhr) {
16268
+ processGetDocAttachments(xhr) {
16252
16269
  const status = xhr.status;
16253
16270
  let _headers = {};
16254
16271
  if (status === 204) {
@@ -16279,7 +16296,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16279
16296
  const _responseText = xhr.responseText;
16280
16297
  let result409 = null;
16281
16298
  result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16282
- return throwException("Could not persist the delete", status, _responseText, _headers, result409);
16299
+ return throwException("Could not persist the document", status, _responseText, _headers, result409);
16283
16300
  }
16284
16301
  else if (status === 500) {
16285
16302
  const _responseText = xhr.responseText;
@@ -16294,27 +16311,27 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16294
16311
  return null;
16295
16312
  }
16296
16313
  /**
16297
- * Updates an attachment on the specified document
16314
+ * Removes the specified attachment from the specified document
16298
16315
  * @param id Document Key
16299
- * @param updatedData Replacement attachment data
16300
- * @return Specified attachment not found
16316
+ * @param attachKeys Doc Attachment Keys
16317
+ * @return Specified addresses not found
16301
16318
  */
16302
- updateDocAttachments(id, updatedData) {
16319
+ deleteDocAttachments(id, attachKeys) {
16303
16320
  return new Promise((resolve, reject) => {
16304
- this.updateDocAttachmentsWithCallbacks(id, updatedData, (result) => resolve(result), (exception, _reason) => reject(exception));
16321
+ this.deleteDocAttachmentsWithCallbacks(id, attachKeys, (result) => resolve(result), (exception, _reason) => reject(exception));
16305
16322
  });
16306
16323
  }
16307
- updateDocAttachmentsWithCallbacks(id, updatedData, onSuccess, onFail) {
16324
+ deleteDocAttachmentsWithCallbacks(id, attachKeys, onSuccess, onFail) {
16308
16325
  let url_ = this.baseUrl + "/api/document/{id}/attachments";
16309
16326
  if (id === undefined || id === null)
16310
16327
  throw new globalThis.Error("The parameter 'id' must be defined.");
16311
16328
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
16312
16329
  url_ = url_.replace(/[?&]$/, "");
16313
- const content_ = JSON.stringify(updatedData);
16330
+ const content_ = JSON.stringify(attachKeys);
16314
16331
  jQuery.ajax({
16315
16332
  url: url_,
16316
16333
  beforeSend: this.beforeSend,
16317
- type: "put",
16334
+ type: "delete",
16318
16335
  data: content_,
16319
16336
  dataType: "text",
16320
16337
  headers: {
@@ -16322,14 +16339,14 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16322
16339
  "Accept": "application/json"
16323
16340
  }
16324
16341
  }).done((_data, _textStatus, xhr) => {
16325
- this.processUpdateDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16342
+ this.processDeleteDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16326
16343
  }).fail((xhr) => {
16327
- this.processUpdateDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16344
+ this.processDeleteDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16328
16345
  });
16329
16346
  }
16330
- processUpdateDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16347
+ processDeleteDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16331
16348
  try {
16332
- let result = this.transformResult(_url, xhr, (xhr) => this.processUpdateDocAttachments(xhr));
16349
+ let result = this.transformResult(_url, xhr, (xhr) => this.processDeleteDocAttachments(xhr));
16333
16350
  if (onSuccess !== undefined)
16334
16351
  onSuccess(result);
16335
16352
  }
@@ -16338,7 +16355,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16338
16355
  onFail(e, "http_service_exception");
16339
16356
  }
16340
16357
  }
16341
- processUpdateDocAttachments(xhr) {
16358
+ processDeleteDocAttachments(xhr) {
16342
16359
  const status = xhr.status;
16343
16360
  let _headers = {};
16344
16361
  if (status === 204) {
@@ -16359,11 +16376,17 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16359
16376
  result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16360
16377
  return throwException("Document not found, or not accessible", status, _responseText, _headers, result404);
16361
16378
  }
16379
+ else if (status === 406) {
16380
+ const _responseText = xhr.responseText;
16381
+ let result406 = null;
16382
+ result406 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16383
+ return throwException("Not acceptable", status, _responseText, _headers, result406);
16384
+ }
16362
16385
  else if (status === 409) {
16363
16386
  const _responseText = xhr.responseText;
16364
16387
  let result409 = null;
16365
16388
  result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16366
- return throwException("Could not persist the update", status, _responseText, _headers, result409);
16389
+ return throwException("Could not persist the delete", status, _responseText, _headers, result409);
16367
16390
  }
16368
16391
  else if (status === 500) {
16369
16392
  const _responseText = xhr.responseText;
@@ -16378,26 +16401,27 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16378
16401
  return null;
16379
16402
  }
16380
16403
  /**
16381
- * Inserts an attachment on the specified document, optionally from a template
16404
+ * Updates an attachment on the specified document
16382
16405
  * @param id Document Key
16383
- * @param newData New attachment data. To copy a template use DocKey:TemplateKey
16406
+ * @param updatedData Replacement attachment data
16407
+ * @return Specified attachment not found
16384
16408
  */
16385
- addDocAttachments(id, newData) {
16409
+ updateDocAttachments(id, updatedData) {
16386
16410
  return new Promise((resolve, reject) => {
16387
- this.addDocAttachmentsWithCallbacks(id, newData, (result) => resolve(result), (exception, _reason) => reject(exception));
16411
+ this.updateDocAttachmentsWithCallbacks(id, updatedData, (result) => resolve(result), (exception, _reason) => reject(exception));
16388
16412
  });
16389
16413
  }
16390
- addDocAttachmentsWithCallbacks(id, newData, onSuccess, onFail) {
16414
+ updateDocAttachmentsWithCallbacks(id, updatedData, onSuccess, onFail) {
16391
16415
  let url_ = this.baseUrl + "/api/document/{id}/attachments";
16392
16416
  if (id === undefined || id === null)
16393
16417
  throw new globalThis.Error("The parameter 'id' must be defined.");
16394
16418
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
16395
16419
  url_ = url_.replace(/[?&]$/, "");
16396
- const content_ = JSON.stringify(newData);
16420
+ const content_ = JSON.stringify(updatedData);
16397
16421
  jQuery.ajax({
16398
16422
  url: url_,
16399
16423
  beforeSend: this.beforeSend,
16400
- type: "post",
16424
+ type: "put",
16401
16425
  data: content_,
16402
16426
  dataType: "text",
16403
16427
  headers: {
@@ -16405,14 +16429,14 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16405
16429
  "Accept": "application/json"
16406
16430
  }
16407
16431
  }).done((_data, _textStatus, xhr) => {
16408
- this.processAddDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16432
+ this.processUpdateDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16409
16433
  }).fail((xhr) => {
16410
- this.processAddDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16434
+ this.processUpdateDocAttachmentsWithCallbacks(url_, xhr, onSuccess, onFail);
16411
16435
  });
16412
16436
  }
16413
- processAddDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16437
+ processUpdateDocAttachmentsWithCallbacks(_url, xhr, onSuccess, onFail) {
16414
16438
  try {
16415
- let result = this.transformResult(_url, xhr, (xhr) => this.processAddDocAttachments(xhr));
16439
+ let result = this.transformResult(_url, xhr, (xhr) => this.processUpdateDocAttachments(xhr));
16416
16440
  if (onSuccess !== undefined)
16417
16441
  onSuccess(result);
16418
16442
  }
@@ -16421,20 +16445,14 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16421
16445
  onFail(e, "http_service_exception");
16422
16446
  }
16423
16447
  }
16424
- processAddDocAttachments(xhr) {
16448
+ processUpdateDocAttachments(xhr) {
16425
16449
  const status = xhr.status;
16426
16450
  let _headers = {};
16427
- if (status === 200) {
16428
- const _responseText = xhr.responseText;
16429
- let result200 = null;
16430
- result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16431
- return result200;
16432
- }
16433
- else if (status === 400) {
16451
+ if (status === 204) {
16434
16452
  const _responseText = xhr.responseText;
16435
- let result400 = null;
16436
- result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16437
- return throwException("Missing or invalid data", status, _responseText, _headers, result400);
16453
+ let result204 = null;
16454
+ result204 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16455
+ return result204;
16438
16456
  }
16439
16457
  else if (status === 403) {
16440
16458
  const _responseText = xhr.responseText;
@@ -16448,17 +16466,11 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
16448
16466
  result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16449
16467
  return throwException("Document not found, or not accessible", status, _responseText, _headers, result404);
16450
16468
  }
16451
- else if (status === 406) {
16452
- const _responseText = xhr.responseText;
16453
- let result406 = null;
16454
- result406 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16455
- return throwException("Not acceptable", status, _responseText, _headers, result406);
16456
- }
16457
16469
  else if (status === 409) {
16458
16470
  const _responseText = xhr.responseText;
16459
16471
  let result409 = null;
16460
16472
  result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
16461
- return throwException("Could not persist the insert", status, _responseText, _headers, result409);
16473
+ return throwException("Could not persist the update", status, _responseText, _headers, result409);
16462
16474
  }
16463
16475
  else if (status === 500) {
16464
16476
  const _responseText = xhr.responseText;
@@ -17889,7 +17901,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
17889
17901
  return null;
17890
17902
  }
17891
17903
  /**
17892
- * Returns the comments for the specified document
17904
+ * Returns the comments for the specified document, most recent first.
17893
17905
  * @param id Document Key
17894
17906
  */
17895
17907
  getDocComments(id) {
@@ -18118,7 +18130,7 @@ class DocumentToolsClient extends APIClientBase_1.APIClientBase {
18118
18130
  return null;
18119
18131
  }
18120
18132
  /**
18121
- * Inserts Comments on the specified document
18133
+ * Inserts Comments on the specified document. Typically TopicKey=DocRevKey because comments are associated with the Doc Revision. You can specify the empty GUID for TopicKey and/or FromUser, the correct defaults will be supplied (the current Revision and the current user). Other values for TopicKey must resolve to this document (for example, a prior revision comment). Any value for created more than 5 days ago stamps the comment with the server time. FromUser is set automatically.
18122
18134
  * @param id Document Key
18123
18135
  * @param newData New comment data
18124
18136
  */