@criipto/signatures 1.2.1 → 1.2.2

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,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="whatwg-fetch" />
3
2
  import { GraphQLClient } from 'graphql-request';
4
3
  import * as Dom from 'graphql-request/dist/types.dom';
5
4
  export type Maybe<T> = T | null;
@@ -251,15 +250,19 @@ export type DeleteSignatoryOutput = {
251
250
  export type Document = {
252
251
  blob?: Maybe<Scalars['Blob']>;
253
252
  id: Scalars['ID'];
253
+ originalBlob?: Maybe<Scalars['Blob']>;
254
254
  reference?: Maybe<Scalars['String']>;
255
255
  signatoryViewerStatus?: Maybe<SignatoryDocumentStatus>;
256
256
  signatures?: Maybe<Array<Signature>>;
257
257
  title: Scalars['String'];
258
258
  };
259
+ export type DocumentIdLocation = 'BOTTOM' | 'LEFT' | 'RIGHT' | 'TOP' | '%future added value';
259
260
  export type DocumentInput = {
260
- pdf: PadesDocumentInput;
261
- /** When enabled, will remove any existing signatures from the document before storing. */
261
+ pdf?: InputMaybe<PadesDocumentInput>;
262
+ /** When enabled, will remove any existing signatures from the document before storing. (PDF only) */
262
263
  removePreviousSignatures?: InputMaybe<Scalars['Boolean']>;
264
+ /** XML signing is coming soon, reach out to learn more. */
265
+ xml?: InputMaybe<XadesDocumentInput>;
263
266
  };
264
267
  /** Document storage mode. Temporary documents will be deleted once completed. */
265
268
  export type DocumentStorageMode =
@@ -459,6 +462,8 @@ export type OidcJwtSignatureEvidenceProvider = SignatureEvidenceProvider & {
459
462
  };
460
463
  export type PadesDocumentInput = {
461
464
  blob: Scalars['Blob'];
465
+ /** Will add a unique identifier for the document to the specified margin of each page. Useful when printing signed documents. */
466
+ displayDocumentID?: InputMaybe<DocumentIdLocation>;
462
467
  /** Will not be displayed to signatories, can be used as a reference to your own system. */
463
468
  reference?: InputMaybe<Scalars['String']>;
464
469
  storageMode: DocumentStorageMode;
@@ -480,6 +485,7 @@ export type PdfDocument = Document & {
480
485
  __typename?: 'PdfDocument';
481
486
  blob?: Maybe<Scalars['Blob']>;
482
487
  id: Scalars['ID'];
488
+ originalBlob?: Maybe<Scalars['Blob']>;
483
489
  reference?: Maybe<Scalars['String']>;
484
490
  signatoryViewerStatus?: Maybe<SignatoryDocumentStatus>;
485
491
  signatures?: Maybe<Array<Signature>>;
@@ -655,6 +661,7 @@ export type Signature = {
655
661
  };
656
662
  export type SignatureAppearanceInput = {
657
663
  displayName?: InputMaybe<Array<SignatureAppearanceTemplateInput>>;
664
+ headerLeft?: InputMaybe<Array<SignatureAppearanceTemplateInput>>;
658
665
  /** Render evidence claim as identifier in the signature appearance inside the document. You can supply multiple keys and they will be tried in order. If no key is found a GUID will be rendered. */
659
666
  identifierFromEvidence: Array<Scalars['String']>;
660
667
  };
@@ -723,7 +730,7 @@ export type SignatureOrderUiLogo = {
723
730
  export type SignatureOrderUiLogoInput = {
724
731
  /** Turns your logo into a link with the defined href. */
725
732
  href?: InputMaybe<Scalars['String']>;
726
- /** The image source for the logo. Must be an absolute HTTPS URL. */
733
+ /** The image source for the logo. Must be an absolute HTTPS URL or a valid data: url */
727
734
  src: Scalars['String'];
728
735
  };
729
736
  export type SignatureOrderWebhook = {
@@ -859,12 +866,35 @@ export type WebhookTimeoutInvocation = WebhookInvocation & {
859
866
  timestamp: Scalars['String'];
860
867
  url: Scalars['String'];
861
868
  };
862
- export type BasicDocumentFragment = {
869
+ export type XadesDocumentInput = {
870
+ blob: Scalars['Blob'];
871
+ /** Will not be displayed to signatories, can be used as a reference to your own system. */
872
+ reference?: InputMaybe<Scalars['String']>;
873
+ storageMode: DocumentStorageMode;
874
+ title: Scalars['String'];
875
+ };
876
+ export type XmlDocument = Document & {
877
+ __typename?: 'XmlDocument';
878
+ blob?: Maybe<Scalars['Blob']>;
879
+ id: Scalars['ID'];
880
+ originalBlob?: Maybe<Scalars['Blob']>;
881
+ reference?: Maybe<Scalars['String']>;
882
+ signatoryViewerStatus?: Maybe<SignatoryDocumentStatus>;
883
+ signatures?: Maybe<Array<Signature>>;
884
+ title: Scalars['String'];
885
+ };
886
+ type BasicDocument_PdfDocument_Fragment = {
863
887
  __typename: 'PdfDocument';
864
888
  id: string;
865
889
  title: string;
866
890
  };
867
- export type SignedDocumentFragment = {
891
+ type BasicDocument_XmlDocument_Fragment = {
892
+ __typename: 'XmlDocument';
893
+ id: string;
894
+ title: string;
895
+ };
896
+ export type BasicDocumentFragment = BasicDocument_PdfDocument_Fragment | BasicDocument_XmlDocument_Fragment;
897
+ type SignedDocument_PdfDocument_Fragment = {
868
898
  __typename?: 'PdfDocument';
869
899
  id: string;
870
900
  title: string;
@@ -891,6 +921,34 @@ export type SignedDocumentFragment = {
891
921
  } | null;
892
922
  }> | null;
893
923
  };
924
+ type SignedDocument_XmlDocument_Fragment = {
925
+ __typename?: 'XmlDocument';
926
+ id: string;
927
+ title: string;
928
+ blob?: Buffer | null;
929
+ signatures?: Array<{
930
+ __typename: 'DrawableSignature';
931
+ signatory?: {
932
+ __typename?: 'Signatory';
933
+ id: string;
934
+ } | null;
935
+ } | {
936
+ __typename: 'EmptySignature';
937
+ signatory?: {
938
+ __typename?: 'Signatory';
939
+ id: string;
940
+ } | null;
941
+ } | {
942
+ __typename: 'JWTSignature';
943
+ jwt: string;
944
+ jwks: string;
945
+ signatory?: {
946
+ __typename?: 'Signatory';
947
+ id: string;
948
+ } | null;
949
+ }> | null;
950
+ };
951
+ export type SignedDocumentFragment = SignedDocument_PdfDocument_Fragment | SignedDocument_XmlDocument_Fragment;
894
952
  export type BasicSignatoryFragment = {
895
953
  __typename?: 'Signatory';
896
954
  id: string;
@@ -920,6 +978,9 @@ export type BasicSignatoryFragment = {
920
978
  node: {
921
979
  __typename: 'PdfDocument';
922
980
  id: string;
981
+ } | {
982
+ __typename: 'XmlDocument';
983
+ id: string;
923
984
  };
924
985
  }>;
925
986
  };
@@ -958,6 +1019,9 @@ export type BasicSignatureOrderFragment = {
958
1019
  node: {
959
1020
  __typename: 'PdfDocument';
960
1021
  id: string;
1022
+ } | {
1023
+ __typename: 'XmlDocument';
1024
+ id: string;
961
1025
  };
962
1026
  }>;
963
1027
  };
@@ -992,6 +1056,10 @@ export type CreateSignatureOrderMutation = {
992
1056
  __typename: 'PdfDocument';
993
1057
  id: string;
994
1058
  title: string;
1059
+ } | {
1060
+ __typename: 'XmlDocument';
1061
+ id: string;
1062
+ title: string;
995
1063
  }>;
996
1064
  signatories: Array<{
997
1065
  __typename?: 'Signatory';
@@ -1022,6 +1090,9 @@ export type CreateSignatureOrderMutation = {
1022
1090
  node: {
1023
1091
  __typename: 'PdfDocument';
1024
1092
  id: string;
1093
+ } | {
1094
+ __typename: 'XmlDocument';
1095
+ id: string;
1025
1096
  };
1026
1097
  }>;
1027
1098
  };
@@ -1058,6 +1129,10 @@ export type CleanupSignatureOrderMutation = {
1058
1129
  __typename: 'PdfDocument';
1059
1130
  id: string;
1060
1131
  title: string;
1132
+ } | {
1133
+ __typename: 'XmlDocument';
1134
+ id: string;
1135
+ title: string;
1061
1136
  }>;
1062
1137
  signatories: Array<{
1063
1138
  __typename?: 'Signatory';
@@ -1088,6 +1163,9 @@ export type CleanupSignatureOrderMutation = {
1088
1163
  node: {
1089
1164
  __typename: 'PdfDocument';
1090
1165
  id: string;
1166
+ } | {
1167
+ __typename: 'XmlDocument';
1168
+ id: string;
1091
1169
  };
1092
1170
  }>;
1093
1171
  };
@@ -1144,6 +1222,9 @@ export type AddSignatoryMutation = {
1144
1222
  node: {
1145
1223
  __typename: 'PdfDocument';
1146
1224
  id: string;
1225
+ } | {
1226
+ __typename: 'XmlDocument';
1227
+ id: string;
1147
1228
  };
1148
1229
  }>;
1149
1230
  };
@@ -1186,6 +1267,9 @@ export type AddSignatoriesMutation = {
1186
1267
  node: {
1187
1268
  __typename: 'PdfDocument';
1188
1269
  id: string;
1270
+ } | {
1271
+ __typename: 'XmlDocument';
1272
+ id: string;
1189
1273
  };
1190
1274
  }>;
1191
1275
  };
@@ -1228,6 +1312,9 @@ export type ChangeSignatoryMutation = {
1228
1312
  node: {
1229
1313
  __typename: 'PdfDocument';
1230
1314
  id: string;
1315
+ } | {
1316
+ __typename: 'XmlDocument';
1317
+ id: string;
1231
1318
  };
1232
1319
  }>;
1233
1320
  };
@@ -1272,6 +1359,32 @@ export type CloseSignatureOrderMutation = {
1272
1359
  id: string;
1273
1360
  } | null;
1274
1361
  }> | null;
1362
+ } | {
1363
+ __typename: 'XmlDocument';
1364
+ id: string;
1365
+ title: string;
1366
+ blob?: Buffer | null;
1367
+ signatures?: Array<{
1368
+ __typename: 'DrawableSignature';
1369
+ signatory?: {
1370
+ __typename?: 'Signatory';
1371
+ id: string;
1372
+ } | null;
1373
+ } | {
1374
+ __typename: 'EmptySignature';
1375
+ signatory?: {
1376
+ __typename?: 'Signatory';
1377
+ id: string;
1378
+ } | null;
1379
+ } | {
1380
+ __typename: 'JWTSignature';
1381
+ jwt: string;
1382
+ jwks: string;
1383
+ signatory?: {
1384
+ __typename?: 'Signatory';
1385
+ id: string;
1386
+ } | null;
1387
+ }> | null;
1275
1388
  }>;
