@outseta/api-client 0.4.13 → 0.4.15

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.
package/dist/index.js CHANGED
@@ -196,6 +196,15 @@ var transactionsAddPaymentTransaction = async (transactionsAddPaymentTransaction
196
196
  body: JSON.stringify(transactionsAddPaymentTransactionBody)
197
197
  });
198
198
  };
199
+ var getPaymentProcessOutstandingInvoiceUrl = (invoiceUid) => {
200
+ return `/api/v1/billing/payments/${invoiceUid}/processpayment`;
201
+ };
202
+ var paymentProcessOutstandingInvoice = async (invoiceUid, options) => {
203
+ return customFetch(getPaymentProcessOutstandingInvoiceUrl(invoiceUid), {
204
+ ...options,
205
+ method: "POST"
206
+ });
207
+ };
199
208
  var getPaymentInformationSavePaymentInformationUrl = () => {
200
209
  return `/api/v1/billing/paymentinformation`;
201
210
  };
@@ -2485,7 +2494,8 @@ var EntityType = {
2485
2494
  Task: 10,
2486
2495
  Segment: 11,
2487
2496
  Broadcast: 12,
2488
- Article: 13
2497
+ Article: 13,
2498
+ Template: 14
2489
2499
  };
2490
2500
  // src/generated/models/leadFormSubmissionFieldOutcome.ts
