@waffo/pancake-ts 0.13.0 → 0.15.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 +21 -0
- package/README.md +12 -0
- package/dist/index.cjs +79 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +144 -43
- package/dist/index.d.ts +144 -43
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
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;
|
|
@@ -327,6 +327,7 @@ interface NotificationSettings {
|
|
|
327
327
|
emailSubscriptionPastDue: boolean;
|
|
328
328
|
emailTrialStarted: boolean;
|
|
329
329
|
emailTrialEnding: boolean;
|
|
330
|
+
emailUpcomingCharge: boolean;
|
|
330
331
|
notifyNewOrders: boolean;
|
|
331
332
|
notifyNewSubscriptions: boolean;
|
|
332
333
|
notifySubscriptionCanceled: boolean;
|
|
@@ -336,20 +337,19 @@ interface NotificationSettings {
|
|
|
336
337
|
notifySubscriptionUncanceled: boolean;
|
|
337
338
|
notifySubscriptionUpdated: boolean;
|
|
338
339
|
notifyChargeback: boolean;
|
|
339
|
-
notifyPayoutCompleted: boolean;
|
|
340
|
-
notifyPayoutFailed: boolean;
|
|
341
340
|
}
|
|
342
341
|
/**
|
|
343
342
|
* Merchant-writable subset of {@link NotificationSettings}.
|
|
344
343
|
*
|
|
345
|
-
* Consumer-email toggles (`email*`) are managed by the PANCAKE platform
|
|
346
|
-
*
|
|
347
|
-
*
|
|
344
|
+
* Consumer-email toggles (`email*`) are managed by the PANCAKE platform and **not**
|
|
345
|
+
* writable from this SDK; they would be silently dropped by the `update-store`
|
|
346
|
+
* endpoint if included. Payout result notifications are platform-managed and always
|
|
347
|
+
* delivered — they have no toggle key. Use this type for any merchant-side update.
|
|
348
348
|
*/
|
|
349
|
-
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback"
|
|
349
|
+
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback">;
|
|
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) */
|
|
@@ -724,7 +724,7 @@ interface BillingDetail {
|
|
|
724
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";
|
|
725
725
|
/**
|
|
726
726
|
* Parameters for creating a checkout session.
|
|
727
|
-
* @see
|
|
727
|
+
* @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
|
|
728
728
|
*/
|
|
729
729
|
interface CreateCheckoutSessionParams {
|
|
730
730
|
/** Product ID */
|
|
@@ -1123,6 +1123,81 @@ interface VerifyWebhookOptions {
|
|
|
1123
1123
|
*/
|
|
1124
1124
|
publicKeys?: WebhookPublicKeys;
|
|
1125
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
|
+
}
|
|
1126
1201
|
|
|
1127
1202
|
/**
|
|
1128
1203
|
* Internal HTTP client that auto-signs requests.
|
|
@@ -1326,6 +1401,31 @@ declare class CheckoutResource {
|
|
|
1326
1401
|
}>;
|
|
1327
1402
|
}
|
|
1328
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
|
+
|
|
1329
1429
|
/**
|
|
1330
1430
|
* Internal HTTP client for customer-side requests using Bearer token authentication.
|
|
1331
1431
|
*
|
|
@@ -2037,6 +2137,7 @@ declare class WaffoPancake {
|
|
|
2037
2137
|
readonly checkout: CheckoutResource;
|
|
2038
2138
|
readonly graphql: GraphQLResource;
|
|
2039
2139
|
readonly webhooks: WebhooksResource;
|
|
2140
|
+
readonly contentSafety: ContentSafetyResource;
|
|
2040
2141
|
constructor(config: WaffoPancakeConfig);
|
|
2041
2142
|
/**
|
|
2042
2143
|
* Create a customer session for self-service operations.
|
|
@@ -2149,4 +2250,4 @@ declare class WaffoPancakeError extends Error {
|
|
|
2149
2250
|
*/
|
|
2150
2251
|
declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
|
|
2151
2252
|
|
|
2152
|
-
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, 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 };
|