@korala/api-client 1.10.2 → 1.13.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.
@@ -1,10 +1,10 @@
1
- import type { AcroFormFieldDto, AuditEventDto, BulkSignRequestDto, BulkSignResponseDto, CreateUploadUrlDto, DocumentDto, UploadUrlResponseDto } from '@korala/public-dtos';
1
+ import type { AcroFormFieldDto, AssignFormFieldPartiesDto, AuditEventDto, BulkSignRequestDto, BulkSignResponseDto, ConfirmUploadDto, CreateUploadUrlDto, DocumentDto, FieldDto, FormFieldPartyDto, ImportFormFieldsDto, UploadUrlResponseDto } from '@korala/public-dtos';
2
2
  import type { HttpClient } from '../http.js';
3
3
  export declare class DocumentsResource {
4
4
  private readonly http;
5
5
  constructor(http: HttpClient);
6
6
  createUploadUrl(data: CreateUploadUrlDto): Promise<UploadUrlResponseDto>;
7
- confirmUpload(documentId: string): Promise<DocumentDto>;
7
+ confirmUpload(documentId: string, data?: ConfirmUploadDto): Promise<DocumentDto>;
8
8
  list(): Promise<DocumentDto[]>;
9
9
  get(documentId: string): Promise<DocumentDto>;
10
10
  send(documentId: string, options?: {
@@ -17,6 +17,26 @@ export declare class DocumentsResource {
17
17
  * such as IRS tax forms). Returns [] for flat PDFs.
18
18
  */
19
19
  getFormFields(documentId: string): Promise<AcroFormFieldDto[]>;
20
+ /**
21
+ * Create fields for a signer from the PDF's embedded form, keeping the
22
+ * positions, types, option lists, character limits and font sizes the PDF
23
+ * declares. This already runs automatically for the first signer added to
24
+ * an uploaded fillable PDF, so call it to assign the form to a different
25
+ * signer or to redo an import.
26
+ */
27
+ importFormFields(documentId: string, data: ImportFormFieldsDto): Promise<FieldDto[]>;
28
+ /**
29
+ * How the placed fields divide between the parties the form names.
30
+ *
31
+ * A fillable PDF says where every box is but never who fills it, so an
32
+ * automatic import puts the whole form on the first signer. This reads the
33
+ * parties the form names — employer and employee, landlord and tenant —
34
+ * from each field's tooltip, the text beside it and its name. Returns []
35
+ * for a single-party form such as a W-9.
36
+ */
37
+ getFormFieldParties(documentId: string): Promise<FormFieldPartyDto[]>;
38
+ /** Move each party's fields to the signer who fills them. */
39
+ assignFormFieldParties(documentId: string, data: AssignFormFieldPartiesDto): Promise<FormFieldPartyDto[]>;
20
40
  bulkSign(data: BulkSignRequestDto, options?: {
21
41
  clientIp?: string;
22
42
  }): Promise<BulkSignResponseDto>;
@@ -1 +1 @@
1
- {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/resources/documents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIxE,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIvD,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI9B,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI7C,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC5C,OAAO,CAAC,WAAW,CAAC;IAOvB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI9C,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAM3D;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE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IAM9D;;;;;;OAMG;IACH,gBAAgB,CACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOtB;;;;;;;;OAQG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAMrE,6DAA6D;IAC7D,sBAAsB,CACpB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO/B,QAAQ,CACN,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9B,OAAO,CAAC,mBAAmB,CAAC;CAUhC"}
@@ -9,8 +9,8 @@ class DocumentsResource {
9
9
  createUploadUrl(data) {
10
10
  return this.http.post('/documents/upload-url', data);
11
11
  }
12
- confirmUpload(documentId) {
13
- return this.http.post(`/documents/${documentId}/confirm`);
12
+ confirmUpload(documentId, data) {
13
+ return this.http.post(`/documents/${documentId}/confirm`, data);
14
14
  }
15
15
  list() {
16
16
  return this.http.get('/documents');
@@ -34,6 +34,32 @@ class DocumentsResource {
34
34
  getFormFields(documentId) {
35
35
  return this.http.get(`/documents/${documentId}/form-fields`);
36
36
  }
37
+ /**
38
+ * Create fields for a signer from the PDF's embedded form, keeping the
39
+ * positions, types, option lists, character limits and font sizes the PDF
40
+ * declares. This already runs automatically for the first signer added to
41
+ * an uploaded fillable PDF, so call it to assign the form to a different
42
+ * signer or to redo an import.
43
+ */
44
+ importFormFields(documentId, data) {
45
+ return this.http.post(`/documents/${documentId}/form-fields/import`, data);
46
+ }
47
+ /**
48
+ * How the placed fields divide between the parties the form names.
49
+ *
50
+ * A fillable PDF says where every box is but never who fills it, so an
51
+ * automatic import puts the whole form on the first signer. This reads the
52
+ * parties the form names — employer and employee, landlord and tenant —
53
+ * from each field's tooltip, the text beside it and its name. Returns []
54
+ * for a single-party form such as a W-9.
55
+ */
56
+ getFormFieldParties(documentId) {
57
+ return this.http.get(`/documents/${documentId}/form-fields/parties`);
58
+ }
59
+ /** Move each party's fields to the signer who fills them. */
60
+ assignFormFieldParties(documentId, data) {
61
+ return this.http.post(`/documents/${documentId}/form-fields/parties/assign`, data);
62
+ }
37
63
  bulkSign(data, options) {
38
64
  const headers = options?.clientIp
39
65
  ? { 'X-Client-IP': options.clientIp }
@@ -1,10 +1,11 @@
1
- import type { AddFieldDto, FieldDto } from '@korala/public-dtos';
1
+ import type { AddFieldDto, FieldDto, UpdateFieldDto } from '@korala/public-dtos';
2
2
  import type { HttpClient } from '../http.js';
3
3
  export declare class FieldsResource {
4
4
  private readonly http;
5
5
  constructor(http: HttpClient);
6
6
  create(documentId: string, data: AddFieldDto): Promise<FieldDto>;
7
7
  list(documentId: string): Promise<FieldDto[]>;
8
+ update(documentId: string, fieldId: string, data: UpdateFieldDto): Promise<FieldDto>;
8
9
  delete(documentId: string, fieldId: string): Promise<void>;
9
10
  }
10
11
  //# sourceMappingURL=fields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/resources/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIhE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI7C,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/resources/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIhE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI7C,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,CAAC;IAOpB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
@@ -12,6 +12,9 @@ class FieldsResource {
12
12
  list(documentId) {
13
13
  return this.http.get(`/documents/${documentId}/fields`);
14
14
  }
15
+ update(documentId, fieldId, data) {
16
+ return this.http.patch(`/documents/${documentId}/fields/${fieldId}`, data);
17
+ }
15
18
  delete(documentId, fieldId) {
16
19
  return this.http.delete(`/documents/${documentId}/fields/${fieldId}`);
17
20
  }
@@ -1,4 +1,4 @@
1
- import type { AcroFormFieldDto, ConfirmReplaceTemplateFileDto, CreateDocumentFromTemplateDto, CreateSignerRoleDto, CreateTemplateDto, CreateTemplateFieldDto, CreateTemplateUploadUrlDto, DetectedMergeFieldDto, DocumentDto, DuplicateTemplateDto, GenerateDocumentDto, GeneratedDocumentDto, PaginatedTemplatesDto, ReplaceTemplateFileDto, ReplaceTemplateFileResponseDto, TemplateBookmarksDto, TemplateDto, TemplateFieldDto, TemplateSignerRoleDto, TemplateUploadUrlResponseDto, TemplateWithDetailsDto, UpdateSignerRoleDto, UpdateTemplateDto, UpdateTemplateFieldDto } from '@korala/public-dtos';
1
+ import type { AcroFormFieldDto, AssignTemplateFormFieldPartiesDto, ConfirmReplaceTemplateFileDto, CreateDocumentFromTemplateDto, CreateSignerRoleDto, CreateTemplateDto, CreateTemplateFieldDto, CreateTemplateUploadUrlDto, DetectedMergeFieldDto, DocumentDto, DuplicateTemplateDto, GenerateDocumentDto, GeneratedDocumentDto, ImportTemplateFormFieldsDto, PaginatedTemplatesDto, ReplaceTemplateFileDto, ReplaceTemplateFileResponseDto, TemplateBookmarksDto, TemplateDto, TemplateFieldDto, TemplateFormFieldPartyDto, TemplateSignerRoleDto, TemplateUploadUrlResponseDto, TemplateWithDetailsDto, UpdateSignerRoleDto, UpdateTemplateDto, UpdateTemplateFieldDto } from '@korala/public-dtos';
2
2
  import type { HttpClient } from '../http.js';
3
3
  export declare class TemplatesResource {
4
4
  private readonly http;
@@ -30,6 +30,20 @@ export declare class TemplatesResource {
30
30
  * PDFs such as IRS tax forms). Returns [] for flat PDFs.
31
31
  */
32
32
  getFormFields(templateId: string): Promise<AcroFormFieldDto[]>;
33
+ /**
34
+ * Create template fields from the base PDF's embedded form, keeping the
35
+ * positions, types, option lists, character limits and font sizes the PDF
36
+ * declares. This already runs when a fillable PDF is confirmed, so call it
37
+ * to assign the form to a different signer role or to redo an import.
38
+ */
39
+ importFormFields(templateId: string, data?: ImportTemplateFormFieldsDto): Promise<TemplateFieldDto[]>;
40
+ /**
41
+ * How the template's fields divide between the parties the base PDF names.
42
+ * Returns [] for a single-party form.
43
+ */
44
+ getFormFieldParties(templateId: string): Promise<TemplateFormFieldPartyDto[]>;
45
+ /** Move each party's fields to the signer role that fills them. */
46
+ assignFormFieldParties(templateId: string, data: AssignTemplateFormFieldPartiesDto): Promise<TemplateFormFieldPartyDto[]>;
33
47
  /**
34
48
  * List the Word bookmarks a DOCX template exposes for bookmark placement,
35
49
  * plus any names that collapse onto one PDF destination once the converter
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/resources/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAI7C,eAAe,CACb,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,4BAA4B,CAAC;IAOxC,aAAa,CACX,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,WAAW,CAAC;IAOvB,WAAW,CACT,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,8BAA8B,CAAC;IAO1C,kBAAkB,CAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,WAAW,CAAC;IAOvB,IAAI,CAAC,MAAM,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAalC,GAAG,CAAC,UAAU,EAAE,MAAM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AAsB,GAC3B,OAAO,CAAC,gBAAgB,CAAC;IAO5B,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAM9D;;;;;OAKG;IACH,gBAAgB,CACd,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,2BAAgC,GACrC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO9B;;;OAGG;IACH,mBAAmB,CACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAMvC,mEAAmE;IACnE,sBAAsB,CACpB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,iCAAiC,GACtC,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAOvC;;;;;;;;OAQG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ/D,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQpE,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,WAAW,CAAC;IASvB,QAAQ,CACN,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,oBAAoB,CAAC;CAMjC"}
@@ -77,6 +77,26 @@ class TemplatesResource {
77
77
  getFormFields(templateId) {
78
78
  return this.http.get(`/templates/${templateId}/form-fields`);
79
79
  }
80
+ /**
81
+ * Create template fields from the base PDF's embedded form, keeping the
82
+ * positions, types, option lists, character limits and font sizes the PDF
83
+ * declares. This already runs when a fillable PDF is confirmed, so call it
84
+ * to assign the form to a different signer role or to redo an import.
85
+ */
86
+ importFormFields(templateId, data = {}) {
87
+ return this.http.post(`/templates/${templateId}/form-fields/import`, data);
88
+ }
89
+ /**
90
+ * How the template's fields divide between the parties the base PDF names.
91
+ * Returns [] for a single-party form.
92
+ */
93
+ getFormFieldParties(templateId) {
94
+ return this.http.get(`/templates/${templateId}/form-fields/parties`);
95
+ }
96
+ /** Move each party's fields to the signer role that fills them. */
97
+ assignFormFieldParties(templateId, data) {
98
+ return this.http.post(`/templates/${templateId}/form-fields/parties/assign`, data);
99
+ }
80
100
  /**
81
101
  * List the Word bookmarks a DOCX template exposes for bookmark placement,
82
102
  * plus any names that collapse onto one PDF destination once the converter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korala/api-client",
3
- "version": "1.10.2",
3
+ "version": "1.13.0",
4
4
  "description": "TypeScript API client for Korala document signing API",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.korala.ai",
@@ -29,8 +29,8 @@
29
29
  "typescript"
30
30
  ],
31
31
  "dependencies": {
32
- "@korala/auth": "^1.1.0",
33
- "@korala/public-dtos": "^1.10.2"
32
+ "@korala/public-dtos": "^1.13.0",
33
+ "@korala/auth": "^1.1.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "typescript": "^5.9.3"