zuplo 6.69.8 → 6.69.10
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/docs/articles/monetization/meters.mdx +14 -7
- package/docs/articles/monetization/plans.mdx +1 -2
- package/docs/articles/monetization/rate-cards.mdx +36 -3
- package/docs/cli/bucket-list.mdx +71 -0
- package/docs/cli/logout.mdx +25 -0
- package/docs/policies/api-key-inbound/schema.json +5 -0
- package/package.json +4 -4
|
@@ -43,8 +43,10 @@ Track the total number of API requests:
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Each event
|
|
47
|
-
|
|
46
|
+
Each event identifies the subscription being metered, the actor that drove the
|
|
47
|
+
consumption, and how much to record. The `subscription` field carries the
|
|
48
|
+
subscription ID, the `subject` field identifies the actor, and `data.total`
|
|
49
|
+
carries the quantity:
|
|
48
50
|
|
|
49
51
|
```json
|
|
50
52
|
{
|
|
@@ -52,7 +54,7 @@ Each event contains the `subscription` ID linking it to a subscription and a
|
|
|
52
54
|
"specversion": "1.0",
|
|
53
55
|
"type": "api_requests",
|
|
54
56
|
"source": "monetization-policy",
|
|
55
|
-
"subject": "
|
|
57
|
+
"subject": "acme-prod",
|
|
56
58
|
"subscription": "01KNVXHQG356VA7T7W0V9N21GH",
|
|
57
59
|
"data": {
|
|
58
60
|
"total": 1
|
|
@@ -62,8 +64,13 @@ Each event contains the `subscription` ID linking it to a subscription and a
|
|
|
62
64
|
|
|
63
65
|
:::note
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
`subject` identifies _who_ consumed the subscription's entitlements on this
|
|
68
|
+
request — typically the API key's consumer name, the end-user id, or another
|
|
69
|
+
stable per-actor identifier. It is **not** the subscription id (use the
|
|
70
|
+
`subscription` field for that) and is not used to route billing. Its purpose is
|
|
71
|
+
to let you break down usage within a subscription so you can see which key,
|
|
72
|
+
user, or agent drove the consumption — a single subscription will commonly emit
|
|
73
|
+
events with many different `subject` values. See
|
|
67
74
|
[Monetization Policy](./monetization-policy.md) for how usage is recorded.
|
|
68
75
|
|
|
69
76
|
:::
|
|
@@ -96,7 +103,7 @@ consumed 50 tokens looks like this:
|
|
|
96
103
|
"specversion": "1.0",
|
|
97
104
|
"type": "tokens",
|
|
98
105
|
"source": "monetization-policy",
|
|
99
|
-
"subject": "
|
|
106
|
+
"subject": "acme-prod",
|
|
100
107
|
"subscription": "01KNVXHQG356VA7T7W0V9N21GH",
|
|
101
108
|
"data": {
|
|
102
109
|
"total": 50
|
|
@@ -126,7 +133,7 @@ Each event reports the number of bytes transferred:
|
|
|
126
133
|
"specversion": "1.0",
|
|
127
134
|
"type": "data_transfer",
|
|
128
135
|
"source": "monetization-policy",
|
|
129
|
-
"subject": "
|
|
136
|
+
"subject": "acme-prod",
|
|
130
137
|
"subscription": "01KNVXHQG356VA7T7W0V9N21GH",
|
|
131
138
|
"data": {
|
|
132
139
|
"total": 4096
|
|
@@ -204,8 +204,7 @@ After the trial ends, customers automatically move to the default phase. The $99
|
|
|
204
204
|
monthly subscription fee is charged in advance at the start of each billing
|
|
205
205
|
period via the `monthly_fee` flat-fee rate card. The plan includes 10,000 API
|
|
206
206
|
requests per period; additional requests are billed at $0.01 each in arrears
|
|
207
|
-
(
|
|
208
|
-
next invoice).
|
|
207
|
+
(soft limit allows overage).
|
|
209
208
|
|
|
210
209
|
## Plan Properties
|
|
211
210
|
|
|
@@ -26,7 +26,9 @@ A rate card consists of:
|
|
|
26
26
|
- **Feature** - Optional link to a feature from your product catalog
|
|
27
27
|
- **Price** - How much to charge (see [Pricing Models](./pricing-models.mdx))
|
|
28
28
|
- **Entitlement** - Optional usage limits or access controls
|
|
29
|
-
- **Billing Cadence** - How often
|
|
29
|
+
- **Billing Cadence** - How often this rate card produces a charge — distinct
|
|
30
|
+
from the plan's billing cadence, and constrained to align with it (see
|
|
31
|
+
[Billing Cadence](#billing-cadence) below)
|
|
30
32
|
|
|
31
33
|
## Rate Card Types
|
|
32
34
|
|
|
@@ -53,8 +55,9 @@ recurring fee. Use these for:
|
|
|
53
55
|
}
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
When `billingCadence` is set (e.g., `P1M`
|
|
57
|
-
|
|
58
|
+
When `billingCadence` is set (e.g., `P1M`), the flat fee recurs at that cadence
|
|
59
|
+
— see [Billing Cadence](#billing-cadence) for the constraint relative to the
|
|
60
|
+
plan's cadence. When `billingCadence` is `null`, the fee is charged once per
|
|
58
61
|
subscription phase.
|
|
59
62
|
|
|
60
63
|
The `paymentTerm` field controls when the charge is collected:
|
|
@@ -90,6 +93,36 @@ Usage-based rate cards support multiple pricing models. See
|
|
|
90
93
|
[Pricing Models](./pricing-models.mdx) for details on unit, tiered, package, and
|
|
91
94
|
dynamic pricing.
|
|
92
95
|
|
|
96
|
+
## Billing Cadence
|
|
97
|
+
|
|
98
|
+
A rate card's `billingCadence` controls how often this specific rate card
|
|
99
|
+
produces a charge. It's distinct from the **plan's** `billingCadence`, which
|
|
100
|
+
sets the overall invoice schedule for the subscription:
|
|
101
|
+
|
|
102
|
+
- For **flat-fee** rate cards, the cadence determines how often the flat fee
|
|
103
|
+
recurs. Set it to `null` to charge once per subscription phase (a setup fee,
|
|
104
|
+
onboarding charge, or other one-time payment).
|
|
105
|
+
- For **usage-based** rate cards, the cadence is required and determines the
|
|
106
|
+
period over which metered usage is aggregated and emitted as an invoice line.
|
|
107
|
+
|
|
108
|
+
### Alignment with the plan
|
|
109
|
+
|
|
110
|
+
The rate card's cadence must align with the plan's `billingCadence`. Two
|
|
111
|
+
cadences align when:
|
|
112
|
+
|
|
113
|
+
- They are identical (e.g., plan `P1M` and rate card `P1M`), or
|
|
114
|
+
- The shorter one divides the longer one without remainder (e.g., plan `P1M`
|
|
115
|
+
with a rate card at `P3M`, or plan `P1Y` with a rate card at `P1M`).
|
|
116
|
+
|
|
117
|
+
Plans accept these `billingCadence` values: `PT1H`, `P1D`, `P1W`, `P2W`, `P4W`,
|
|
118
|
+
`P1M`, `P3M`, `P6M`, `P12M`, `P1Y`. A rate card with a cadence that doesn't
|
|
119
|
+
align (for example, `P2M` on a `P3M` plan, where neither divides the other) is
|
|
120
|
+
rejected at plan creation.
|
|
121
|
+
|
|
122
|
+
This rule exists for invoice-generation correctness: it guarantees that every
|
|
123
|
+
rate-card cycle ends on a plan-invoice boundary, so a single charge from this
|
|
124
|
+
rate card lands on exactly one customer invoice rather than straddling two.
|
|
125
|
+
|
|
93
126
|
## Rate Cards With Features
|
|
94
127
|
|
|
95
128
|
When a rate card is linked to a feature via `featureKey`:
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Zuplo CLI: Bucket List"
|
|
3
|
+
sidebar_label: bucket list
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<CliCommand
|
|
7
|
+
command="bucket list"
|
|
8
|
+
description="Lists the buckets in your account"
|
|
9
|
+
options={[
|
|
10
|
+
{
|
|
11
|
+
"name": "account",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The account name",
|
|
14
|
+
"required": false,
|
|
15
|
+
"deprecated": false,
|
|
16
|
+
"hidden": false
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "project",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Filter buckets by project name",
|
|
22
|
+
"required": false,
|
|
23
|
+
"deprecated": false,
|
|
24
|
+
"hidden": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "output",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Output format",
|
|
30
|
+
"default": "default",
|
|
31
|
+
"required": false,
|
|
32
|
+
"deprecated": false,
|
|
33
|
+
"hidden": false,
|
|
34
|
+
"alias": [
|
|
35
|
+
"o"
|
|
36
|
+
],
|
|
37
|
+
"choices": [
|
|
38
|
+
"default",
|
|
39
|
+
"json"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]}
|
|
43
|
+
examples={[
|
|
44
|
+
[
|
|
45
|
+
"$0 bucket list",
|
|
46
|
+
"List all buckets in your account"
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"$0 bucket list --output json",
|
|
50
|
+
"List all buckets as JSON"
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"$0 bucket list --account my-account",
|
|
54
|
+
"Explicitly specify the account"
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"$0 bucket list --project my-project",
|
|
58
|
+
"Filter buckets by project name"
|
|
59
|
+
]
|
|
60
|
+
]}
|
|
61
|
+
usage="$0 bucket list [options]"
|
|
62
|
+
>
|
|
63
|
+
|
|
64
|
+
</CliCommand>
|
|
65
|
+
|
|
66
|
+
## Global options
|
|
67
|
+
|
|
68
|
+
The following global options are available for all commands:
|
|
69
|
+
|
|
70
|
+
- [`--help`](./global-options.mdx#help)
|
|
71
|
+
- [`--api-key`](./global-options.mdx#api-key)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Zuplo CLI: Logout"
|
|
3
|
+
sidebar_label: logout
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<CliCommand
|
|
7
|
+
command="logout"
|
|
8
|
+
description="Logs the current user out if logged in"
|
|
9
|
+
examples={[
|
|
10
|
+
[
|
|
11
|
+
"$0 logout",
|
|
12
|
+
"Remove locally stored Zuplo credentials"
|
|
13
|
+
]
|
|
14
|
+
]}
|
|
15
|
+
usage="$0 logout"
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
</CliCommand>
|
|
19
|
+
|
|
20
|
+
## Global options
|
|
21
|
+
|
|
22
|
+
The following global options are available for all commands:
|
|
23
|
+
|
|
24
|
+
- [`--help`](./global-options.mdx#help)
|
|
25
|
+
- [`--api-key`](./global-options.mdx#api-key)
|
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
"x-show-example": false,
|
|
47
47
|
"description": "The scheme used on the header."
|
|
48
48
|
},
|
|
49
|
+
"bucketId": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"x-show-example": false,
|
|
52
|
+
"description": "The ID of the API Key service bucket. Preferred over bucketName. Defaults to the autogenerated bucket ID for your project."
|
|
53
|
+
},
|
|
49
54
|
"bucketName": {
|
|
50
55
|
"type": "string",
|
|
51
56
|
"x-show-example": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zuplo",
|
|
3
|
-
"version": "6.69.
|
|
3
|
+
"version": "6.69.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The programmable API Gateway",
|
|
6
6
|
"author": "Zuplo, Inc.",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"zuplo": "zuplo.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@zuplo/cli": "6.69.
|
|
23
|
-
"@zuplo/core": "6.69.
|
|
24
|
-
"@zuplo/runtime": "6.69.
|
|
22
|
+
"@zuplo/cli": "6.69.10",
|
|
23
|
+
"@zuplo/core": "6.69.10",
|
|
24
|
+
"@zuplo/runtime": "6.69.10",
|
|
25
25
|
"@zuplo/test": "1.4.0"
|
|
26
26
|
}
|
|
27
27
|
}
|