@outseta/api-client 0.1.1 → 0.2.1

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 (75) hide show
  1. package/README.md +6 -8
  2. package/dist/index.js +23 -19
  3. package/package.json +3 -6
  4. package/src/__tests__/accounts-crud.integration.test.ts +41 -39
  5. package/src/__tests__/client.test.ts +3 -3
  6. package/src/__tests__/people.integration.test.ts +28 -32
  7. package/src/__tests__/setup.ts +5 -6
  8. package/src/__tests__/support.integration.test.ts +28 -35
  9. package/src/client.ts +55 -24
  10. package/src/generated/activity/activity.ts +335 -0
  11. package/src/generated/billing/billing.ts +1006 -0
  12. package/src/generated/crm/crm.ts +1143 -1
  13. package/src/generated/email/email.ts +798 -0
  14. package/src/generated/models/accountAddPersonToAccountBody.ts +227 -0
  15. package/src/generated/models/accountCancelAccountBody.ts +227 -0
  16. package/src/generated/models/accountCancelationAllOf.ts +2 -0
  17. package/src/generated/models/accountExtendTrialBody.ts +227 -0
  18. package/src/generated/models/accountStage.ts +2 -1
  19. package/src/generated/models/accountUpdateAccountBody.ts +227 -0
  20. package/src/generated/models/accountUpdateMembershipBody.ts +227 -0
  21. package/src/generated/models/activityAddCustomActivityBody.ts +227 -0
  22. package/src/generated/models/activityGetAllParams.ts +241 -0
  23. package/src/generated/models/articleGetAllArticlesParams.ts +228 -0
  24. package/src/generated/models/backGroundTaskType.ts +3 -1
  25. package/src/generated/models/broadcastCampaignAllOf.ts +4 -0
  26. package/src/generated/models/broadcastCampaignStatus.ts +2 -1
  27. package/src/generated/models/campaignAddBroadcastEmailBody.ts +227 -0
  28. package/src/generated/models/campaignSendTestCampaignEmailBody.ts +227 -0
  29. package/src/generated/models/campaignUpdateBroadcastEmailBody.ts +227 -0
  30. package/src/generated/models/cancelationStatus.ts +236 -0
  31. package/src/generated/models/caseAddCaseBody.ts +227 -0
  32. package/src/generated/models/caseAddCaseParams.ts +229 -0
  33. package/src/generated/models/crmSettingsAllOf.ts +2 -0
  34. package/src/generated/models/dealAddDealBody.ts +227 -0
  35. package/src/generated/models/dealGetAllDealsParams.ts +234 -0
  36. package/src/generated/models/dealUpdateDealBody.ts +227 -0
  37. package/src/generated/models/discountCouponAddDiscountCouponBody.ts +227 -0
  38. package/src/generated/models/dnsEntry.ts +2 -0
  39. package/src/generated/models/emailListAddSubscriptionBody.ts +227 -0
  40. package/src/generated/models/emailListGetAllSubscriptionsParams.ts +229 -0
  41. package/src/generated/models/extendSubscriptionOptions.ts +225 -0
  42. package/src/generated/models/index.ts +40 -0
  43. package/src/generated/models/invoiceAddInvoiceBody.ts +227 -0
  44. package/src/generated/models/invoiceAllOf.ts +8 -0
  45. package/src/generated/models/messageAllOf.ts +1 -0
  46. package/src/generated/models/paymentInformationSavePaymentInformationBody.ts +227 -0
  47. package/src/generated/models/personAddPersonBody.ts +227 -0
  48. package/src/generated/models/personAllOf.ts +3 -3
  49. package/src/generated/models/personForgotPasswordBody.ts +227 -0
  50. package/src/generated/models/personGetAllPeopleParams.ts +229 -0
  51. package/src/generated/models/personSetTemporaryPasswordBody.ts +227 -0
  52. package/src/generated/models/personUpdatePersonBody.ts +227 -0
  53. package/src/generated/models/qcountConfigSettingType.ts +3 -1
  54. package/src/generated/models/resendEmailsRequest.ts +226 -0
  55. package/src/generated/models/sendGridDomainAuthenticationAllOf.ts +1 -0
  56. package/src/generated/models/setupIntent.ts +2 -0
  57. package/src/generated/models/stripeCreditNoteAllOf.ts +9 -0
  58. package/src/generated/models/stripeInvoiceAllOf.ts +9 -0
  59. package/src/generated/models/stripePriceAllOf.ts +2 -0
  60. package/src/generated/models/stripeProductAllOf.ts +5 -0
  61. package/src/generated/models/stripeSubscriptionAllOf.ts +4 -0
  62. package/src/generated/models/subscriptionAddOnAddSubscriptionAddOnBody.ts +227 -0
  63. package/src/generated/models/subscriptionChangeSubscriptionBody.ts +227 -0
  64. package/src/generated/models/subscriptionChangeSubscriptionParams.ts +229 -0
  65. package/src/generated/models/subscriptionChangeSubscriptionPreviewBody.ts +227 -0
  66. package/src/generated/models/subscriptionChangeSubscriptionPreviewParams.ts +229 -0
  67. package/src/generated/models/subscriptionFirstTimeSubscriptionBody.ts +227 -0
  68. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewBody.ts +227 -0
  69. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewParams.ts +229 -0
  70. package/src/generated/models/subscriptionSetSubscriptionUpgradeRequiredBody.ts +227 -0
  71. package/src/generated/models/transactionsAddPaymentTransactionBody.ts +227 -0
  72. package/src/generated/models/usageAddUsageBody.ts +227 -0
  73. package/src/generated/support/support.ts +341 -1
  74. package/src/index.ts +7 -1
  75. package/src/generated/zod.ts +0 -191087