1276
1389
  signatories: Array<{
1277
1390
  __typename?: 'Signatory';
@@ -1302,6 +1415,9 @@ export type CloseSignatureOrderMutation = {
1302
1415
  node: {
1303
1416
  __typename: 'PdfDocument';
1304
1417
  id: string;
1418
+ } | {
1419
+ __typename: 'XmlDocument';
1420
+ id: string;
1305
1421
  };
1306
1422
  }>;
1307
1423
  };
@@ -1338,6 +1454,10 @@ export type CancelSignatureOrderMutation = {
1338
1454
  __typename: 'PdfDocument';
1339
1455
  id: string;
1340
1456
  title: string;
1457
+ } | {
1458
+ __typename: 'XmlDocument';
1459
+ id: string;
1460
+ title: string;
1341
1461
  }>;
1342
1462
  signatories: Array<{
1343
1463
  __typename?: 'Signatory';
@@ -1368,6 +1488,9 @@ export type CancelSignatureOrderMutation = {
1368
1488
  node: {
1369
1489
  __typename: 'PdfDocument';
1370
1490
  id: string;
1491
+ } | {
1492
+ __typename: 'XmlDocument';
1493
+ id: string;
1371
1494
  };
1372
1495
  }>;
1373
1496
  };
@@ -1424,6 +1547,9 @@ export type SignActingAsMutation = {
1424
1547
  node: {
1425
1548
  __typename: 'PdfDocument';
1426
1549
  id: string;
1550
+ } | {
1551
+ __typename: 'XmlDocument';
1552
+ id: string;
1427
1553
  };
1428
1554
  }>;
