@worknice/js-sdk 0.0.2 → 0.0.4

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 (101) hide show
  1. package/dist/_types-BXw9D0Qi.d.ts +642 -0
  2. package/dist/api/WorkniceIntegrationLogger.d.ts +99 -0
  3. package/dist/api/WorkniceIntegrationLogger.js +173 -0
  4. package/dist/api/WorkniceIntegrationLogger.js.map +1 -0
  5. package/dist/api/_generated.d.ts +357 -22
  6. package/dist/api/_generated.js.map +1 -1
  7. package/dist/api/_types.d.ts +2 -2
  8. package/dist/api/_types.js +1 -0
  9. package/dist/api/_types.js.map +1 -1
  10. package/dist/api/createApiOperation.d.ts +1 -1
  11. package/dist/api/createWorkniceClient.d.ts +1 -1
  12. package/dist/api/createWorkniceClient.js +21 -1
  13. package/dist/api/createWorkniceClient.js.map +1 -1
  14. package/dist/api/operations/activateIntegration.d.ts +1 -1
  15. package/dist/api/operations/authorizeIntegration.d.ts +20 -0
  16. package/dist/api/operations/authorizeIntegration.js +23 -0
  17. package/dist/api/operations/authorizeIntegration.js.map +1 -0
  18. package/dist/api/operations/completeSync.d.ts +20 -0
  19. package/dist/api/operations/completeSync.js +23 -0
  20. package/dist/api/operations/completeSync.js.map +1 -0
  21. package/dist/api/operations/createApiToken.d.ts +1 -1
  22. package/dist/api/operations/createDataImport.d.ts +12 -0
  23. package/dist/api/operations/createDataImport.js +25 -0
  24. package/dist/api/operations/createDataImport.js.map +1 -0
  25. package/dist/api/operations/createPersonConnection.d.ts +132 -0
  26. package/dist/api/operations/createPersonConnection.js +65 -0
  27. package/dist/api/operations/createPersonConnection.js.map +1 -0
  28. package/dist/api/operations/createPersonDataImportLine.d.ts +22 -0
  29. package/dist/api/operations/createPersonDataImportLine.js +49 -0
  30. package/dist/api/operations/createPersonDataImportLine.js.map +1 -0
  31. package/dist/api/operations/deleteApiToken.d.ts +1 -1
  32. package/dist/api/operations/deletePersonConnection.d.ts +10 -0
  33. package/dist/api/operations/deletePersonConnection.js +21 -0
  34. package/dist/api/operations/deletePersonConnection.js.map +1 -0
  35. package/dist/api/operations/getApiTokens.d.ts +1 -1
  36. package/dist/api/operations/getIntegration.d.ts +65 -0
  37. package/dist/api/operations/getIntegration.js +32 -0
  38. package/dist/api/operations/getIntegration.js.map +1 -0
  39. package/dist/api/operations/getPeople.d.ts +65 -0
  40. package/dist/api/operations/getPeople.js +79 -0
  41. package/dist/api/operations/getPeople.js.map +1 -0
  42. package/dist/api/operations/getPersonConnections.d.ts +107 -0
  43. package/dist/api/operations/getPersonConnections.js +43 -0
  44. package/dist/api/operations/getPersonConnections.js.map +1 -0
  45. package/dist/api/operations/initializeIntegration.d.ts +1 -1
  46. package/dist/api/operations/updatePersonConnection.d.ts +132 -0
  47. package/dist/api/operations/updatePersonConnection.js +65 -0
  48. package/dist/api/operations/updatePersonConnection.js.map +1 -0
  49. package/dist/employee-records/EQUALITY_CHECKS.d.ts +1 -0
  50. package/dist/employee-records/EQUALITY_CHECKS.js +0 -1
  51. package/dist/employee-records/EQUALITY_CHECKS.js.map +1 -1
  52. package/dist/employee-records/_types.d.ts +13 -12
  53. package/dist/employee-records/comparePersonDataTransferLines.d.ts +1 -0
  54. package/dist/employee-records/comparePersonDataTransferLines.js +0 -3
  55. package/dist/employee-records/comparePersonDataTransferLines.js.map +1 -1
  56. package/dist/employee-records/index.d.ts +1 -0
  57. package/dist/employee-records/mergePersonDataTransferLines.d.ts +1 -0
  58. package/dist/employee-records/mergePersonDataTransferLines.js +0 -1
  59. package/dist/employee-records/mergePersonDataTransferLines.js.map +1 -1
  60. package/dist/employee-records/validatePersonDataTransferLine.d.ts +1 -0
  61. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.d.ts +1 -0
  62. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.js +10 -9
  63. package/dist/employee-records/validatePersonDataTransferLineBankAccounts.js.map +1 -1
  64. package/dist/employee-records/validatePersonDataTransferLineEmergencyContacts.d.ts +1 -0
  65. package/dist/employee-records/validatePersonDataTransferLinePersonalDetails.d.ts +1 -0
  66. package/dist/employee-records/validatePersonDataTransferLinePersonalDetails.js +0 -2
  67. package/dist/employee-records/validatePersonDataTransferLinePersonalDetails.js.map +1 -1
  68. package/dist/employee-records/validatePersonDataTransferLinePostalAddress.d.ts +1 -0
  69. package/dist/employee-records/validatePersonDataTransferLineResidentialAddress.d.ts +1 -0
  70. package/dist/employee-records/validatePersonDataTransferLineSuperFunds.d.ts +1 -0
  71. package/dist/employee-records/validatePersonDataTransferLineTaxDetails.d.ts +1 -0
  72. package/dist/employee-records/validatePersonDataTransferLineTenure.d.ts +1 -0
  73. package/dist/helpers/_types.d.ts +7 -6
  74. package/dist/helpers/handleCreateIntegrationWebhook.d.ts +2 -1
  75. package/dist/helpers/handleCreateIntegrationWebhook.js +6 -4
  76. package/dist/helpers/handleCreateIntegrationWebhook.js.map +1 -1
  77. package/dist/helpers/handleGetAuthorizationUrlWebhook.d.ts +2 -1
  78. package/dist/helpers/handleGetAuthorizationUrlWebhook.js +4 -1
  79. package/dist/helpers/handleGetAuthorizationUrlWebhook.js.map +1 -1
  80. package/dist/helpers/handleGetLeaveBalancesWebhook.d.ts +14 -0
  81. package/dist/helpers/handleGetLeaveBalancesWebhook.js +22 -0
  82. package/dist/helpers/handleGetLeaveBalancesWebhook.js.map +1 -0
  83. package/dist/helpers/handleRequestWithWorknice.d.ts +9 -14
  84. package/dist/helpers/handleRequestWithWorknice.js +40 -19
  85. package/dist/helpers/handleRequestWithWorknice.js.map +1 -1
  86. package/dist/helpers/handleTriggerIntegrationSyncWebhook.d.ts +73 -0
  87. package/dist/helpers/handleTriggerIntegrationSyncWebhook.js +612 -0
  88. package/dist/helpers/handleTriggerIntegrationSyncWebhook.js.map +1 -0
  89. package/dist/helpers/index.d.ts +7 -1
  90. package/dist/helpers/index.js +9 -1
  91. package/dist/helpers/index.js.map +1 -1
  92. package/dist/index.d.ts +1 -0
  93. package/dist/utils/disambiguatePersonConnections.d.ts +25 -0
  94. package/dist/utils/disambiguatePersonConnections.js +18 -0
  95. package/dist/utils/disambiguatePersonConnections.js.map +1 -0
  96. package/dist/utils/isNotNullable.d.ts +10 -0
  97. package/dist/utils/isNotNullable.js +6 -0
  98. package/dist/utils/isNotNullable.js.map +1 -0
  99. package/dist/webhooks.d.ts +13 -1
  100. package/package.json +8 -4
  101. package/dist/_types-DsB4q143.d.ts +0 -127