@@ -223,11 +223,321 @@ import type {
223
223
  Account,
224
224
  AccountAddAccountBody,
225
225
  AccountAddAccountParams,
226
- AccountGetAllAccountsParams
226
+ AccountAddPersonToAccountBody,
227
+ AccountCancelAccountBody,
228
+ AccountExtendTrialBody,
229
+ AccountGetAllAccountsParams,
230
+ AccountUpdateAccountBody,
231
+ AccountUpdateMembershipBody,
232
+ Deal,
233
+ DealAddDealBody,
234
+ DealGetAllDealsParams,
235
+ DealUpdateDealBody,
236
+ Person,
237
+ PersonAccount,
238
+ PersonAddPersonBody,
239
+ PersonForgotPasswordBody,
240
+ PersonGetAllPeopleParams,
241
+ PersonSetTemporaryPasswordBody,
242
+ PersonUpdatePersonBody
227
243
  } from '.././models';
228
244
 
229
245
  import { customFetch } from '../../client';
230
246
 
247
+ /**
248
+ * @summary Retrieves all the deals associated with your account.
249
+ */
250
+ export type dealGetAllDealsResponse200 = {
251
+ data: Deal[]
252
+ status: 200
253
+ }
254
+
255
+ export type dealGetAllDealsResponse400 = {
256
+ data: void
257
+ status: 400
258
+ }
259
+
260
+ export type dealGetAllDealsResponse401 = {
261
+ data: void
262
+ status: 401
263
+ }
264
+
265
+ export type dealGetAllDealsResponseSuccess = (dealGetAllDealsResponse200) & {
266
+ headers: Headers;
267
+ };
268
+ export type dealGetAllDealsResponseError = (dealGetAllDealsResponse400 | dealGetAllDealsResponse401) & {
269
+ headers: Headers;
270
+ };
271
+
272
+ export type dealGetAllDealsResponse = (dealGetAllDealsResponseSuccess | dealGetAllDealsResponseError)
273
+
274
+ export const getDealGetAllDealsUrl = (params?: DealGetAllDealsParams,) => {
275
+ const normalizedParams = new URLSearchParams();
276
+
277
+ Object.entries(params || {}).forEach(([key, value]) => {
278
+
279
+ if (value !== undefined) {
280
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
281
+ }
282
+ });
283
+
284
+ const stringifiedParams = normalizedParams.toString();
285
+
286
+ return stringifiedParams.length > 0 ? `/api/v1/crm/deals?${stringifiedParams}` : `/api/v1/crm/deals`
287
+ }
288
+
289
+ export const dealGetAllDeals = async (params?: DealGetAllDealsParams, options?: RequestInit): Promise<dealGetAllDealsResponse> => {
290
+
291
+ return customFetch<dealGetAllDealsResponse>(getDealGetAllDealsUrl(params),
292
+ {
293
+ ...options,
294
+ method: 'GET'
295
+
296
+
297
+ }
298
+ );}
299
+
300
+
301
+ /**
302
+ * @summary Add a new deal.
303
+ */
304
+ export type dealAddDealResponse200 = {
305
+ data: Deal
306
+ status: 200
307
+ }
308
+
309
+ export type dealAddDealResponse401 = {
310
+ data: void
311
+ status: 401
312
+ }
313
+
314
+ export type dealAddDealResponseSuccess = (dealAddDealResponse200) & {
315
+ headers: Headers;
316
+ };
317
+ export type dealAddDealResponseError = (dealAddDealResponse401) & {
318
+ headers: Headers;
319
+ };
320
+
321
+ export type dealAddDealResponse = (dealAddDealResponseSuccess | dealAddDealResponseError)
322
+
323
+ export const getDealAddDealUrl = () => {
324
+
325
+
326
+
327
+
328
+ return `/api/v1/crm/deals`
329
+ }
330
+
331
+ export const dealAddDeal = async (dealAddDealBody: DealAddDealBody, options?: RequestInit): Promise<dealAddDealResponse> => {
332
+
333
+ return customFetch<dealAddDealResponse>(getDealAddDealUrl(),
334
+ {
335
+ ...options,
336
+ method: 'POST',
337
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
338
+ body: JSON.stringify(
339
+ dealAddDealBody,)
340
+ }
341
+ );}
342
+
343
+
344
+ /**
345
+ * @summary Retrieves one deal associated with your account.
346
+ */
347
+ export type dealGetDealResponse200 = {
348
+ data: Deal
349
+ status: 200
350
+ }
351
+
352
+ export type dealGetDealResponse400 = {
353
+ data: void
354
+ status: 400
355
+ }
356
+
357
+ export type dealGetDealResponse401 = {
358
+ data: void
359
+ status: 401
360
+ }
361
+
362
+ export type dealGetDealResponse404 = {
363
+ data: void
364
+ status: 404
365
+ }
366
+
367
+ export type dealGetDealResponseSuccess = (dealGetDealResponse200) & {
368
+ headers: Headers;
369
+ };
370
+ export type dealGetDealResponseError = (dealGetDealResponse400 | dealGetDealResponse401 | dealGetDealResponse404) & {
371
+ headers: Headers;
372
+ };
373
+
374
+ export type dealGetDealResponse = (dealGetDealResponseSuccess | dealGetDealResponseError)
375
+
376
+ export const getDealGetDealUrl = (dealUid: string | null,) => {
377
+
378
+
379
+
380
+
381
+ return `/api/v1/crm/deals/${dealUid}`
382
+ }
383
+
384
+ export const dealGetDeal = async (dealUid: string | null, options?: RequestInit): Promise<dealGetDealResponse> => {
385
+
386
+ return customFetch<dealGetDealResponse>(getDealGetDealUrl(dealUid),
387
+ {
388
+ ...options,
389
+ method: 'GET'
390
+
391
+
392
+ }
393
+ );}
394
+
395
+
396
+ /**
397
+ * @summary Update a deal.
398
+ */
399
+ export type dealUpdateDealResponse200 = {
400
+ data: Deal
401
+ status: 200
402
+ }
403
+
404
+ export type dealUpdateDealResponse400 = {
405
+ data: void
406
+ status: 400
407
+ }
408
+
409
+ export type dealUpdateDealResponse401 = {
410
+ data: void
411
+ status: 401
412
+ }
413
+
414
+ export type dealUpdateDealResponse404 = {
415
+ data: void
416
+ status: 404
417
+ }
418
+
419
+ export type dealUpdateDealResponseSuccess = (dealUpdateDealResponse200) & {
420
+ headers: Headers;
421
+ };
422
+ export type dealUpdateDealResponseError = (dealUpdateDealResponse400 | dealUpdateDealResponse401 | dealUpdateDealResponse404) & {
423
+ headers: Headers;
424
+ };
425
+
426
+ export type dealUpdateDealResponse = (dealUpdateDealResponseSuccess | dealUpdateDealResponseError)
427
+
428
+ export const getDealUpdateDealUrl = (dealUid: string | null,) => {
429
+
430
+
431
+
432
+
433
+ return `/api/v1/crm/deals/${dealUid}`
434
+ }
435
+
436
+ export const dealUpdateDeal = async (dealUid: string | null,
437
+ dealUpdateDealBody: DealUpdateDealBody, options?: RequestInit): Promise<dealUpdateDealResponse> => {
438
+
439
+ return customFetch<dealUpdateDealResponse>(getDealUpdateDealUrl(dealUid),
440
+ {
441
+ ...options,
442
+ method: 'PUT',
443
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
444
+ body: JSON.stringify(
445
+ dealUpdateDealBody,)
446
+ }
447
+ );}
448
+
449
+
450
+ /**
451
+ * @summary Delete a deal.
452
+ */
453
+ export type dealDeleteDealResponse200 = {
454
+ data: Blob
455
+ status: 200
456
+ }
457
+
458
+ export type dealDeleteDealResponse400 = {
459
+ data: void
460
+ status: 400
461
+ }
462
+
463
+ export type dealDeleteDealResponse401 = {
464
+ data: void
465
+ status: 401
466
+ }
467
+
468
+ export type dealDeleteDealResponse404 = {
469
+ data: void
470
+ status: 404
471
+ }
472
+
473
+ export type dealDeleteDealResponseSuccess = (dealDeleteDealResponse200) & {
474
+ headers: Headers;
475
+ };
476
+ export type dealDeleteDealResponseError = (dealDeleteDealResponse400 | dealDeleteDealResponse401 | dealDeleteDealResponse404) & {
477
+ headers: Headers;
478
+ };
479
+
480
+ export type dealDeleteDealResponse = (dealDeleteDealResponseSuccess | dealDeleteDealResponseError)
481
+
482
+ export const getDealDeleteDealUrl = (dealUid: string | null,) => {
483
+
484
+
485
+
486
+
487
+ return `/api/v1/crm/deals/${dealUid}`
488
+ }
489
+
490
+ export const dealDeleteDeal = async (dealUid: string | null, options?: RequestInit): Promise<dealDeleteDealResponse> => {
491
+
492
+ return customFetch<dealDeleteDealResponse>(getDealDeleteDealUrl(dealUid),
493
+ {
494
+ ...options,
495
+ method: 'DELETE'
496
+
497
+
498
+ }
499
+ );}
500
+
501
+
502
+ /**
503
+ * @summary Register a new account. This is the same endpoint the sign up embed uses to create accounts.
504
+ At a minimum you must pass one Primary Contact with an Email address and one Subscription
505
+ record with a reference to a Plan. Other fields (e.g. Account Name, Billing Address,
506
+ Payment Information, etc.) can be passed as desired. A confirmation email will be sent
507
+ to the user unless you've specifically toggled this option off on the AUTH > SIGN UP AND LOGIN page.
508
+ */
509
+ export type registrationRegisterAccountResponse200 = {
510
+ data: Account
511
+ status: 200
512
+ }
513
+
514
+ export type registrationRegisterAccountResponseSuccess = (registrationRegisterAccountResponse200) & {
515
+ headers: Headers;
516
+ };
517
+ ;
518
+
519
+ export type registrationRegisterAccountResponse = (registrationRegisterAccountResponseSuccess)
520
+
521
+ export const getRegistrationRegisterAccountUrl = () => {
522
+
523
+
524
+
525
+
526
+ return `/api/v1/crm/registrations`
527
+ }
528
+
529
+ export const registrationRegisterAccount = async ( options?: RequestInit): Promise<registrationRegisterAccountResponse> => {
530
+
531
+ return customFetch<registrationRegisterAccountResponse>(getRegistrationRegisterAccountUrl(),
532
+ {
533
+ ...options,
534
+ method: 'POST'
535
+
536
+
537
+ }
538
+ );}
539
+
540
+
231
541
  /**
232
542
  * @summary Returns all accounts, optionally filtered by segment or search query.
233
543
  */
