zpan-cloud-sdk 1.0.0 → 1.0.2
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/README.md +1 -1
- package/dist/chunk-YQNXMZK4.js +572 -0
- package/dist/index.d.ts +203 -441
- package/dist/index.js +92 -1
- package/dist/schemas.d.ts +1167 -2
- package/dist/schemas.js +83 -1
- package/package.json +1 -1
- package/dist/chunk-VMYIHGPC.js +0 -218
- package/dist/schemas-R0lkMmfq.d.ts +0 -366
package/dist/index.js
CHANGED
|
@@ -1,32 +1,73 @@
|
|
|
1
1
|
import {
|
|
2
2
|
accountBillingQuerySchema,
|
|
3
|
+
accountBillingResponseSchema,
|
|
4
|
+
accountMembershipResponseSchema,
|
|
5
|
+
accountOverviewResponseSchema,
|
|
3
6
|
accountUsagePeriodSchema,
|
|
4
7
|
accountUsageQuerySchema,
|
|
8
|
+
accountWalletResponseSchema,
|
|
5
9
|
adminUserListQuerySchema,
|
|
10
|
+
adminUserListResponseSchema,
|
|
6
11
|
adminUserPatchSchema,
|
|
12
|
+
adminUserSchema,
|
|
13
|
+
billingPortalSessionResponseSchema,
|
|
7
14
|
billingPortalSessionSchema,
|
|
15
|
+
billingRecordItemSchema,
|
|
16
|
+
billingRecordSchema,
|
|
17
|
+
billingSummarySchema,
|
|
18
|
+
boundLicenseSchema,
|
|
19
|
+
commerceOrderItemSchema,
|
|
20
|
+
commerceOrderSchema,
|
|
21
|
+
commercePaymentSchema,
|
|
22
|
+
commerceProductSchema,
|
|
23
|
+
commerceStoreSchema,
|
|
8
24
|
createOrderSchema,
|
|
9
25
|
createPairingSchema,
|
|
10
26
|
createProductSchema,
|
|
11
27
|
deliverableSchema,
|
|
28
|
+
entitlementRefreshResponseSchema,
|
|
12
29
|
giftCardCampaignCreateSchema,
|
|
13
30
|
giftCardCampaignListQuerySchema,
|
|
31
|
+
giftCardCampaignListResponseSchema,
|
|
32
|
+
giftCardCampaignSchema,
|
|
14
33
|
giftCardCreateSchema,
|
|
15
34
|
giftCardListQuerySchema,
|
|
35
|
+
giftCardListResponseSchema,
|
|
16
36
|
giftCardPatchSchema,
|
|
37
|
+
licenseAssertionSchema,
|
|
38
|
+
licenseListResponseSchema,
|
|
39
|
+
membershipStripeChannelSchema,
|
|
17
40
|
orderListQuerySchema,
|
|
41
|
+
orderListResponseSchema,
|
|
18
42
|
orderPatchSchema,
|
|
43
|
+
pageSchema,
|
|
19
44
|
paginationQuerySchema,
|
|
45
|
+
pairingActionResponseSchema,
|
|
20
46
|
pairingActionSchema,
|
|
47
|
+
pairingCreateResponseSchema,
|
|
48
|
+
pairingPollResponseSchema,
|
|
49
|
+
pairingPreviewSchema,
|
|
50
|
+
paymentCreateResponseSchema,
|
|
21
51
|
paymentSchema,
|
|
22
52
|
productListQuerySchema,
|
|
53
|
+
productListResponseSchema,
|
|
23
54
|
productMetadataSchema,
|
|
24
55
|
productPriceSchema,
|
|
56
|
+
storeGiftCardSchema,
|
|
57
|
+
storeListResponseSchema,
|
|
25
58
|
storePatchSchema,
|
|
26
59
|
updateProductSchema,
|
|
60
|
+
usageEventCreateResponseSchema,
|
|
27
61
|
usageEventCreateSchema,
|
|
62
|
+
usageResourceSummarySchema,
|
|
63
|
+
usageSummarySchema,
|
|
64
|
+
walletBalanceListResponseSchema,
|
|
65
|
+
walletBalanceSchema,
|
|
66
|
+
walletLedgerEntrySchema,
|
|
67
|
+
walletLedgerResponseSchema,
|
|
68
|
+
walletRedemptionResponseSchema,
|
|
28
69
|
walletRedemptionSchema
|
|
29
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-YQNXMZK4.js";
|
|
30
71
|
|
|
31
72
|
// src/client.ts
|
|
32
73
|
import { hc } from "hono/client";
|
|
@@ -34,6 +75,7 @@ function createCloudClient(options) {
|
|
|
34
75
|
const headers = new Headers(options.headers);
|
|
35
76
|
if (options.token) headers.set("Authorization", `Bearer ${options.token}`);
|
|
36
77
|
return hc(withoutTrailingSlash(options.baseUrl), {
|
|
78
|
+
fetch: fetchWithoutEmptyQuery,
|
|
37
79
|
init: {
|
|
38
80
|
credentials: options.credentials,
|
|
39
81
|
headers
|
|
@@ -43,6 +85,14 @@ function createCloudClient(options) {
|
|
|
43
85
|
function withoutTrailingSlash(value) {
|
|
44
86
|
return value.endsWith("/") ? value.slice(0, -1) : value;
|
|
45
87
|
}
|
|
88
|
+
function fetchWithoutEmptyQuery(input, init) {
|
|
89
|
+
if (typeof input === "string") return fetch(stripEmptyQuery(input), init);
|
|
90
|
+
if (input instanceof URL) return fetch(stripEmptyQuery(input.toString()), init);
|
|
91
|
+
return fetch(input, init);
|
|
92
|
+
}
|
|
93
|
+
function stripEmptyQuery(url) {
|
|
94
|
+
return url.endsWith("?") ? url.slice(0, -1) : url;
|
|
95
|
+
}
|
|
46
96
|
|
|
47
97
|
// src/events.ts
|
|
48
98
|
import { z } from "zod";
|
|
@@ -79,33 +129,74 @@ var storeFulfillmentEventSchema = z.object({
|
|
|
79
129
|
var zpanCloudEventSchema = storeFulfillmentEventSchema;
|
|
80
130
|
export {
|
|
81
131
|
accountBillingQuerySchema,
|
|
132
|
+
accountBillingResponseSchema,
|
|
133
|
+
accountMembershipResponseSchema,
|
|
134
|
+
accountOverviewResponseSchema,
|
|
82
135
|
accountUsagePeriodSchema,
|
|
83
136
|
accountUsageQuerySchema,
|
|
137
|
+
accountWalletResponseSchema,
|
|
84
138
|
adminUserListQuerySchema,
|
|
139
|
+
adminUserListResponseSchema,
|
|
85
140
|
adminUserPatchSchema,
|
|
141
|
+
adminUserSchema,
|
|
142
|
+
billingPortalSessionResponseSchema,
|
|
86
143
|
billingPortalSessionSchema,
|
|
144
|
+
billingRecordItemSchema,
|
|
145
|
+
billingRecordSchema,
|
|
146
|
+
billingSummarySchema,
|
|
147
|
+
boundLicenseSchema,
|
|
148
|
+
commerceOrderItemSchema,
|
|
149
|
+
commerceOrderSchema,
|
|
150
|
+
commercePaymentSchema,
|
|
151
|
+
commerceProductSchema,
|
|
152
|
+
commerceStoreSchema,
|
|
87
153
|
createCloudClient,
|
|
88
154
|
createOrderSchema,
|
|
89
155
|
createPairingSchema,
|
|
90
156
|
createProductSchema,
|
|
91
157
|
deliverableSchema,
|
|
158
|
+
entitlementRefreshResponseSchema,
|
|
92
159
|
giftCardCampaignCreateSchema,
|
|
93
160
|
giftCardCampaignListQuerySchema,
|
|
161
|
+
giftCardCampaignListResponseSchema,
|
|
162
|
+
giftCardCampaignSchema,
|
|
94
163
|
giftCardCreateSchema,
|
|
95
164
|
giftCardListQuerySchema,
|
|
165
|
+
giftCardListResponseSchema,
|
|
96
166
|
giftCardPatchSchema,
|
|
167
|
+
licenseAssertionSchema,
|
|
168
|
+
licenseListResponseSchema,
|
|
169
|
+
membershipStripeChannelSchema,
|
|
97
170
|
orderListQuerySchema,
|
|
171
|
+
orderListResponseSchema,
|
|
98
172
|
orderPatchSchema,
|
|
173
|
+
pageSchema,
|
|
99
174
|
paginationQuerySchema,
|
|
175
|
+
pairingActionResponseSchema,
|
|
100
176
|
pairingActionSchema,
|
|
177
|
+
pairingCreateResponseSchema,
|
|
178
|
+
pairingPollResponseSchema,
|
|
179
|
+
pairingPreviewSchema,
|
|
180
|
+
paymentCreateResponseSchema,
|
|
101
181
|
paymentSchema,
|
|
102
182
|
productListQuerySchema,
|
|
183
|
+
productListResponseSchema,
|
|
103
184
|
productMetadataSchema,
|
|
104
185
|
productPriceSchema,
|
|
105
186
|
storeFulfillmentEventSchema,
|
|
187
|
+
storeGiftCardSchema,
|
|
188
|
+
storeListResponseSchema,
|
|
106
189
|
storePatchSchema,
|
|
107
190
|
updateProductSchema,
|
|
191
|
+
usageEventCreateResponseSchema,
|
|
108
192
|
usageEventCreateSchema,
|
|
193
|
+
usageResourceSummarySchema,
|
|
194
|
+
usageSummarySchema,
|
|
195
|
+
walletBalanceListResponseSchema,
|
|
196
|
+
walletBalanceSchema,
|
|
197
|
+
walletLedgerEntrySchema,
|
|
198
|
+
walletLedgerResponseSchema,
|
|
199
|
+
walletRedemptionResponseSchema,
|
|
109
200
|
walletRedemptionSchema,
|
|
110
201
|
zpanCloudEventSchema
|
|
111
202
|
};
|