@odla-ai/chapter 0.42.4 → 0.43.1

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 CHANGED
@@ -646,8 +646,32 @@ var giftRedemptionAttemptsEntity = { attrs: {
646
646
  updatedAt: attr3("number")
647
647
  } };
648
648
 
649
+ // src/schema-stripe.ts
650
+ var attr4 = (type, flags = {}) => ({
651
+ type,
652
+ unique: flags.unique ?? false,
653
+ indexed: flags.indexed ?? false,
654
+ optional: flags.optional ?? false
655
+ });
656
+ var stripeEventReceiptsEntity = {
657
+ attrs: {
658
+ id: attr4("string", { unique: true, indexed: true }),
659
+ eventId: attr4("string", { unique: true, indexed: true }),
660
+ digest: attr4("string", { indexed: true }),
661
+ disposition: attr4("string", { indexed: true }),
662
+ kind: attr4("string", { indexed: true }),
663
+ matched: attr4("boolean", { indexed: true }),
664
+ appId: attr4("string", { indexed: true, optional: true }),
665
+ environment: attr4("string", { indexed: true, optional: true }),
666
+ dataEnvironment: attr4("string", { indexed: true, optional: true }),
667
+ runtime: attr4("string", { indexed: true, optional: true }),
668
+ chapterId: attr4("string", { indexed: true, optional: true }),
669
+ receivedAt: attr4("number", { indexed: true })
670
+ }
671
+ };
672
+
649
673
  // src/schema.ts