@@ -387,3 +697,835 @@ export const accountGetAccount = async (accountUid: string | null, options?: Req
387
697
  );}
388
698
 
389
699
 
700
+ /**
701
+ * @summary Delete an account record.
702
+ */
703
+ export type accountDeleteAccountResponse200 = {
704
+ data: Blob
705
+ status: 200
706
+ }
707
+
708
+ export type accountDeleteAccountResponse400 = {
709
+ data: void
710
+ status: 400
711
+ }
712
+
713
+ export type accountDeleteAccountResponse401 = {
714
+ data: void
715
+ status: 401
716
+ }
717
+
718
+ export type accountDeleteAccountResponse404 = {
719
+ data: void
720
+ status: 404
721
+ }
722
+
723
+ export type accountDeleteAccountResponseSuccess = (accountDeleteAccountResponse200) & {
724
+ headers: Headers;
725
+ };
726
+ export type accountDeleteAccountResponseError = (accountDeleteAccountResponse400 | accountDeleteAccountResponse401 | accountDeleteAccountResponse404) & {
727
+ headers: Headers;
728
+ };
729
+
730
+ export type accountDeleteAccountResponse = (accountDeleteAccountResponseSuccess | accountDeleteAccountResponseError)
731
+
732
+ export const getAccountDeleteAccountUrl = (accountUid: string | null,) => {
733
+
734
+
735
+
736
+
737
+ return `/api/v1/crm/accounts/${accountUid}`
738
+ }
739
+
740
+ export const accountDeleteAccount = async (accountUid: string | null, options?: RequestInit): Promise<accountDeleteAccountResponse> => {
741
+
742
+ return customFetch<accountDeleteAccountResponse>(getAccountDeleteAccountUrl(accountUid),
743
+ {
744
+ ...options,
745
+ method: 'DELETE'
746
+
747
+
748
+ }
749
+ );}
750
+
751
+
752
+ /**
753
+ * @summary Update account information. You can update one or multiple properties on the object.
754
+ Any property that you include in the json schema will be updated.
755
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
756
+ */
757
+ export type accountUpdateAccountResponse200 = {
758
+ data: Account
759
+ status: 200
760
+ }
761
+
762
+ export type accountUpdateAccountResponse400 = {
763
+ data: void
764
+ status: 400
765
+ }
766
+
767
+ export type accountUpdateAccountResponse401 = {
768
+ data: void
769
+ status: 401
770
+ }
771
+
772
+ export type accountUpdateAccountResponse404 = {
773
+ data: void
774
+ status: 404
775
+ }
776
+
777
+ export type accountUpdateAccountResponseSuccess = (accountUpdateAccountResponse200) & {
778
+ headers: Headers;
779
+ };
780
+ export type accountUpdateAccountResponseError = (accountUpdateAccountResponse400 | accountUpdateAccountResponse401 | accountUpdateAccountResponse404) & {
781
+ headers: Headers;
782
+ };
783
+
784
+ export type accountUpdateAccountResponse = (accountUpdateAccountResponseSuccess | accountUpdateAccountResponseError)
785
+
786
+ export const getAccountUpdateAccountUrl = (accountUid: string | null,) => {
787
+
788
+
789
+
790
+
791
+ return `/api/v1/crm/accounts/${accountUid}`
792
+ }
793
+
794
+ export const accountUpdateAccount = async (accountUid: string | null,
795
+ accountUpdateAccountBody: AccountUpdateAccountBody, options?: RequestInit): Promise<accountUpdateAccountResponse> => {
796
+
797
+ return customFetch<accountUpdateAccountResponse>(getAccountUpdateAccountUrl(accountUid),
798
+ {
799
+ ...options,
800
+ method: 'PUT',
801
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
802
+ body: JSON.stringify(
803
+ accountUpdateAccountBody,)
804
+ }
805
+ );}
806
+
807
+
808
+ /**
809
+ * @summary Add a person to an existing account. Set sendWelcomeEmail=true to send a welcome email to the person added.
810
+ */
811
+ export type accountAddPersonToAccountResponse200 = {
812
+ data: PersonAccount
813
+ status: 200
814
+ }
815
+
816
+ export type accountAddPersonToAccountResponse400 = {
817
+ data: void
818
+ status: 400
819
+ }
820
+
821
+ export type accountAddPersonToAccountResponse401 = {
822
+ data: void
823
+ status: 401
824
+ }
825
+
826
+ export type accountAddPersonToAccountResponse404 = {
827
+ data: void
828
+ status: 404
829
+ }
830
+
831
+ export type accountAddPersonToAccountResponseSuccess = (accountAddPersonToAccountResponse200) & {
832
+ headers: Headers;
833
+ };
834
+ export type accountAddPersonToAccountResponseError = (accountAddPersonToAccountResponse400 | accountAddPersonToAccountResponse401 | accountAddPersonToAccountResponse404) & {
835
+ headers: Headers;
836
+ };
837
+
838
+ export type accountAddPersonToAccountResponse = (accountAddPersonToAccountResponseSuccess | accountAddPersonToAccountResponseError)
839
+
840
+ export const getAccountAddPersonToAccountUrl = (accountUid: string | null,) => {
841
+
842
+
843
+
844
+
845
+ return `/api/v1/crm/accounts/${accountUid}/memberships`
846
+ }
847
+
848
+ export const accountAddPersonToAccount = async (accountUid: string | null,
849
+ accountAddPersonToAccountBody: AccountAddPersonToAccountBody, options?: RequestInit): Promise<accountAddPersonToAccountResponse> => {
850
+
851
+ return customFetch<accountAddPersonToAccountResponse>(getAccountAddPersonToAccountUrl(accountUid),
852
+ {
853
+ ...options,
854
+ method: 'POST',
855
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
856
+ body: JSON.stringify(
857
+ accountAddPersonToAccountBody,)
858
+ }
859
+ );}
860
+
861
+
862
+ /**
863
+ * @summary Update an account membership. This is the method by which you can change the primary contact of an account.
864
+ */
865
+ export type accountUpdateMembershipResponse200 = {
866
+ data: Blob
867
+ status: 200
868
+ }
869
+
870
+ export type accountUpdateMembershipResponse400 = {
871
+ data: void
872
+ status: 400
873
+ }
874
+
875
+ export type accountUpdateMembershipResponse401 = {
876
+ data: void
877
+ status: 401
878
+ }
879
+
880
+ export type accountUpdateMembershipResponse404 = {
881
+ data: void
882
+ status: 404
883
+ }
884
+
885
+ export type accountUpdateMembershipResponseSuccess = (accountUpdateMembershipResponse200) & {
886
+ headers: Headers;
887
+ };
888
+ export type accountUpdateMembershipResponseError = (accountUpdateMembershipResponse400 | accountUpdateMembershipResponse401 | accountUpdateMembershipResponse404) & {
889
+ headers: Headers;
890
+ };
891
+
892
+ export type accountUpdateMembershipResponse = (accountUpdateMembershipResponseSuccess | accountUpdateMembershipResponseError)
893
+
894
+ export const getAccountUpdateMembershipUrl = (accountUid: string | null,
895
+ membershipUid: string | null,) => {
896
+
897
+
898
+
899
+
900
+ return `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`
901
+ }
902
+
903
+ export const accountUpdateMembership = async (accountUid: string | null,
904
+ membershipUid: string | null,
905
+ accountUpdateMembershipBody: AccountUpdateMembershipBody, options?: RequestInit): Promise<accountUpdateMembershipResponse> => {
906
+
907
+ return customFetch<accountUpdateMembershipResponse>(getAccountUpdateMembershipUrl(accountUid,membershipUid),
908
+ {
909
+ ...options,
910
+ method: 'PUT',
911
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
912
+ body: JSON.stringify(
913
+ accountUpdateMembershipBody,)
914
+ }
915
+ );}
916
+
917
+
918
+ /**
919
+ * @summary Remove a person from an account. Note that you cannot remove the primary contact of an account.
920
+ */
921
+ export type accountDeleteMembershipResponse200 = {
922
+ data: Blob
923
+ status: 200
924
+ }
925
+
926
+ export type accountDeleteMembershipResponse400 = {
927
+ data: void
928
+ status: 400
929
+ }
930
+
931
+ export type accountDeleteMembershipResponse401 = {
932
+ data: void
933
+ status: 401
934
+ }
935
+
936
+ export type accountDeleteMembershipResponse404 = {
937
+ data: void
938
+ status: 404
939
+ }
940
+
941
+ export type accountDeleteMembershipResponseSuccess = (accountDeleteMembershipResponse200) & {
942
+ headers: Headers;
943
+ };
944
+ export type accountDeleteMembershipResponseError = (accountDeleteMembershipResponse400 | accountDeleteMembershipResponse401 | accountDeleteMembershipResponse404) & {
945
+ headers: Headers;
946
+ };
947
+
948
+ export type accountDeleteMembershipResponse = (accountDeleteMembershipResponseSuccess | accountDeleteMembershipResponseError)
949
+
950
+ export const getAccountDeleteMembershipUrl = (accountUid: string | null,
951
+ membershipUid: string | null,) => {
952
+
953
+
954
+
955
+
956
+ return `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`
957
+ }
958
+
959
+ export const accountDeleteMembership = async (accountUid: string | null,
960
+ membershipUid: string | null, options?: RequestInit): Promise<accountDeleteMembershipResponse> => {
961
+
962
+ return customFetch<accountDeleteMembershipResponse>(getAccountDeleteMembershipUrl(accountUid,membershipUid),
963
+ {
964
+ ...options,
965
+ method: 'DELETE'
966
+
967
+
968
+ }
969
+ );}
970
+
971
+
972
+ /**
973
+ * @summary Add a cancellation request to an account. The account needs to be in subscribing stage.
974
+ The stage will automatically change over to cancelling. If the account has a subscription
975
+ attached to it then at the subscription renewal the subscription will end and the account
976
+ will be automatically set to expired.
977
+ */
978
+ export type accountCancelAccountResponse200 = {
979
+ data: Blob
980
+ status: 200
981
+ }
982
+
983
+ export type accountCancelAccountResponse400 = {
984
+ data: void
985
+ status: 400
986
+ }
987
+
988
+ export type accountCancelAccountResponse401 = {
989
+ data: void
990
+ status: 401
991
+ }
992
+
993
+ export type accountCancelAccountResponse404 = {
994
+ data: void
995
+ status: 404
996
+ }
997
+
998
+ export type accountCancelAccountResponseSuccess = (accountCancelAccountResponse200) & {
999
+ headers: Headers;
1000
+ };
1001
+ export type accountCancelAccountResponseError = (accountCancelAccountResponse400 | accountCancelAccountResponse401 | accountCancelAccountResponse404) & {
1002
+ headers: Headers;
1003
+ };
1004
+
1005
+ export type accountCancelAccountResponse = (accountCancelAccountResponseSuccess | accountCancelAccountResponseError)
1006
+
1007
+ export const getAccountCancelAccountUrl = (accountUid: string | null,) => {
1008
+
1009
+
1010
+
1011
+
1012
+ return `/api/v1/crm/accounts/${accountUid}/cancel`
1013
+ }
1014
+
1015
+ export const accountCancelAccount = async (accountUid: string | null,
1016
+ accountCancelAccountBody: AccountCancelAccountBody, options?: RequestInit): Promise<accountCancelAccountResponse> => {
1017
+
1018
+ return customFetch<accountCancelAccountResponse>(getAccountCancelAccountUrl(accountUid),
1019
+ {
1020
+ ...options,
1021
+ method: 'PUT',
1022
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1023
+ body: JSON.stringify(
1024
+ accountCancelAccountBody,)
1025
+ }
1026
+ );}
1027
+
1028
+
1029
+ /**
1030
+ * @summary Remove a previous cancellation request from an account.
1031
+ */
1032
+ export type accountRemoveCancellationResponse200 = {
1033
+ data: Blob
1034
+ status: 200
1035
+ }
1036
+
1037
+ export type accountRemoveCancellationResponse400 = {
1038
+ data: void
1039
+ status: 400
1040
+ }
1041
+
1042
+ export type accountRemoveCancellationResponse401 = {
1043
+ data: void
1044
+ status: 401
1045
+ }
1046
+
1047
+ export type accountRemoveCancellationResponse404 = {
1048
+ data: void
1049
+ status: 404
1050
+ }
1051
+
1052
+ export type accountRemoveCancellationResponseSuccess = (accountRemoveCancellationResponse200) & {
1053
+ headers: Headers;
1054
+ };
1055
+ export type accountRemoveCancellationResponseError = (accountRemoveCancellationResponse400 | accountRemoveCancellationResponse401 | accountRemoveCancellationResponse404) & {
1056
+ headers: Headers;
1057
+ };
1058
+
1059
+ export type accountRemoveCancellationResponse = (accountRemoveCancellationResponseSuccess | accountRemoveCancellationResponseError)
1060
+
1061
+ export const getAccountRemoveCancellationUrl = (accountUid: string | null,) => {
1062
+
1063
+
1064
+
1065
+
1066
+ return `/api/v1/crm/accounts/${accountUid}/remove-cancellation`
1067
+ }
1068
+
1069
+ export const accountRemoveCancellation = async (accountUid: string | null, options?: RequestInit): Promise<accountRemoveCancellationResponse> => {
1070
+
1071
+ return customFetch<accountRemoveCancellationResponse>(getAccountRemoveCancellationUrl(accountUid),
1072
+ {
1073
+ ...options,
1074
+ method: 'PUT'
1075
+
1076
+
1077
+ }
1078
+ );}
1079
+
1080
+
1081
+ /**
1082
+ * @summary Extend the date that a trial subscription expires.
1083
+ */
1084
+ export type accountExtendTrialResponse200 = {
1085
+ data: Blob
1086
+ status: 200
1087
+ }
1088
+
1089
+ export type accountExtendTrialResponse400 = {
1090
+ data: void
1091
+ status: 400
1092
+ }
1093
+
1094
+ export type accountExtendTrialResponse401 = {
1095
+ data: void
1096
+ status: 401
1097
+ }
1098
+
1099
+ export type accountExtendTrialResponse404 = {
1100
+ data: void
1101
+ status: 404
1102
+ }
1103
+
1104
+ export type accountExtendTrialResponseSuccess = (accountExtendTrialResponse200) & {
1105
+ headers: Headers;
1106
+ };
1107
+ export type accountExtendTrialResponseError = (accountExtendTrialResponse400 | accountExtendTrialResponse401 | accountExtendTrialResponse404) & {
1108
+ headers: Headers;
1109
+ };
1110
+
1111
+ export type accountExtendTrialResponse = (accountExtendTrialResponseSuccess | accountExtendTrialResponseError)
1112
+
1113
+ export const getAccountExtendTrialUrl = (accountUid: string | null,) => {
1114
+
1115
+
1116
+
1117
+
1118
+ return `/api/v1/crm/accounts/${accountUid}/extend-trial`
1119
+ }
1120
+
1121
+ export const accountExtendTrial = async (accountUid: string | null,
1122
+ accountExtendTrialBody: AccountExtendTrialBody, options?: RequestInit): Promise<accountExtendTrialResponse> => {
1123
+
1124
+ return customFetch<accountExtendTrialResponse>(getAccountExtendTrialUrl(accountUid),
1125
+ {
1126
+ ...options,
1127
+ method: 'PUT',
1128
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1129
+ body: JSON.stringify(
1130
+ accountExtendTrialBody,)
1131
+ }
1132
+ );}
1133
+
1134
+
1135
+ /**
1136
+ * @summary Send a confirmation email to people on an account. Pass personUid as a query parameter
1137
+ to send to a specific person, or personUid=* to send to all people on the account.
1138
+ If no personUid is provided, the email is sent to the primary contact.
1139
+ */
1140
+ export type accountSendConfirmationEmailResponse200 = {
1141
+ data: Blob
1142
+ status: 200
1143
+ }
1144
+
1145
+ export type accountSendConfirmationEmailResponse400 = {
1146
+ data: void
1147
+ status: 400
1148
+ }
1149
+
1150
+ export type accountSendConfirmationEmailResponse401 = {
1151
+ data: void
1152
+ status: 401
1153
+ }
1154
+
1155
+ export type accountSendConfirmationEmailResponse404 = {
1156
+ data: void
1157
+ status: 404
1158
+ }
1159
+
1160
+ export type accountSendConfirmationEmailResponseSuccess = (accountSendConfirmationEmailResponse200) & {
1161
+ headers: Headers;
1162
+ };
1163
+ export type accountSendConfirmationEmailResponseError = (accountSendConfirmationEmailResponse400 | accountSendConfirmationEmailResponse401 | accountSendConfirmationEmailResponse404) & {
1164
+ headers: Headers;
1165
+ };
1166
+
1167
+ export type accountSendConfirmationEmailResponse = (accountSendConfirmationEmailResponseSuccess | accountSendConfirmationEmailResponseError)
1168
+
1169
+ export const getAccountSendConfirmationEmailUrl = (accountUid: string | null,) => {
1170
+
1171
+
1172
+
1173
+
1174
+ return `/api/v1/crm/accounts/${accountUid}/send-confirmation-email`
1175
+ }
1176
+
1177
+ export const accountSendConfirmationEmail = async (accountUid: string | null, options?: RequestInit): Promise<accountSendConfirmationEmailResponse> => {
1178
+
1179
+ return customFetch<accountSendConfirmationEmailResponse>(getAccountSendConfirmationEmailUrl(accountUid),
1180
+ {
1181
+ ...options,
1182
+ method: 'PUT'
1183
+
1184
+
1185
+ }
1186
+ );}
1187
+
1188
+
1189
+ /**
1190
+ * @summary Retrieves all the people associated with your account.
1191
+ */
1192
+ export type personGetAllPeopleResponse200 = {
1193
+ data: Person[]
1194
+ status: 200
1195
+ }
1196
+
1197
+ export type personGetAllPeopleResponse401 = {
1198
+ data: void
1199
+ status: 401
1200
+ }
1201
+
1202
+ export type personGetAllPeopleResponseSuccess = (personGetAllPeopleResponse200) & {
1203
+ headers: Headers;
1204
+ };
1205
+ export type personGetAllPeopleResponseError = (personGetAllPeopleResponse401) & {
1206
+ headers: Headers;
1207
+ };
1208
+
1209
+ export type personGetAllPeopleResponse = (personGetAllPeopleResponseSuccess | personGetAllPeopleResponseError)
1210
+
1211
+ export const getPersonGetAllPeopleUrl = (params?: PersonGetAllPeopleParams,) => {
1212
+ const normalizedParams = new URLSearchParams();
1213
+
1214
+ Object.entries(params || {}).forEach(([key, value]) => {
1215
+
1216
+ if (value !== undefined) {
1217
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1218
+ }
1219
+ });
1220
+
1221
+ const stringifiedParams = normalizedParams.toString();
1222
+
1223
+ return stringifiedParams.length > 0 ? `/api/v1/crm/people?${stringifiedParams}` : `/api/v1/crm/people`
1224
+ }
1225
+
1226
+ export const personGetAllPeople = async (params?: PersonGetAllPeopleParams, options?: RequestInit): Promise<personGetAllPeopleResponse> => {
1227
+
1228
+ return customFetch<personGetAllPeopleResponse>(getPersonGetAllPeopleUrl(params),
1229
+ {
1230
+ ...options,
1231
+ method: 'GET'
1232
+
1233
+
1234
+ }
1235
+ );}
1236
+
1237
+
1238
+ /**
1239
+ * @summary Add a new person.
1240
+ */
1241
+ export type personAddPersonResponse200 = {
1242
+ data: Person
1243
+ status: 200
1244
+ }
1245
+
1246
+ export type personAddPersonResponse401 = {
1247
+ data: void
1248
+ status: 401
1249
+ }
1250
+
1251
+ export type personAddPersonResponseSuccess = (personAddPersonResponse200) & {
1252
+ headers: Headers;
1253
+ };
1254
+ export type personAddPersonResponseError = (personAddPersonResponse401) & {
1255
+ headers: Headers;
1256
+ };
1257
+
1258
+ export type personAddPersonResponse = (personAddPersonResponseSuccess | personAddPersonResponseError)
1259
+
1260
+ export const getPersonAddPersonUrl = () => {
1261
+
1262
+
1263
+
1264
+
1265
+ return `/api/v1/crm/people`
1266
+ }
1267
+
1268
+ export const personAddPerson = async (personAddPersonBody: PersonAddPersonBody, options?: RequestInit): Promise<personAddPersonResponse> => {
1269
+
1270
+ return customFetch<personAddPersonResponse>(getPersonAddPersonUrl(),
1271
+ {
1272
+ ...options,
1273
+ method: 'POST',
1274
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1275
+ body: JSON.stringify(
1276
+ personAddPersonBody,)
1277
+ }
1278
+ );}
1279
+
1280
+
1281
+ /**
1282
+ * @summary Retrieves a person.
1283
+ */
1284
+ export type personGetPersonResponse200 = {
1285
+ data: Person
1286
+ status: 200
1287
+ }
1288
+
1289
+ export type personGetPersonResponse400 = {
1290
+ data: void
1291
+ status: 400
1292
+ }
1293
+
1294
+ export type personGetPersonResponse401 = {
1295
+ data: void
1296
+ status: 401
1297
+ }
1298
+
1299
+ export type personGetPersonResponse404 = {
1300
+ data: void
1301
+ status: 404
1302
+ }
1303
+
1304
+ export type personGetPersonResponseSuccess = (personGetPersonResponse200) & {
1305
+ headers: Headers;
1306
+ };
1307
+ export type personGetPersonResponseError = (personGetPersonResponse400 | personGetPersonResponse401 | personGetPersonResponse404) & {
1308
+ headers: Headers;
1309
+ };
1310
+
1311
+ export type personGetPersonResponse = (personGetPersonResponseSuccess | personGetPersonResponseError)
1312
+
1313
+ export const getPersonGetPersonUrl = (personUid: string | null,) => {
1314
+
1315
+
1316
+
1317
+
1318
+ return `/api/v1/crm/people/${personUid}`
1319
+ }
1320
+
1321
+ export const personGetPerson = async (personUid: string | null, options?: RequestInit): Promise<personGetPersonResponse> => {
1322
+
1323
+ return customFetch<personGetPersonResponse>(getPersonGetPersonUrl(personUid),
1324
+ {
1325
+ ...options,
1326
+ method: 'GET'
1327
+
1328
+
1329
+ }
1330
+ );}
1331
+
1332
+
1333
+ /**
1334
+ * @summary Update a person record. You can update one or multiple properties on the object.
1335
+ Any property that you include in the json schema will be updated.
1336
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
1337
+ */
1338
+ export type personUpdatePersonResponse200 = {
1339
+ data: Person
1340
+ status: 200
1341
+ }
1342
+
1343
+ export type personUpdatePersonResponse400 = {
1344
+ data: void
1345
+ status: 400
1346
+ }
1347
+
1348
+ export type personUpdatePersonResponse401 = {
1349
+ data: void
1350
+ status: 401
1351
+ }
1352
+
1353
+ export type personUpdatePersonResponse404 = {
1354
+ data: void
1355
+ status: 404
1356
+ }
1357
+
1358
+ export type personUpdatePersonResponseSuccess = (personUpdatePersonResponse200) & {
1359
+ headers: Headers;
1360
+ };
1361
+ export type personUpdatePersonResponseError = (personUpdatePersonResponse400 | personUpdatePersonResponse401 | personUpdatePersonResponse404) & {
1362
+ headers: Headers;
1363
+ };
1364
+
1365
+ export type personUpdatePersonResponse = (personUpdatePersonResponseSuccess | personUpdatePersonResponseError)
1366
+
1367
+ export const getPersonUpdatePersonUrl = (personUid: string | null,) => {
1368
+
1369
+
1370
+
1371
+
1372
+ return `/api/v1/crm/people/${personUid}`
1373
+ }
1374
+
1375
+ export const personUpdatePerson = async (personUid: string | null,
1376
+ personUpdatePersonBody: PersonUpdatePersonBody, options?: RequestInit): Promise<personUpdatePersonResponse> => {
1377
+
1378
+ return customFetch<personUpdatePersonResponse>(getPersonUpdatePersonUrl(personUid),
1379
+ {
1380
+ ...options,
1381
+ method: 'PUT',
1382
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1383
+ body: JSON.stringify(
1384
+ personUpdatePersonBody,)
1385
+ }
1386
+ );}
1387
+
1388
+
1389
+ /**
1390
+ * @summary Delete a person record.
1391
+ */
1392
+ export type personDeletePersonResponse200 = {
1393
+ data: Blob
1394
+ status: 200
1395
+ }
1396
+
1397
+ export type personDeletePersonResponse400 = {
1398
+ data: void
1399
+ status: 400
1400
+ }
1401
+
1402
+ export type personDeletePersonResponse401 = {
1403
+ data: void
1404
+ status: 401
1405
+ }
1406
+
1407
+ export type personDeletePersonResponse404 = {
1408
+ data: void
1409
+ status: 404
1410
+ }
1411
+
1412
+ export type personDeletePersonResponseSuccess = (personDeletePersonResponse200) & {
1413
+ headers: Headers;
1414
+ };
1415
+ export type personDeletePersonResponseError = (personDeletePersonResponse400 | personDeletePersonResponse401 | personDeletePersonResponse404) & {
1416
+ headers: Headers;
1417
+ };
1418
+
1419
+ export type personDeletePersonResponse = (personDeletePersonResponseSuccess | personDeletePersonResponseError)
1420
+
1421
+ export const getPersonDeletePersonUrl = (personUid: string | null,) => {
1422
+
1423
+
1424
+
1425
+
1426
+ return `/api/v1/crm/people/${personUid}`
1427
+ }
1428
+
1429
+ export const personDeletePerson = async (personUid: string | null, options?: RequestInit): Promise<personDeletePersonResponse> => {
1430
+
1431
+ return customFetch<personDeletePersonResponse>(getPersonDeletePersonUrl(personUid),
1432
+ {
1433
+ ...options,
1434
+ method: 'DELETE'
1435
+
1436
+
1437
+ }
1438
+ );}
1439
+
1440
+
1441
+ /**
1442
+ * @summary Set a temporary password for a user. The user needs to update the password with the next login.
1443
+ */
1444
+ export type personSetTemporaryPasswordResponse200 = {
1445
+ data: Blob
1446
+ status: 200
1447
+ }
1448
+
1449
+ export type personSetTemporaryPasswordResponse400 = {
1450
+ data: void
1451
+ status: 400
1452
+ }
1453
+
1454
+ export type personSetTemporaryPasswordResponse401 = {
1455
+ data: void
1456
+ status: 401
1457
+ }
1458
+
1459
+ export type personSetTemporaryPasswordResponse404 = {
1460
+ data: void
1461
+ status: 404
1462
+ }
1463
+
1464
+ export type personSetTemporaryPasswordResponseSuccess = (personSetTemporaryPasswordResponse200) & {
1465
+ headers: Headers;
1466
+ };
1467
+ export type personSetTemporaryPasswordResponseError = (personSetTemporaryPasswordResponse400 | personSetTemporaryPasswordResponse401 | personSetTemporaryPasswordResponse404) & {
1468
+ headers: Headers;
1469
+ };
1470
+
1471
+ export type personSetTemporaryPasswordResponse = (personSetTemporaryPasswordResponseSuccess | personSetTemporaryPasswordResponseError)
1472
+
1473
+ export const getPersonSetTemporaryPasswordUrl = (personUid: string | null,) => {
1474
+
1475
+
1476
+
1477
+
1478
+ return `/api/v1/crm/people/${personUid}/setTemporaryPassword`
1479
+ }
1480
+
1481
+ export const personSetTemporaryPassword = async (personUid: string | null,
1482
+ personSetTemporaryPasswordBody: PersonSetTemporaryPasswordBody, options?: RequestInit): Promise<personSetTemporaryPasswordResponse> => {
1483
+
1484
+ return customFetch<personSetTemporaryPasswordResponse>(getPersonSetTemporaryPasswordUrl(personUid),
1485
+ {
1486
+ ...options,
1487
+ method: 'PUT',
1488
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1489
+ body: JSON.stringify(
1490
+ personSetTemporaryPasswordBody,)
1491
+ }
1492
+ );}
1493
+
1494
+
1495
+ /**
1496
+ * @summary Initiate the forgot password flow by sending an email to the user with a link to a page
1497
+ where they can reset their password. The reset password token in the link is valid for 30 minutes.
1498
+ */
1499
+ export type personForgotPasswordResponse200 = {
1500
+ data: Blob
1501
+ status: 200
1502
+ }
1503
+
1504
+ export type personForgotPasswordResponseSuccess = (personForgotPasswordResponse200) & {
1505
+ headers: Headers;
1506
+ };
1507
+ ;
1508
+
1509
+ export type personForgotPasswordResponse = (personForgotPasswordResponseSuccess)
1510
+
1511
+ export const getPersonForgotPasswordUrl = () => {
1512
+
1513
+
1514
+
1515
+
1516
+ return `/api/v1/crm/people/forgotPassword`
1517
+ }
1518
+
1519
+ export const personForgotPassword = async (personForgotPasswordBody: PersonForgotPasswordBody, options?: RequestInit): Promise<personForgotPasswordResponse> => {
1520
+
1521
+ return customFetch<personForgotPasswordResponse>(getPersonForgotPasswordUrl(),
1522
+ {
1523
+ ...options,
1524
+ method: 'POST',
1525
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1526
+ body: JSON.stringify(
1527
+ personForgotPasswordBody,)
1528
+ }
1529
+ );}
1530
+
1531
+