@connect-plus-online/ogabai-integrations 0.0.64 → 0.0.66
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 +87 -66
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.esm.js +87 -67
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/types/subscription.ts
|
|
4
|
+
var SubscriptionPlanFeatureKeyLabels = {
|
|
5
|
+
product: "Product",
|
|
6
|
+
stock: "Stock",
|
|
7
|
+
sale: "Sale",
|
|
8
|
+
store: "Store",
|
|
9
|
+
expense: "Expense",
|
|
10
|
+
scanAdd: "Scan & Add",
|
|
11
|
+
report: "Report",
|
|
12
|
+
order: "Order",
|
|
13
|
+
export: "Export",
|
|
14
|
+
offline: "Offline Mode",
|
|
15
|
+
tax: "Tax Management",
|
|
16
|
+
loyalty: "Loyalty Program",
|
|
17
|
+
staff: "Staff Management",
|
|
18
|
+
scanSell: "Scan & Sell",
|
|
19
|
+
stockAlert: "Stock Alert"
|
|
20
|
+
};
|
|
21
|
+
|
|
3
22
|
// src/auth.ts
|
|
4
23
|
var toAsyncTokenProvider = (p) => {
|
|
5
24
|
if (!p) return async () => null;
|
|
@@ -474,6 +493,70 @@ var getAccountResponseNestedFields = {
|
|
|
474
493
|
wallets: walletQuery
|
|
475
494
|
};
|
|
476
495
|
|
|
496
|
+
// src/helpers/entity.factory.ts
|
|
497
|
+
function createEntityIntegration(config) {
|
|
498
|
+
var _a;
|
|
499
|
+
return {
|
|
500
|
+
responseFields: [config.key],
|
|
501
|
+
nestedFields: {
|
|
502
|
+
...(_a = config.nested) != null ? _a : {},
|
|
503
|
+
[config.key]: config.fields
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
function createListIntegration(config) {
|
|
508
|
+
var _a;
|
|
509
|
+
return {
|
|
510
|
+
responseFields: [config.key, "total"],
|
|
511
|
+
nestedFields: {
|
|
512
|
+
...(_a = config.nested) != null ? _a : {},
|
|
513
|
+
[config.key]: config.fields
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function createDeleteIntegration(key) {
|
|
518
|
+
const idKey = `${key}Id`;
|
|
519
|
+
return {
|
|
520
|
+
responseFields: [idKey]
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function createStandardEntityIntegration(config) {
|
|
524
|
+
const base = createEntityIntegration(config);
|
|
525
|
+
return {
|
|
526
|
+
get: base,
|
|
527
|
+
create: base,
|
|
528
|
+
update: base
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/services/user/types/user-account.type.ts
|
|
533
|
+
var ENTITY = "userAccount";
|
|
534
|
+
var userAccountIntegration = createStandardEntityIntegration({
|
|
535
|
+
key: ENTITY,
|
|
536
|
+
fields: userAccountQuery,
|
|
537
|
+
nested: {
|
|
538
|
+
userAccount: userAccountQuery,
|
|
539
|
+
store: storeQuery,
|
|
540
|
+
address: addressQuery,
|
|
541
|
+
privileges: privilegeQuery,
|
|
542
|
+
user: userQuery,
|
|
543
|
+
userRole: userRoleQuery
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
var userAccountListIntegration = createListIntegration({
|
|
547
|
+
key: "userAccounts",
|
|
548
|
+
fields: userAccountQuery,
|
|
549
|
+
nested: {
|
|
550
|
+
userAccount: userAccountQuery,
|
|
551
|
+
store: storeQuery,
|
|
552
|
+
address: addressQuery,
|
|
553
|
+
privileges: privilegeQuery,
|
|
554
|
+
user: userQuery,
|
|
555
|
+
userRole: userRoleQuery
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
var userAccountDeleteIntegration = createDeleteIntegration(ENTITY);
|
|
559
|
+
|
|
477
560
|
// src/services/user/types/user.type.ts
|
|
478
561
|
var getUserTypeCountsResponse = [
|
|
479
562
|
"userTypeCounts"
|
|
@@ -530,11 +613,13 @@ var meResponse = [
|
|
|
530
613
|
"user",
|
|
531
614
|
"account",
|
|
532
615
|
"stores",
|
|
533
|
-
"userSetting"
|
|
616
|
+
"userSetting",
|
|
617
|
+
"userAccounts"
|
|
534
618
|
];
|
|
535
619
|
var meResponseNestedFields = {
|
|
536
620
|
stores: storeQuery,
|
|
537
621
|
userSetting: userSettingQuery,
|
|
622
|
+
...userAccountListIntegration.nestedFields,
|
|
538
623
|
...getUserResponseNestedFields,
|
|
539
624
|
...getAccountResponseNestedFields
|
|
540
625
|
};
|
|
@@ -887,70 +972,6 @@ var createUserNotificationService = (client) => ({
|
|
|
887
972
|
}
|
|
888
973
|
});
|
|
889
974
|
|
|
890
|
-
// src/helpers/entity.factory.ts
|
|
891
|
-
function createEntityIntegration(config) {
|
|
892
|
-
var _a;
|
|
893
|
-
return {
|
|
894
|
-
responseFields: [config.key],
|
|
895
|
-
nestedFields: {
|
|
896
|
-
...(_a = config.nested) != null ? _a : {},
|
|
897
|
-
[config.key]: config.fields
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
function createListIntegration(config) {
|
|
902
|
-
var _a;
|
|
903
|
-
return {
|
|
904
|
-
responseFields: [config.key, "total"],
|
|
905
|
-
nestedFields: {
|
|
906
|
-
...(_a = config.nested) != null ? _a : {},
|
|
907
|
-
[config.key]: config.fields
|
|
908
|
-
}
|
|
909
|
-
};
|
|
910
|
-
}
|
|
911
|
-
function createDeleteIntegration(key) {
|
|
912
|
-
const idKey = `${key}Id`;
|
|
913
|
-
return {
|
|
914
|
-
responseFields: [idKey]
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
function createStandardEntityIntegration(config) {
|
|
918
|
-
const base = createEntityIntegration(config);
|
|
919
|
-
return {
|
|
920
|
-
get: base,
|
|
921
|
-
create: base,
|
|
922
|
-
update: base
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
// src/services/user/types/user-account.type.ts
|
|
927
|
-
var ENTITY = "userAccount";
|
|
928
|
-
var userAccountIntegration = createStandardEntityIntegration({
|
|
929
|
-
key: ENTITY,
|
|
930
|
-
fields: userAccountQuery,
|
|
931
|
-
nested: {
|
|
932
|
-
userAccount: userAccountQuery,
|
|
933
|
-
store: storeQuery,
|
|
934
|
-
address: addressQuery,
|
|
935
|
-
privileges: privilegeQuery,
|
|
936
|
-
user: userQuery,
|
|
937
|
-
userRole: userRoleQuery
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
var userAccountListIntegration = createListIntegration({
|
|
941
|
-
key: "userAccounts",
|
|
942
|
-
fields: userAccountQuery,
|
|
943
|
-
nested: {
|
|
944
|
-
userAccount: userAccountQuery,
|
|
945
|
-
store: storeQuery,
|
|
946
|
-
address: addressQuery,
|
|
947
|
-
privileges: privilegeQuery,
|
|
948
|
-
user: userQuery,
|
|
949
|
-
userRole: userRoleQuery
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
var userAccountDeleteIntegration = createDeleteIntegration(ENTITY);
|
|
953
|
-
|
|
954
975
|
// src/services/user/schemas/user-account.schema.ts
|
|
955
976
|
var userAccountSchema = {
|
|
956
977
|
get: {
|
|
@@ -2788,7 +2809,6 @@ var subscriptionPlanQuery = [
|
|
|
2788
2809
|
"subscriptionPlanStatus",
|
|
2789
2810
|
"createdAt",
|
|
2790
2811
|
"updatedAt",
|
|
2791
|
-
"subscriptionPlanFeatureIds",
|
|
2792
2812
|
"features",
|
|
2793
2813
|
"monthlyPlanPrice",
|
|
2794
2814
|
"annuallyPlanPrice"
|
|
@@ -3211,6 +3231,7 @@ exports.AuthenticationError = AuthenticationError;
|
|
|
3211
3231
|
exports.GraphQLClient = GraphQLClient;
|
|
3212
3232
|
exports.NetworkError = NetworkError;
|
|
3213
3233
|
exports.SdkError = SdkError;
|
|
3234
|
+
exports.SubscriptionPlanFeatureKeyLabels = SubscriptionPlanFeatureKeyLabels;
|
|
3214
3235
|
exports.UpdateSaleResponse = UpdateSaleResponse;
|
|
3215
3236
|
exports._getPackageResponseNestedFields = _getPackageResponseNestedFields;
|
|
3216
3237
|
exports._getProductResponseNestedFields = _getProductResponseNestedFields;
|