@mohasinac/appkit 3.0.1 → 3.0.2

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.
@@ -43,19 +43,19 @@ const EVENT_STATUS_OPTIONS = [
43
43
  { label: "Ended", value: "ended" },
44
44
  ];
45
45
  const FORM_FIELD_TYPE_OPTIONS = [
46
- { label: "Short text", value: "text" },
47
- { label: "Long text", value: "textarea" },
48
- { label: "Email", value: "email" },
49
- { label: "Phone", value: "phone" },
50
- { label: "Number", value: "number" },
51
- { label: "Dropdown (select)", value: "select" },
52
- { label: "Multi-select", value: "multiselect" },
53
- { label: "Checkbox", value: "checkbox" },
54
- { label: "Radio", value: "radio" },
55
- { label: "Date", value: "date" },
56
- { label: "Rating (1–5)", value: "rating" },
57
- { label: "File upload", value: "file" },
58
- ];
46
+ ["text", "Short text"],
47
+ ["textarea", "Long text"],
48
+ ["email", "Email"],
49
+ ["phone", "Phone"],
50
+ ["number", "Number"],
51
+ ["select", "Dropdown (select)"],
52
+ ["multiselect", "Multi-select"],
53
+ ["checkbox", "Checkbox"],
54
+ ["radio", "Radio"],
55
+ ["date", "Date"],
56
+ ["rating", "Rating (1–5)"],
57
+ ["file", "File upload"],
58
+ ].map(([value, label]) => ({ label, value: value }));
59
59
  const FIELD_TYPES_WITH_OPTIONS = ["select", "multiselect", "radio", "checkbox"];
