@connect-plus-online/ogabai-integrations 0.0.82 → 0.0.84
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.cjs.js +268 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +158 -8
- package/dist/index.d.ts +158 -8
- package/dist/index.esm.js +259 -16
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1904,12 +1904,6 @@ var customerSchema = {
|
|
|
1904
1904
|
variables: "($customer: CustomerInput!)",
|
|
1905
1905
|
field: "(customer: $customer)"
|
|
1906
1906
|
},
|
|
1907
|
-
list: {
|
|
1908
|
-
operation: "query",
|
|
1909
|
-
name: "getCustomers",
|
|
1910
|
-
variables: "($limit: Int!, $skip: Int!, $search: String, $customer: CustomerInput, $customerIds: [String])",
|
|
1911
|
-
field: "(limit: $limit, skip: $skip, search: $search, customer: $customer, customerIds: $customerIds)"
|
|
1912
|
-
},
|
|
1913
1907
|
create: {
|
|
1914
1908
|
operation: "mutation",
|
|
1915
1909
|
name: "createCustomer",
|
|
@@ -1983,15 +1977,20 @@ var createCustomerService = (client) => ({
|
|
|
1983
1977
|
}
|
|
1984
1978
|
),
|
|
1985
1979
|
// only admin
|
|
1986
|
-
getCustomers: createOperationExecutor
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1980
|
+
// getCustomers: createOperationExecutor<
|
|
1981
|
+
// "getCustomers",
|
|
1982
|
+
// CustomerCRUD["ListRequest"],
|
|
1983
|
+
// CustomerCRUD["ListResponse"],
|
|
1984
|
+
// typeof customerListIntegration.nestedFields
|
|
1985
|
+
// >(
|
|
1986
|
+
// client,
|
|
1987
|
+
// "getCustomers",
|
|
1988
|
+
// {
|
|
1989
|
+
// schema: buildSchema(customerSchema.list),
|
|
1990
|
+
// defaultRootFields: [...customerListIntegration.responseFields],
|
|
1991
|
+
// defaultNestedFields: customerListIntegration.nestedFields,
|
|
1992
|
+
// }
|
|
1993
|
+
// ),
|
|
1995
1994
|
getCustomersByStoreId: createOperationExecutor(
|
|
1996
1995
|
client,
|
|
1997
1996
|
"getCustomersByStoreId",
|
|
@@ -3202,6 +3201,21 @@ var orderSchema = {
|
|
|
3202
3201
|
};
|
|
3203
3202
|
|
|
3204
3203
|
// src/services/sales/sale.entity.ts
|
|
3204
|
+
var expenseQuery = [
|
|
3205
|
+
"id",
|
|
3206
|
+
"createdAt",
|
|
3207
|
+
"description",
|
|
3208
|
+
"title",
|
|
3209
|
+
"repeatedEvery",
|
|
3210
|
+
"expenseCategoryId"
|
|
3211
|
+
];
|
|
3212
|
+
var expenseCategoryQuery = [
|
|
3213
|
+
"id",
|
|
3214
|
+
"createdAt",
|
|
3215
|
+
"description",
|
|
3216
|
+
"storeId",
|
|
3217
|
+
"title"
|
|
3218
|
+
];
|
|
3205
3219
|
var transactionQuery = [
|
|
3206
3220
|
"_id",
|
|
3207
3221
|
"amountPaid",
|
|
@@ -3220,6 +3234,7 @@ var transactionQuery = [
|
|
|
3220
3234
|
"to",
|
|
3221
3235
|
"toWallet",
|
|
3222
3236
|
"txStatus",
|
|
3237
|
+
"customerId",
|
|
3223
3238
|
"transactionType"
|
|
3224
3239
|
];
|
|
3225
3240
|
var orderQuery = [
|
|
@@ -3443,6 +3458,32 @@ var createTransactionService = (client) => ({
|
|
|
3443
3458
|
);
|
|
3444
3459
|
return (_d = (_c = res.data) == null ? void 0 : _c.addTransaction) != null ? _d : null;
|
|
3445
3460
|
},
|
|
3461
|
+
async addCustomerDeposit(input, fetchFields, option) {
|
|
3462
|
+
return this.addTransaction(
|
|
3463
|
+
{
|
|
3464
|
+
transaction: {
|
|
3465
|
+
...input,
|
|
3466
|
+
transactionType: "customerDeposit",
|
|
3467
|
+
platform: "pos"
|
|
3468
|
+
}
|
|
3469
|
+
},
|
|
3470
|
+
fetchFields,
|
|
3471
|
+
option
|
|
3472
|
+
);
|
|
3473
|
+
},
|
|
3474
|
+
async addCustomerRefund(input, fetchFields, option) {
|
|
3475
|
+
return this.addTransaction(
|
|
3476
|
+
{
|
|
3477
|
+
transaction: {
|
|
3478
|
+
...input,
|
|
3479
|
+
transactionType: "customerRefund",
|
|
3480
|
+
platform: "pos"
|
|
3481
|
+
}
|
|
3482
|
+
},
|
|
3483
|
+
fetchFields,
|
|
3484
|
+
option
|
|
3485
|
+
);
|
|
3486
|
+
},
|
|
3446
3487
|
async getTransaction(input, fetchFields, option) {
|
|
3447
3488
|
var _a, _b, _c, _d;
|
|
3448
3489
|
const res = await client.request(
|
|
@@ -3473,6 +3514,208 @@ var createTransactionService = (client) => ({
|
|
|
3473
3514
|
}
|
|
3474
3515
|
});
|
|
3475
3516
|
|
|
3476
|
-
|
|
3517
|
+
// src/services/sales/types/expense-category.type.ts
|
|
3518
|
+
var ENTITY8 = "expenseCategory";
|
|
3519
|
+
var expenseCategoryIntegration = createStandardEntityIntegration({
|
|
3520
|
+
key: ENTITY8,
|
|
3521
|
+
fields: expenseCategoryQuery,
|
|
3522
|
+
nested: {
|
|
3523
|
+
features: expenseCategoryQuery
|
|
3524
|
+
}
|
|
3525
|
+
});
|
|
3526
|
+
var expenseCategoryListIntegration = createListIntegration({
|
|
3527
|
+
key: "expenseCategorys",
|
|
3528
|
+
fields: expenseCategoryQuery,
|
|
3529
|
+
nested: {
|
|
3530
|
+
features: expenseCategoryQuery
|
|
3531
|
+
}
|
|
3532
|
+
});
|
|
3533
|
+
var expenseCategoryDeleteIntegration = createDeleteIntegration(ENTITY8);
|
|
3534
|
+
|
|
3535
|
+
// src/services/sales/types/expense.type.ts
|
|
3536
|
+
var ENTITY9 = "expense";
|
|
3537
|
+
var expenseIntegration = createStandardEntityIntegration({
|
|
3538
|
+
key: ENTITY9,
|
|
3539
|
+
fields: expenseQuery,
|
|
3540
|
+
nested: {
|
|
3541
|
+
features: expenseQuery
|
|
3542
|
+
}
|
|
3543
|
+
});
|
|
3544
|
+
var expenseListIntegration = createListIntegration({
|
|
3545
|
+
key: "expenses",
|
|
3546
|
+
fields: expenseQuery,
|
|
3547
|
+
nested: {
|
|
3548
|
+
features: expenseQuery
|
|
3549
|
+
}
|
|
3550
|
+
});
|
|
3551
|
+
var expenseDeleteIntegration = createDeleteIntegration(ENTITY9);
|
|
3552
|
+
|
|
3553
|
+
// src/services/sales/schemas/expense-category.schema.ts
|
|
3554
|
+
var expenseCategorySchema = {
|
|
3555
|
+
get: {
|
|
3556
|
+
operation: "query",
|
|
3557
|
+
name: "getExpenseCategory",
|
|
3558
|
+
variables: "($expenseCategory: ExpenseCategoryInput!)",
|
|
3559
|
+
field: "(expenseCategory: $expenseCategory)"
|
|
3560
|
+
},
|
|
3561
|
+
list: {
|
|
3562
|
+
operation: "query",
|
|
3563
|
+
name: "getExpenseCategorys",
|
|
3564
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $expenseCategory: ExpenseCategoryInput, $expenseCategoryIds: [String])",
|
|
3565
|
+
field: "(limit: $limit, skip: $skip, search: $search, expenseCategory: $expenseCategory, expenseCategoryIds: $expenseCategoryIds)"
|
|
3566
|
+
},
|
|
3567
|
+
create: {
|
|
3568
|
+
operation: "mutation",
|
|
3569
|
+
name: "createExpenseCategory",
|
|
3570
|
+
variables: "($expenseCategory: ExpenseCategoryInput!)",
|
|
3571
|
+
field: "(expenseCategory: $expenseCategory)"
|
|
3572
|
+
},
|
|
3573
|
+
update: {
|
|
3574
|
+
operation: "mutation",
|
|
3575
|
+
name: "updateExpenseCategory",
|
|
3576
|
+
variables: "($expenseCategoryId: String!, $expenseCategory: ExpenseCategoryInput!)",
|
|
3577
|
+
field: "(expenseCategoryId: $expenseCategoryId, expenseCategory: $expenseCategory)"
|
|
3578
|
+
},
|
|
3579
|
+
delete: {
|
|
3580
|
+
operation: "mutation",
|
|
3581
|
+
name: "deleteExpenseCategory",
|
|
3582
|
+
variables: "($expenseCategoryId: String!)",
|
|
3583
|
+
field: "(expenseCategoryId: $expenseCategoryId)"
|
|
3584
|
+
}
|
|
3585
|
+
};
|
|
3586
|
+
|
|
3587
|
+
// src/services/sales/expense-category.service.ts
|
|
3588
|
+
var createExpenseCategoryService = (client) => ({
|
|
3589
|
+
createExpenseCategory: createOperationExecutor(
|
|
3590
|
+
client,
|
|
3591
|
+
"createExpenseCategory",
|
|
3592
|
+
{
|
|
3593
|
+
schema: buildSchema(expenseCategorySchema.create),
|
|
3594
|
+
defaultRootFields: expenseCategoryIntegration.create.responseFields,
|
|
3595
|
+
defaultNestedFields: expenseCategoryIntegration.create.nestedFields
|
|
3596
|
+
}
|
|
3597
|
+
),
|
|
3598
|
+
updateExpenseCategory: createOperationExecutor(
|
|
3599
|
+
client,
|
|
3600
|
+
"updateExpenseCategory",
|
|
3601
|
+
{
|
|
3602
|
+
schema: buildSchema(expenseCategorySchema.update),
|
|
3603
|
+
defaultRootFields: expenseCategoryIntegration.update.responseFields,
|
|
3604
|
+
defaultNestedFields: expenseCategoryIntegration.update.nestedFields
|
|
3605
|
+
}
|
|
3606
|
+
),
|
|
3607
|
+
getExpenseCategory: createOperationExecutor(
|
|
3608
|
+
client,
|
|
3609
|
+
"getExpenseCategory",
|
|
3610
|
+
{
|
|
3611
|
+
schema: buildSchema(expenseCategorySchema.get),
|
|
3612
|
+
defaultRootFields: expenseCategoryIntegration.get.responseFields,
|
|
3613
|
+
defaultNestedFields: expenseCategoryIntegration.get.nestedFields
|
|
3614
|
+
}
|
|
3615
|
+
),
|
|
3616
|
+
deleteExpenseCategory: createOperationExecutor(
|
|
3617
|
+
client,
|
|
3618
|
+
"deleteExpenseCategory",
|
|
3619
|
+
{
|
|
3620
|
+
schema: buildSchema(expenseCategorySchema.delete),
|
|
3621
|
+
defaultRootFields: expenseCategoryDeleteIntegration.responseFields,
|
|
3622
|
+
defaultNestedFields: {}
|
|
3623
|
+
}
|
|
3624
|
+
),
|
|
3625
|
+
getExpenseCategorys: createOperationExecutor(
|
|
3626
|
+
client,
|
|
3627
|
+
"getExpenseCategorys",
|
|
3628
|
+
{
|
|
3629
|
+
schema: buildSchema(expenseCategorySchema.list),
|
|
3630
|
+
defaultRootFields: [...expenseCategoryListIntegration.responseFields],
|
|
3631
|
+
defaultNestedFields: expenseCategoryListIntegration.nestedFields
|
|
3632
|
+
}
|
|
3633
|
+
)
|
|
3634
|
+
});
|
|
3635
|
+
|
|
3636
|
+
// src/services/sales/schemas/expense.schema.ts
|
|
3637
|
+
var expenseSchema = {
|
|
3638
|
+
get: {
|
|
3639
|
+
operation: "query",
|
|
3640
|
+
name: "getExpense",
|
|
3641
|
+
variables: "($expense: ExpenseInput!)",
|
|
3642
|
+
field: "(expense: $expense)"
|
|
3643
|
+
},
|
|
3644
|
+
list: {
|
|
3645
|
+
operation: "query",
|
|
3646
|
+
name: "getExpenses",
|
|
3647
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $expense: ExpenseInput, $expenseIds: [String])",
|
|
3648
|
+
field: "(limit: $limit, skip: $skip, search: $search, expense: $expense, expenseIds: $expenseIds)"
|
|
3649
|
+
},
|
|
3650
|
+
create: {
|
|
3651
|
+
operation: "mutation",
|
|
3652
|
+
name: "createExpense",
|
|
3653
|
+
variables: "($expense: ExpenseInput!)",
|
|
3654
|
+
field: "(expense: $expense)"
|
|
3655
|
+
},
|
|
3656
|
+
update: {
|
|
3657
|
+
operation: "mutation",
|
|
3658
|
+
name: "updateExpense",
|
|
3659
|
+
variables: "($expenseId: String!, $expense: ExpenseInput!)",
|
|
3660
|
+
field: "(expenseId: $expenseId, expense: $expense)"
|
|
3661
|
+
},
|
|
3662
|
+
delete: {
|
|
3663
|
+
operation: "mutation",
|
|
3664
|
+
name: "deleteExpense",
|
|
3665
|
+
variables: "($expenseId: String!)",
|
|
3666
|
+
field: "(expenseId: $expenseId)"
|
|
3667
|
+
}
|
|
3668
|
+
};
|
|
3669
|
+
|
|
3670
|
+
// src/services/sales/expense.service.ts
|
|
3671
|
+
var createExpenseService = (client) => ({
|
|
3672
|
+
createExpense: createOperationExecutor(
|
|
3673
|
+
client,
|
|
3674
|
+
"createExpense",
|
|
3675
|
+
{
|
|
3676
|
+
schema: buildSchema(expenseSchema.create),
|
|
3677
|
+
defaultRootFields: expenseIntegration.create.responseFields,
|
|
3678
|
+
defaultNestedFields: expenseIntegration.create.nestedFields
|
|
3679
|
+
}
|
|
3680
|
+
),
|
|
3681
|
+
updateExpense: createOperationExecutor(
|
|
3682
|
+
client,
|
|
3683
|
+
"updateExpense",
|
|
3684
|
+
{
|
|
3685
|
+
schema: buildSchema(expenseSchema.update),
|
|
3686
|
+
defaultRootFields: expenseIntegration.update.responseFields,
|
|
3687
|
+
defaultNestedFields: expenseIntegration.update.nestedFields
|
|
3688
|
+
}
|
|
3689
|
+
),
|
|
3690
|
+
getExpense: createOperationExecutor(
|
|
3691
|
+
client,
|
|
3692
|
+
"getExpense",
|
|
3693
|
+
{
|
|
3694
|
+
schema: buildSchema(expenseSchema.get),
|
|
3695
|
+
defaultRootFields: expenseIntegration.get.responseFields,
|
|
3696
|
+
defaultNestedFields: expenseIntegration.get.nestedFields
|
|
3697
|
+
}
|
|
3698
|
+
),
|
|
3699
|
+
deleteExpense: createOperationExecutor(
|
|
3700
|
+
client,
|
|
3701
|
+
"deleteExpense",
|
|
3702
|
+
{
|
|
3703
|
+
schema: buildSchema(expenseSchema.delete),
|
|
3704
|
+
defaultRootFields: expenseDeleteIntegration.responseFields,
|
|
3705
|
+
defaultNestedFields: {}
|
|
3706
|
+
}
|
|
3707
|
+
),
|
|
3708
|
+
getExpenses: createOperationExecutor(
|
|
3709
|
+
client,
|
|
3710
|
+
"getExpenses",
|
|
3711
|
+
{
|
|
3712
|
+
schema: buildSchema(expenseSchema.list),
|
|
3713
|
+
defaultRootFields: [...expenseListIntegration.responseFields],
|
|
3714
|
+
defaultNestedFields: expenseListIntegration.nestedFields
|
|
3715
|
+
}
|
|
3716
|
+
)
|
|
3717
|
+
});
|
|
3718
|
+
|
|
3719
|
+
export { APPLICATION_FEATURES, AuthenticationError, GraphQLClient, NetworkError, SdkError, SubscriptionPlanFeatureKeyLabels, UpdateSaleResponse, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addProductsResponseFields, addProductsResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createAuthService, createCustomerService, createExpenseCategoryService, createExpenseService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, expenseCategoryDeleteIntegration, expenseCategoryIntegration, expenseCategoryListIntegration, expenseCategoryQuery, expenseDeleteIntegration, expenseIntegration, expenseListIntegration, expenseQuery, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields, userRoleExample };
|
|
3477
3720
|
//# sourceMappingURL=index.esm.js.map
|
|
3478
3721
|
//# sourceMappingURL=index.esm.js.map
|