650
- function attr4(type, flags = {}) {
674
+ function attr5(type, flags = {}) {
651
675
  return {
652
676
  type,
653
677
  unique: flags.unique ?? false,
@@ -655,167 +679,167 @@ function attr4(type, flags = {}) {
655
679
  optional: flags.optional ?? false
656
680
  };
657
681
  }
658
- var id3 = () => attr4("string", { unique: true, indexed: true });
682
+ var id3 = () => attr5("string", { unique: true, indexed: true });
659
683
  var admins = {
660
684
  attrs: {
661
685
  id: id3(),
662
- email: attr4("string", { unique: true, indexed: true }),
663
- name: attr4("string", { optional: true }),
664
- note: attr4("string", { optional: true })
686
+ email: attr5("string", { unique: true, indexed: true }),
687
+ name: attr5("string", { optional: true }),
688
+ note: attr5("string", { optional: true })
665
689
  }
666
690
  };
667
691
  var superAdmins = {
668
692
  attrs: {
669
693
  id: id3(),
670
- email: attr4("string", { unique: true, indexed: true }),
671
- note: attr4("string", { optional: true }),
672
- createdAt: attr4("number", { indexed: true })
694
+ email: attr5("string", { unique: true, indexed: true }),
695
+ note: attr5("string", { optional: true }),
696
+ createdAt: attr5("number", { indexed: true })
673
697
  }
674
698
  };
675
699
  var networkNotes = {
676
700
  attrs: {
677
701
  id: id3(),
678
- recordKey: attr4("string", { indexed: true }),
679
- targetId: attr4("string", { indexed: true }),
680
- recordType: attr4("string", { indexed: true }),
681
- recordId: attr4("string", { indexed: true }),
682
- body: attr4("string"),
683
- authorId: attr4("string", { indexed: true }),
684
- authorEmail: attr4("string", { optional: true }),
685
- createdAt: attr4("number", { indexed: true })
702
+ recordKey: attr5("string", { indexed: true }),
703
+ targetId: attr5("string", { indexed: true }),
704
+ recordType: attr5("string", { indexed: true }),
705
+ recordId: attr5("string", { indexed: true }),
706
+ body: attr5("string"),
707
+ authorId: attr5("string", { indexed: true }),
708
+ authorEmail: attr5("string", { optional: true }),
709
+ createdAt: attr5("number", { indexed: true })
686
710
  }
687
711
  };
688
712
  var signupControls = {
689
713
  attrs: {
690
714
  id: id3(),
691
- sourceId: attr4("string", { indexed: true }),
692
- targetId: attr4("string", { indexed: true }),
693
- environment: attr4("string", { indexed: true }),
694
- revision: attr4("number", { indexed: true }),
695
- digest: attr4("string", { indexed: true }),
696
- document: attr4("json"),
697
- active: attr4("boolean", { indexed: true }),
698
- receivedAt: attr4("number", { indexed: true })
715
+ sourceId: attr5("string", { indexed: true }),
716
+ targetId: attr5("string", { indexed: true }),
717
+ environment: attr5("string", { indexed: true }),
718
+ revision: attr5("number", { indexed: true }),
719
+ digest: attr5("string", { indexed: true }),
720
+ document: attr5("json"),
721
+ active: attr5("boolean", { indexed: true }),
722
+ receivedAt: attr5("number", { indexed: true })
699
723
  }
700
724
  };
701
725
  var memberContentControls = {
702
726
  attrs: {
703
727
  id: id3(),
704
- sourceId: attr4("string", { indexed: true }),
705
- targetId: attr4("string", { indexed: true }),
706
- environment: attr4("string", { indexed: true }),
707
- revision: attr4("number", { indexed: true }),
708
- digest: attr4("string", { indexed: true }),
709
- document: attr4("json"),
710
- active: attr4("boolean", { indexed: true }),
711
- receivedAt: attr4("number", { indexed: true })
728
+ sourceId: attr5("string", { indexed: true }),
729
+ targetId: attr5("string", { indexed: true }),
730
+ environment: attr5("string", { indexed: true }),
731
+ revision: attr5("number", { indexed: true }),
732
+ digest: attr5("string", { indexed: true }),
733
+ document: attr5("json"),
734
+ active: attr5("boolean", { indexed: true }),
735
+ receivedAt: attr5("number", { indexed: true })
712
736
  }
713
737
  };
714
738
  var memberContentLocal = {
715
739
  attrs: {
716
740
  id: id3(),
717
- chapterId: attr4("string", { indexed: true }),
718
- environment: attr4("string", { indexed: true }),
719
- revision: attr4("number", { indexed: true }),
720
- document: attr4("json"),
721
- updatedAt: attr4("number", { indexed: true }),
722
- updatedBy: attr4("string", { optional: true })
741
+ chapterId: attr5("string", { indexed: true }),
742
+ environment: attr5("string", { indexed: true }),
743
+ revision: attr5("number", { indexed: true }),
744
+ document: attr5("json"),
745
+ updatedAt: attr5("number", { indexed: true }),
746
+ updatedBy: attr5("string", { optional: true })
723
747
  }
724
748
  };
725
749
  var builderLibraryControls = {
726
750
  attrs: {
727
751
  id: id3(),
728
- sourceId: attr4("string", { indexed: true }),
729
- targetId: attr4("string", { indexed: true }),
730
- environment: attr4("string", { indexed: true }),
731
- revision: attr4("number", { indexed: true }),
732
- digest: attr4("string", { indexed: true }),
733
- document: attr4("json"),
734
- active: attr4("boolean", { indexed: true }),
735
- receivedAt: attr4("number", { indexed: true })
752
+ sourceId: attr5("string", { indexed: true }),
753
+ targetId: attr5("string", { indexed: true }),
754
+ environment: attr5("string", { indexed: true }),
755
+ revision: attr5("number", { indexed: true }),
756
+ digest: attr5("string", { indexed: true }),
757
+ document: attr5("json"),
758
+ active: attr5("boolean", { indexed: true }),
759
+ receivedAt: attr5("number", { indexed: true })
736
760
  }
737
761
  };
738
762
  var builderLibraryLocal = {
739
763
  attrs: {
740
764
  id: id3(),
741
- appId: attr4("string", { indexed: true }),
742
- environment: attr4("string", { indexed: true }),
743
- revision: attr4("number", { indexed: true }),
744
- document: attr4("json"),
745
- updatedAt: attr4("number", { indexed: true }),
746
- updatedBy: attr4("string", { optional: true })
765
+ appId: attr5("string", { indexed: true }),
766
+ environment: attr5("string", { indexed: true }),
767
+ revision: attr5("number", { indexed: true }),
768
+ document: attr5("json"),
769
+ updatedAt: attr5("number", { indexed: true }),
770
+ updatedBy: attr5("string", { optional: true })
747
771
  }
748
772
  };
749
773
  var groups = {
750
774
  attrs: {
751
775
  id: id3(),
752
- name: attr4("string"),
753
- standardPriceCents: attr4("number"),
754
- foundingDiscountCents: attr4("number"),
755
- stripePriceId: attr4("string", { optional: true }),
756
- stripePublishableKey: attr4("string", { optional: true }),
757
- notificationEmail: attr4("string"),
758
- replyTo: attr4("string"),
759
- debugEmail: attr4("string", { optional: true }),
760
- calendarLink: attr4("string", { optional: true }),
761
- disclaimerText: attr4("string"),
762
- refundPolicyText: attr4("string"),
763
- merchantDisclosureText: attr4("string", { optional: true }),
764
- trustCopy: attr4("string"),
765
- commitmentText: attr4("string", { optional: true }),
766
- normsText: attr4("string", { optional: true }),
767
- emailTemplates: attr4("json"),
768
- schedulingJson: attr4("json", { optional: true }),
769
- createdAt: attr4("number", { indexed: true })
776
+ name: attr5("string"),
777
+ standardPriceCents: attr5("number"),
778
+ foundingDiscountCents: attr5("number"),
779
+ stripePriceId: attr5("string", { optional: true }),
780
+ stripePublishableKey: attr5("string", { optional: true }),
781
+ notificationEmail: attr5("string"),
782
+ replyTo: attr5("string"),
783
+ debugEmail: attr5("string", { optional: true }),
784
+ calendarLink: attr5("string", { optional: true }),
785
+ disclaimerText: attr5("string"),
786
+ refundPolicyText: attr5("string"),
787
+ merchantDisclosureText: attr5("string", { optional: true }),
788
+ trustCopy: attr5("string"),
789
+ commitmentText: attr5("string", { optional: true }),
790
+ normsText: attr5("string", { optional: true }),
791
+ emailTemplates: attr5("json"),
792
+ schedulingJson: attr5("json", { optional: true }),
793
+ createdAt: attr5("number", { indexed: true })
770
794
  }
771
795
  };
772
796
  var tiers = {
773
797
  attrs: {
774
798
  id: id3(),
775
- groupId: attr4("string", { indexed: true }),
776
- name: attr4("string"),
777
- priceCents: attr4("number"),
778
- stripePriceId: attr4("string", { optional: true }),
779
- blurb: attr4("string", { optional: true }),
780
- sortOrder: attr4("number", { indexed: true }),
781
- active: attr4("boolean", { indexed: true }),
782
- createdAt: attr4("number", { indexed: true })
799
+ groupId: attr5("string", { indexed: true }),
800
+ name: attr5("string"),
801
+ priceCents: attr5("number"),
802
+ stripePriceId: attr5("string", { optional: true }),
803
+ blurb: attr5("string", { optional: true }),
804
+ sortOrder: attr5("number", { indexed: true }),
805
+ active: attr5("boolean", { indexed: true }),
806
+ createdAt: attr5("number", { indexed: true })
783
807
  }
784
808
  };
785
809
  var meetings = {
786
810
  attrs: {
787
811
  id: id3(),
788
- applicationId: attr4("string", { indexed: true }),
789
- groupId: attr4("string", { indexed: true }),
790
- startAt: attr4("number", { indexed: true }),
791
- endAt: attr4("number"),
792
- timezone: attr4("string"),
793
- status: attr4("string", { indexed: true }),
794
- googleEventId: attr4("string", { indexed: true, optional: true }),
795
- meetUrl: attr4("string", { optional: true }),
796
- htmlLink: attr4("string", { optional: true }),
797
- drift: attr4("string", { indexed: true, optional: true }),
798
- driftGoogleStartAt: attr4("number", { optional: true }),
799
- driftDetectedAt: attr4("number", { optional: true }),
800
- adoptedFromGoogleAt: attr4("number", { optional: true }),
801
- createdAt: attr4("number", { indexed: true })
812
+ applicationId: attr5("string", { indexed: true }),
813
+ groupId: attr5("string", { indexed: true }),
814
+ startAt: attr5("number", { indexed: true }),
815
+ endAt: attr5("number"),
816
+ timezone: attr5("string"),
817
+ status: attr5("string", { indexed: true }),
818
+ googleEventId: attr5("string", { indexed: true, optional: true }),
819
+ meetUrl: attr5("string", { optional: true }),
820
+ htmlLink: attr5("string", { optional: true }),
821
+ drift: attr5("string", { indexed: true, optional: true }),
822
+ driftGoogleStartAt: attr5("number", { optional: true }),
823
+ driftDetectedAt: attr5("number", { optional: true }),
824
+ adoptedFromGoogleAt: attr5("number", { optional: true }),
825
+ createdAt: attr5("number", { indexed: true })
802
826
  }
803
827
  };
804
828
  var emailLog = {
805
829
  attrs: {
806
830
  id: id3(),
807
- groupId: attr4("string", { indexed: true }),
808
- applicationId: attr4("string", { indexed: true, optional: true }),
809
- to: attr4("string", { indexed: true }),
810
- template: attr4("string", { indexed: true }),
811
- subject: attr4("string"),
812
- body: attr4("string", { optional: true }),
813
- transport: attr4("string"),
814
- messageId: attr4("string", { optional: true }),
815
- redirected: attr4("boolean", { optional: true }),
816
- dedupeKey: attr4("string", { indexed: true, optional: true }),
817
- error: attr4("string", { optional: true }),
818
- sentAt: attr4("number", { indexed: true })
831
+ groupId: attr5("string", { indexed: true }),
832
+ applicationId: attr5("string", { indexed: true, optional: true }),
833
+ to: attr5("string", { indexed: true }),
834
+ template: attr5("string", { indexed: true }),
835
+ subject: attr5("string"),
836
+ body: attr5("string", { optional: true }),
837
+ transport: attr5("string"),
838
+ messageId: attr5("string", { optional: true }),
839
+ redirected: attr5("boolean", { optional: true }),
840
+ dedupeKey: attr5("string", { indexed: true, optional: true }),
841
+ error: attr5("string", { optional: true }),
842
+ sentAt: attr5("number", { indexed: true })
819
843
  }
820
844
  };
821
845
  function chapterDb(mode, auth, includeNetworkNotes = false, application = resolveApplication(void 0), includeSignupControl = false, includeMemberContent = false, includeBuilderLibrary = false, includeLeaderAdmissions = false) {
@@ -826,6 +850,7 @@ function chapterDb(mode, auth, includeNetworkNotes = false, application = resolv
826
850
  entities.tiers = tiers;
827
851
  entities.meetings = meetings;
828
852
  entities.emailLog = emailLog;
853
+ entities.stripeEventReceipts = stripeEventReceiptsEntity;
829
854
  entities.admissionGrants = admissionGrantsEntity;
830
855
  entities.admissionGrantRevisions = admissionGrantRevisionsEntity;
831
856
  entities.giftPurchaseIntents = giftPurchaseIntentsEntity;
@@ -3025,6 +3050,7 @@ function findApplicationRef(obj) {
3025
3050
  const environment = candidates.map((metadata) => typeof metadata.odlaEnvironment === "string" ? metadata.odlaEnvironment : void 0).find(Boolean);
3026
3051
  const dataEnvironment = candidates.map((metadata) => typeof metadata.odlaDataEnvironment === "string" ? metadata.odlaDataEnvironment : void 0).find(Boolean);
3027
3052
  const runtime = candidates.map((metadata) => typeof metadata.odlaRuntime === "string" ? metadata.odlaRuntime : void 0).find(Boolean);
3053
+ const chapterId = candidates.map((metadata) => typeof metadata.chapterId === "string" ? metadata.chapterId : void 0).find(Boolean);
3028
3054
  const customerId = typeof obj.customer === "string" ? obj.customer : void 0;
3029
3055
  return {
3030
3056
  ...applicationId ? { applicationId } : {},
@@ -3032,7 +3058,8 @@ function findApplicationRef(obj) {
3032
3058
  ...appId ? { appId } : {},
3033
3059
  ...environment ? { environment } : {},
3034
3060
  ...dataEnvironment ? { dataEnvironment } : {},
3035
- ...runtime ? { runtime } : {}
3061
+ ...runtime ? { runtime } : {},
3062
+ ...chapterId ? { chapterId } : {}
3036
3063
  };
3037
3064
  }
3038
3065
  function findGiftRef(obj) {
@@ -3048,13 +3075,15 @@ function findGiftRef(obj) {
3048
3075
  const environment = pickIdentity("odlaEnvironment");
3049
3076
  const dataEnvironment = pickIdentity("odlaDataEnvironment");
3050
3077
  const runtime = pickIdentity("odlaRuntime");
3078
+ const chapterId = pickIdentity("chapterId");
3051
3079
  return {
3052
3080
  ...giftIntentId ? { giftIntentId } : {},
3053
3081
  providerObjectId: subscriptionId ?? String(obj.id ?? ""),
3054
3082
  ...appId ? { appId } : {},
3055
3083
  ...environment ? { environment } : {},
3056
3084
  ...dataEnvironment ? { dataEnvironment } : {},
3057
- ...runtime ? { runtime } : {}
3085
+ ...runtime ? { runtime } : {},
3086
+ ...chapterId ? { chapterId } : {}
3058
3087
  };
3059
3088
  }
3060
3089
  function normalizeWebhookEvent(event) {