@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 +135 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +135 -106
- package/dist/index.js.map +1 -1
- package/dist/worker/index.cjs +306 -124
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.js +306 -124
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
- package/runbooks/adopt-existing.md +16 -0
- package/runbooks/greenfield.md +16 -1
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
|
|
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 = () =>
|
|
682
|
+
var id3 = () => attr5("string", { unique: true, indexed: true });
|
|
659
683
|
var admins = {
|
|
660
684
|
attrs: {
|
|
661
685
|
id: id3(),
|
|
662
|
-
email:
|
|
663
|
-
name:
|
|
664
|
-
note:
|
|
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:
|
|
671
|
-
note:
|
|
672
|
-
createdAt:
|
|
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:
|
|
679
|
-
targetId:
|
|
680
|
-
recordType:
|
|
681
|
-
recordId:
|
|
682
|
-
body:
|
|
683
|
-
authorId:
|
|
684
|
-
authorEmail:
|
|
685
|
-
createdAt:
|
|
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:
|
|
692
|
-
targetId:
|
|
693
|
-
environment:
|
|
694
|
-
revision:
|
|
695
|
-
digest:
|
|
696
|
-
document:
|
|
697
|
-
active:
|
|
698
|
-
receivedAt:
|
|
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:
|
|
705
|
-
targetId:
|
|
706
|
-
environment:
|
|
707
|
-
revision:
|
|
708
|
-
digest:
|
|
709
|
-
document:
|
|
710
|
-
active:
|
|
711
|
-
receivedAt:
|
|
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:
|
|
718
|
-
environment:
|
|
719
|
-
revision:
|
|
720
|
-
document:
|
|
721
|
-
updatedAt:
|
|
722
|
-
updatedBy:
|
|
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:
|
|
729
|
-
targetId:
|
|
730
|
-
environment:
|
|
731
|
-
revision:
|
|
732
|
-
digest:
|
|
733
|
-
document:
|
|
734
|
-
active:
|
|
735
|
-
receivedAt:
|
|
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:
|
|
742
|
-
environment:
|
|
743
|
-
revision:
|
|
744
|
-
document:
|
|
745
|
-
updatedAt:
|
|
746
|
-
updatedBy:
|
|
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:
|
|
753
|
-
standardPriceCents:
|
|
754
|
-
foundingDiscountCents:
|
|
755
|
-
stripePriceId:
|
|
756
|
-
stripePublishableKey:
|
|
757
|
-
notificationEmail:
|
|
758
|
-
replyTo:
|
|
759
|
-
debugEmail:
|
|
760
|
-
calendarLink:
|
|
761
|
-
disclaimerText:
|
|
762
|
-
refundPolicyText:
|
|
763
|
-
merchantDisclosureText:
|
|
764
|
-
trustCopy:
|
|
765
|
-
commitmentText:
|
|
766
|
-
normsText:
|
|
767
|
-
emailTemplates:
|
|
768
|
-
schedulingJson:
|
|
769
|
-
createdAt:
|
|
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:
|
|
776
|
-
name:
|
|
777
|
-
priceCents:
|
|
778
|
-
stripePriceId:
|
|
779
|
-
blurb:
|
|
780
|
-
sortOrder:
|
|
781
|
-
active:
|
|
782
|
-
createdAt:
|
|
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:
|
|
789
|
-
groupId:
|
|
790
|
-
startAt:
|
|
791
|
-
endAt:
|
|
792
|
-
timezone:
|
|
793
|
-
status:
|
|
794
|
-
googleEventId:
|
|
795
|
-
meetUrl:
|
|
796
|
-
htmlLink:
|
|
797
|
-
drift:
|
|
798
|
-
driftGoogleStartAt:
|
|
799
|
-
driftDetectedAt:
|
|
800
|
-
adoptedFromGoogleAt:
|
|
801
|
-
createdAt:
|
|
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:
|
|
808
|
-
applicationId:
|
|
809
|
-
to:
|
|
810
|
-
template:
|
|
811
|
-
subject:
|
|
812
|
-
body:
|
|
813
|
-
transport:
|
|
814
|
-
messageId:
|
|
815
|
-
redirected:
|
|
816
|
-
dedupeKey:
|
|
817
|
-
error:
|
|
818
|
-
sentAt:
|
|
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) {
|