1429
1555
  };
@@ -1469,6 +1595,9 @@ export type SignatureOrderQuery = {
1469
1595
  node: {
1470
1596
  __typename: 'PdfDocument';
1471
1597
  id: string;
1598
+ } | {
1599
+ __typename: 'XmlDocument';
1600
+ id: string;
1472
1601
  };
1473
1602
  }>;
1474
1603
  };
@@ -1524,6 +1653,32 @@ export type SignatureOrderWithDocumentsQuery = {
1524
1653
  id: string;
1525
1654
  } | null;
1526
1655
  }> | null;
1656
+ } | {
1657
+ __typename: 'XmlDocument';
1658
+ id: string;
1659
+ title: string;
1660
+ blob?: Buffer | null;
1661
+ signatures?: Array<{
1662
+ __typename: 'DrawableSignature';
1663
+ signatory?: {
1664
+ __typename?: 'Signatory';
1665
+ id: string;
1666
+ } | null;
1667
+ } | {
1668
+ __typename: 'EmptySignature';
1669
+ signatory?: {
1670
+ __typename?: 'Signatory';
1671
+ id: string;
1672
+ } | null;
1673
+ } | {
1674
+ __typename: 'JWTSignature';
1675
+ jwt: string;
1676
+ jwks: string;
1677
+ signatory?: {
1678
+ __typename?: 'Signatory';
1679
+ id: string;
1680
+ } | null;
1681
+ }> | null;
1527
1682
  }>;
