omni-sync-sdk 0.7.5 → 0.7.7

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/dist/index.d.mts CHANGED
@@ -2163,7 +2163,7 @@ declare class OmniSyncClient {
2163
2163
  }): Promise<CustomerProfile>;
2164
2164
  /**
2165
2165
  * Get the current customer's orders (requires customerToken)
2166
- * Only available in storefront mode
2166
+ * Works in vibe-coded and storefront modes
2167
2167
  */
2168
2168
  getMyOrders(params?: {
2169
2169
  page?: number;
package/dist/index.d.ts CHANGED
@@ -2163,7 +2163,7 @@ declare class OmniSyncClient {
2163
2163
  }): Promise<CustomerProfile>;
2164
2164
  /**
2165
2165
  * Get the current customer's orders (requires customerToken)
2166
- * Only available in storefront mode
2166
+ * Works in vibe-coded and storefront modes
2167
2167
  */
2168
2168
  getMyOrders(params?: {
2169
2169
  page?: number;
package/dist/index.js CHANGED
@@ -190,6 +190,9 @@ var OmniSyncClient = class {
190
190
  "X-SDK-Version": "0.3.0",
191
191
  "ngrok-skip-browser-warning": "true"
192
192
  };
193
+ if (this.customerToken) {
194
+ headers["Authorization"] = `Bearer ${this.customerToken}`;
195
+ }
193
196
  const response = await fetch(url.toString(), {
194
197
  method,
195
198
  headers,
@@ -2012,24 +2015,33 @@ var OmniSyncClient = class {
2012
2015
  }
2013
2016
  /**
2014
2017
  * Get the current customer's orders (requires customerToken)
2015
- * Only available in storefront mode
2018
+ * Works in vibe-coded and storefront modes
2016
2019
  */
2017
2020
  async getMyOrders(params) {
2018
- if (!this.storeId) {
2019
- throw new OmniSyncError("getMyOrders is only available in storefront mode", 400);
2020
- }
2021
2021
  if (!this.customerToken) {
2022
2022
  throw new OmniSyncError("Customer token required. Call setCustomerToken() after login.", 401);
2023
2023
  }
2024
- return this.storefrontRequest(
2025
- "GET",
2026
- "/customers/me/orders",
2027
- void 0,
2028
- {
2029
- page: params?.page,
2030
- limit: params?.limit
2031
- }
2032
- );
2024
+ const queryParams = {
2025
+ page: params?.page,
2026
+ limit: params?.limit
2027
+ };
2028
+ if (this.isVibeCodedMode()) {
2029
+ return this.vibeCodedRequest(
2030
+ "GET",
2031
+ "/customers/me/orders",
2032
+ void 0,
2033
+ queryParams
2034
+ );
2035
+ }
2036
+ if (this.storeId && !this.apiKey) {
2037
+ return this.storefrontRequest(
2038
+ "GET",
2039
+ "/customers/me/orders",
2040
+ void 0,
2041
+ queryParams
2042
+ );
2043
+ }
2044
+ throw new OmniSyncError("getMyOrders is only available in vibe-coded or storefront mode", 400);
2033
2045
  }
2034
2046
  /**
2035
2047
  * Get the current customer's addresses (requires customerToken)
package/dist/index.mjs CHANGED
@@ -165,6 +165,9 @@ var OmniSyncClient = class {
165
165
  "X-SDK-Version": "0.3.0",
166
166
  "ngrok-skip-browser-warning": "true"
167
167
  };
168
+ if (this.customerToken) {
169
+ headers["Authorization"] = `Bearer ${this.customerToken}`;
170
+ }
168
171
  const response = await fetch(url.toString(), {
169
172
  method,
170
173
  headers,
@@ -1987,24 +1990,33 @@ var OmniSyncClient = class {
1987
1990
  }
1988
1991
  /**
1989
1992
  * Get the current customer's orders (requires customerToken)
1990
- * Only available in storefront mode
1993
+ * Works in vibe-coded and storefront modes
1991
1994
  */
1992
1995
  async getMyOrders(params) {
1993
- if (!this.storeId) {
1994
- throw new OmniSyncError("getMyOrders is only available in storefront mode", 400);
1995
- }
1996
1996
  if (!this.customerToken) {
1997
1997
  throw new OmniSyncError("Customer token required. Call setCustomerToken() after login.", 401);
1998
1998
  }
1999
- return this.storefrontRequest(
2000
- "GET",
2001
- "/customers/me/orders",
2002
- void 0,
2003
- {
2004
- page: params?.page,
2005
- limit: params?.limit
2006
- }
2007
- );
1999
+ const queryParams = {
2000
+ page: params?.page,
2001
+ limit: params?.limit
2002
+ };
2003
+ if (this.isVibeCodedMode()) {
2004
+ return this.vibeCodedRequest(
2005
+ "GET",
2006
+ "/customers/me/orders",
2007
+ void 0,
2008
+ queryParams
2009
+ );
2010
+ }
2011
+ if (this.storeId && !this.apiKey) {
2012
+ return this.storefrontRequest(
2013
+ "GET",
2014
+ "/customers/me/orders",
2015
+ void 0,
2016
+ queryParams
2017
+ );
2018
+ }
2019
+ throw new OmniSyncError("getMyOrders is only available in vibe-coded or storefront mode", 400);
2008
2020
  }
2009
2021
  /**
2010
2022
  * Get the current customer's addresses (requires customerToken)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-sync-sdk",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Official SDK for building e-commerce storefronts with OmniSync Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",