@fonderie/client 0.9.0 → 0.11.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.
@@ -80,7 +80,7 @@ interface IListAuditEventsInput {
80
80
  new AuditClient(http: HttpClient, tokens: TokenStore): AuditClient
81
81
  .setAccessToken(token: string | undefined): void
82
82
  .setWorkspaceId(workspaceId: string | undefined): void
83
- .listEvents(input?: IListAuditEventsInput): Promise<IApiResponse<IAuditPageResult>>
83
+ .listEvents(input?: IListAuditEventsInput, opts?: IReadOptions | undefined): Promise<IApiResponse<IAuditPageResult>>
84
84
 
85
85
  interface IChangePasswordInput {
86
86
  currentPassword: string;
@@ -107,16 +107,21 @@ interface IResetPasswordInput {
107
107
  interface IUpdatePreferencesInput {
108
108
  locale?: string;
109
109
  timezone?: string;
110
- notifications?: unknown;
111
- emailDigest?: unknown;
112
- dateFormat?: unknown;
113
- timeFormat?: unknown;
110
+ notifications?: {
111
+ email?: boolean;
112
+ inApp?: boolean;
113
+ sms?: boolean;
114
+ push?: boolean;
115
+ };
116
+ emailDigest?: string;
117
+ dateFormat?: string;
118
+ timeFormat?: string;
114
119
  }
115
120
 
116
121
  interface IUpdateProfileInput {
117
- firstName?: string;
118
- lastName?: string;
119
- avatarUrl?: string;
122
+ firstName?: string | null;
123
+ lastName?: string | null;
124
+ avatarUrl?: string | null;
120
125
  }
121
126
 
122
127
  new AuthClient(http: HttpClient, tokens: TokenStore): AuthClient
@@ -130,7 +135,7 @@ new AuthClient(http: HttpClient, tokens: TokenStore): AuthClient
130
135
  .verifyEmail(token: string): Promise<IApiResponse<IVerifyEmailResult>>
131
136
  .logout(refreshToken?: string | undefined): Promise<IApiResponse<undefined>>
132
137
  .sendVerificationEmail(): Promise<IApiResponse<IResendVerificationResult>>
133
- .getUser(): Promise<IApiResponse<IMeResult>>
138
+ .getUser(opts?: IReadOptions | undefined): Promise<IApiResponse<IMeResult>>
134
139
  .updateProfile(input: IUpdateProfileInput): Promise<IApiResponse<IMeResult>>
135
140
  .updatePreferences(input: IUpdatePreferencesInput): Promise<IApiResponse<IMeResult>>
136
141
  .updateEmail(email: string): Promise<IApiResponse<unknown>>
@@ -168,20 +173,21 @@ type IUpdatePlanInput = Partial<ICreatePlanInput>;
168
173
  new BillingClient(http: HttpClient, tokens: TokenStore): BillingClient
169
174
  .setAccessToken(token: string | undefined): void
170
175
  .setWorkspaceId(workspaceId: string | undefined): void
171
- .listPlans(): Promise<IApiResponse<IPlanListResult>>
172
- .getPlan(planId: string): Promise<IApiResponse<IPlanResult>>
176
+ .listPlans(opts?: IReadOptions | undefined): Promise<IApiResponse<IPlanListResult>>
177
+ .getPlan(planId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IPlanResult>>
173
178
  .createPlan(input: ICreatePlanInput): Promise<IApiResponse<IPlanResult>>
174
179
  .updatePlan(planId: string, input: Partial<ICreatePlanInput>): Promise<IApiResponse<IPlanResult>>
175
180
  .deletePlan(planId: string): Promise<IApiResponse<undefined>>
176
- .getSubscription(): Promise<IApiResponse<ISubscriptionResult>>
181
+ .getSubscription(opts?: IReadOptions | undefined): Promise<IApiResponse<ISubscriptionResult>>
177
182
  .createCheckoutSession(input: ICheckoutInput): Promise<IApiResponse<ICheckoutUrlResult>>
178
183
  .createPortalSession(): Promise<IApiResponse<IPortalUrlResult>>
179
184
  .recordUsage(input: IRecordUsageInput): Promise<IApiResponse<undefined>>
180
- .getUsage(metric: string): Promise<IApiResponse<IUsageResult>>
185
+ .getUsage(metric: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IUsageResult>>
181
186
 
182
187
  interface IConfigAdminClientOptions {
183
188
  baseUrl: string;
184
189
  adminToken: string;
190
+ actor?: string;
185
191
  }
186
192
 
187
193
  interface IRollbackInput {
@@ -191,12 +197,14 @@ interface IRollbackInput {
191
197
  interface ISetConfigInput {
192
198
  value: unknown;
193
199
  description?: string;
200
+ active?: boolean;
194
201
  ifVersion?: number;
195
202
  }
196
203
 
197
204
  interface ISetSecretInput {
198
205
  value: string;
199
206
  description?: string;
207
+ active?: boolean;
200
208
  ifVersion?: number;
201
209
  }
202
210
 
@@ -218,6 +226,7 @@ new ConfigAdminClient(opts: IConfigAdminClientOptions): ConfigAdminClient
218
226
  interface ICourierAdminClientOptions {
219
227
  baseUrl: string;
220
228
  adminToken: string;
229
+ actor?: string;
221
230
  }
222
231
 
223
232
  interface IRollbackTemplateInput {
@@ -266,7 +275,7 @@ interface IAddPhoneInput {
266
275
 
267
276
  interface IAddRelationshipInput {
268
277
  relatedId: string;
269
- relationship?: string;
278
+ relationship: string;
270
279
  isPrimary?: boolean;
271
280
  }
272
281
 
@@ -298,45 +307,45 @@ interface IListCustomersInput {
298
307
  offset?: number;
299
308
  }
300
309
 
301
- type IUpdateCustomerInput = ICreateCustomerInput;
310
+ type IUpdateCustomerInput = Omit<ICreateCustomerInput, 'referralCode' | 'referredByCode'>;
302
311
 
303
312
  new CustomersClient(http: HttpClient, tokens: TokenStore): CustomersClient
304
313
  .setAccessToken(token: string | undefined): void
305
314
  .setWorkspaceId(workspaceId: string | undefined): void
306
- .listCustomers(input?: IListCustomersInput): Promise<IApiResponse<ICustomerListResult>>
315
+ .listCustomers(input?: IListCustomersInput, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerListResult>>
307
316
  .createCustomer(input?: ICreateCustomerInput): Promise<IApiResponse<ICustomerResult>>
308
- .getCustomer(customerId: string, input?: IGetCustomerInput): Promise<IApiResponse<ICustomerDetailDTO | ICustomerDetailD2DTO>>
309
- .updateCustomer(customerId: string, input: ICreateCustomerInput): Promise<IApiResponse<ICustomerResult>>
317
+ .getCustomer(customerId: string, input?: IGetCustomerInput, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerDetailDTO | ICustomerDetailD2DTO>>
318
+ .updateCustomer(customerId: string, input: IUpdateCustomerInput): Promise<IApiResponse<ICustomerResult>>
310
319
  .deleteCustomer(customerId: string): Promise<IApiResponse<undefined>>
311
320
  .blacklistCustomer(customerId: string, input?: IBlacklistCustomerInput): Promise<IApiResponse<undefined>>
312
321
  .unblacklistCustomer(customerId: string): Promise<IApiResponse<undefined>>
313
- .listEmails(customerId: string): Promise<IApiResponse<ICustomerEmailListResult>>
322
+ .listEmails(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerEmailListResult>>
314
323
  .addEmail(customerId: string, input: IAddEmailInput): Promise<IApiResponse<ICustomerEmailResult>>
315
324
  .updateEmailLabel(customerId: string, emailId: string, label: string): Promise<IApiResponse<ICustomerEmailResult>>
316
325
  .setPrimaryEmail(customerId: string, emailId: string): Promise<IApiResponse<undefined>>
317
326
  .removeEmail(customerId: string, emailId: string): Promise<IApiResponse<undefined>>
318
- .listPhones(customerId: string): Promise<IApiResponse<ICustomerPhoneListResult>>
327
+ .listPhones(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerPhoneListResult>>
319
328
  .addPhone(customerId: string, input: IAddPhoneInput): Promise<IApiResponse<ICustomerPhoneResult>>
320
329
  .updatePhoneLabel(customerId: string, phoneId: string, label: string): Promise<IApiResponse<ICustomerPhoneResult>>
321
330
  .setPrimaryPhone(customerId: string, phoneId: string): Promise<IApiResponse<undefined>>
322
331
  .removePhone(customerId: string, phoneId: string): Promise<IApiResponse<undefined>>
323
- .listAddresses(customerId: string): Promise<IApiResponse<ICustomerAddressListResult>>
332
+ .listAddresses(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerAddressListResult>>
324
333
  .addAddress(customerId: string, input: IAddAddressInput): Promise<IApiResponse<ICustomerAddressResult>>
325
334
  .updateAddressLabel(customerId: string, addrId: string, label: string): Promise<IApiResponse<ICustomerAddressResult>>
326
335
  .setPrimaryAddress(customerId: string, addrId: string): Promise<IApiResponse<undefined>>
327
336
  .removeAddress(customerId: string, addrId: string): Promise<IApiResponse<undefined>>
328
- .listNotes(customerId: string): Promise<IApiResponse<ICustomerNoteListResult>>
337
+ .listNotes(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerNoteListResult>>
329
338
  .createNote(customerId: string, body: string): Promise<IApiResponse<ICustomerNoteResult>>
330
339
  .updateNote(customerId: string, noteId: string, body: string): Promise<IApiResponse<ICustomerNoteResult>>
331
340
  .deleteNote(customerId: string, noteId: string): Promise<IApiResponse<undefined>>
332
- .listTags(customerId: string): Promise<IApiResponse<ICustomerTagListResult>>
341
+ .listTags(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerTagListResult>>
333
342
  .addTag(customerId: string, tag: string): Promise<IApiResponse<undefined>>
334
343
  .removeTag(customerId: string, tag: string): Promise<IApiResponse<undefined>>
335
- .listRelationships(customerId: string): Promise<IApiResponse<ICustomerRelationshipListResult>>
344
+ .listRelationships(customerId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerRelationshipListResult>>
336
345
  .addRelationship(customerId: string, input: IAddRelationshipInput): Promise<IApiResponse<ICustomerRelationshipResult>>
337
346
  .setPrimaryRelationship(customerId: string, relatedId: string): Promise<IApiResponse<undefined>>
338
347
  .removeRelationship(customerId: string, relatedId: string): Promise<IApiResponse<undefined>>
339
- .listLabels(type: CustomerLabelType): Promise<IApiResponse<ICustomerLabelListResult>>
348
+ .listLabels(type: CustomerLabelType, opts?: IReadOptions | undefined): Promise<IApiResponse<ICustomerLabelListResult>>
340
349
  .removeLabel(labelId: string): Promise<IApiResponse<undefined>>
341
350
 
342
351
  interface ICreateWebhookEndpointInput {
@@ -353,12 +362,12 @@ interface IUpdateWebhookEndpointInput {
353
362
  new WebhooksClient(http: HttpClient, tokens: TokenStore): WebhooksClient
354
363
  .setAccessToken(token: string | undefined): void
355
364
  .setWorkspaceId(workspaceId: string | undefined): void
356
- .listEndpoints(): Promise<IApiResponse<IWebhookEndpointListResult>>
365
+ .listEndpoints(opts?: IReadOptions | undefined): Promise<IApiResponse<IWebhookEndpointListResult>>
357
366
  .createEndpoint(input: ICreateWebhookEndpointInput): Promise<IApiResponse<IWebhookEndpointCreatedDTO>>
358
- .getEndpoint(endpointId: string): Promise<IApiResponse<IWebhookEndpointDTO>>
367
+ .getEndpoint(endpointId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IWebhookEndpointDTO>>
359
368
  .updateEndpoint(endpointId: string, input: IUpdateWebhookEndpointInput): Promise<IApiResponse<IWebhookEndpointDTO>>
360
369
  .deleteEndpoint(endpointId: string): Promise<undefined>
361
- .listDeliveries(endpointId: string): Promise<IApiResponse<IWebhookDeliveryListResult>>
370
+ .listDeliveries(endpointId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IWebhookDeliveryListResult>>
362
371
  .testEndpoint(endpointId: string): Promise<IApiResponse<ITestWebhookResult>>
363
372
 
364
373
  interface ICreateRoleInput {
@@ -430,29 +439,29 @@ interface IUpdateWorkspaceInput {
430
439
  new WorkspacesClient(http: HttpClient, tokens: TokenStore): WorkspacesClient
431
440
  .setAccessToken(token: string | undefined): void
432
441
  .setWorkspaceId(workspaceId: string | undefined): void
433
- .listWorkspaces(): Promise<IApiResponse<IWorkspaceListResult>>
442
+ .listWorkspaces(opts?: IReadOptions | undefined): Promise<IApiResponse<IWorkspaceListResult>>
434
443
  .createWorkspace(input: ICreateWorkspaceInput): Promise<IApiResponse<IWorkspaceResult>>
435
- .getWorkspace(id: string): Promise<IApiResponse<IWorkspaceResult>>
444
+ .getWorkspace(id: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IWorkspaceResult>>
436
445
  .updateWorkspace(input: IUpdateWorkspaceInput): Promise<IApiResponse<IWorkspaceResult>>
437
446
  .archiveWorkspace(): Promise<IApiResponse<undefined>>
438
447
  .restoreWorkspace(): Promise<IApiResponse<undefined>>
439
- .listRoles(): Promise<IApiResponse<IRoleListResult>>
448
+ .listRoles(opts?: IReadOptions | undefined): Promise<IApiResponse<IRoleListResult>>
440
449
  .createRole(input: ICreateRoleInput): Promise<IApiResponse<IRoleResult>>
441
- .getRole(roleId: string): Promise<IApiResponse<IRoleResult>>
450
+ .getRole(roleId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IRoleResult>>
442
451
  .updateRole(roleId: string, input: IUpdateRoleInput): Promise<IApiResponse<IRoleResult>>
443
452
  .removeRole(roleId: string): Promise<IApiResponse<undefined>>
444
- .getRolePermissions(roleId: string): Promise<IApiResponse<IRolePermissionsResult>>
453
+ .getRolePermissions(roleId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IRolePermissionsResult>>
445
454
  .setRolePermissions(roleId: string, permissions: IRolePermissionInput[]): Promise<IApiResponse<undefined>>
446
- .listMembers(): Promise<IApiResponse<IMemberListResult>>
455
+ .listMembers(opts?: IReadOptions | undefined): Promise<IApiResponse<IMemberListResult>>
447
456
  .removeMember(userId: string): Promise<IApiResponse<undefined>>
448
- .getMemberRoles(userId: string): Promise<IApiResponse<IRoleListResult>>
457
+ .getMemberRoles(userId: string, opts?: IReadOptions | undefined): Promise<IApiResponse<IRoleListResult>>
449
458
  .addMemberRole(userId: string, roleId: string): Promise<IApiResponse<undefined>>
450
459
  .removeMemberRole(userId: string, roleId: string): Promise<IApiResponse<undefined>>
451
- .listInvitations(): Promise<IApiResponse<IInvitationListResult>>
460
+ .listInvitations(opts?: IReadOptions | undefined): Promise<IApiResponse<IInvitationListResult>>
452
461
  .invite(entries: IInviteEntry | IInviteEntry[]): Promise<IApiResponse<IInviteResult>>
453
462
  .cancelInvitation(inviteId: string): Promise<IApiResponse<undefined>>
454
463
  .acceptInvitation(pin: string): Promise<IApiResponse<IAcceptInvitationResult>>
455
- .getSettings(): Promise<IApiResponse<IWorkspaceSettingsResult>>
464
+ .getSettings(opts?: IReadOptions | undefined): Promise<IApiResponse<IWorkspaceSettingsResult>>
456
465
  .updateSettings(input: IUpdateSettingsInput): Promise<IApiResponse<IWorkspaceSettingsResult>>
457
466
 
458
467
  type CustomerLabelType = 'phone' | 'email' | 'address';
@@ -528,6 +537,7 @@ interface IConfigRevision {
528
537
  interface ICustomerAddressDTO {
529
538
  id: string;
530
539
  label: string;
540
+ labelId: string | null;
531
541
  isPrimary: boolean;
532
542
  address: IAddressDTO;
533
543
  }
@@ -578,6 +588,7 @@ interface ICustomerEmailDTO {
578
588
  id: string;
579
589
  email: string;
580
590
  label: string;
591
+ labelId: string | null;
581
592
  isPrimary: boolean;
582
593
  createdAt: string;
583
594
  }
@@ -626,6 +637,7 @@ interface ICustomerPhoneDTO {
626
637
  id: string;
627
638
  phone: string;
628
639
  label: string;
640
+ labelId: string | null;
629
641
  isPrimary: boolean;
630
642
  createdAt: string;
631
643
  }
@@ -655,6 +667,7 @@ type ICustomerRelationshipExpandedDTO = Omit<ICustomerShallowDTO, 'id'> & {
655
667
  customerId: string;
656
668
  relationship: string;
657
669
  isPrimary: boolean;
670
+ relationshipCreatedAt: string;
658
671
  };
659
672
 
660
673
  interface ICustomerRelationshipListResult {
@@ -706,6 +719,7 @@ interface IInviteResult {
706
719
  interface ILoginResult {
707
720
  tokens: ITokens;
708
721
  user: IUserDTO;
722
+ requiresVerification?: boolean;
709
723
  }
710
724
 
711
725
  interface IMemberDTO {
@@ -715,6 +729,10 @@ interface IMemberDTO {
715
729
  roleName: string;
716
730
  confirmed: boolean;
717
731
  createdAt: string;
732
+ email: string;
733
+ firstName: string;
734
+ lastName: string;
735
+ profileImageUrl: string;
718
736
  }
719
737
 
720
738
  interface IMemberListResult {
@@ -726,8 +744,7 @@ interface IMeResult {
726
744
  }
727
745
 
728
746
  interface IMfaEnabledResult {
729
- tokens: ITokens;
730
- user: IUserDTO;
747
+ mfaEnabled: boolean;
731
748
  }
732
749
 
733
750
  interface IMfaRequiredResult {
@@ -752,6 +769,7 @@ interface IPlanDTO {
752
769
  yearly: number;
753
770
  currency: string;
754
771
  };
772
+ pricingStale?: boolean;
755
773
  features: IPlanFeature[];
756
774
  metadata: Record<string, unknown>;
757
775
  }
@@ -779,19 +797,19 @@ interface IRefreshResult {
779
797
  tokens: ITokens;
780
798
  }
781
799
 
800
+ interface IReadOptions {
801
+ bust?: boolean | undefined;
802
+ }
803
+
782
804
  interface IRegisterResult {
783
805
  tokens: ITokens;
784
806
  user: IUserDTO;
807
+ requiresVerification?: boolean;
785
808
  }
786
809
 
787
810
  interface IResendVerificationResult {
788
- stat: string;
789
- message: string;
790
- data: {
791
- token: string;
792
- expiresAt: string;
793
- email: string;
794
- };
811
+ email?: string;
812
+ verified?: boolean;
795
813
  }
796
814
 
797
815
  interface IRevealSecretResult {
@@ -900,9 +918,9 @@ interface IUserDTO {
900
918
  profileImageUrl: string;
901
919
  isActive: boolean;
902
920
  lastLogin: string;
903
- skills: IUserSkill[];
904
921
  preferences: IUserPreferences;
905
922
  isEmailVerified: boolean;
923
+ isPhoneVerified: boolean;
906
924
  mfaEnabled: boolean;
907
925
  suspended: boolean;
908
926
  whitelist: boolean;
@@ -925,11 +943,6 @@ interface IUserPreferences {
925
943
  timeFormat: string;
926
944
  }
927
945
 
928
- interface IUserSkill {
929
- name: string;
930
- level: string;
931
- }
932
-
933
946
  interface IVerifyEmailResult {
934
947
  verified: boolean;
935
948
  email: string;
@@ -941,7 +954,10 @@ interface IWebhookDeliveryDTO {
941
954
  eventType: string;
942
955
  status: string;
943
956
  attempts: number;
957
+ payload: Record<string, unknown>;
944
958
  responseStatus: number | null;
959
+ responseBody: string | null;
960
+ nextAttemptAt: string | null;
945
961
  deliveredAt: string | null;
946
962
  createdAt: string;
947
963
  }
@@ -990,6 +1006,7 @@ interface IWorkspaceDTO {
990
1006
  isPersonal: boolean;
991
1007
  isArchived: boolean;
992
1008
  archivedAt: string;
1009
+ archivedBy: string;
993
1010
  createdAt: string;
994
1011
  updatedAt: string;
995
1012
  }