1528
1683
  signatories: Array<{
1529
1684
  __typename?: 'Signatory';
@@ -1554,6 +1709,9 @@ export type SignatureOrderWithDocumentsQuery = {
1554
1709
  node: {
1555
1710
  __typename: 'PdfDocument';
1556
1711
  id: string;
1712
+ } | {
1713
+ __typename: 'XmlDocument';
1714
+ id: string;
1557
1715
  };
1558
1716
  }>;
1559
1717
  };
@@ -1620,6 +1778,9 @@ export type SignatoryQuery = {
1620
1778
  node: {
1621
1779
  __typename: 'PdfDocument';
1622
1780
  id: string;
1781
+ } | {
1782
+ __typename: 'XmlDocument';
1783
+ id: string;
1623
1784
  };
1624
1785
  }>;
1625
1786
  };
@@ -1659,6 +1820,9 @@ export type SignatoryQuery = {
1659
1820
  node: {
1660
1821
  __typename: 'PdfDocument';
1661
1822
  id: string;
1823
+ } | {
1824
+ __typename: 'XmlDocument';
1825
+ id: string;
1662
1826
  };
1663
1827
  }>;
1664
1828
  };
@@ -1713,6 +1877,9 @@ export type SignatureOrdersQuery = {
1713
1877
  node: {
1714
1878
  __typename: 'PdfDocument';
1715
1879
  id: string;
1880
+ } | {
1881
+ __typename: 'XmlDocument';
1882
+ id: string;
1716
1883
  };
1717
1884
  }>;