2491
2501
  var LeadFormSubmissionFieldOutcome = {
@@ -2955,6 +2965,7 @@ export {
2955
2965
  getInvoiceSendInvoicePaidEmailUrl,
2956
2966
  getInvoiceUpdateInvoiceUrl,
2957
2967
  getPaymentInformationSavePaymentInformationUrl,
2968
+ getPaymentProcessOutstandingInvoiceUrl,
2958
2969
  getPersonAddPersonUrl,
2959
2970
  getPersonDeletePersonUrl,
2960
2971
  getPersonForgotPasswordUrl,
@@ -3058,6 +3069,7 @@ export {
3058
3069
  invoiceSendInvoicePaidEmail,
3059
3070
  invoiceUpdateInvoice,
3060
3071
  paymentInformationSavePaymentInformation,
3072
+ paymentProcessOutstandingInvoice,
3061
3073
  personAddPerson,
3062
3074
  personDeletePerson,
3063
3075
  personForgotPassword,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -46,12 +46,13 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
46
46
  * Each tag applies to a single entity type. Pass entityType to retrieve the tags for one
47
47
  of them, for example entityType=Article for knowledge base article tags.
48
48
 
49
- How a tag goes onto a record depends on the entity type. Articles, broadcasts and
50
- segments each take tags on a tags sub-resource of the record:
49
+ How a tag goes onto a record depends on the entity type. Articles, broadcasts,
50
+ segments, and email templates each take tags on a tags sub-resource of the record:
51
51
 
52
52
  - POST /support/articles/{entityUid}/tags and PUT, GET, DELETE on the same path
53
53
  - POST /email/campaigns/broadcasts/{entityUid}/tags and the same for the rest
54
54
  - POST /crm/segments/{entityUid}/tags and the same for the rest
55
+ - POST /templates/{entityUid}/tags and the same for the rest
55
56
 
56
57
  A support ticket is the exception. It holds its tags in its own CaseTags collection, so
57
58
  you add and remove ticket tags with PUT /support/cases/{caseUid}.
@@ -109,7 +110,8 @@ export const tagGetAllTags = async (params?: TagGetAllTagsParams, options?: Requ
109
110
  /**
110
111
  * Name and EntityType are required. EntityType fixes what the tag can go on: 4 (Case) for
111
112
  support tickets, 13 (Article) for knowledge base articles, 12 (Broadcast) for broadcast
112
- emails, 11 (Segment) for segments. TagColor sets the color the tag shows in.
113
+ emails, 11 (Segment) for segments, 14 (Template) for email templates. TagColor sets
114
+ the color the tag shows in.
113
115
 
114
116
  Name must be unique within an entity type. If the name already exists for that
115
117
  entity type, the existing tag is returned instead of a duplicate, and its color is
@@ -607,6 +607,73 @@ export const transactionsAddPaymentTransaction = async (transactionsAddPaymentTr
607
607
  );}
608
608
 
609
609
 
610
+ /**
611
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3) the request is rejected.
612
+
613
+ Charges the outstanding amount of the invoice to the payment method on file for the
614
+ account. Without this call, the scheduled payment job charges an unpaid invoice no
615
+ sooner than 6 hours after its invoice date.
616
+
617
+ When the payment succeeds, the invoice status changes to Paid. For a payment method
618
+ that settles later, such as a bank debit, the status changes to Processing.
619
+
620
+ The request is rejected when the invoice is not unpaid, has no outstanding amount,
621
+ is already being processed, or the account has no payment method or is Expired.
622
+
623
+ When the payment is declined, the request returns a validation error. The decline
624
+ counts as a failed payment attempt for the account, the same as a failed renewal.
625
+ After the third failed attempt, the account moves to Past Due.
626
+ * @summary Charge an unpaid invoice now.
627
+ */
628
+ export type paymentProcessOutstandingInvoiceResponse200 = {
629
+ data: Blob
630
+ status: 200
631
+ }
632
+
633
+ export type paymentProcessOutstandingInvoiceResponse400 = {
634
+ data: void
635
+ status: 400
636
+ }
637
+
638
+ export type paymentProcessOutstandingInvoiceResponse401 = {
639
+ data: void
640
+ status: 401
641
+ }
642
+
643
+ export type paymentProcessOutstandingInvoiceResponse404 = {
644
+ data: void
645
+ status: 404
646
+ }
647
+
648
+ export type paymentProcessOutstandingInvoiceResponseSuccess = (paymentProcessOutstandingInvoiceResponse200) & {
649
+ headers: Headers;
650
+ };
651
+ export type paymentProcessOutstandingInvoiceResponseError = (paymentProcessOutstandingInvoiceResponse400 | paymentProcessOutstandingInvoiceResponse401 | paymentProcessOutstandingInvoiceResponse404) & {
652
+ headers: Headers;
653
+ };
654
+
655
+ export type paymentProcessOutstandingInvoiceResponse = (paymentProcessOutstandingInvoiceResponseSuccess | paymentProcessOutstandingInvoiceResponseError)
656
+
657
+ export const getPaymentProcessOutstandingInvoiceUrl = (invoiceUid: string | null,) => {
658
+
659
+
660
+
661
+
662
+ return `/api/v1/billing/payments/${invoiceUid}/processpayment`
663
+ }
664
+
665
+ export const paymentProcessOutstandingInvoice = async (invoiceUid: string | null, options?: RequestInit): Promise<paymentProcessOutstandingInvoiceResponse> => {
666
+
667
+ return customFetch<paymentProcessOutstandingInvoiceResponse>(getPaymentProcessOutstandingInvoiceUrl(invoiceUid),
668
+ {
669
+ ...options,
670
+ method: 'POST'
671
+
672
+
673
+ }
674
+ );}
675
+
676
+
610
677
  /**
611
678
  * @summary Update payment information for an account.
612
679
  */
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
 
3
3
  /**
4
- * `0` - None, `1` - Account, `2` - Person, `3` - Deal, `4` - Case, `5` - Invoice, `6` - EmailLog, `7` - Plan, `8` - DiscountCoupon, `9` - AddOn, `10` - Task, `11` - Segment, `12` - Broadcast, `13` - Article
4
+ * `0` - None, `1` - Account, `2` - Person, `3` - Deal, `4` - Case, `5` - Invoice, `6` - EmailLog, `7` - Plan, `8` - DiscountCoupon, `9` - AddOn, `10` - Task, `11` - Segment, `12` - Broadcast, `13` - Article, `14` - Template
5
5
  */
6
6
  export type EntityType = typeof EntityType[keyof typeof EntityType];
7
7
 
@@ -22,4 +22,5 @@ export const EntityType = {
22
22
  Segment: 11,
23
23
  Broadcast: 12,
24
24
  Article: 13,
25
+ Template: 14,
25
26
  } as const;
@@ -818,6 +818,7 @@ export * from './taxRateAllOf';
818
818
  export * from './teamRole';
819
819
  export * from './teamTwoFactorSettings';
820
820
  export * from './template';
821
+ export * from './templateAddTagToEntityBody';
821
822
  export * from './templateAllOf';
822
823
  export * from './templateEmailInstance';
823
824
  export * from './templateEmailInstanceAllOf';
@@ -827,11 +828,14 @@ export * from './templateGetAllTemplateEmails200';
827
828
  export * from './templateGetAllTemplateEmailsParams';
828
829
  export * from './templateGetAllTemplates200';
829
830
  export * from './templateGetAllTemplatesParams';
831
+ export * from './templateGetTagsForEntity200';
832
+ export * from './templateGetTagsForEntityParams';
830
833
  export * from './templateGetTemplateEmails200';
831
834
  export * from './templateGetTemplateEmailsParams';
832
835
  export * from './templateGetTransactionalEmailSettings200';
833
836
  export * from './templateGetTransactionalEmailSettingsParams';
834
837
  export * from './templateSendTemplateEmailBody';
838
+ export * from './templateSetTagsForEntityBody';
835
839
  export * from './templateUpdateTransactionalEmailSettings200';
836
840
  export * from './templateUpdateTransactionalEmailSettingsBody';
837
841
  export * from './temporaryPasswordModel';
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { TagUidList } from './tagUidList';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateAddTagToEntityBody = TagUidList | null;
@@ -1,4 +1,5 @@
1
1
  // @ts-nocheck
2
+ import type { Tag } from './tag';
2
3
 
3
4
  export type TemplateAllOf = {
4
5
  /**
@@ -32,4 +33,6 @@ export type TemplateAllOf = {
32
33
  RequiredTokens?: string | null;
33
34
  /** @nullable */
34
35
  Tag?: string | null;
36
+ /** @nullable */
37
+ Tags?: Tag[] | null;
35
38
  };
@@ -3,6 +3,14 @@ import type { LimitParameter } from './limitParameter';
3
3
  import type { OffsetParameter } from './offsetParameter';
4
4
 
5
5
  export type TemplateGetAllTemplatesParams = {
6
+ /**
7
+ * Keep only the records that carry one of these tags. Separate several tag uids with commas. The value none keeps the records that carry no tag at all.
8
+ */
9
+ tagUid?: string;
10
+ /**
11
+ * Keep only the records that carry none of these tags. Separate several tag uids with commas. Combined with tagUid, the two widen the result instead of narrowing it: a record is kept when it matches either one.
12
+ */
13
+ withoutTagUid?: string;
6
14
  /**
7
15
  * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
16
  */
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { Tag } from './tag';
4
+
5
+ export type TemplateGetTagsForEntity200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: Tag[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type TemplateGetTagsForEntityParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { TagUidList } from './tagUidList';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateSetTagsForEntityBody = TagUidList | null;
@@ -1,16 +1,20 @@
1
1
  // @ts-nocheck
2
2
  import type {
3
3
  Template,
4
+ TemplateAddTagToEntityBody,
4
5
  TemplateEmailInstance,
5
6
  TemplateGetAllTemplateEmails200,
6
7
  TemplateGetAllTemplateEmailsParams,
7
8
  TemplateGetAllTemplates200,
8
9
  TemplateGetAllTemplatesParams,
10
+ TemplateGetTagsForEntity200,
11
+ TemplateGetTagsForEntityParams,
9
12
  TemplateGetTemplateEmails200,
10
13
  TemplateGetTemplateEmailsParams,
11
14
  TemplateGetTransactionalEmailSettings200,
12
15
  TemplateGetTransactionalEmailSettingsParams,
13
16
  TemplateSendTemplateEmailBody,
17
+ TemplateSetTagsForEntityBody,
14
18
  TemplateUpdateTransactionalEmailSettings200,
15
19
  TemplateUpdateTransactionalEmailSettingsBody,
16
20
  UpdateTemplateRequest
@@ -495,3 +499,239 @@ export const templateSendTemplateEmail = async (templateUid: string | null,
495
499
  );}
496
500
 
497
501
 
502
+ /**
503
+ * Send the uids of the tags to add. Tags that the record already carries stay on it, and
504
+ naming one of them again changes nothing, so the same request is safe to repeat. To
505
+ replace the whole set instead, use PUT on this same path.
506
+
507
+ A tag belongs to one entity type, so use tags whose EntityType matches this record.
508
+ List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
509
+ * @summary Add tags to a record.
510
+ */
511
+ export type templateAddTagToEntityResponse200 = {
512
+ data: Blob
513
+ status: 200
514
+ }
515
+
516
+ export type templateAddTagToEntityResponse400 = {
517
+ data: void
518
+ status: 400
519
+ }
520
+
521
+ export type templateAddTagToEntityResponse401 = {
522
+ data: void
523
+ status: 401
524
+ }
525
+
526
+ export type templateAddTagToEntityResponse404 = {
527
+ data: void
528
+ status: 404
529
+ }
530
+
531
+ export type templateAddTagToEntityResponseSuccess = (templateAddTagToEntityResponse200) & {
532
+ headers: Headers;
533
+ };
534
+ export type templateAddTagToEntityResponseError = (templateAddTagToEntityResponse400 | templateAddTagToEntityResponse401 | templateAddTagToEntityResponse404) & {
535
+ headers: Headers;
536
+ };
537
+
538
+ export type templateAddTagToEntityResponse = (templateAddTagToEntityResponseSuccess | templateAddTagToEntityResponseError)
539
+
540
+ export const getTemplateAddTagToEntityUrl = (entityUid: string | null,) => {
541
+
542
+
543
+
544
+
545
+ return `/api/v1/templates/${entityUid}/tags`
546
+ }
547
+
548
+ export const templateAddTagToEntity = async (entityUid: string | null,
549
+ templateAddTagToEntityBody: TemplateAddTagToEntityBody, options?: RequestInit): Promise<templateAddTagToEntityResponse> => {
550
+
551
+ return customFetch<templateAddTagToEntityResponse>(getTemplateAddTagToEntityUrl(entityUid),
552
+ {
553
+ ...options,
554
+ method: 'POST',
555
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
556
+ body: JSON.stringify(
557
+ templateAddTagToEntityBody,)
558
+ }
559
+ );}
560
+
561
+
562
+ /**
563
+ * Returns the tags themselves, not the links that hold them. The same tags are also
564
+ available on the record: ask for them with the fields parameter, for example
565
+ fields=Uid,Tags.Uid,Tags.Name,Tags.TagColor. Tags cost an extra query, so the record
566
+ leaves them out unless fields names Tags or is a plain wildcard.
567
+ * @summary Retrieve the tags on a record.
568
+ */
569
+ export type templateGetTagsForEntityResponse200 = {
570
+ data: TemplateGetTagsForEntity200
571
+ status: 200
572
+ }
573
+
574
+ export type templateGetTagsForEntityResponse400 = {
575
+ data: void
576
+ status: 400
577
+ }
578
+
579
+ export type templateGetTagsForEntityResponse401 = {
580
+ data: void
581
+ status: 401
582
+ }
583
+
584
+ export type templateGetTagsForEntityResponseSuccess = (templateGetTagsForEntityResponse200) & {
585
+ headers: Headers;
586
+ };
587
+ export type templateGetTagsForEntityResponseError = (templateGetTagsForEntityResponse400 | templateGetTagsForEntityResponse401) & {
588
+ headers: Headers;
589
+ };
590
+
591
+ export type templateGetTagsForEntityResponse = (templateGetTagsForEntityResponseSuccess | templateGetTagsForEntityResponseError)
592
+
593
+ export const getTemplateGetTagsForEntityUrl = (entityUid: string | null,
594
+ params?: TemplateGetTagsForEntityParams,) => {
595
+ const normalizedParams = new URLSearchParams();
596
+
597
+ Object.entries(params || {}).forEach(([key, value]) => {
598
+
599
+ if (value !== undefined) {
600
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
601
+ }
602
+ });
603
+
604
+ const stringifiedParams = normalizedParams.toString();
605
+
606
+ return stringifiedParams.length > 0 ? `/api/v1/templates/${entityUid}/tags?${stringifiedParams}` : `/api/v1/templates/${entityUid}/tags`
607
+ }
608
+
609
+ export const templateGetTagsForEntity = async (entityUid: string | null,
610
+ params?: TemplateGetTagsForEntityParams, options?: RequestInit): Promise<templateGetTagsForEntityResponse> => {
611
+
612
+ return customFetch<templateGetTagsForEntityResponse>(getTemplateGetTagsForEntityUrl(entityUid,params),
613
+ {
614
+ ...options,
615
+ method: 'GET'
616
+
617
+
618
+ }
619
+ );}
620
+
621
+
622
+ /**
623
+ * Send the full set of tags the record must end with. A tag that the list leaves out is
624
+ taken off the record, and one that the list names is added. Send an empty list to take
625
+ every tag off. To add tags without disturbing the others, use POST on this same path.
626
+
627
+ A tag belongs to one entity type, so use tags whose EntityType matches this record.
628
+ List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
629
+ * @summary Replace the tags on a record.
630
+ */
631
+ export type templateSetTagsForEntityResponse200 = {
632
+ data: Blob
633
+ status: 200
634
+ }
635
+
636
+ export type templateSetTagsForEntityResponse400 = {
637
+ data: void
638
+ status: 400
639
+ }
640
+
641
+ export type templateSetTagsForEntityResponse401 = {
642
+ data: void
643
+ status: 401
644
+ }
645
+
646
+ export type templateSetTagsForEntityResponse404 = {
647
+ data: void
648
+ status: 404
649
+ }
650
+
651
+ export type templateSetTagsForEntityResponseSuccess = (templateSetTagsForEntityResponse200) & {
652
+ headers: Headers;
653
+ };
654
+ export type templateSetTagsForEntityResponseError = (templateSetTagsForEntityResponse400 | templateSetTagsForEntityResponse401 | templateSetTagsForEntityResponse404) & {
655
+ headers: Headers;
656
+ };
657
+
658
+ export type templateSetTagsForEntityResponse = (templateSetTagsForEntityResponseSuccess | templateSetTagsForEntityResponseError)
659
+
660
+ export const getTemplateSetTagsForEntityUrl = (entityUid: string | null,) => {
661
+
662
+
663
+
664
+
665
+ return `/api/v1/templates/${entityUid}/tags`
666
+ }
667
+
668
+ export const templateSetTagsForEntity = async (entityUid: string | null,
669
+ templateSetTagsForEntityBody: TemplateSetTagsForEntityBody, options?: RequestInit): Promise<templateSetTagsForEntityResponse> => {
670
+
671
+ return customFetch<templateSetTagsForEntityResponse>(getTemplateSetTagsForEntityUrl(entityUid),
672
+ {
673
+ ...options,
674
+ method: 'PUT',
675
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
676
+ body: JSON.stringify(
677
+ templateSetTagsForEntityBody,)
678
+ }
679
+ );}
680
+
681
+
682
+ /**
683
+ * The tag itself is kept and stays available for other records. If the record does not
684
+ carry the tag, nothing changes and the call still succeeds.
685
+ * @summary Remove one tag from a record.
686
+ */
687
+ export type templateRemoveTagFromEntityResponse200 = {
688
+ data: Blob
689
+ status: 200
690
+ }
691
+
692
+ export type templateRemoveTagFromEntityResponse400 = {
693
+ data: void
694
+ status: 400
695
+ }
696
+
697
+ export type templateRemoveTagFromEntityResponse401 = {
698
+ data: void
699
+ status: 401
700
+ }
701
+
702
+ export type templateRemoveTagFromEntityResponse404 = {
703
+ data: void
704
+ status: 404
705
+ }
706
+
707
+ export type templateRemoveTagFromEntityResponseSuccess = (templateRemoveTagFromEntityResponse200) & {
708
+ headers: Headers;
709
+ };
710
+ export type templateRemoveTagFromEntityResponseError = (templateRemoveTagFromEntityResponse400 | templateRemoveTagFromEntityResponse401 | templateRemoveTagFromEntityResponse404) & {
711
+ headers: Headers;
712
+ };
713
+
714
+ export type templateRemoveTagFromEntityResponse = (templateRemoveTagFromEntityResponseSuccess | templateRemoveTagFromEntityResponseError)
715
+
716
+ export const getTemplateRemoveTagFromEntityUrl = (entityUid: string | null,
717
+ tagUid: string | null,) => {
718
+
719
+
720
+
721
+
722
+ return `/api/v1/templates/${entityUid}/tags/${tagUid}`
723
+ }
724
+
725
+ export const templateRemoveTagFromEntity = async (entityUid: string | null,
726
+ tagUid: string | null, options?: RequestInit): Promise<templateRemoveTagFromEntityResponse> => {
727
+
728
+ return customFetch<templateRemoveTagFromEntityResponse>(getTemplateRemoveTagFromEntityUrl(entityUid,tagUid),
729
+ {
730
+ ...options,
731
+ method: 'DELETE'
732
+
733
+
734
+ }
735
+ );}
736
+
737
+