@@ -0,0 +1,642 @@
1
+ import { Exact, Scalars, InputMaybe, ConnectionStatus, PersonBankAccountsChangeInput, PersonDataTransferConfigInput, PersonEmergencyContactsChangeInput, PersonPersonalDetailsChangeInput, PersonPostalAddressChangeInput, PersonResidentialAddressChangeInput, PersonSuperFundsChangeInput, PersonTaxDetailsChangeInput, PersonTenureChangeInput, IntegrationStatus, AppCategory, AllocationMethod, Gender, TaxResidencyStatus, SuperFundNomination, TaxFileNumberExemption } from './api/_generated.js';
2
+
3
+ declare const createWorkniceClient: (clientConfig?: ClientConfig) => {
4
+ fetchFromApi: <Data extends object, Variables extends object>(query: string, variables?: Variables, fetchOptions?: FetchOptions) => Promise<SuccessfulQueryResult<Data>>;
5
+ /**
6
+ * Transitions an integration with an 'UNAUTHORIZED' or 'UNCONFIGURED'
7
+ * status to an 'ACTIVE' status. Optionally, the name of the integration can
8
+ * be set at the same time.
9
+ */
10
+ activateIntegration: (variables: Pick<Exact<{
11
+ id: Scalars["ID"]["input"];
12
+ name?: InputMaybe<Scalars["String"]["input"]>;
13
+ rename: Scalars["Boolean"]["input"];
14
+ }>, "id" | "name">, fetchOptions?: FetchOptions) => Promise<{
15
+ id: string;
16
+ } | {
17
+ id: string;
18
+ } | {
19
+ id: string;
20
+ } | {
21
+ id: string;
22
+ } | {
23
+ id: string;
24
+ }>;
25
+ authorizeIntegration: (variables: Exact<{
26
+ integrationId: Scalars["ID"]["input"];
27
+ }>, fetchOptions?: FetchOptions) => Promise<{
28
+ id: string;
29
+ } | {
30
+ id: string;
31
+ } | {
32
+ id: string;
33
+ } | {
34
+ id: string;
35
+ } | {
36
+ id: string;
37
+ }>;
38
+ completeSync: (variables: Exact<{
39
+ integrationId: Scalars["ID"]["input"];
40
+ }>, fetchOptions?: FetchOptions) => Promise<{
41
+ id: string;
42
+ } | {
43
+ id: string;
44
+ } | {
45
+ id: string;
46
+ } | {
47
+ id: string;
48
+ } | {
49
+ id: string;
50
+ }>;
51
+ /**
52
+ * Creates a new API token belonging to the current person.
53
+ */
54
+ createApiToken: (variables: Exact<{
55
+ name: Scalars["String"]["input"];
56
+ }>, fetchOptions?: FetchOptions) => Promise<{
57
+ token: string;
58
+ id: string;
59
+ name: string;
60
+ }>;
61
+ createDataImport: (variables: Exact<{
62
+ integrationId: Scalars["ID"]["input"];
63
+ }>, fetchOptions?: FetchOptions) => Promise<{
64
+ id: string;
65
+ }>;
66
+ createPersonConnection: (variables: {
67
+ integrationId: string;
68
+ personId: string;
69
+ remote: {
70
+ id: string;
71
+ name: string;
72
+ };
73
+ status: ConnectionStatus.Connected;
74
+ } | {
75
+ integrationId: string;
76
+ personId: string;
77
+ status: ConnectionStatus.LocalOnly;
78
+ } | {
79
+ integrationId: string;
80
+ personId: string;
81
+ remote: {
82
+ id: string;
83
+ name: string;
84
+ };
85
+ status: ConnectionStatus.Merged;
86
+ } | {
87
+ integrationId: string;
88
+ remote: {
89
+ id: string;
90
+ name: string;
91
+ };
92
+ status: ConnectionStatus.RemoteOnly;
93
+ }, fetchOptions?: FetchOptions) => Promise<({
94
+ __typename: "PersonConnection";
95
+ createdAt: string;
96
+ id: string;
97
+ status: ConnectionStatus;
98
+ updatedAt: string;
99
+ person?: {
100
+ displayName: string;
101
+ id: string;
102
+ } | null;
103
+ remote?: {
104
+ name: string;
105
+ id: string;
106
+ url?: string | null;
107
+ } | null;
108
+ } & {
109
+ status: ConnectionStatus.Connected;
110
+ remote: {
111
+ name: string;
112
+ id: string;
113
+ url?: string | null;
114
+ };
115
+ person: {
116
+ displayName: string;
117
+ id: string;
118
+ };
119
+ }) | ({
120
+ __typename: "PersonConnection";
121
+ createdAt: string;
122
+ id: string;
123
+ status: ConnectionStatus;
124
+ updatedAt: string;
125
+ person?: {
126
+ displayName: string;
127
+ id: string;
128
+ } | null;
129
+ remote?: {
130
+ name: string;
131
+ id: string;
132
+ url?: string | null;
133
+ } | null;
134
+ } & {
135
+ status: ConnectionStatus.Merged;
136
+ remote: {
137
+ name: string;
138
+ id: string;
139
+ url?: string | null;
140
+ };
141
+ person: {
142
+ displayName: string;
143
+ id: string;
144
+ };
145
+ }) | ({
146
+ __typename: "PersonConnection";
147
+ createdAt: string;
148
+ id: string;
149
+ status: ConnectionStatus;
150
+ updatedAt: string;
151
+ person?: {
152
+ displayName: string;
153
+ id: string;
154
+ } | null;
155
+ remote?: {
156
+ name: string;
157
+ id: string;
158
+ url?: string | null;
159
+ } | null;
160
+ } & {
161
+ status: ConnectionStatus.LocalOnly;
162
+ person: {
163
+ displayName: string;
164
+ id: string;
165
+ };
166
+ remote: null;
167
+ }) | ({
168
+ __typename: "PersonConnection";
169
+ createdAt: string;
170
+ id: string;
171
+ status: ConnectionStatus;
172
+ updatedAt: string;
173
+ person?: {
174
+ displayName: string;
175
+ id: string;
176
+ } | null;
177
+ remote?: {
178
+ name: string;
179
+ id: string;
180
+ url?: string | null;
181
+ } | null;
182
+ } & {
183
+ status: ConnectionStatus.RemoteOnly;
184
+ remote: {
185
+ name: string;
186
+ id: string;
187
+ url?: string | null;
188
+ };
189
+ person: null;
190
+ })>;
191
+ createPersonDataImportLine: (variables: Exact<{
192
+ bankAccounts?: InputMaybe<PersonBankAccountsChangeInput>;
193
+ config: PersonDataTransferConfigInput;
194
+ dataImportId: Scalars["ID"]["input"];
195
+ emergencyContacts?: InputMaybe<PersonEmergencyContactsChangeInput>;
196
+ personalDetails?: InputMaybe<PersonPersonalDetailsChangeInput>;
197
+ personId: Scalars["ID"]["input"];
198
+ postalAddress?: InputMaybe<PersonPostalAddressChangeInput>;
199
+ residentialAddress?: InputMaybe<PersonResidentialAddressChangeInput>;
200
+ superFunds?: InputMaybe<PersonSuperFundsChangeInput>;
201
+ taxDetails?: InputMaybe<PersonTaxDetailsChangeInput>;
202
+ tenure?: InputMaybe<PersonTenureChangeInput>;
203
+ }>, fetchOptions?: FetchOptions) => Promise<{
204
+ id: string;
205
+ }>;
206
+ /**
207
+ * Permanently deletes an API token belonging to the current person.
208
+ */
209
+ deleteApiToken: (variables: Exact<{
210
+ tokenId: Scalars["ID"]["input"];
211
+ }>, fetchOptions?: FetchOptions) => Promise<boolean>;
212
+ deletePersonConnection: (variables: Exact<{
213
+ personConnectionId: Scalars["ID"]["input"];
214
+ }>, fetchOptions?: FetchOptions) => Promise<boolean>;
215
+ /**
216
+ * Transitions an integration with an 'UNINITIALIZED' status to an 'UNAUTHORIZED' status.
217
+ */
218
+ initializeIntegration: (variables: Exact<{
219
+ id: Scalars["ID"]["input"];
220
+ }>, fetchOptions?: FetchOptions) => Promise<{
221
+ id: string;
222
+ } | {
223
+ id: string;
224
+ } | {
225
+ id: string;
226
+ } | {
227
+ id: string;
228
+ } | {
229
+ id: string;
230
+ }>;
231
+ /**
232
+ * Returns a list of API tokens belonging to the current person. This will not
233
+ * include the token values themselves as they are only available when the
234
+ * token is initially created.
235
+ *
236
+ * If there is no person associated with the session, a `NO_PERSON` error will
237
+ * be thrown.
238
+ */
239
+ getApiTokens: (variables: Exact<{
240
+ [key: string]: never;
241
+ }>, fetchOptions?: FetchOptions) => Promise<{
242
+ createdAt: string;
243
+ id: string;
244
+ name: string;
245
+ }[]>;
246
+ getIntegration: (variables: Exact<{
247
+ integrationId: Scalars["ID"]["input"];
248
+ }>, fetchOptions?: FetchOptions) => Promise<{
249
+ archived: boolean;
250
+ id: string;
251
+ status: IntegrationStatus;
252
+ app: {
253
+ category: AppCategory;
254
+ name: string;
255
+ };
256
+ org: {
257
+ id: string;
258
+ };
259
+ } | {
260
+ archived: boolean;
261
+ id: string;
262
+ status: IntegrationStatus;
263
+ app: {
264
+ category: AppCategory;
265
+ name: string;
266
+ };
267
+ org: {
268
+ id: string;
269
+ };
270
+ } | {
271
+ archived: boolean;
272
+ id: string;
273
+ status: IntegrationStatus;
274
+ app: {
275
+ category: AppCategory;
276
+ name: string;
277
+ };
278
+ org: {
279
+ id: string;
280
+ };
281
+ } | {
282
+ archived: boolean;
283
+ id: string;
284
+ status: IntegrationStatus;
285
+ app: {
286
+ category: AppCategory;
287
+ name: string;
288
+ };
289
+ org: {
290
+ id: string;
291
+ };
292
+ } | {
293
+ archived: boolean;
294
+ id: string;
295
+ status: IntegrationStatus;
296
+ app: {
297
+ category: AppCategory;
298
+ name: string;
299
+ };
300
+ org: {
301
+ id: string;
302
+ };
303
+ }>;
304
+ getPeople: (variables: Exact<{
305
+ orgId: Scalars["ID"]["input"];
306
+ }>, fetchOptions?: FetchOptions) => Promise<{
307
+ bankAccount1Allocation?: string | null;
308
+ bankAccount1AllocationMethod?: AllocationMethod | null;
309
+ bankAccount1Bsb?: string | null;
310
+ bankAccount1Name?: string | null;
311
+ bankAccount1Number?: string | null;
312
+ bankAccount2Allocation?: string | null;
313
+ bankAccount2AllocationMethod?: AllocationMethod | null;
314
+ bankAccount2Bsb?: string | null;
315
+ bankAccount2Name?: string | null;
316
+ bankAccount2Number?: string | null;
317
+ bankAccount3Allocation?: string | null;
318
+ bankAccount3AllocationMethod?: AllocationMethod | null;
319
+ bankAccount3Bsb?: string | null;
320
+ bankAccount3Name?: string | null;
321
+ bankAccount3Number?: string | null;
322
+ bankAccount4Allocation?: string | null;
323
+ bankAccount4AllocationMethod?: AllocationMethod | null;
324
+ bankAccount4Bsb?: string | null;
325
+ bankAccount4Name?: string | null;
326
+ bankAccount4Number?: string | null;
327
+ bankAccount5Allocation?: string | null;
328
+ bankAccount5AllocationMethod?: AllocationMethod | null;
329
+ bankAccount5Bsb?: string | null;
330
+ bankAccount5Name?: string | null;
331
+ bankAccount5Number?: string | null;
332
+ dateOfBirth?: string | null;
333
+ displayName: string;
334
+ employeeCode?: string | null;
335
+ endDate?: string | null;
336
+ familyName?: string | null;
337
+ gender?: Gender | null;
338
+ givenName?: string | null;
339
+ hasLoanOrStudentDebt?: boolean | null;
340
+ id: string;
341
+ otherGivenNames?: string | null;
342
+ personalEmail?: string | null;
343
+ personalPhone?: string | null;
344
+ profileEmail?: string | null;
345
+ residencyStatus?: TaxResidencyStatus | null;
346
+ residentialAddressCity?: string | null;
347
+ residentialAddressCountry?: string | null;
348
+ residentialAddressLine1?: string | null;
349
+ residentialAddressLine2?: string | null;
350
+ residentialAddressPostcode?: string | null;
351
+ residentialAddressState?: string | null;
352
+ startDate?: string | null;
353
+ superFund1MemberName?: string | null;
354
+ superFund1MemberNumber?: string | null;
355
+ superFund1Nomination?: SuperFundNomination | null;
356
+ superFund1Usi?: string | null;
357
+ taxFileNumber?: string | null;
358
+ taxFileNumberExemption?: TaxFileNumberExemption | null;
359
+ taxFreeThresholdClaimed?: boolean | null;
360
+ updatedAt: string;
361
+ }[]>;
362
+ getPersonConnections: (variables: Exact<{
363
+ integrationId: Scalars["ID"]["input"];
364
+ }>, fetchOptions?: FetchOptions) => Promise<(({
365
+ __typename: "PersonConnection";
366
+ createdAt: string;
367
+ id: string;
368
+ status: ConnectionStatus;
369
+ updatedAt: string;
370
+ person?: {
371
+ displayName: string;
372
+ id: string;
373
+ } | null;
374
+ remote?: {
375
+ name: string;
376
+ id: string;
377
+ url?: string | null;
378
+ } | null;
379
+ } & {
380
+ status: ConnectionStatus.Connected;
381
+ remote: {
382
+ name: string;
383
+ id: string;
384
+ url?: string | null;
385
+ };
386
+ person: {
387
+ displayName: string;
388
+ id: string;
389
+ };
390
+ }) | ({
391
+ __typename: "PersonConnection";
392
+ createdAt: string;
393
+ id: string;
394
+ status: ConnectionStatus;
395
+ updatedAt: string;
396
+ person?: {
397
+ displayName: string;
398
+ id: string;
399
+ } | null;
400
+ remote?: {
401
+ name: string;
402
+ id: string;
403
+ url?: string | null;
404
+ } | null;
405
+ } & {
406
+ status: ConnectionStatus.Merged;
407
+ remote: {
408
+ name: string;
409
+ id: string;
410
+ url?: string | null;
411
+ };
412
+ person: {
413
+ displayName: string;
414
+ id: string;
415
+ };
416
+ }) | ({
417
+ __typename: "PersonConnection";
418
+ createdAt: string;
419
+ id: string;
420
+ status: ConnectionStatus;
421
+ updatedAt: string;
422
+ person?: {
423
+ displayName: string;
424
+ id: string;
425
+ } | null;
426
+ remote?: {
427
+ name: string;
428
+ id: string;
429
+ url?: string | null;
430
+ } | null;
431
+ } & {
432
+ status: ConnectionStatus.LocalOnly;
433
+ person: {
434
+ displayName: string;
435
+ id: string;
436
+ };
437
+ remote: null;
438
+ }) | ({
439
+ __typename: "PersonConnection";
440
+ createdAt: string;
441
+ id: string;
442
+ status: ConnectionStatus;
443
+ updatedAt: string;
444
+ person?: {
445
+ displayName: string;
446
+ id: string;
447
+ } | null;
448
+ remote?: {
449
+ name: string;
450
+ id: string;
451
+ url?: string | null;
452
+ } | null;
453
+ } & {
454
+ status: ConnectionStatus.RemoteOnly;
455
+ remote: {
456
+ name: string;
457
+ id: string;
458
+ url?: string | null;
459
+ };
460
+ person: null;
461
+ }))[]>;
462
+ updatePersonConnection: (variables: {
463
+ personConnectionId: string;
464
+ personId: string;
465
+ remote: {
466
+ id: string;
467
+ name: string;
468
+ };
469
+ status: ConnectionStatus.Connected;
470
+ } | {
471
+ personConnectionId: string;
472
+ personId: string;
473
+ status: ConnectionStatus.LocalOnly;
474
+ } | {
475
+ personConnectionId: string;
476
+ personId: string;
477
+ remote: {
478
+ id: string;
479
+ name: string;
480
+ };
481
+ status: ConnectionStatus.Merged;
482
+ } | {
483
+ personConnectionId: string;
484
+ remote: {
485
+ id: string;
486
+ name: string;
487
+ };
488
+ status: ConnectionStatus.RemoteOnly;
489
+ }, fetchOptions?: FetchOptions) => Promise<({
490
+ __typename: "PersonConnection";
491
+ createdAt: string;
492
+ id: string;
493
+ status: ConnectionStatus;
494
+ updatedAt: string;
495
+ person?: {
496
+ displayName: string;
497
+ id: string;
498
+ } | null;
499
+ remote?: {
500
+ name: string;
501
+ id: string;
502
+ url?: string | null;
503
+ } | null;
504
+ } & {
505
+ status: ConnectionStatus.Connected;
506
+ remote: {
507
+ name: string;
508
+ id: string;
509
+ url?: string | null;
510
+ };
511
+ person: {
512
+ displayName: string;
513
+ id: string;
514
+ };
515
+ }) | ({
516
+ __typename: "PersonConnection";
517
+ createdAt: string;
518
+ id: string;
519
+ status: ConnectionStatus;
520
+ updatedAt: string;
521
+ person?: {
522
+ displayName: string;
523
+ id: string;
524
+ } | null;
525
+ remote?: {
526
+ name: string;
527
+ id: string;
528
+ url?: string | null;
529
+ } | null;
530
+ } & {
531
+ status: ConnectionStatus.Merged;
532
+ remote: {
533
+ name: string;
534
+ id: string;
535
+ url?: string | null;
536
+ };
537
+ person: {
538
+ displayName: string;
539
+ id: string;
540
+ };
541
+ }) | ({
542
+ __typename: "PersonConnection";
543
+ createdAt: string;
544
+ id: string;
545
+ status: ConnectionStatus;
546
+ updatedAt: string;
547
+ person?: {
548
+ displayName: string;
549
+ id: string;
550
+ } | null;
551
+ remote?: {
552
+ name: string;
553
+ id: string;
554
+ url?: string | null;
555
+ } | null;
556
+ } & {
557
+ status: ConnectionStatus.LocalOnly;
558
+ person: {
559
+ displayName: string;
560
+ id: string;
561
+ };
562
+ remote: null;
563
+ }) | ({
564
+ __typename: "PersonConnection";
565
+ createdAt: string;
566
+ id: string;
567
+ status: ConnectionStatus;
568
+ updatedAt: string;
569
+ person?: {
570
+ displayName: string;
571
+ id: string;
572
+ } | null;
573
+ remote?: {
574
+ name: string;
575
+ id: string;
576
+ url?: string | null;
577
+ } | null;
578
+ } & {
579
+ status: ConnectionStatus.RemoteOnly;
580
+ remote: {
581
+ name: string;
582
+ id: string;
583
+ url?: string | null;
584
+ };
585
+ person: null;
586
+ })>;
587
+ };
588
+
589
+ type SuccessfulQueryResult<Data extends object = object> = Readonly<{
590
+ data: Data;
591
+ }> | Readonly<{
592
+ data: Data;
593
+ errors: ReadonlyArray<GraphQLFormattedError>;
594
+ }>;
595
+ type FailedQueryResult = Readonly<{
596
+ data: null;
597
+ errors: ReadonlyArray<GraphQLFormattedError>;
598
+ }> | Readonly<{
599
+ errors: ReadonlyArray<GraphQLFormattedError>;
600
+ }>;
601
+ type QueryResult<Data extends object = object> = SuccessfulQueryResult<Data> | FailedQueryResult;
602
+ type FetchOptions = {
603
+ signal?: AbortSignal;
604
+ };
605
+ type ClientConfig = {
606
+ accessToken?: string;
607
+ apiUrl?: string;
608
+ };
609
+ type WorkniceClient = ReturnType<typeof createWorkniceClient>;
610
+ interface GraphQLFormattedError {
611
+ /**
612
+ * A short, human-readable summary of the problem that **SHOULD NOT** change
613
+ * from occurrence to occurrence of the problem, except for purposes of
614
+ * localization.
615
+ */
616
+ readonly message: string;
617
+ /**
618
+ * If an error can be associated to a particular point in the requested
619
+ * GraphQL document, it should contain a list of locations.
620
+ */
621
+ readonly locations?: ReadonlyArray<SourceLocation>;
622
+ /**
623
+ * If an error can be associated to a particular field in the GraphQL result,
624
+ * it _must_ contain an entry with the key `path` that details the path of
625
+ * the response field which experienced the error. This allows clients to
626
+ * identify whether a null result is intentional or caused by a runtime error.
627
+ */
628
+ readonly path?: ReadonlyArray<string | number>;
629
+ /**
630
+ * Reserved for implementors to extend the protocol however they see fit,
631
+ * and hence there are no additional restrictions on its contents.
632
+ */
633
+ readonly extensions?: {
634
+ [key: string]: unknown;
635
+ };
636
+ }
637
+ interface SourceLocation {
638
+ readonly line: number;
639
+ readonly column: number;
640
+ }
641
+
642
+ export { type ClientConfig as C, type FetchOptions as F, type QueryResult as Q, type SuccessfulQueryResult as S, type WorkniceClient as W, type FailedQueryResult as a, createWorkniceClient as c };