File size: 1,336 Bytes
048b1e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import "../shared/index.tsp";

namespace Apps;

/**
 * Supported capability types for an App.
 *
 * Each capability defines an integration function that an App can perform.
 */
@friendlyName("BillingAppCapabilityType")
enum AppCapabilityType {
  /**
   * The app can report aggregated usage.
   */
  ReportUsage: "report_usage",

  /**
   * The app can report raw events.
   */
  ReportEvents: "report_events",

  /**
   * The app can calculate tax for invoices.
   */
  CalculateTax: "calculate_tax",

  /**
   * The app can issue invoices to customers.
   */
  InvoiceCustomers: "invoice_customers",

  /**
   * The app can collect payments from customers.
   */
  CollectPayments: "collect_payments",
}

/**
 * App capability describes a function that an App can perform.
 */
@friendlyName("BillingAppCapability")
@example(#{
  type: AppCapabilityType.CollectPayments,
  key: "stripe_collect_payment",
  name: "Collect Payments",
  description: "Stripe payments collects outstanding revenue with Stripe customer's default payment method.",
})
model AppCapability {
  /**
   * Type of the capability.
   */
  type: AppCapabilityType;

  /**
   * Key of the capability.
   */
  key: Shared.ResourceKey;

  /**
   * Name of the capability.
   */
  name: string;

  /**
   * Description of the capability.
   */
  description: string;
}