1718
1885
  };
@@ -1773,3 +1940,4 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
1773
1940
  signatureOrders(variables: SignatureOrdersQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<SignatureOrdersQuery>;
1774
1941
  };
1775
1942
  export type Sdk = ReturnType<typeof getSdk>;
1943
+ export {};
package/dist/index.d.ts CHANGED
@@ -12,11 +12,15 @@ export declare class CriiptoSignatures {
12
12
  id: string;
13
13
  status: Types.SignatureOrderStatus;
14
14
  title?: string | null | undefined;
15
- documents: {
15
+ documents: ({
16
16
  __typename: "PdfDocument";
17
17
  id: string;
18
18
  title: string;
19
- }[];
19
+ } | {
20
+ __typename: "XmlDocument";
21
+ id: string;
22
+ title: string;
23
+ })[];
20
24
  signatories: {
21
25
  __typename?: "Signatory" | undefined;
22
26
  id: string;
@@ -46,6 +50,9 @@ export declare class CriiptoSignatures {
46
50
  node: {
47
51
  __typename: "PdfDocument";
48
52
  id: string;
53
+ } | {
54
+ __typename: "XmlDocument";
55
+ id: string;
49
56
  };
50
57
  }[];
51
58
  };
@@ -93,6 +100,9 @@ export declare class CriiptoSignatures {
93
100
  node: {
94
101
  __typename: "PdfDocument";
95
102
  id: string;
103
+ } | {
104
+ __typename: "XmlDocument";
105
+ id: string;
96
106
  };
97
107
  }[];
98
108
  };
@@ -126,6 +136,9 @@ export declare class CriiptoSignatures {
126
136
  node: {
127
137
  __typename: "PdfDocument";
128
138
  id: string;
139
+ } | {
140
+ __typename: "XmlDocument";
141
+ id: string;
129
142
  };
130
143
  }[];
131
144
  };
@@ -159,6 +172,9 @@ export declare class CriiptoSignatures {
159
172
  node: {
160
173
  __typename: "PdfDocument";
161
174
  id: string;
175
+ } | {
176
+ __typename: "XmlDocument";
177
+ id: string;
162
178
  };
163
179
  }[];
164
180
  };
@@ -168,7 +184,7 @@ export declare class CriiptoSignatures {
168
184
  id: string;
169
185
  status: Types.SignatureOrderStatus;
170
186
  title?: string | null | undefined;
171
- documents: {
187
+ documents: ({
172
188
  __typename: "PdfDocument";
173
189
  id: string;
174
190
  title: string;
@@ -194,7 +210,33 @@ export declare class CriiptoSignatures {
194
210
  id: string;
195
211
  } | null | undefined;
196
212
  })[] | null | undefined;
197
- }[];
213
+ } | {
214
+ __typename: "XmlDocument";
215
+ id: string;
216
+ title: string;
217
+ blob?: Buffer | null | undefined;
218
+ signatures?: ({
219
+ __typename: "DrawableSignature";
220
+ signatory?: {
221
+ __typename?: "Signatory" | undefined;
222
+ id: string;
223
+ } | null | undefined;
224
+ } | {
225
+ __typename: "EmptySignature";
226
+ signatory?: {
227
+ __typename?: "Signatory" | undefined;
228
+ id: string;
229
+ } | null | undefined;
230
+ } | {
231
+ __typename: "JWTSignature";
232
+ jwt: string;
233
+ jwks: string;
234
+ signatory?: {
235
+ __typename?: "Signatory" | undefined;
236
+ id: string;
237
+ } | null | undefined;
238
+ })[] | null | undefined;
239
+ })[];
198
240
  signatories: {
199
241
  __typename?: "Signatory" | undefined;
200
242
  id: string;
@@ -224,6 +266,9 @@ export declare class CriiptoSignatures {
224
266
  node: {
225
267
  __typename: "PdfDocument";
226
268
  id: string;
269
+ } | {
270
+ __typename: "XmlDocument";
271
+ id: string;
227
272
  };
228
273
  }[];
229
274
  };