60
60
  function FormFieldBuilder({ fields, setFields }) {
61
61
  const addField = () => setFields([...fields, { id: `field-${Date.now()}`, type: "text", label: "", required: false, order: fields.length }]);
package/dist/index.d.ts CHANGED
@@ -518,7 +518,7 @@ export type { ResolvedUser } from "./security/index";
518
518
  export type { RoleDefinition } from "./security/index";
519
519
  export type { UserRole } from "./security/index";
520
520
  export { AddressesRepository } from "./repositories/index";
521
- export * from "./features/store-extensions/index";
521
+ export { type PayoutMethodType, type PayoutMethodDocument, PAYOUT_METHODS_COLLECTION, PAYOUT_METHOD_INDEXED_FIELDS, DEFAULT_PAYOUT_METHOD_DATA, type ShippingMethod as ShippingConfigMethod, type ShippingConfigDocument, SHIPPING_CONFIGS_COLLECTION, SHIPPING_CONFIG_INDEXED_FIELDS, DEFAULT_SHIPPING_CONFIG_DATA, type AnalyticsScope, type AnalyticsCardType, type AnalyticsCardDocument, ANALYTICS_CARDS_COLLECTION, ANALYTICS_CARD_INDEXED_FIELDS, DEFAULT_ANALYTICS_CARD_DATA, type AlertOperator, type AnalyticsAlertDocument, ANALYTICS_ALERTS_COLLECTION, ANALYTICS_ALERT_INDEXED_FIELDS, DEFAULT_ANALYTICS_ALERT_DATA, type StoreCategoryDocument, STORE_CATEGORIES_COLLECTION, STORE_CATEGORY_INDEXED_FIELDS, DEFAULT_STORE_CATEGORY_DATA, type ListingTemplateType, type ListingTemplateDocument, LISTING_TEMPLATES_COLLECTION, LISTING_TEMPLATE_INDEXED_FIELDS, DEFAULT_LISTING_TEMPLATE_DATA, type ModerationStatus, type ModerationMediaType, type ModerationQueueDocument, MODERATION_QUEUE_COLLECTION, MODERATION_QUEUE_INDEXED_FIELDS, DEFAULT_MODERATION_QUEUE_DATA, type ReportEntityType, type ReportStatus, type ReportReason, type ReportDocument, REPORTS_COLLECTION, REPORT_INDEXED_FIELDS, DEFAULT_REPORT_DATA, type AdminNotificationCategory, type AdminNotificationDocument, ADMIN_NOTIFICATIONS_COLLECTION, ADMIN_NOTIFICATION_INDEXED_FIELDS, DEFAULT_ADMIN_NOTIFICATION_DATA, type ItemRequestStatus, type ItemRequestReply, type ItemRequestDocument, ITEM_REQUESTS_COLLECTION, ITEM_REQUEST_INDEXED_FIELDS, DEFAULT_ITEM_REQUEST_DATA, type StoreGoogleConfigDocument, STORE_GOOGLE_CONFIG_COLLECTION, STORE_GOOGLE_CONFIG_INDEXED_FIELDS, DEFAULT_STORE_GOOGLE_CONFIG_DATA, type StoreWhatsAppConfigDocument, STORE_WHATSAPP_CONFIG_COLLECTION, STORE_WHATSAPP_CONFIG_INDEXED_FIELDS, DEFAULT_STORE_WHATSAPP_CONFIG_DATA, type CustomRoleDocument, CUSTOM_ROLES_COLLECTION, CUSTOM_ROLE_INDEXED_FIELDS, DEFAULT_CUSTOM_ROLE_DATA, type RoleOverrideDocument, ROLE_OVERRIDES_COLLECTION, ROLE_OVERRIDE_INDEXED_FIELDS, DEFAULT_ROLE_OVERRIDE_DATA, PayoutMethodsRepository, ShippingConfigsRepository, AnalyticsCardsRepository, AnalyticsAlertsRepository, StoreCategoriesRepository, ListingTemplatesRepository, ModerationQueueRepository, ReportsRepository, AdminNotificationsRepository, ItemRequestsRepository, StoreGoogleConfigRepository, StoreWhatsAppConfigRepository, CustomRolesRepository, RoleOverridesRepository, payoutMethodsRepository, shippingConfigsRepository, analyticsCardsRepository, analyticsAlertsRepository, storeCategoriesRepository, listingTemplatesRepository, moderationQueueRepository, reportsRepository, adminNotificationsRepository, itemRequestsRepository, storeGoogleConfigRepository, storeWhatsAppConfigRepository, customRolesRepository, roleOverridesRepository, } from "./features/store-extensions/index";
522
522
  export { BaseRepository } from "./repositories/index";
523
523
  export { BlogRepository } from "./repositories/index";
524
524
  export { CartRepository } from "./repositories/index";
package/dist/index.js CHANGED
@@ -984,8 +984,11 @@ export { resolvePermissions } from "./security/index";
984
984
  // AddressesRepository - unified top-level addresses collection (SB-UNI-A 2026-05-13).
985
985
  export { AddressesRepository } from "./repositories/index";
986
986
  // S-STORE foundation — 14 schemas + 14 repositories + RBAC.
987
- // store-extensions barrel: named-export expansion would be ~200 lines.
988
- export * from "./features/store-extensions/index";
987
+ export { PAYOUT_METHODS_COLLECTION, PAYOUT_METHOD_INDEXED_FIELDS, DEFAULT_PAYOUT_METHOD_DATA, SHIPPING_CONFIGS_COLLECTION, SHIPPING_CONFIG_INDEXED_FIELDS, DEFAULT_SHIPPING_CONFIG_DATA, ANALYTICS_CARDS_COLLECTION, ANALYTICS_CARD_INDEXED_FIELDS, DEFAULT_ANALYTICS_CARD_DATA, ANALYTICS_ALERTS_COLLECTION, ANALYTICS_ALERT_INDEXED_FIELDS, DEFAULT_ANALYTICS_ALERT_DATA, STORE_CATEGORIES_COLLECTION, STORE_CATEGORY_INDEXED_FIELDS, DEFAULT_STORE_CATEGORY_DATA, LISTING_TEMPLATES_COLLECTION, LISTING_TEMPLATE_INDEXED_FIELDS, DEFAULT_LISTING_TEMPLATE_DATA, MODERATION_QUEUE_COLLECTION, MODERATION_QUEUE_INDEXED_FIELDS, DEFAULT_MODERATION_QUEUE_DATA, REPORTS_COLLECTION, REPORT_INDEXED_FIELDS, DEFAULT_REPORT_DATA, ADMIN_NOTIFICATIONS_COLLECTION, ADMIN_NOTIFICATION_INDEXED_FIELDS, DEFAULT_ADMIN_NOTIFICATION_DATA, ITEM_REQUESTS_COLLECTION, ITEM_REQUEST_INDEXED_FIELDS, DEFAULT_ITEM_REQUEST_DATA, STORE_GOOGLE_CONFIG_COLLECTION, STORE_GOOGLE_CONFIG_INDEXED_FIELDS, DEFAULT_STORE_GOOGLE_CONFIG_DATA, STORE_WHATSAPP_CONFIG_COLLECTION, STORE_WHATSAPP_CONFIG_INDEXED_FIELDS, DEFAULT_STORE_WHATSAPP_CONFIG_DATA, CUSTOM_ROLES_COLLECTION, CUSTOM_ROLE_INDEXED_FIELDS, DEFAULT_CUSTOM_ROLE_DATA, ROLE_OVERRIDES_COLLECTION, ROLE_OVERRIDE_INDEXED_FIELDS, DEFAULT_ROLE_OVERRIDE_DATA,
988
+ // Repositories classes
989
+ PayoutMethodsRepository, ShippingConfigsRepository, AnalyticsCardsRepository, AnalyticsAlertsRepository, StoreCategoriesRepository, ListingTemplatesRepository, ModerationQueueRepository, ReportsRepository, AdminNotificationsRepository, ItemRequestsRepository, StoreGoogleConfigRepository, StoreWhatsAppConfigRepository, CustomRolesRepository, RoleOverridesRepository,
990
+ // Repositories — singletons
991
+ payoutMethodsRepository, shippingConfigsRepository, analyticsCardsRepository, analyticsAlertsRepository, storeCategoriesRepository, listingTemplatesRepository, moderationQueueRepository, reportsRepository, adminNotificationsRepository, itemRequestsRepository, storeGoogleConfigRepository, storeWhatsAppConfigRepository, customRolesRepository, roleOverridesRepository, } from "./features/store-extensions/index";
989
992
  // [DB]-Database layer â€" uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
990
993
  // BaseRepository - Shared export for base repository.
991
994
  export { BaseRepository } from "./repositories/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -46,6 +46,16 @@ const TRANSITIVE_RUNTIME_DUPS = [
46
46
  "@tanstack/query-core",
47
47
  ];
48
48
 
49
+ // Peer deps that have NO React context / module-scope singleton and that the
50
+ // consumer may not install at the root (e.g. firebase-functions ships only in
51
+ // the Firebase Cloud Functions deploy, not the Next.js consumer). Keeping them
52
+ // in appkit/node_modules lets `tsc -p appkit` resolve their types when the
53
+ // consumer-root copy is absent. The dual-instance crash (2026-06-10) cannot
54
+ // occur here because none of these packages own a top-level React context.
55
+ const SAFE_TO_KEEP = new Set([
56
+ "firebase-functions",
57
+ ]);
58
+
49
59
  const removed = [];
50
60
 
51
61
  function removeIfPresent(absPath, label) {
@@ -56,6 +66,7 @@ function removeIfPresent(absPath, label) {
56
66
  }
57
67
 
58
68
  for (const dep of [...peers, ...TRANSITIVE_RUNTIME_DUPS]) {
69
+ if (SAFE_TO_KEEP.has(dep)) continue;
59
70
  removeIfPresent(resolve(here, "..", "node_modules", dep), dep);
60
71
  }
61
72