Skip to content

Commit

Permalink
Merge pull request #93 from ExWeiv/dev
Browse files Browse the repository at this point in the history
BUG Fixes for Sync Plugins
  • Loading branch information
loeiks authored Jul 19, 2024
2 parents 87b1564 + 29e6c76 commit bfdc2b3
Show file tree
Hide file tree
Showing 120 changed files with 474 additions and 327 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ In this file you can find what's changed in each version. (Versions with -dev, -

---

### 4.7.1

- Examples included in documentation.
- BUG Fixes

### 4.7.0

- New Wix apps added to Sync plug-in including: Wix Stores, Wix eCommerce, Wix Marketing, Wix Pricing Plans, Wix Blog. Now you can sync all data from these apps easily.
Expand Down
39 changes: 35 additions & 4 deletions app/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Expand Down Expand Up @@ -79,11 +102,19 @@ const filter = () => new data_filter_1.WeivDataFilter();
exports.filter = filter;
const _version = () => package_json_1.default.version;
exports._version = _version;
const wix_members_1 = require("./Apps/wix_members");
const wix_stores_1 = require("./Apps/wix_stores");
const wixMembers = __importStar(require("./Apps/wix_members"));
const wixStores = __importStar(require("./Apps/wix_stores"));
const wixBlog = __importStar(require("./Apps/wix_blog"));
const wixEcom = __importStar(require("./Apps/wix_ecom"));
const wixMarketing = __importStar(require("./Apps/wix_marketing"));
const wixPricingPlans = __importStar(require("./Apps/wix_pricingplans"));
const SyncWixApps = {
wixMembers: { onMemberCreated: wix_members_1.onMemberCreated, onMemberUpdated: wix_members_1.onMemberUpdated, onMemberDeleted: wix_members_1.onMemberDeleted, onBadgeCreated: wix_members_1.onBadgeCreated, onBadgeUpdated: wix_members_1.onBadgeUpdated, onBadgeDeleted: wix_members_1.onBadgeDeleted },
wixStores: { onCollectionCreated: wix_stores_1.onCollectionCreated, onCollectionUpdated: wix_stores_1.onCollectionUpdated, onCollectionDeleted: wix_stores_1.onCollectionDeleted, onProductCreated: wix_stores_1.onProductCreated, onProductUpdated: wix_stores_1.onProductUpdated, onProductDeleted: wix_stores_1.onProductDeleted }
wixBlog,
wixEcom,
wixMarketing,
wixMembers,
wixPricingPlans,
wixStores,
};
exports.SyncWixApps = SyncWixApps;
exports.default = {
Expand Down
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exweiv/weiv-data",
"version": "4.7.0",
"version": "4.7.1",
"description": "Custom API Library for Wix sites to connect MongoDB. Designed to easily switch from wix-data APIs.",
"main": "./lib/index.js",
"files": [
Expand Down
16 changes: 12 additions & 4 deletions app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ const query = (collectionId: CollectionID) => new QueryResult(collectionId);
const filter = () => new WeivDataFilter();
const _version = () => npm.version;

import { onMemberCreated, onMemberUpdated, onMemberDeleted, onBadgeCreated, onBadgeUpdated, onBadgeDeleted } from "./Apps/wix_members";
import { onCollectionCreated, onCollectionUpdated, onCollectionDeleted, onProductCreated, onProductUpdated, onProductDeleted } from "./Apps/wix_stores";
import * as wixMembers from "./Apps/wix_members";
import * as wixStores from "./Apps/wix_stores";
import * as wixBlog from "./Apps/wix_blog";
import * as wixEcom from "./Apps/wix_ecom";
import * as wixMarketing from "./Apps/wix_marketing";
import * as wixPricingPlans from "./Apps/wix_pricingplans";

const SyncWixApps = {
wixMembers: { onMemberCreated, onMemberUpdated, onMemberDeleted, onBadgeCreated, onBadgeUpdated, onBadgeDeleted },
wixStores: { onCollectionCreated, onCollectionUpdated, onCollectionDeleted, onProductCreated, onProductUpdated, onProductDeleted }
wixBlog,
wixEcom,
wixMarketing,
wixMembers,
wixPricingPlans,
wixStores,
};

export {
Expand Down
79 changes: 79 additions & 0 deletions app/weivdata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,20 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-members.v2` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixMembers } = SyncWixApps;
*
* export const wixMembers_onMemberCreated = (event) => wixMembers.onMemberCreated(event);
* export const wixMembers_onMemberUpdated = (event) => wixMembers.onMemberUpdated(event);
* export const wixMembers_onMemberDeleted = (event) => wixMembers.onMemberDeleted(event);
* export const wixBadges_onBadgeCreated = (event) => wixMembers.onBadgeCreated(event);
* export const wixBadges_onBadgeUpdated = (event) => wixMembers.onBadgeUpdated(event);
* export const wixBadges_onBadgeDeleted = (event) => wixMembers.onBadgeDeleted(event);
* ```
*/
interface wixMembers {
onMemberCreated(event: any): Promise<void>;
Expand Down Expand Up @@ -2296,6 +2310,20 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-stores-backend` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixStores } = SyncWixApps;
*
* export const wixStores_onCollectionCreated = (event) => wixStores.onCollectionCreated(event);
* export const wixStores_onCollectionUpdated = (event) => wixStores.onCollectionUpdated(event);
* export const wixStores_onCollectionDeleted = (event) => wixStores.onCollectionDeleted(event);
* export const wixStores_onProductCreated = (event) => wixStores.onProductCreated(event);
* export const wixStores_onProductUpdated = (event) => wixStores.onProductUpdated(event);
* export const wixStores_onProductDeleted = (event) => wixStores.onProductDeleted(event);
* ```
*/
interface wixStores {
onProductCreated(event: any): Promise<void>;
Expand Down Expand Up @@ -2329,6 +2357,18 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-ecom-backend` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixEcom } = SyncWixApps;
*
* export const wixEcom_onOrderCreated = (event) => wixEcom.onOrderCreated(event);
* export const wixEcom_onOrderUpdated = (event) => wixEcom.onOrderUpdated(event);
* export const wixEcom_onAbandonedCheckoutCreated = (event) => wixEcom.onAbandonedCheckoutCreated(event);
* export const wixEcom_onAbandonedCheckoutRecovered = (event) => wixEcom.onAbandonedCheckoutRecovered(event);
* ```
*/
interface wixEcom {
onOrderCreated(event: any): Promise<void>;
Expand Down Expand Up @@ -2357,6 +2397,17 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-marketing.v2` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixMarketing } = SyncWixApps;
*
* export const wixMarketing_onCouponCreated = (event) => wixMarketing.onCouponCreated(event);
* export const wixMarketing_onCouponDeleted = (event) => wixMarketing.onCouponDeleted(event);
* export const wixMarketing_onCouponUpdated = (event) => wixMarketing.onCouponUpdated(event);
* ```
*/
interface wixMarketing {
onCouponCreated(event: any): Promise<void>;
Expand All @@ -2383,6 +2434,17 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-pricing-plans.v2` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixPricingPlans } = SyncWixApps;
*
* export const wixPricingPlansV2_onPlanCreated = (event) => wixPricingPlans.onPlanCreated(event);
* export const wixPricingPlansV2_onPlanUpdated = (event) => wixPricingPlans.onPlanUpdated(event);
* export const wixPricingPlansV2_onPlanArchived = (event) => wixPricingPlans.onPlanArchived(event);
* ```
*/
interface wixPricingPlans {
onPlanCreated(event: any): Promise<void>;
Expand Down Expand Up @@ -2411,6 +2473,23 @@ declare module '@exweiv/weiv-data' {
* ---
*
* Functions are designed to work with `wix-blog-backend` APIs Events. Define events inside the `events.js` file and point the functions you import from this plugin.
*
* Example:
*
* ```js
* import { SyncWixApps } from '@exweiv/weiv-data';
* const { wixBlog } = SyncWixApps;
*
* export const wixBlog_onCategoryCreated = (event) => wixBlog.onCategoryCreated(event);
* export const wixBlog_onCategoryDeleted = (event) => wixBlog.onCategoryDeleted(event);
* export const wixBlog_onCategoryUpdated = (event) => wixBlog.onCategoryUpdated(event);
* export const wixBlog_onTagCreated = (event) => wixBlog.onTagCreated(event);
* export const wixBlog_onTagDeleted = (event) => wixBlog.onTagDeleted(event);
* export const wixBlog_onTagUpdated = (event) => wixBlog.onTagUpdated(event);
* export const wixBlog_onPostCreated = (event) => wixBlog.onPostCreated(event);
* export const wixBlog_onPostDeleted = (event) => wixBlog.onPostDeleted(event);
* export const wixBlog_onPostUpdated = (event) => wixBlog.onPostUpdated(event);
* ```
*/
interface wixBlog {
onPostCreated(event: any): Promise<void>;
Expand Down
4 changes: 2 additions & 2 deletions docs/functions/Hooks.afterCount.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">context</span>: <a href="../types/Hooks.HookContext.html" class="tsd-signature-type tsd-kind-type-alias">HookContext</a></span><div class="tsd-comment tsd-typography"><p>Contextual information about the hook.</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h4><p>The count to return to <code>count()</code> instead of the original count. Returning a rejected promise will not block the operation, but will return a rejected promise to the caller as well as trigger the <code>onFailure()</code> hook.</p>
<div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Description" class="tsd-anchor"></a>Description<a href="#Description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>A hook that is triggered after a <code>count()</code> operation.</p>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ExWeiv/weiv-data/blob/63800e927ba0fffbc616cbf206cd620ebc0ce19c/app/weivdata.d.ts#L1550">weivdata.d.ts:1550</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>WeivData API Reference | ExWeiv Apps</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a><br>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ExWeiv/weiv-data/blob/b44e8c8953c77a76f3773e37dabf32b3f3ffd288/app/weivdata.d.ts#L1550">weivdata.d.ts:1550</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>WeivData API Reference | ExWeiv Apps</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a><br>
<span id="generation-date"></span>
<script>
window.GENERATION_DATE = 1721400494375;
window.GENERATION_DATE = 1721402043654;

(() => {

Expand Down
Loading

0 comments on commit bfdc2b3

Please sign in to comment.