@shoplygg/node 0.10.0 → 0.11.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/generated/api.d.ts +72 -3
- package/generated/operations.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/generated/api.d.ts
CHANGED
|
@@ -294,6 +294,8 @@ export type StoreEmailSettingsResult = {
|
|
|
294
294
|
emailCustomPaidEnabled: boolean;
|
|
295
295
|
emailTicketsEnabled: boolean;
|
|
296
296
|
emailResellersEnabled: boolean;
|
|
297
|
+
emailPaymentSetupEnabled: boolean;
|
|
298
|
+
emailDiscordSetupEnabled: boolean;
|
|
297
299
|
emailDisputeOpenedEnabled: boolean;
|
|
298
300
|
emailDisputeClosedEnabled: boolean;
|
|
299
301
|
testEmailEvery: {
|
|
@@ -2447,6 +2449,8 @@ export type ProductsListItem = {
|
|
|
2447
2449
|
deliveryInstructions: string;
|
|
2448
2450
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2449
2451
|
paymentFees: unknown[] | Record<string, unknown>;
|
|
2452
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2453
|
+
discordLinking: string;
|
|
2450
2454
|
showViewers: boolean;
|
|
2451
2455
|
showSales: boolean;
|
|
2452
2456
|
salesWindow: string;
|
|
@@ -2482,6 +2486,8 @@ export type ProductsListItem = {
|
|
|
2482
2486
|
customFields: unknown[] | Record<string, unknown>;
|
|
2483
2487
|
sort: number;
|
|
2484
2488
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2489
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2490
|
+
discordLinking: string;
|
|
2485
2491
|
}>;
|
|
2486
2492
|
runningSubscriptions: number;
|
|
2487
2493
|
};
|
|
@@ -2563,6 +2569,10 @@ export interface ProductsCreateParams {
|
|
|
2563
2569
|
}>;
|
|
2564
2570
|
/** Payment methods this variant cannot be bought with, by their names in the payment methods list. */
|
|
2565
2571
|
blockedPaymentMethods?: string[];
|
|
2572
|
+
/** Discord roles this variant gives on top of the product's, each as `server ID:role ID` (the server's ID as Settings, Discord Roles answers it on the dashboard, then the role's Discord ID), up to 10. A role a server does not have is dropped. Left out, they stay as they are. */
|
|
2573
|
+
discordRoles?: string[];
|
|
2574
|
+
/** Whether its buyer must link their Discord at checkout: `product` follows the product, `required` holds Pay until they link, `optional` lets them skip it. Left out, it stays as it is. */
|
|
2575
|
+
discordLinking?: "product" | "required" | "optional";
|
|
2566
2576
|
/** Its place among the product's variants. Left out, its place in the list sent. */
|
|
2567
2577
|
sort?: number;
|
|
2568
2578
|
}>;
|
|
@@ -2600,6 +2610,10 @@ export interface ProductsCreateParams {
|
|
|
2600
2610
|
}>;
|
|
2601
2611
|
/** Payment methods the product cannot be bought with, by their names in the payment methods list. Left out on an update, they stay as they are. */
|
|
2602
2612
|
blockedPaymentMethods?: string[];
|
|
2613
|
+
/** Discord roles every variant of the product gives, each as `server ID:role ID`. A product and its variants give up to 25 in all. Left out on an update, they stay as they are. */
|
|
2614
|
+
discordRoles?: string[];
|
|
2615
|
+
/** Whether its buyers must link their Discord at checkout: `store` follows the store's setting, `required` holds Pay until they link, `optional` lets them skip it. Left out on an update, it stays as it is. */
|
|
2616
|
+
discordLinking?: "store" | "required" | "optional";
|
|
2603
2617
|
/** What a payment method adds to this product's price: a payment method's name, and under it `percent` and `fixed`. A fee can only add. Left out on an update, the fees stay as they are. */
|
|
2604
2618
|
paymentFees?: Record<string, unknown>;
|
|
2605
2619
|
/**
|
|
@@ -2643,6 +2657,8 @@ export type ProductsCreateResult = {
|
|
|
2643
2657
|
deliveryInstructions: string;
|
|
2644
2658
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2645
2659
|
paymentFees: unknown[] | Record<string, unknown>;
|
|
2660
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2661
|
+
discordLinking: string;
|
|
2646
2662
|
showViewers: boolean;
|
|
2647
2663
|
showSales: boolean;
|
|
2648
2664
|
salesWindow: string;
|
|
@@ -2678,6 +2694,8 @@ export type ProductsCreateResult = {
|
|
|
2678
2694
|
customFields: unknown[] | Record<string, unknown>;
|
|
2679
2695
|
sort: number;
|
|
2680
2696
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2697
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2698
|
+
discordLinking: string;
|
|
2681
2699
|
}>;
|
|
2682
2700
|
runningSubscriptions: number;
|
|
2683
2701
|
};
|
|
@@ -2709,6 +2727,8 @@ export type ProductsShowResult = {
|
|
|
2709
2727
|
deliveryInstructions: string;
|
|
2710
2728
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2711
2729
|
paymentFees: unknown[] | Record<string, unknown>;
|
|
2730
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2731
|
+
discordLinking: string;
|
|
2712
2732
|
showViewers: boolean;
|
|
2713
2733
|
showSales: boolean;
|
|
2714
2734
|
salesWindow: string;
|
|
@@ -2744,6 +2764,8 @@ export type ProductsShowResult = {
|
|
|
2744
2764
|
customFields: unknown[] | Record<string, unknown>;
|
|
2745
2765
|
sort: number;
|
|
2746
2766
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2767
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2768
|
+
discordLinking: string;
|
|
2747
2769
|
}>;
|
|
2748
2770
|
runningSubscriptions: number;
|
|
2749
2771
|
};
|
|
@@ -2825,6 +2847,10 @@ export interface ProductsUpdateParams {
|
|
|
2825
2847
|
}>;
|
|
2826
2848
|
/** Payment methods this variant cannot be bought with, by their names in the payment methods list. */
|
|
2827
2849
|
blockedPaymentMethods?: string[];
|
|
2850
|
+
/** Discord roles this variant gives on top of the product's, each as `server ID:role ID` (the server's ID as Settings, Discord Roles answers it on the dashboard, then the role's Discord ID), up to 10. A role a server does not have is dropped. Left out, they stay as they are. */
|
|
2851
|
+
discordRoles?: string[];
|
|
2852
|
+
/** Whether its buyer must link their Discord at checkout: `product` follows the product, `required` holds Pay until they link, `optional` lets them skip it. Left out, it stays as it is. */
|
|
2853
|
+
discordLinking?: "product" | "required" | "optional";
|
|
2828
2854
|
/** Its place among the product's variants. Left out, its place in the list sent. */
|
|
2829
2855
|
sort?: number;
|
|
2830
2856
|
}>;
|
|
@@ -2862,6 +2888,10 @@ export interface ProductsUpdateParams {
|
|
|
2862
2888
|
}>;
|
|
2863
2889
|
/** Payment methods the product cannot be bought with, by their names in the payment methods list. Left out on an update, they stay as they are. */
|
|
2864
2890
|
blockedPaymentMethods?: string[];
|
|
2891
|
+
/** Discord roles every variant of the product gives, each as `server ID:role ID`. A product and its variants give up to 25 in all. Left out on an update, they stay as they are. */
|
|
2892
|
+
discordRoles?: string[];
|
|
2893
|
+
/** Whether its buyers must link their Discord at checkout: `store` follows the store's setting, `required` holds Pay until they link, `optional` lets them skip it. Left out on an update, it stays as it is. */
|
|
2894
|
+
discordLinking?: "store" | "required" | "optional";
|
|
2865
2895
|
/** What a payment method adds to this product's price: a payment method's name, and under it `percent` and `fixed`. A fee can only add. Left out on an update, the fees stay as they are. */
|
|
2866
2896
|
paymentFees?: Record<string, unknown>;
|
|
2867
2897
|
/**
|
|
@@ -2907,6 +2937,8 @@ export type ProductsUpdateResult = {
|
|
|
2907
2937
|
deliveryInstructions: string;
|
|
2908
2938
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2909
2939
|
paymentFees: unknown[] | Record<string, unknown>;
|
|
2940
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2941
|
+
discordLinking: string;
|
|
2910
2942
|
showViewers: boolean;
|
|
2911
2943
|
showSales: boolean;
|
|
2912
2944
|
salesWindow: string;
|
|
@@ -2942,6 +2974,8 @@ export type ProductsUpdateResult = {
|
|
|
2942
2974
|
customFields: unknown[] | Record<string, unknown>;
|
|
2943
2975
|
sort: number;
|
|
2944
2976
|
blockedPaymentMethods: unknown[] | Record<string, unknown>;
|
|
2977
|
+
discordRoles: unknown[] | Record<string, unknown>;
|
|
2978
|
+
discordLinking: string;
|
|
2945
2979
|
}>;
|
|
2946
2980
|
runningSubscriptions: number;
|
|
2947
2981
|
};
|
|
@@ -2984,6 +3018,10 @@ export interface ProductsBulkUpdateParams {
|
|
|
2984
3018
|
paymentMethods?: Record<string, unknown>;
|
|
2985
3019
|
/** Instructions for every variant of all of them, up to 5,000 characters, in place of what each has. Empty takes them off. A variant's own instructions are not touched. */
|
|
2986
3020
|
deliveryInstructions?: string;
|
|
3021
|
+
/** A Discord role as `server ID:role ID`, and `give` or `stop`. `give` adds it to what every variant of each product gives. `stop` takes it off the product and off every variant of it. */
|
|
3022
|
+
discordRoles?: Record<string, unknown>;
|
|
3023
|
+
/** Whether buyers of all of them must link their Discord at checkout, for the whole product. */
|
|
3024
|
+
discordLinking?: "store" | "required" | "optional";
|
|
2987
3025
|
}
|
|
2988
3026
|
|
|
2989
3027
|
/** What change many products answers: `products.bulkUpdate`. */
|
|
@@ -4326,6 +4364,7 @@ export type OrdersShowResult = {
|
|
|
4326
4364
|
payments: unknown[] | Record<string, unknown>;
|
|
4327
4365
|
invoice: unknown;
|
|
4328
4366
|
disputes: unknown[] | Record<string, unknown>;
|
|
4367
|
+
discord: unknown;
|
|
4329
4368
|
review: unknown;
|
|
4330
4369
|
requests: unknown[] | Record<string, unknown>;
|
|
4331
4370
|
customPayment: unknown;
|
|
@@ -7731,7 +7770,7 @@ export interface ResellerProductsBadgesParams {
|
|
|
7731
7770
|
|
|
7732
7771
|
/** What set a product's status and labels on the panel answers: `resellerProducts.badges`. */
|
|
7733
7772
|
export type ResellerProductsBadgesResult = {
|
|
7734
|
-
"
|
|
7773
|
+
"17a715fc-872e-4907-b0ec-f6c1ca743380": {
|
|
7735
7774
|
label: string;
|
|
7736
7775
|
color: string;
|
|
7737
7776
|
kind: string;
|
|
@@ -9272,6 +9311,8 @@ export type DisputesSettingsResult = {
|
|
|
9272
9311
|
emailOpened: boolean;
|
|
9273
9312
|
emailClosed: boolean;
|
|
9274
9313
|
discord: boolean;
|
|
9314
|
+
discordRoles: string;
|
|
9315
|
+
discordRolesBack: boolean;
|
|
9275
9316
|
currency: string;
|
|
9276
9317
|
};
|
|
9277
9318
|
|
|
@@ -9297,6 +9338,10 @@ export interface DisputesUpdateSettingsParams {
|
|
|
9297
9338
|
emailClosed?: boolean;
|
|
9298
9339
|
/** Post both to the store's Discord. Needs a webhook in its notification settings. */
|
|
9299
9340
|
discord?: boolean;
|
|
9341
|
+
/** What an opened dispute does to a buyer who linked their Discord to the order: `keep` their roles, `take` them, `kick` (take them and remove the buyer from the server), or `ban` them from it. */
|
|
9342
|
+
discordRoles?: "keep" | "take" | "kick" | "ban";
|
|
9343
|
+
/** Whether a dispute closed in the store's favour gives the roles back, adds a kicked buyer again and lifts a ban. */
|
|
9344
|
+
discordRolesBack?: boolean;
|
|
9300
9345
|
}
|
|
9301
9346
|
|
|
9302
9347
|
/** What change dispute settings answers: `disputes.updateSettings`. */
|
|
@@ -9311,6 +9356,8 @@ export type DisputesUpdateSettingsResult = {
|
|
|
9311
9356
|
emailOpened: boolean;
|
|
9312
9357
|
emailClosed: boolean;
|
|
9313
9358
|
discord: boolean;
|
|
9359
|
+
discordRoles: string;
|
|
9360
|
+
discordRolesBack: boolean;
|
|
9314
9361
|
currency: string;
|
|
9315
9362
|
};
|
|
9316
9363
|
|
|
@@ -11542,6 +11589,7 @@ export type CustomerOrdersShowResult = {
|
|
|
11542
11589
|
};
|
|
11543
11590
|
}>;
|
|
11544
11591
|
general: string;
|
|
11592
|
+
discord: unknown;
|
|
11545
11593
|
};
|
|
11546
11594
|
|
|
11547
11595
|
/** What sign out answers: `customer.logout`. */
|
|
@@ -16457,6 +16505,9 @@ export type WebhookEventName =
|
|
|
16457
16505
|
| "order.chargeback"
|
|
16458
16506
|
| "order.payment_submitted"
|
|
16459
16507
|
| "order.rerouted"
|
|
16508
|
+
| "order.discord_linked"
|
|
16509
|
+
| "order.discord_roles_given"
|
|
16510
|
+
| "order.discord_roles_taken"
|
|
16460
16511
|
| "review.created"
|
|
16461
16512
|
| "review.removed"
|
|
16462
16513
|
| "review.flag_declined"
|
|
@@ -16593,6 +16644,24 @@ export interface WebhookEventData {
|
|
|
16593
16644
|
* `data`: The order, as [Get an order](https://docs.shoply.gg/api-reference/orders/get-an-order) answers it, with `payments`, every payment opened for it, and `invoice` where the store raised it as one.
|
|
16594
16645
|
*/
|
|
16595
16646
|
"order.rerouted": OrdersShowResult & Record<string, unknown>;
|
|
16647
|
+
/**
|
|
16648
|
+
* The buyer linked their Discord to an order, at checkout or after paying.
|
|
16649
|
+
*
|
|
16650
|
+
* `data`: The order, as [Get an order](https://docs.shoply.gg/api-reference/orders/get-an-order) answers it, with `payments`, every payment opened for it, and `invoice` where the store raised it as one.
|
|
16651
|
+
*/
|
|
16652
|
+
"order.discord_linked": OrdersShowResult & Record<string, unknown>;
|
|
16653
|
+
/**
|
|
16654
|
+
* The roles an order gives were given to its buyer in one of the store's Discord servers, adding them to the server where they were not in it.
|
|
16655
|
+
*
|
|
16656
|
+
* `data`: The order, as [Get an order](https://docs.shoply.gg/api-reference/orders/get-an-order) answers it, with `payments`, every payment opened for it, and `invoice` where the store raised it as one.
|
|
16657
|
+
*/
|
|
16658
|
+
"order.discord_roles_given": OrdersShowResult & Record<string, unknown>;
|
|
16659
|
+
/**
|
|
16660
|
+
* The roles an order gave were taken back in one of the store's Discord servers: a refund, a chargeback, a dispute, a subscription that ended, or the store by hand.
|
|
16661
|
+
*
|
|
16662
|
+
* `data`: The order, as [Get an order](https://docs.shoply.gg/api-reference/orders/get-an-order) answers it, with `payments`, every payment opened for it, and `invoice` where the store raised it as one.
|
|
16663
|
+
*/
|
|
16664
|
+
"order.discord_roles_taken": OrdersShowResult & Record<string, unknown>;
|
|
16596
16665
|
/**
|
|
16597
16666
|
* A review was left on an order, by its buyer or by itself after seven days.
|
|
16598
16667
|
*
|
|
@@ -16726,13 +16795,13 @@ export interface WebhookEventData {
|
|
|
16726
16795
|
*/
|
|
16727
16796
|
"subscription.ended": SubscriptionsShowResult & Record<string, unknown>;
|
|
16728
16797
|
/**
|
|
16729
|
-
* A subscription was paused
|
|
16798
|
+
* A subscription was paused: by its buyer or the store, or by Shoply while the store is offline. Nothing renews until it resumes. Where the store takes access back, a pause of the buyer's or the store's takes it.
|
|
16730
16799
|
*
|
|
16731
16800
|
* `data`: The subscription, as [Get a subscription](https://docs.shoply.gg/api-reference/subscriptions/get-a-subscription) answers it.
|
|
16732
16801
|
*/
|
|
16733
16802
|
"subscription.paused": SubscriptionsShowResult & Record<string, unknown>;
|
|
16734
16803
|
/**
|
|
16735
|
-
* A paused subscription is running again
|
|
16804
|
+
* A paused subscription is running again: by itself on its day, when asked, or when its store is back online. Access is given back.
|
|
16736
16805
|
*
|
|
16737
16806
|
* `data`: The subscription, as [Get a subscription](https://docs.shoply.gg/api-reference/subscriptions/get-a-subscription) answers it.
|
|
16738
16807
|
*/
|
package/generated/operations.js
CHANGED
|
@@ -387,4 +387,4 @@ export const OPERATIONS = [
|
|
|
387
387
|
];
|
|
388
388
|
|
|
389
389
|
/** Every webhook event, by name. */
|
|
390
|
-
export const EVENTS = ["order.created","order.payment_started","order.paid","order.delivered","order.redelivered","order.email_failed","order.cancelled","order.refunded","order.disputed","order.chargeback","order.payment_submitted","order.rerouted","review.created","review.removed","review.flag_declined","review.replied","review.reply_removed","stock.low","stock.out","product.created","product.updated","product.deleted","customer.created","customer.balance_changed","customer.tagged","customer.untagged","affiliate.created","affiliate.payout_requested","affiliate.payout_answered","affiliate.balance_changed","subscription.started","subscription.renewed","subscription.cancelled","subscription.ended","subscription.paused","subscription.resumed","subscription.charge_failed","cart.email_sent","cart.recovered","cart.unsubscribed","winback.email_sent","winback.won_back","subscriber.subscribed","subscriber.unsubscribed","routing.processor_paused","routing.processor_resumed","dispute.opened","dispute.updated","dispute.won","dispute.lost","dispute.closed","app.connected","app.disconnected","ticket.opened","ticket.message","ticket.resolved","ticket.reopened","team.created","team.updated","team.deleted","team.member_joined","team.member_moved","team.member_left","reseller.joined","reseller.updated","reseller.removed","reseller.balance_changed","reseller.top_up_paid","reseller.top_up_submitted","reseller.order_completed","fraud.checkout_blocked","fraud.checkout_allowed","webhook.test"];
|
|
390
|
+
export const EVENTS = ["order.created","order.payment_started","order.paid","order.delivered","order.redelivered","order.email_failed","order.cancelled","order.refunded","order.disputed","order.chargeback","order.payment_submitted","order.rerouted","order.discord_linked","order.discord_roles_given","order.discord_roles_taken","review.created","review.removed","review.flag_declined","review.replied","review.reply_removed","stock.low","stock.out","product.created","product.updated","product.deleted","customer.created","customer.balance_changed","customer.tagged","customer.untagged","affiliate.created","affiliate.payout_requested","affiliate.payout_answered","affiliate.balance_changed","subscription.started","subscription.renewed","subscription.cancelled","subscription.ended","subscription.paused","subscription.resumed","subscription.charge_failed","cart.email_sent","cart.recovered","cart.unsubscribed","winback.email_sent","winback.won_back","subscriber.subscribed","subscriber.unsubscribed","routing.processor_paused","routing.processor_resumed","dispute.opened","dispute.updated","dispute.won","dispute.lost","dispute.closed","app.connected","app.disconnected","ticket.opened","ticket.message","ticket.resolved","ticket.reopened","team.created","team.updated","team.deleted","team.member_joined","team.member_moved","team.member_left","reseller.joined","reseller.updated","reseller.removed","reseller.balance_changed","reseller.top_up_paid","reseller.top_up_submitted","reseller.order_completed","fraud.checkout_blocked","fraud.checkout_allowed","webhook.test"];
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplygg/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Shoply's API from your own server: every route as a typed method, safe retries, pages, checking webhooks, and OAuth for apps.",
|
|
5
5
|
"keywords": ["shoply", "api", "sdk", "ecommerce", "webhooks", "digital-goods"],
|
|
6
6
|
"homepage": "https://docs.shoply.gg/api-reference/node",
|