@wix/auto_sdk_stores_subscription-options 1.0.16 → 1.0.18
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/build/cjs/index.d.ts +17 -12
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts → index.typings.d.ts} +176 -1
- package/build/cjs/index.typings.js +767 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +17 -12
- package/build/es/index.mjs.map +1 -1
- package/build/es/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts → index.typings.d.mts} +176 -1
- package/build/es/index.typings.mjs +730 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +17 -12
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts → index.typings.d.ts} +176 -1
- package/build/internal/cjs/index.typings.js +767 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +17 -12
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts → index.typings.d.mts} +176 -1
- package/build/internal/es/index.typings.mjs +730 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface SubscriptionOption {
|
|
2
4
|
/**
|
|
3
5
|
* Subscription option ID (auto-generated upon subscription option creation).
|
|
@@ -356,16 +358,102 @@ interface AllowOneTimePurchasesRequest {
|
|
|
356
358
|
}
|
|
357
359
|
interface AllowOneTimePurchasesResponse {
|
|
358
360
|
}
|
|
361
|
+
type SubscriptionOptionNonNullablePaths = `subscriptionSettings.frequency` | `subscriptionSettings.autoRenewal` | `discount.type` | `discount.value`;
|
|
362
|
+
/**
|
|
363
|
+
* Retrieves a subscription option by ID.
|
|
364
|
+
* @param _id - Subscription option ID.
|
|
365
|
+
* @public
|
|
366
|
+
* @documentationMaturity preview
|
|
367
|
+
* @requiredField _id
|
|
368
|
+
* @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS
|
|
369
|
+
* @applicableIdentity APP
|
|
370
|
+
* @returns Subscription option.
|
|
371
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption
|
|
372
|
+
* @deprecated
|
|
373
|
+
*/
|
|
374
|
+
declare function getSubscriptionOption(_id: string): Promise<NonNullablePaths<SubscriptionOption, SubscriptionOptionNonNullablePaths>>;
|
|
375
|
+
/**
|
|
376
|
+
* Retrieves all subscription options assigned to a specified product.
|
|
377
|
+
* By default, hidden subscription options are not returned. To retrieve all subscription options you must pass `includeHiddenSubscriptionOptions = true`.
|
|
378
|
+
* @param productId - Product ID.
|
|
379
|
+
* @public
|
|
380
|
+
* @documentationMaturity preview
|
|
381
|
+
* @requiredField productId
|
|
382
|
+
* @param options - Options.
|
|
383
|
+
* @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS
|
|
384
|
+
* @applicableIdentity APP
|
|
385
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct
|
|
386
|
+
* @deprecated
|
|
387
|
+
*/
|
|
388
|
+
declare function getSubscriptionOptionsForProduct(productId: string, options?: GetSubscriptionOptionsForProductOptions): Promise<NonNullablePaths<GetSubscriptionOptionsForProductResponse, `subscriptionOptions` | `subscriptionOptions.${number}._id` | `subscriptionOptions.${number}.hidden` | `subscriptionOptions.${number}.subscriptionSettings.frequency` | `subscriptionOptions.${number}.subscriptionSettings.autoRenewal` | `subscriptionOptions.${number}.discount.type` | `subscriptionOptions.${number}.discount.value`>>;
|
|
359
389
|
interface GetSubscriptionOptionsForProductOptions {
|
|
360
390
|
/** Whether to include hidden subscription options in the results. */
|
|
361
391
|
includeHiddenSubscriptionOptions?: boolean;
|
|
362
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Retrieves the IDs of products associated with a specified subscription option.
|
|
395
|
+
* @param _id - Subscription option ID.
|
|
396
|
+
* @public
|
|
397
|
+
* @documentationMaturity preview
|
|
398
|
+
* @requiredField _id
|
|
399
|
+
* @param options - Paging and other options.
|
|
400
|
+
* @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS
|
|
401
|
+
* @applicableIdentity APP
|
|
402
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption
|
|
403
|
+
* @deprecated
|
|
404
|
+
*/
|
|
405
|
+
declare function getProductIdsForSubscriptionOption(_id: string, options?: GetProductIdsForSubscriptionOptionOptions): Promise<NonNullablePaths<GetProductIdsForSubscriptionOptionResponse, `productIds` | `metadata.items` | `metadata.offset` | `totalResults`>>;
|
|
363
406
|
interface GetProductIdsForSubscriptionOptionOptions {
|
|
364
407
|
/** Whether to include hidden products in the returned results. */
|
|
365
408
|
includeHiddenProducts?: boolean;
|
|
366
409
|
/** Optional pagination parameters */
|
|
367
410
|
paging?: Paging;
|
|
368
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Checks whether a specified product (associated with subscription options) is available for one-time purchase.
|
|
414
|
+
* @param productId - Product ID.
|
|
415
|
+
* @public
|
|
416
|
+
* @documentationMaturity preview
|
|
417
|
+
* @requiredField productId
|
|
418
|
+
* @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS
|
|
419
|
+
* @applicableIdentity APP
|
|
420
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus
|
|
421
|
+
* @deprecated
|
|
422
|
+
*/
|
|
423
|
+
declare function getOneTimePurchasesStatus(productId: string): Promise<NonNullablePaths<GetOneTimePurchasesStatusResponse, `allowed`>>;
|
|
424
|
+
/**
|
|
425
|
+
* Creates a subscription option.
|
|
426
|
+
* To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product).
|
|
427
|
+
* Subscription options that are not assigned to a product will not be visible in the Wix business manager.
|
|
428
|
+
* @param subscriptionOption - Subscription option info.
|
|
429
|
+
* @public
|
|
430
|
+
* @documentationMaturity preview
|
|
431
|
+
* @requiredField subscriptionOption
|
|
432
|
+
* @requiredField subscriptionOption.subscriptionSettings
|
|
433
|
+
* @requiredField subscriptionOption.title
|
|
434
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
435
|
+
* @applicableIdentity APP
|
|
436
|
+
* @returns Newly created subscription option.
|
|
437
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.CreateSubscriptionOption
|
|
438
|
+
* @deprecated
|
|
439
|
+
*/
|
|
440
|
+
declare function createSubscriptionOption(subscriptionOption: NonNullablePaths<SubscriptionOption, `subscriptionSettings` | `title`>): Promise<NonNullablePaths<SubscriptionOption, SubscriptionOptionNonNullablePaths>>;
|
|
441
|
+
/**
|
|
442
|
+
* Updates a subscription option.
|
|
443
|
+
* Only parameters passed will be updated.
|
|
444
|
+
* @param _id - Subscription option ID (auto-generated upon subscription option creation).
|
|
445
|
+
* @public
|
|
446
|
+
* @documentationMaturity preview
|
|
447
|
+
* @requiredField _id
|
|
448
|
+
* @requiredField subscriptionOption
|
|
449
|
+
* @param subscriptionOption - Subscription option update options.
|
|
450
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
451
|
+
* @applicableIdentity APP
|
|
452
|
+
* @returns Updated subscription option.
|
|
453
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.UpdateSubscriptionOption
|
|
454
|
+
* @deprecated
|
|
455
|
+
*/
|
|
456
|
+
declare function updateSubscriptionOption(_id: string, subscriptionOption: UpdateSubscriptionOption): Promise<NonNullablePaths<SubscriptionOption, SubscriptionOptionNonNullablePaths>>;
|
|
369
457
|
interface UpdateSubscriptionOption {
|
|
370
458
|
/**
|
|
371
459
|
* Subscription option ID (auto-generated upon subscription option creation).
|
|
@@ -391,6 +479,78 @@ interface UpdateSubscriptionOption {
|
|
|
391
479
|
*/
|
|
392
480
|
discount?: Discount;
|
|
393
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* Deletes a subscription option.
|
|
484
|
+
* @param _id - ID of the subscription option to delete.
|
|
485
|
+
* @public
|
|
486
|
+
* @documentationMaturity preview
|
|
487
|
+
* @requiredField _id
|
|
488
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
489
|
+
* @applicableIdentity APP
|
|
490
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.DeleteSubscriptionOption
|
|
491
|
+
* @deprecated
|
|
492
|
+
*/
|
|
493
|
+
declare function deleteSubscriptionOption(_id: string): Promise<void>;
|
|
494
|
+
/**
|
|
495
|
+
* Creates multiple subscription options (up to 100).
|
|
496
|
+
* To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product).
|
|
497
|
+
* Subscription options that are not assigned to a product will not be visible in the Wix business manager.
|
|
498
|
+
* @param subscriptionOptions - Subscription options info.
|
|
499
|
+
* @public
|
|
500
|
+
* @documentationMaturity preview
|
|
501
|
+
* @requiredField subscriptionOptions
|
|
502
|
+
* @requiredField subscriptionOptions.subscriptionSettings
|
|
503
|
+
* @requiredField subscriptionOptions.title
|
|
504
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
505
|
+
* @applicableIdentity APP
|
|
506
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkCreateSubscriptionOptions
|
|
507
|
+
* @deprecated
|
|
508
|
+
*/
|
|
509
|
+
declare function bulkCreateSubscriptionOptions(subscriptionOptions: NonNullablePaths<SubscriptionOption, `subscriptionSettings` | `title`>[]): Promise<NonNullablePaths<BulkCreateSubscriptionOptionsResponse, {
|
|
510
|
+
[P in SubscriptionOptionNonNullablePaths]: `subscriptionOptions.${number}.${P}`;
|
|
511
|
+
}[SubscriptionOptionNonNullablePaths]>>;
|
|
512
|
+
/**
|
|
513
|
+
* Updates multiple subscription options.
|
|
514
|
+
* Only parameters passed will be updated.
|
|
515
|
+
* @param subscriptionOptions - Subscription options info. Only the passed parameters in each subscription option will be updated.
|
|
516
|
+
* @public
|
|
517
|
+
* @documentationMaturity preview
|
|
518
|
+
* @requiredField subscriptionOptions
|
|
519
|
+
* @requiredField subscriptionOptions._id
|
|
520
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
521
|
+
* @applicableIdentity APP
|
|
522
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkUpdateSubscriptionOptions
|
|
523
|
+
* @deprecated
|
|
524
|
+
*/
|
|
525
|
+
declare function bulkUpdateSubscriptionOptions(subscriptionOptions: NonNullablePaths<SubscriptionOption, `_id`>[]): Promise<NonNullablePaths<BulkUpdateSubscriptionOptionsResponse, {
|
|
526
|
+
[P in SubscriptionOptionNonNullablePaths]: `subscriptionOptions.${number}.${P}`;
|
|
527
|
+
}[SubscriptionOptionNonNullablePaths]>>;
|
|
528
|
+
/**
|
|
529
|
+
* Deletes multiple subscription options.
|
|
530
|
+
* @param ids - IDs of the subscription options to delete.
|
|
531
|
+
* @public
|
|
532
|
+
* @documentationMaturity preview
|
|
533
|
+
* @requiredField ids
|
|
534
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
535
|
+
* @applicableIdentity APP
|
|
536
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkDeleteSubscriptionOptions
|
|
537
|
+
* @deprecated
|
|
538
|
+
*/
|
|
539
|
+
declare function bulkDeleteSubscriptionOptions(ids: string[]): Promise<void>;
|
|
540
|
+
/**
|
|
541
|
+
* Assign up to 6 subscription options to a specified product.
|
|
542
|
+
* Pass an empty array to remove all subscription options assigned to a product.
|
|
543
|
+
* @param productId - Product ID.
|
|
544
|
+
* @public
|
|
545
|
+
* @documentationMaturity preview
|
|
546
|
+
* @requiredField productId
|
|
547
|
+
* @param options - Subscription option assignment options.
|
|
548
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
549
|
+
* @applicableIdentity APP
|
|
550
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AssignSubscriptionOptionsToProduct
|
|
551
|
+
* @deprecated
|
|
552
|
+
*/
|
|
553
|
+
declare function assignSubscriptionOptionsToProduct(productId: string, options?: AssignSubscriptionOptionsToProductOptions): Promise<void>;
|
|
394
554
|
interface AssignSubscriptionOptionsToProductOptions {
|
|
395
555
|
/**
|
|
396
556
|
* Ordered array of subscription options that will be assigned to the product. Pass an empty array to remove all subscription options from the product.
|
|
@@ -398,5 +558,20 @@ interface AssignSubscriptionOptionsToProductOptions {
|
|
|
398
558
|
*/
|
|
399
559
|
assignedSubscriptionOptions?: SubscriptionOptionInProduct[];
|
|
400
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Allow for one-time purchase of a product.
|
|
563
|
+
* By default, product can be sold only as part of a subscription, not as a one-time purchase.
|
|
564
|
+
* @param productId - Product ID.
|
|
565
|
+
* @param allowed - Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only.
|
|
566
|
+
* @public
|
|
567
|
+
* @documentationMaturity preview
|
|
568
|
+
* @requiredField allowed
|
|
569
|
+
* @requiredField productId
|
|
570
|
+
* @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS
|
|
571
|
+
* @applicableIdentity APP
|
|
572
|
+
* @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AllowOneTimePurchases
|
|
573
|
+
* @deprecated
|
|
574
|
+
*/
|
|
575
|
+
declare function allowOneTimePurchases(productId: string, allowed: boolean): Promise<void>;
|
|
401
576
|
|
|
402
|
-
export { type
|
|
577
|
+
export { type AllowOneTimePurchasesRequest, type AllowOneTimePurchasesResponse, type AssignSubscriptionOptionsToProductOptions, type AssignSubscriptionOptionsToProductRequest, type AssignSubscriptionOptionsToProductResponse, type BulkCalculatePricesRequest, type BulkCalculatePricesRequestItem, type BulkCalculatePricesRequestV2, type BulkCalculatePricesResponse, type BulkCalculatePricesResponseItem, type BulkCalculatePricesResponseV2, type BulkCreateSubscriptionOptionsRequest, type BulkCreateSubscriptionOptionsResponse, type BulkDeleteSubscriptionOptionsRequest, type BulkDeleteSubscriptionOptionsResponse, type BulkUpdateSubscriptionOptionsRequest, type BulkUpdateSubscriptionOptionsResponse, type CalculatePricesRequest, type CalculatePricesResponse, type CreateSubscriptionOptionRequest, type CreateSubscriptionOptionResponse, type DeleteSubscriptionOptionRequest, type DeleteSubscriptionOptionResponse, type Discount, DiscountType, type DiscountTypeWithLiterals, type GetOneTimePurchasesStatusRequest, type GetOneTimePurchasesStatusResponse, type GetProductIdsForSubscriptionOptionOptions, type GetProductIdsForSubscriptionOptionRequest, type GetProductIdsForSubscriptionOptionResponse, type GetSubscriptionOptionRequest, type GetSubscriptionOptionResponse, type GetSubscriptionOptionsForProductOptions, type GetSubscriptionOptionsForProductRequest, type GetSubscriptionOptionsForProductResponse, type ListSubscriptionOptionsRequest, type ListSubscriptionOptionsResponse, type Paging, type PagingMetadata, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOption, type SubscriptionOptionInProduct, type SubscriptionOptionPriceData, type SubscriptionOptionPrices, type SubscriptionSettings, type UpdateSubscriptionOption, type UpdateSubscriptionOptionRequest, type UpdateSubscriptionOptionResponse, allowOneTimePurchases, assignSubscriptionOptionsToProduct, bulkCreateSubscriptionOptions, bulkDeleteSubscriptionOptions, bulkUpdateSubscriptionOptions, createSubscriptionOption, deleteSubscriptionOption, getOneTimePurchasesStatus, getProductIdsForSubscriptionOption, getSubscriptionOption, getSubscriptionOptionsForProduct, updateSubscriptionOption };
|