@connect-plus-online/ogabai-integrations 0.0.63 → 0.0.65
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 +67 -61
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.esm.js +67 -61
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -474,6 +474,70 @@ var getAccountResponseNestedFields = {
|
|
|
474
474
|
wallets: walletQuery
|
|
475
475
|
};
|
|
476
476
|
|
|
477
|
+
// src/helpers/entity.factory.ts
|
|
478
|
+
function createEntityIntegration(config) {
|
|
479
|
+
var _a;
|
|
480
|
+
return {
|
|
481
|
+
responseFields: [config.key],
|
|
482
|
+
nestedFields: {
|
|
483
|
+
...(_a = config.nested) != null ? _a : {},
|
|
484
|
+
[config.key]: config.fields
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function createListIntegration(config) {
|
|
489
|
+
var _a;
|
|
490
|
+
return {
|
|
491
|
+
responseFields: [config.key, "total"],
|
|
492
|
+
nestedFields: {
|
|
493
|
+
...(_a = config.nested) != null ? _a : {},
|
|
494
|
+
[config.key]: config.fields
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
function createDeleteIntegration(key) {
|
|
499
|
+
const idKey = `${key}Id`;
|
|
500
|
+
return {
|
|
501
|
+
responseFields: [idKey]
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function createStandardEntityIntegration(config) {
|
|
505
|
+
const base = createEntityIntegration(config);
|
|
506
|
+
return {
|
|
507
|
+
get: base,
|
|
508
|
+
create: base,
|
|
509
|
+
update: base
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// src/services/user/types/user-account.type.ts
|
|
514
|
+
var ENTITY = "userAccount";
|
|
515
|
+
var userAccountIntegration = createStandardEntityIntegration({
|
|
516
|
+
key: ENTITY,
|
|
517
|
+
fields: userAccountQuery,
|
|
518
|
+
nested: {
|
|
519
|
+
userAccount: userAccountQuery,
|
|
520
|
+
store: storeQuery,
|
|
521
|
+
address: addressQuery,
|
|
522
|
+
privileges: privilegeQuery,
|
|
523
|
+
user: userQuery,
|
|
524
|
+
userRole: userRoleQuery
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
var userAccountListIntegration = createListIntegration({
|
|
528
|
+
key: "userAccounts",
|
|
529
|
+
fields: userAccountQuery,
|
|
530
|
+
nested: {
|
|
531
|
+
userAccount: userAccountQuery,
|
|
532
|
+
store: storeQuery,
|
|
533
|
+
address: addressQuery,
|
|
534
|
+
privileges: privilegeQuery,
|
|
535
|
+
user: userQuery,
|
|
536
|
+
userRole: userRoleQuery
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
var userAccountDeleteIntegration = createDeleteIntegration(ENTITY);
|
|
540
|
+
|
|
477
541
|
// src/services/user/types/user.type.ts
|
|
478
542
|
var getUserTypeCountsResponse = [
|
|
479
543
|
"userTypeCounts"
|
|
@@ -530,11 +594,13 @@ var meResponse = [
|
|
|
530
594
|
"user",
|
|
531
595
|
"account",
|
|
532
596
|
"stores",
|
|
533
|
-
"userSetting"
|
|
597
|
+
"userSetting",
|
|
598
|
+
"userAccounts"
|
|
534
599
|
];
|
|
535
600
|
var meResponseNestedFields = {
|
|
536
601
|
stores: storeQuery,
|
|
537
602
|
userSetting: userSettingQuery,
|
|
603
|
+
...userAccountListIntegration.nestedFields,
|
|
538
604
|
...getUserResponseNestedFields,
|
|
539
605
|
...getAccountResponseNestedFields
|
|
540
606
|
};
|
|
@@ -887,66 +953,6 @@ var createUserNotificationService = (client) => ({
|
|
|
887
953
|
}
|
|
888
954
|
});
|
|
889
955
|
|
|
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
|
-
privileges: privilegeQuery,
|
|
935
|
-
user: userQuery
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
var userAccountListIntegration = createListIntegration({
|
|
939
|
-
key: "userAccounts",
|
|
940
|
-
fields: userAccountQuery,
|
|
941
|
-
nested: {
|
|
942
|
-
privileges: privilegeQuery,
|
|
943
|
-
userAccount: userAccountQuery,
|
|
944
|
-
store: storeQuery,
|
|
945
|
-
user: userQuery
|
|
946
|
-
}
|
|
947
|
-
});
|
|
948
|
-
var userAccountDeleteIntegration = createDeleteIntegration(ENTITY);
|
|
949
|
-
|
|
950
956
|
// src/services/user/schemas/user-account.schema.ts
|
|
951
957
|
var userAccountSchema = {
|
|
952
958
|
get: {
|