@@ -247,11 +292,15 @@ export declare class CriiptoSignatures {
247
292
  id: string;
248
293
  status: Types.SignatureOrderStatus;
249
294
  title?: string | null | undefined;
250
- documents: {
295
+ documents: ({
251
296
  __typename: "PdfDocument";
252
297
  id: string;
253
298
  title: string;
254
- }[];
299
+ } | {
300
+ __typename: "XmlDocument";
301
+ id: string;
302
+ title: string;
303
+ })[];
255
304
  signatories: {
256
305
  __typename?: "Signatory" | undefined;
257
306
  id: string;
@@ -281,6 +330,9 @@ export declare class CriiptoSignatures {
281
330
  node: {
282
331
  __typename: "PdfDocument";
283
332
  id: string;
333
+ } | {
334
+ __typename: "XmlDocument";
335
+ id: string;
284
336
  };
285
337
  }[];
286
338
  };
@@ -304,11 +356,15 @@ export declare class CriiptoSignatures {
304
356
  id: string;
305
357
  status: Types.SignatureOrderStatus;
306
358
  title?: string | null | undefined;
307
- documents: {
359
+ documents: ({
308
360
  __typename: "PdfDocument";
309
361
  id: string;
310
362
  title: string;
311
- }[];
363
+ } | {
364
+ __typename: "XmlDocument";
365
+ id: string;
366
+ title: string;
367
+ })[];
312
368
  signatories: {
313
369
  __typename?: "Signatory" | undefined;
314
370
  id: string;
@@ -338,6 +394,9 @@ export declare class CriiptoSignatures {
338
394
  node: {
339
395
  __typename: "PdfDocument";
340
396
  id: string;
397
+ } | {
398
+ __typename: "XmlDocument";
399
+ id: string;
341
400
  };
342
401
  }[];
343
402
  };
@@ -385,6 +444,9 @@ export declare class CriiptoSignatures {
385
444
  node: {
386
445
  __typename: "PdfDocument";
387
446
  id: string;
447
+ } | {
448
+ __typename: "XmlDocument";
449
+ id: string;
388
450
  };
389
451
  }[];
390
452
  };
@@ -432,6 +494,9 @@ export declare class CriiptoSignatures {
432
494
  node: {
433
495
  __typename: "PdfDocument";
434
496
  id: string;
497
+ } | {
498
+ __typename: "XmlDocument";
499
+ id: string;
435
500
  };
436
501
  }[];
437
502
  };
@@ -471,6 +536,9 @@ export declare class CriiptoSignatures {
471
536
  node: {
472
537
  __typename: "PdfDocument";
473
538
  id: string;
539
+ } | {
540
+ __typename: "XmlDocument";
541
+ id: string;
474
542
  };
475
543
  }[];
476
544
  };
@@ -513,6 +581,9 @@ export declare class CriiptoSignatures {
513
581
  node: {
514
582
  __typename: "PdfDocument";
515
583
  id: string;
584
+ } | {
585
+ __typename: "XmlDocument";
586
+ id: string;
516
587
  };
517
588
  }[];
518
589
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@criipto/signatures",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "private": false,
5
5
  "description": "A Node.js SDK for Criipto Signatures",
6
6
  "main": "dist/index.js",