@waffo/pancake-ts 0.12.0 → 0.14.0
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/CHANGELOG.md +18 -0
- package/README.md +14 -1
- package/dist/index.cjs +79 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -37
- package/dist/index.d.ts +151 -37
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ interface PostResult<T> extends Envelope<T> {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Environment type.
|
|
84
|
-
* @see
|
|
84
|
+
* @see docs/api-reference/authentication.mdx
|
|
85
85
|
*/
|
|
86
86
|
declare enum Environment {
|
|
87
87
|
Test = "test",
|
|
@@ -89,7 +89,7 @@ declare enum Environment {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Tax category for products.
|
|
92
|
-
* @see
|
|
92
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
93
93
|
*/
|
|
94
94
|
declare enum TaxCategory {
|
|
95
95
|
DigitalGoods = "digital_goods",
|
|
@@ -102,7 +102,7 @@ declare enum TaxCategory {
|
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Subscription billing period.
|
|
105
|
-
* @see
|
|
105
|
+
* @see docs/api-reference/endpoints/subscription-products/overview.mdx
|
|
106
106
|
*/
|
|
107
107
|
declare enum BillingPeriod {
|
|
108
108
|
Weekly = "weekly",
|
|
@@ -112,7 +112,7 @@ declare enum BillingPeriod {
|
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* Product version status.
|
|
115
|
-
* @see
|
|
115
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
116
116
|
*/
|
|
117
117
|
declare enum ProductVersionStatus {
|
|
118
118
|
Active = "active",
|
|
@@ -120,7 +120,7 @@ declare enum ProductVersionStatus {
|
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Store entity status.
|
|
123
|
-
* @see
|
|
123
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
124
124
|
*/
|
|
125
125
|
declare enum EntityStatus {
|
|
126
126
|
Active = "active",
|
|
@@ -129,7 +129,7 @@ declare enum EntityStatus {
|
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Store member role.
|
|
132
|
-
* @see
|
|
132
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
133
133
|
*/
|
|
134
134
|
declare enum StoreRole {
|
|
135
135
|
Owner = "owner",
|
|
@@ -138,7 +138,7 @@ declare enum StoreRole {
|
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
140
|
* One-time order status.
|
|
141
|
-
* @see
|
|
141
|
+
* @see docs/api-reference/endpoints/orders/overview.mdx
|
|
142
142
|
*/
|
|
143
143
|
declare enum OnetimeOrderStatus {
|
|
144
144
|
Pending = "pending",
|
|
@@ -157,7 +157,7 @@ declare enum OnetimeOrderStatus {
|
|
|
157
157
|
* - canceled -> terminal
|
|
158
158
|
* - expired -> terminal
|
|
159
159
|
*
|
|
160
|
-
* @see
|
|
160
|
+
* @see docs/api-reference/endpoints/subscriptions/overview.mdx
|
|
161
161
|
*/
|
|
162
162
|
declare enum SubscriptionOrderStatus {
|
|
163
163
|
Pending = "pending",
|
|
@@ -170,7 +170,7 @@ declare enum SubscriptionOrderStatus {
|
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Payment status.
|
|
173
|
-
* @see
|
|
173
|
+
* @see docs/api-reference/endpoints/orders/overview.mdx
|
|
174
174
|
*/
|
|
175
175
|
declare enum PaymentStatus {
|
|
176
176
|
Pending = "pending",
|
|
@@ -180,7 +180,7 @@ declare enum PaymentStatus {
|
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* Refund ticket status.
|
|
183
|
-
* @see
|
|
183
|
+
* @see docs/api-reference/endpoints/refunds/overview.mdx
|
|
184
184
|
*/
|
|
185
185
|
declare enum RefundTicketStatus {
|
|
186
186
|
Pending = "pending",
|
|
@@ -195,7 +195,7 @@ declare enum RefundTicketStatus {
|
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* Refund status.
|
|
198
|
-
* @see
|
|
198
|
+
* @see docs/api-reference/endpoints/refunds/overview.mdx
|
|
199
199
|
*/
|
|
200
200
|
declare enum RefundStatus {
|
|
201
201
|
Succeeded = "succeeded",
|
|
@@ -203,7 +203,7 @@ declare enum RefundStatus {
|
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Media asset type.
|
|
206
|
-
* @see
|
|
206
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
207
207
|
*/
|
|
208
208
|
declare enum MediaType {
|
|
209
209
|
Image = "image",
|
|
@@ -230,7 +230,7 @@ declare enum ErrorLayer {
|
|
|
230
230
|
* Provide either `storeId` or `productId` (at least one required).
|
|
231
231
|
* When `productId` is given without `storeId`, the server derives the store from the product.
|
|
232
232
|
*
|
|
233
|
-
* @see
|
|
233
|
+
* @see docs/api-reference/endpoints/auth/issue-session-token.mdx
|
|
234
234
|
*/
|
|
235
235
|
interface IssueSessionTokenParams {
|
|
236
236
|
/**
|
|
@@ -265,7 +265,7 @@ type WebhookChannel = "http" | "feishu" | "discord" | "telegram" | "slack";
|
|
|
265
265
|
/**
|
|
266
266
|
* Configured webhook endpoint (one row of `store.store_webhooks`).
|
|
267
267
|
*
|
|
268
|
-
* @see
|
|
268
|
+
* @see docs/api-reference/endpoints/webhooks/overview.mdx
|
|
269
269
|
*/
|
|
270
270
|
interface StoreWebhook {
|
|
271
271
|
/** Webhook UUID (not Short ID) */
|
|
@@ -316,7 +316,7 @@ interface RemoveWebhookParams {
|
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
318
318
|
* Notification settings (all default to true).
|
|
319
|
-
* @see
|
|
319
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
320
320
|
*/
|
|
321
321
|
interface NotificationSettings {
|
|
322
322
|
emailOrderConfirmation: boolean;
|
|
@@ -349,7 +349,7 @@ interface NotificationSettings {
|
|
|
349
349
|
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback" | "notifyPayoutCompleted" | "notifyPayoutFailed">;
|
|
350
350
|
/**
|
|
351
351
|
* Single-theme checkout page styling.
|
|
352
|
-
* @see
|
|
352
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
353
353
|
*/
|
|
354
354
|
interface CheckoutThemeSettings {
|
|
355
355
|
checkoutLogo: string | null;
|
|
@@ -361,7 +361,7 @@ interface CheckoutThemeSettings {
|
|
|
361
361
|
}
|
|
362
362
|
/**
|
|
363
363
|
* Checkout page configuration (light and dark themes).
|
|
364
|
-
* @see
|
|
364
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
365
365
|
*/
|
|
366
366
|
interface CheckoutSettings {
|
|
367
367
|
defaultDarkMode: boolean;
|
|
@@ -370,7 +370,7 @@ interface CheckoutSettings {
|
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
372
|
* Store entity.
|
|
373
|
-
* @see
|
|
373
|
+
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
374
374
|
*/
|
|
375
375
|
interface Store {
|
|
376
376
|
id: string;
|
|
@@ -470,7 +470,7 @@ interface UpdateRoleResult {
|
|
|
470
470
|
* Amounts are represented as display strings (e.g., "9.99" for USD, "1000" for JPY).
|
|
471
471
|
* The server handles conversion to/from smallest currency units internally.
|
|
472
472
|
*
|
|
473
|
-
* @see
|
|
473
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
474
474
|
*
|
|
475
475
|
* @example
|
|
476
476
|
* // USD $9.99
|
|
@@ -489,7 +489,7 @@ interface PriceInfo {
|
|
|
489
489
|
/**
|
|
490
490
|
* Multi-currency prices (keyed by ISO 4217 currency code).
|
|
491
491
|
*
|
|
492
|
-
* @see
|
|
492
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
493
493
|
*
|
|
494
494
|
* @example
|
|
495
495
|
* {
|
|
@@ -500,7 +500,7 @@ interface PriceInfo {
|
|
|
500
500
|
type Prices = Record<string, PriceInfo>;
|
|
501
501
|
/**
|
|
502
502
|
* Media asset (image or video).
|
|
503
|
-
* @see
|
|
503
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
504
504
|
*/
|
|
505
505
|
interface MediaItem {
|
|
506
506
|
/** Media type */
|
|
@@ -514,7 +514,7 @@ interface MediaItem {
|
|
|
514
514
|
}
|
|
515
515
|
/**
|
|
516
516
|
* One-time product detail (public API shape).
|
|
517
|
-
* @see
|
|
517
|
+
* @see docs/api-reference/endpoints/onetime-products/overview.mdx
|
|
518
518
|
*/
|
|
519
519
|
interface OnetimeProductDetail {
|
|
520
520
|
id: string;
|
|
@@ -531,7 +531,7 @@ interface OnetimeProductDetail {
|
|
|
531
531
|
}
|
|
532
532
|
/**
|
|
533
533
|
* Parameters for creating a one-time product.
|
|
534
|
-
* @see
|
|
534
|
+
* @see docs/api-reference/endpoints/onetime-products/create-product.mdx
|
|
535
535
|
*/
|
|
536
536
|
interface CreateOnetimeProductParams {
|
|
537
537
|
storeId: string;
|
|
@@ -544,7 +544,7 @@ interface CreateOnetimeProductParams {
|
|
|
544
544
|
}
|
|
545
545
|
/**
|
|
546
546
|
* Parameters for updating a one-time product (creates a new version; skips if unchanged).
|
|
547
|
-
* @see
|
|
547
|
+
* @see docs/api-reference/endpoints/onetime-products/update-product.mdx
|
|
548
548
|
*/
|
|
549
549
|
interface UpdateOnetimeProductParams {
|
|
550
550
|
id: string;
|
|
@@ -562,7 +562,7 @@ interface PublishOnetimeProductParams {
|
|
|
562
562
|
}
|
|
563
563
|
/**
|
|
564
564
|
* Parameters for updating a one-time product's status.
|
|
565
|
-
* @see
|
|
565
|
+
* @see docs/api-reference/endpoints/onetime-products/update-status.mdx
|
|
566
566
|
*/
|
|
567
567
|
interface UpdateOnetimeStatusParams {
|
|
568
568
|
id: string;
|
|
@@ -570,7 +570,7 @@ interface UpdateOnetimeStatusParams {
|
|
|
570
570
|
}
|
|
571
571
|
/**
|
|
572
572
|
* Subscription product detail (public API shape).
|
|
573
|
-
* @see
|
|
573
|
+
* @see docs/api-reference/endpoints/subscription-products/overview.mdx
|
|
574
574
|
*/
|
|
575
575
|
interface SubscriptionProductDetail {
|
|
576
576
|
id: string;
|
|
@@ -588,7 +588,7 @@ interface SubscriptionProductDetail {
|
|
|
588
588
|
}
|
|
589
589
|
/**
|
|
590
590
|
* Parameters for creating a subscription product.
|
|
591
|
-
* @see
|
|
591
|
+
* @see docs/api-reference/endpoints/subscription-products/create-product.mdx
|
|
592
592
|
*/
|
|
593
593
|
interface CreateSubscriptionProductParams {
|
|
594
594
|
storeId: string;
|
|
@@ -602,7 +602,7 @@ interface CreateSubscriptionProductParams {
|
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
604
604
|
* Parameters for updating a subscription product (creates a new version; skips if unchanged).
|
|
605
|
-
* @see
|
|
605
|
+
* @see docs/api-reference/endpoints/subscription-products/update-product.mdx
|
|
606
606
|
*/
|
|
607
607
|
interface UpdateSubscriptionProductParams {
|
|
608
608
|
id: string;
|
|
@@ -621,7 +621,7 @@ interface PublishSubscriptionProductParams {
|
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* Parameters for updating a subscription product's status.
|
|
624
|
-
* @see
|
|
624
|
+
* @see docs/api-reference/endpoints/subscription-products/update-status.mdx
|
|
625
625
|
*/
|
|
626
626
|
interface UpdateSubscriptionStatusParams {
|
|
627
627
|
id: string;
|
|
@@ -629,7 +629,7 @@ interface UpdateSubscriptionStatusParams {
|
|
|
629
629
|
}
|
|
630
630
|
/**
|
|
631
631
|
* Group rules for subscription product groups.
|
|
632
|
-
* @see
|
|
632
|
+
* @see docs/api-reference/endpoints/subscription-products/overview.mdx
|
|
633
633
|
*/
|
|
634
634
|
interface GroupRules {
|
|
635
635
|
/** Whether trial period is shared across products in the group */
|
|
@@ -637,7 +637,7 @@ interface GroupRules {
|
|
|
637
637
|
}
|
|
638
638
|
/**
|
|
639
639
|
* Subscription product group entity.
|
|
640
|
-
* @see
|
|
640
|
+
* @see docs/api-reference/endpoints/subscription-products/overview.mdx
|
|
641
641
|
*/
|
|
642
642
|
interface SubscriptionProductGroup {
|
|
643
643
|
id: string;
|
|
@@ -652,7 +652,7 @@ interface SubscriptionProductGroup {
|
|
|
652
652
|
}
|
|
653
653
|
/**
|
|
654
654
|
* Parameters for creating a subscription product group.
|
|
655
|
-
* @see
|
|
655
|
+
* @see docs/api-reference/endpoints/subscription-products/create-group.mdx
|
|
656
656
|
*/
|
|
657
657
|
interface CreateSubscriptionProductGroupParams {
|
|
658
658
|
storeId: string;
|
|
@@ -663,7 +663,7 @@ interface CreateSubscriptionProductGroupParams {
|
|
|
663
663
|
}
|
|
664
664
|
/**
|
|
665
665
|
* Parameters for updating a subscription product group (`productIds` is a full replacement).
|
|
666
|
-
* @see
|
|
666
|
+
* @see docs/api-reference/endpoints/subscription-products/update-group.mdx
|
|
667
667
|
*/
|
|
668
668
|
interface UpdateSubscriptionProductGroupParams {
|
|
669
669
|
id: string;
|
|
@@ -689,7 +689,7 @@ interface CancelSubscriptionParams {
|
|
|
689
689
|
}
|
|
690
690
|
/**
|
|
691
691
|
* Result of canceling a subscription order.
|
|
692
|
-
* @see
|
|
692
|
+
* @see docs/api-reference/endpoints/subscriptions/cancel-subscription.mdx
|
|
693
693
|
*/
|
|
694
694
|
interface CancelSubscriptionResult {
|
|
695
695
|
orderId: string;
|
|
@@ -698,7 +698,7 @@ interface CancelSubscriptionResult {
|
|
|
698
698
|
}
|
|
699
699
|
/**
|
|
700
700
|
* Customer billing details for checkout.
|
|
701
|
-
* @see
|
|
701
|
+
* @see docs/api-reference/endpoints/orders/overview.mdx
|
|
702
702
|
*/
|
|
703
703
|
interface BillingDetail {
|
|
704
704
|
/** Country code (ISO 3166-1 alpha-2) */
|
|
@@ -714,9 +714,17 @@ interface BillingDetail {
|
|
|
714
714
|
/** Tax ID / VAT number (EU businesses: triggers reverse charge 0% when provided) */
|
|
715
715
|
taxId?: string;
|
|
716
716
|
}
|
|
717
|
+
/**
|
|
718
|
+
* Supported checkout cashier languages (IETF BCP 47 tags).
|
|
719
|
+
*
|
|
720
|
+
* The default language of the hosted checkout page. Pass one of these values as
|
|
721
|
+
* {@link CreateCheckoutSessionParams.language}; the customer can still switch language
|
|
722
|
+
* on the checkout page. Language×currency mismatches are rejected by the payment provider.
|
|
723
|
+
*/
|
|
724
|
+
type CashierLanguage = "en" | "pt-BR" | "es-MX" | "id-ID" | "vi-VN" | "ru-RU" | "en-KE" | "es-PE" | "es-CO" | "es-CL" | "zh-Hant-TW" | "zh-Hant-HK" | "th-TH" | "ja-JP" | "en-NG" | "ko-KR" | "en-HK" | "zh-Hans-HK" | "pl-PL" | "tr-TR" | "zh-Hans" | "ms-MY";
|
|
717
725
|
/**
|
|
718
726
|
* Parameters for creating a checkout session.
|
|
719
|
-
* @see
|
|
727
|
+
* @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
|
|
720
728
|
*/
|
|
721
729
|
interface CreateCheckoutSessionParams {
|
|
722
730
|
/** Product ID */
|
|
@@ -741,6 +749,11 @@ interface CreateCheckoutSessionParams {
|
|
|
741
749
|
metadata?: Record<string, string>;
|
|
742
750
|
/** Order-side business identifier (max 128 chars); inherited by orders, payments, refunds */
|
|
743
751
|
orderMerchantExternalId?: string;
|
|
752
|
+
/**
|
|
753
|
+
* Default language of the hosted checkout page ({@link CashierLanguage}, IETF BCP 47).
|
|
754
|
+
* The customer can switch language on the checkout page. Omit to let the provider infer.
|
|
755
|
+
*/
|
|
756
|
+
language?: CashierLanguage;
|
|
744
757
|
}
|
|
745
758
|
/** Result of creating a checkout session. */
|
|
746
759
|
interface CheckoutSessionResult {
|
|
@@ -1110,6 +1123,81 @@ interface VerifyWebhookOptions {
|
|
|
1110
1123
|
*/
|
|
1111
1124
|
publicKeys?: WebhookPublicKeys;
|
|
1112
1125
|
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Content-safety scan verdict.
|
|
1128
|
+
* @see docs/api-reference/endpoints/content-safety/scan-prompt.mdx
|
|
1129
|
+
*/
|
|
1130
|
+
declare enum ScanAction {
|
|
1131
|
+
Allow = "allow",
|
|
1132
|
+
Review = "review",
|
|
1133
|
+
Block = "block"
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Scan verdict reason code.
|
|
1137
|
+
* @see docs/api-reference/endpoints/content-safety/scan-prompt.mdx
|
|
1138
|
+
*/
|
|
1139
|
+
declare enum ScanReasonCode {
|
|
1140
|
+
Allowed = "allowed",
|
|
1141
|
+
ReviewRequired = "review_required",
|
|
1142
|
+
RestrictedContent = "restricted_content",
|
|
1143
|
+
ServiceDegraded = "service_degraded"
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Matched content-safety policy category.
|
|
1147
|
+
* @see docs/api-reference/endpoints/content-safety/scan-prompt.mdx
|
|
1148
|
+
*/
|
|
1149
|
+
declare enum ScanPolicyCategory {
|
|
1150
|
+
CsamMinor = "csam_minor",
|
|
1151
|
+
SexualViolenceNonconsensual = "sexual_violence_nonconsensual",
|
|
1152
|
+
UndressTransform = "undress_transform",
|
|
1153
|
+
FaceSwapIdentity = "face_swap_identity",
|
|
1154
|
+
BestialityRestricted = "bestiality_restricted",
|
|
1155
|
+
AdultNsfw = "adult_nsfw"
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Semantic scan channel mode.
|
|
1159
|
+
* @see docs/api-reference/endpoints/content-safety/scan-prompt.mdx
|
|
1160
|
+
*/
|
|
1161
|
+
declare enum ScanSemanticMode {
|
|
1162
|
+
Off = "off",
|
|
1163
|
+
Shadow = "shadow",
|
|
1164
|
+
Enforce = "enforce"
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Semantic scan channel status.
|
|
1168
|
+
* @see docs/api-reference/endpoints/content-safety/scan-prompt.mdx
|
|
1169
|
+
*/
|
|
1170
|
+
declare enum ScanSemanticStatus {
|
|
1171
|
+
Disabled = "disabled",
|
|
1172
|
+
Scored = "scored",
|
|
1173
|
+
ShadowScored = "shadow_scored",
|
|
1174
|
+
SkippedRulesBlock = "skipped_rules_block",
|
|
1175
|
+
SkippedBudget = "skipped_budget",
|
|
1176
|
+
ProviderTimeout = "provider_timeout",
|
|
1177
|
+
ProviderError = "provider_error"
|
|
1178
|
+
}
|
|
1179
|
+
/** Parameters for scanning a prompt before AIGC generation. */
|
|
1180
|
+
interface ScanPromptParams {
|
|
1181
|
+
/** The user's text prompt to scan (1–10,000 characters). */
|
|
1182
|
+
prompt: string;
|
|
1183
|
+
/** Prompt text language (default "en"). */
|
|
1184
|
+
locale?: "ja" | "en" | "zh";
|
|
1185
|
+
/** How the external semantic channel participates. */
|
|
1186
|
+
semantic?: ScanSemanticMode;
|
|
1187
|
+
}
|
|
1188
|
+
/** Redacted scan verdict — no scores, thresholds, or keyword text. */
|
|
1189
|
+
interface ScanResult {
|
|
1190
|
+
/** Final verdict; continue only when `allow`. */
|
|
1191
|
+
action: ScanAction;
|
|
1192
|
+
/** Stable machine-readable reason. */
|
|
1193
|
+
reasonCode: ScanReasonCode;
|
|
1194
|
+
/** Matched policy categories; empty when allowed. */
|
|
1195
|
+
matchedCategories: ScanPolicyCategory[];
|
|
1196
|
+
/** Correlation id for support and appeals; safe to log. */
|
|
1197
|
+
requestId: string;
|
|
1198
|
+
/** Whether/how the semantic channel contributed to this scan. */
|
|
1199
|
+
semanticStatus: ScanSemanticStatus;
|
|
1200
|
+
}
|
|
1113
1201
|
|
|
1114
1202
|
/**
|
|
1115
1203
|
* Internal HTTP client that auto-signs requests.
|
|
@@ -1313,6 +1401,31 @@ declare class CheckoutResource {
|
|
|
1313
1401
|
}>;
|
|
1314
1402
|
}
|
|
1315
1403
|
|
|
1404
|
+
/** Content safety resource — scan user prompts before AIGC generation. */
|
|
1405
|
+
declare class ContentSafetyResource {
|
|
1406
|
+
private readonly http;
|
|
1407
|
+
constructor(http: HttpClient);
|
|
1408
|
+
/**
|
|
1409
|
+
* Scan a user's text prompt for content-safety compliance before AIGC
|
|
1410
|
+
* generation. Call this before invoking your image/video model and continue
|
|
1411
|
+
* only when `action` is `allow`.
|
|
1412
|
+
*
|
|
1413
|
+
* Stateless — the check never stores prompt text. If the safety service is
|
|
1414
|
+
* briefly unavailable, the verdict fails closed to `review` so an
|
|
1415
|
+
* unmoderated prompt is never let through.
|
|
1416
|
+
*
|
|
1417
|
+
* @param params - Scan parameters (prompt required; locale / semantic optional)
|
|
1418
|
+
* @returns Redacted scan verdict
|
|
1419
|
+
*
|
|
1420
|
+
* @example
|
|
1421
|
+
* const verdict = await client.contentSafety.scanPrompt({ prompt: "a cat riding a bike" });
|
|
1422
|
+
* if (verdict.action !== "allow") {
|
|
1423
|
+
* // do not generate
|
|
1424
|
+
* }
|
|
1425
|
+
*/
|
|
1426
|
+
scanPrompt(params: ScanPromptParams): Promise<ScanResult>;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1316
1429
|
/**
|
|
1317
1430
|
* Internal HTTP client for customer-side requests using Bearer token authentication.
|
|
1318
1431
|
*
|
|
@@ -2024,6 +2137,7 @@ declare class WaffoPancake {
|
|
|
2024
2137
|
readonly checkout: CheckoutResource;
|
|
2025
2138
|
readonly graphql: GraphQLResource;
|
|
2026
2139
|
readonly webhooks: WebhooksResource;
|
|
2140
|
+
readonly contentSafety: ContentSafetyResource;
|
|
2027
2141
|
constructor(config: WaffoPancakeConfig);
|
|
2028
2142
|
/**
|
|
2029
2143
|
* Create a customer session for self-service operations.
|
|
@@ -2136,4 +2250,4 @@ declare class WaffoPancakeError extends Error {
|
|
|
2136
2250
|
*/
|
|
2137
2251
|
declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
|
|
2138
2252
|
|
|
2139
|
-
export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
|
|
2253
|
+
export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
|
package/dist/index.js
CHANGED
|
@@ -490,6 +490,35 @@ var CheckoutResource = class {
|
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
|
|
493
|
+
// src/resources/content-safety.ts
|
|
494
|
+
var ContentSafetyResource = class {
|
|
495
|
+
constructor(http) {
|
|
496
|
+
this.http = http;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Scan a user's text prompt for content-safety compliance before AIGC
|
|
500
|
+
* generation. Call this before invoking your image/video model and continue
|
|
501
|
+
* only when `action` is `allow`.
|
|
502
|
+
*
|
|
503
|
+
* Stateless — the check never stores prompt text. If the safety service is
|
|
504
|
+
* briefly unavailable, the verdict fails closed to `review` so an
|
|
505
|
+
* unmoderated prompt is never let through.
|
|
506
|
+
*
|
|
507
|
+
* @param params - Scan parameters (prompt required; locale / semantic optional)
|
|
508
|
+
* @returns Redacted scan verdict
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* const verdict = await client.contentSafety.scanPrompt({ prompt: "a cat riding a bike" });
|
|
512
|
+
* if (verdict.action !== "allow") {
|
|
513
|
+
* // do not generate
|
|
514
|
+
* }
|
|
515
|
+
*/
|
|
516
|
+
async scanPrompt(params) {
|
|
517
|
+
validateRequired("prompt", params.prompt);
|
|
518
|
+
return unwrapAction(await this.http.post("/v1/actions/verification/scan-prompt", params));
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
|
|
493
522
|
// src/resources/customer.ts
|
|
494
523
|
var CustomerSession = class {
|
|
495
524
|
constructor(http) {
|
|
@@ -1281,6 +1310,7 @@ var WaffoPancake = class {
|
|
|
1281
1310
|
checkout;
|
|
1282
1311
|
graphql;
|
|
1283
1312
|
webhooks;
|
|
1313
|
+
contentSafety;
|
|
1284
1314
|
constructor(config) {
|
|
1285
1315
|
validateShortId("merchantId", config.merchantId, "MER");
|
|
1286
1316
|
this.config = config;
|
|
@@ -1295,6 +1325,7 @@ var WaffoPancake = class {
|
|
|
1295
1325
|
this.checkout = new CheckoutResource(this.http);
|
|
1296
1326
|
this.graphql = new GraphQLResource(this.http);
|
|
1297
1327
|
this.webhooks = new WebhooksResource(this.http, config.webhookPublicKey);
|
|
1328
|
+
this.contentSafety = new ContentSafetyResource(this.http);
|
|
1298
1329
|
}
|
|
1299
1330
|
/**
|
|
1300
1331
|
* Create a customer session for self-service operations.
|
|
@@ -1450,6 +1481,44 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
|
1450
1481
|
WebhookEventType2["RefundFailed"] = "refund.failed";
|
|
1451
1482
|
return WebhookEventType2;
|
|
1452
1483
|
})(WebhookEventType || {});
|
|
1484
|
+
var ScanAction = /* @__PURE__ */ ((ScanAction2) => {
|
|
1485
|
+
ScanAction2["Allow"] = "allow";
|
|
1486
|
+
ScanAction2["Review"] = "review";
|
|
1487
|
+
ScanAction2["Block"] = "block";
|
|
1488
|
+
return ScanAction2;
|
|
1489
|
+
})(ScanAction || {});
|
|
1490
|
+
var ScanReasonCode = /* @__PURE__ */ ((ScanReasonCode2) => {
|
|
1491
|
+
ScanReasonCode2["Allowed"] = "allowed";
|
|
1492
|
+
ScanReasonCode2["ReviewRequired"] = "review_required";
|
|
1493
|
+
ScanReasonCode2["RestrictedContent"] = "restricted_content";
|
|
1494
|
+
ScanReasonCode2["ServiceDegraded"] = "service_degraded";
|
|
1495
|
+
return ScanReasonCode2;
|
|
1496
|
+
})(ScanReasonCode || {});
|
|
1497
|
+
var ScanPolicyCategory = /* @__PURE__ */ ((ScanPolicyCategory2) => {
|
|
1498
|
+
ScanPolicyCategory2["CsamMinor"] = "csam_minor";
|
|
1499
|
+
ScanPolicyCategory2["SexualViolenceNonconsensual"] = "sexual_violence_nonconsensual";
|
|
1500
|
+
ScanPolicyCategory2["UndressTransform"] = "undress_transform";
|
|
1501
|
+
ScanPolicyCategory2["FaceSwapIdentity"] = "face_swap_identity";
|
|
1502
|
+
ScanPolicyCategory2["BestialityRestricted"] = "bestiality_restricted";
|
|
1503
|
+
ScanPolicyCategory2["AdultNsfw"] = "adult_nsfw";
|
|
1504
|
+
return ScanPolicyCategory2;
|
|
1505
|
+
})(ScanPolicyCategory || {});
|
|
1506
|
+
var ScanSemanticMode = /* @__PURE__ */ ((ScanSemanticMode2) => {
|
|
1507
|
+
ScanSemanticMode2["Off"] = "off";
|
|
1508
|
+
ScanSemanticMode2["Shadow"] = "shadow";
|
|
1509
|
+
ScanSemanticMode2["Enforce"] = "enforce";
|
|
1510
|
+
return ScanSemanticMode2;
|
|
1511
|
+
})(ScanSemanticMode || {});
|
|
1512
|
+
var ScanSemanticStatus = /* @__PURE__ */ ((ScanSemanticStatus2) => {
|
|
1513
|
+
ScanSemanticStatus2["Disabled"] = "disabled";
|
|
1514
|
+
ScanSemanticStatus2["Scored"] = "scored";
|
|
1515
|
+
ScanSemanticStatus2["ShadowScored"] = "shadow_scored";
|
|
1516
|
+
ScanSemanticStatus2["SkippedRulesBlock"] = "skipped_rules_block";
|
|
1517
|
+
ScanSemanticStatus2["SkippedBudget"] = "skipped_budget";
|
|
1518
|
+
ScanSemanticStatus2["ProviderTimeout"] = "provider_timeout";
|
|
1519
|
+
ScanSemanticStatus2["ProviderError"] = "provider_error";
|
|
1520
|
+
return ScanSemanticStatus2;
|
|
1521
|
+
})(ScanSemanticStatus || {});
|
|
1453
1522
|
export {
|
|
1454
1523
|
BillingPeriod,
|
|
1455
1524
|
EntityStatus,
|
|
@@ -1461,6 +1530,11 @@ export {
|
|
|
1461
1530
|
ProductVersionStatus,
|
|
1462
1531
|
RefundStatus,
|
|
1463
1532
|
RefundTicketStatus,
|
|
1533
|
+
ScanAction,
|
|
1534
|
+
ScanPolicyCategory,
|
|
1535
|
+
ScanReasonCode,
|
|
1536
|
+
ScanSemanticMode,
|
|
1537
|
+
ScanSemanticStatus,
|
|
1464
1538
|
StoreRole,
|
|
1465
1539
|
SubscriptionOrderStatus,
|
|
1466
1540
|
TaxCategory,
|