@betterstore/sdk 0.3.88 → 0.3.90

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.90
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
9
+ ## 0.3.89
10
+
11
+ ### Patch Changes
12
+
13
+ - bug fixes
14
+
3
15
  ## 0.3.88
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -162,10 +162,9 @@ type ListProductsQuery = {
162
162
  seoHandle: string;
163
163
  };
164
164
  type ListProductsSortBy = "createdAt" | "updatedAt" | "title" | "stockAvailable";
165
- type SortOrder = "asc" | "desc";
166
165
  type ListProductsParams = {
167
166
  sortBy?: ListProductsSortBy;
168
- sortOrder?: SortOrder;
167
+ sortOrder?: "asc" | "desc";
169
168
  query?: ListProductsQuery;
170
169
  };
171
170
  type RetrieveProductParams = {
@@ -190,8 +189,8 @@ type ListCollectionsQuery = undefined;
190
189
  type ListCollectionsSortBy = "createdAt" | "updatedAt" | "title";
191
190
  type ListCollectionsParams = {
192
191
  sortBy?: ListCollectionsSortBy;
193
- sortOrder?: SortOrder;
194
- query?: string;
192
+ sortOrder?: "asc" | "desc";
193
+ query?: ListCollectionsQuery;
195
194
  };
196
195
  type RetrieveCollectionParams = {
197
196
  seoHandle: string;
@@ -264,6 +263,18 @@ interface Discount {
264
263
  status: "ACTIVE" | "EXPIRED" | "SCHEDULED";
265
264
  organizationId: string;
266
265
  }
266
+ type ListDiscountsQuery = {
267
+ type?: Discount["type"];
268
+ valueType?: Discount["valueType"];
269
+ method?: Discount["method"];
270
+ status?: Discount["status"];
271
+ };
272
+ type ListDiscountsSortBy = "createdAt" | "updatedAt";
273
+ type ListDiscountsParams = {
274
+ sortBy?: ListDiscountsSortBy;
275
+ sortOrder?: "asc" | "desc";
276
+ query?: ListDiscountsQuery;
277
+ };
267
278
  type RetrieveDiscountParams = {
268
279
  id: string;
269
280
  } | {
@@ -465,7 +476,7 @@ declare class Customer {
465
476
  declare class Discounts {
466
477
  private apiClient;
467
478
  constructor(apiKey: string, proxy?: string);
468
- list(): Promise<Discount[]>;
479
+ list(params?: ListDiscountsParams): Promise<Discount[]>;
469
480
  retrieve(params: RetrieveDiscountParams): Promise<Discount | null>;
470
481
  }
471
482
 
@@ -502,4 +513,4 @@ declare function createStoreHelpers(config?: {
502
513
  proxy?: string;
503
514
  }): Helpers;
504
515
 
505
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
516
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListDiscountsParams, type ListDiscountsQuery, type ListDiscountsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.d.ts CHANGED
@@ -162,10 +162,9 @@ type ListProductsQuery = {
162
162
  seoHandle: string;
163
163
  };
164
164
  type ListProductsSortBy = "createdAt" | "updatedAt" | "title" | "stockAvailable";
165
- type SortOrder = "asc" | "desc";
166
165
  type ListProductsParams = {
167
166
  sortBy?: ListProductsSortBy;
168
- sortOrder?: SortOrder;
167
+ sortOrder?: "asc" | "desc";
169
168
  query?: ListProductsQuery;
170
169
  };
171
170
  type RetrieveProductParams = {
@@ -190,8 +189,8 @@ type ListCollectionsQuery = undefined;
190
189
  type ListCollectionsSortBy = "createdAt" | "updatedAt" | "title";
191
190
  type ListCollectionsParams = {
192
191
  sortBy?: ListCollectionsSortBy;
193
- sortOrder?: SortOrder;
194
- query?: string;
192
+ sortOrder?: "asc" | "desc";
193
+ query?: ListCollectionsQuery;
195
194
  };
196
195
  type RetrieveCollectionParams = {
197
196
  seoHandle: string;
@@ -264,6 +263,18 @@ interface Discount {
264
263
  status: "ACTIVE" | "EXPIRED" | "SCHEDULED";
265
264
  organizationId: string;
266
265
  }
266
+ type ListDiscountsQuery = {
267
+ type?: Discount["type"];
268
+ valueType?: Discount["valueType"];
269
+ method?: Discount["method"];
270
+ status?: Discount["status"];
271
+ };
272
+ type ListDiscountsSortBy = "createdAt" | "updatedAt";
273
+ type ListDiscountsParams = {
274
+ sortBy?: ListDiscountsSortBy;
275
+ sortOrder?: "asc" | "desc";
276
+ query?: ListDiscountsQuery;
277
+ };
267
278
  type RetrieveDiscountParams = {
268
279
  id: string;
269
280
  } | {
@@ -465,7 +476,7 @@ declare class Customer {
465
476
  declare class Discounts {
466
477
  private apiClient;
467
478
  constructor(apiKey: string, proxy?: string);
468
- list(): Promise<Discount[]>;
479
+ list(params?: ListDiscountsParams): Promise<Discount[]>;
469
480
  retrieve(params: RetrieveDiscountParams): Promise<Discount | null>;
470
481
  }
471
482
 
@@ -502,4 +513,4 @@ declare function createStoreHelpers(config?: {
502
513
  proxy?: string;
503
514
  }): Helpers;
504
515
 
505
- export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type SortOrder, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
516
+ export { type Address, type CheckoutCreateParams, type CheckoutSession, type CheckoutUpdateParams, type Collection, type CollectionWithProducts, type Currency, type Customer$1 as Customer, type CustomerCreateParams, type CustomerSession, type CustomerSubscription, type CustomerSubscriptionUpdateParams, type CustomerUpdateParams, type Discount, type LineItem, type LineItemCreate, type ListCollectionsParams, type ListCollectionsQuery, type ListCollectionsSortBy, type ListDiscountsParams, type ListDiscountsQuery, type ListDiscountsSortBy, type ListProductsParams, type ListProductsQuery, type ListProductsSortBy, type OTPLoginParams, type OTPLoginResponse, type OTPSignupParams, type OTPSignupResponse, type OTPVerifyParams, type OTPVerifyResponse, type Product, type ProductBillingInterval, type ProductBillingType, type ProductOption, type ProductStatus, type ProductVariant, type ProductWithoutVariants, type RetrieveCollectionParams, type RetrieveDiscountParams, type RetrieveProductParams, type ShippingRate, type VariantOption, createStoreClient, createStoreHelpers, createBetterStore as default };
package/dist/index.js CHANGED
@@ -500,9 +500,15 @@ var Discounts = class {
500
500
  constructor(apiKey, proxy) {
501
501
  this.apiClient = createApiClient(apiKey, proxy);
502
502
  }
503
- list() {
503
+ list(params) {
504
504
  return __async(this, null, function* () {
505
- const data = yield this.apiClient.get("/discounts");
505
+ const queryParams = new URLSearchParams();
506
+ if (params) {
507
+ queryParams.set("params", JSON.stringify(params));
508
+ }
509
+ const data = yield this.apiClient.get(
510
+ `/discounts?${queryParams.toString()}`
511
+ );
506
512
  return data;
507
513
  });
508
514
  }
package/dist/index.mjs CHANGED
@@ -463,9 +463,15 @@ var Discounts = class {
463
463
  constructor(apiKey, proxy) {
464
464
  this.apiClient = createApiClient(apiKey, proxy);
465
465
  }
466
- list() {
466
+ list(params) {
467
467
  return __async(this, null, function* () {
468
- const data = yield this.apiClient.get("/discounts");
468
+ const queryParams = new URLSearchParams();
469
+ if (params) {
470
+ queryParams.set("params", JSON.stringify(params));
471
+ }
472
+ const data = yield this.apiClient.get(
473
+ `/discounts?${queryParams.toString()}`
474
+ );
469
475
  return data;
470
476
  });
471
477
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.88",
3
+ "version": "0.3.90",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {