@usergist/sdk-core 0.1.0
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/index.cjs +1154 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +250 -0
- package/dist/index.d.ts +250 -0
- package/dist/index.js +1092 -0
- package/dist/index.js.map +1 -0
- package/dist/mobile-H9slSAy8.d.cts +2991 -0
- package/dist/mobile-H9slSAy8.d.ts +2991 -0
- package/dist/mobile.cjs +763 -0
- package/dist/mobile.cjs.map +1 -0
- package/dist/mobile.d.cts +1 -0
- package/dist/mobile.d.ts +1 -0
- package/dist/mobile.js +710 -0
- package/dist/mobile.js.map +1 -0
- package/mobile.js +4 -0
- package/package.json +64 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { B as BillingPriceKind, a as BillingInterval } from './mobile-H9slSAy8.cjs';
|
|
2
|
+
export { A as APP_OPEN_EVENT_NAME, b as APP_VERSION_CHANGED_EVENT_NAME, c as AUDIENCE_JOIN_EVENT_NAME, d as AUDIENCE_JOIN_TRIGGER_KIND, e as AcceptWorkspaceInviteRequest, f as AcceptWorkspaceInviteResponse, g as ActiveWindow, h as AdminActivityEntry, i as AdminBillingEvent, j as AdminBillingNotification, k as AdminCustomerApp, l as AdminCustomerDetail, m as AdminCustomerListRequest, n as AdminCustomerListResponse, o as AdminCustomerMember, p as AdminCustomerSummary, q as AdminGrantStatus, r as AdminSession, s as AdminWorkspaceSummary, t as AmplitudeIntegrationRegion, u as AndroidImportance, v as AnswerValue, w as ApiError, x as ApiMeta, y as ApiResponse, z as ApiToken, C as ApiTokenScope, D as App, E as AppBrandSettings, F as AppOpenBeacon, G as AppOpenTrigger, H as AppUserDetail, I as AppUserEvent, J as AppUserSummary, K as AppVersionChangedTrigger, L as AppVersionCondition, M as ArmedInAppMessage, N as ArmedSurvey, O as ArmedTrigger, P as AudienceCombinator, Q as AudienceCondition, R as AudienceConditionKind, S as AudienceJoinTrigger, T as AudienceMode, U as AudienceSpec, V as BaseSurveyQuestion, W as BillingAccessState, X as BillingChangePlanRequest, Y as BillingChangePlanResponse, Z as BillingChargeStatus, _ as BillingCheckoutRequest, $ as BillingCheckoutResponse, a0 as BillingOfferAvailability, a1 as BillingPeriod, a2 as BillingPlan, a3 as BillingTrial, a4 as BillingUsage, a5 as BrandPillar, a6 as BrandTheme, a7 as BrandThemeDefaults, a8 as BrandThemeRef, a9 as BrandThemeTokens, aa as BulkUpdateStatusRequest, ab as CORE_INTEGRATION_EVENTS, ac as Campaign, ad as CampaignAnalytics, ae as CampaignMode, af as CampaignStatus, ag as CampaignType, ah as CampaignWithVariants, ai as ChannelCategory, aj as ClientPrompt, ak as CloneSurveyFromTemplateRequest, al as Combinator, am as ComparisonOp, an as CompleteSurveyAttemptRequest, ao as ConnectIntegrationRequest, ap as Consent, aq as ConsentPurpose, ar as CoreEventSubjectRole, as as CoreIntegrationEventDefinition, at as CornerRadiusPreset, au as CountOp, av as CountryCondition, aw as CreateApiTokenRequest, ax as CreateAppRequest, ay as CreateBrandThemeRequest, az as CreateCampaignRequest, aA as CreateInAppMessageRequest, aB as CreatePromptRequest, aC as CreateSegmentRequest, aD as CreateSurveyAttemptRequest, aE as CreateSurveyAttemptResponse, aF as CreateSurveyRequest, aG as CreateWorkspacePlanGrantRequest, aH as CreateWorkspaceRequest, aI as CreateWriteKeyRequest, aJ as CreatedApiToken, aK as CreatedApp, aL as CreatedWriteKey, aM as DeliveryBeacon, aN as DeliveryBeaconKind, aO as EditCommentPayload, aP as EffectivePlanAccess, aQ as Endpoint, aR as EndpointKey, aS as EventCountPredicate, aT as EventCountRule, aU as EventDefinition, aV as EventOccurredPredicate, aW as EventPerformedCondition, aX as EventProperties, aY as EventPropertyFilter, aZ as EventPropertySchema, a_ as EventPropertyType, a$ as EventPropertyValue, b0 as EventTrigger, b1 as ExtendWorkspacePlanGrantRequest, b2 as FeedbackRecipient, b3 as FrequencyCaps, b4 as GdprDeleteRequest, b5 as GdprExportRequest, b6 as GenerateSegmentNameRequest, b7 as GenerateSegmentNameResponse, b8 as GenerateSegmentRulesRequest, b9 as GenerateSegmentRulesResponse, ba as GetRequestsOptions, bb as GetRequestsResult, bc as INAPP_AUTO_DISMISSED_EVENT_NAME, bd as INAPP_CTA_CLICKED_EVENT_NAME, be as INAPP_DISMISSED_EVENT_NAME, bf as INAPP_SHOWN_EVENT_NAME, bg as INTEGRATION_CATEGORIES, bh as INTEGRATION_PROVIDERS, bi as InAppCta, bj as InAppCtaAction, bk as InAppFrequency, bl as InAppMessage, bm as InAppMessageAnalytics, bn as InAppMessageFormat, bo as InAppMessageMode, bp as InAppMessageStatus, bq as InAppRecipient, br as InAppRecipientStatus, bs as InfoScreenQuestion, bt as IngestBatch, bu as IngestContext, bv as IngestEvent, bw as InstallDateCondition, bx as IntegrationCategory, by as IntegrationDeliveriesResponse, bz as IntegrationDeliveryStatus, bA as IntegrationDeliverySummary, bB as IntegrationProvider, bC as IntegrationRegion, bD as IntegrationStatus, bE as IntegrationSummary, bF as IntegrationTestResult, bG as InvalidateDeviceTokenPayload, bH as InviteMemberRequest, bI as JsonAction, bJ as LastActiveCondition, bK as LikertQuestion, bL as ListRequestsQuery, bM as ListResponsesQuery, bN as ListUserEventsQuery, bO as ListUsersQuery, bP as LongTextQuestion, bQ as MergeRequestsRequest, bR as MixpanelIntegrationRegion, bS as MultiChoiceQuestion, bT as MultipleChoiceQuestion, bU as NpsQuestion, bV as PUSH_EVENTS, bW as PaginatedAppUserEvents, bX as PaginatedAppUsers, bY as ParsedPushPayload, bZ as PeriodicFrequency, b_ as PeriodicSchedule, b$ as Platform, c0 as PlatformCondition, c1 as PostCommentPayload, c2 as Predicate, c3 as PredicateGroup, c4 as Prompt, c5 as PromptAnalytics, c6 as PromptResponse, c7 as PromptStatus, c8 as PromptTheme, c9 as PushABConfig, ca as PushActionButton, cb as PushActionType, cc as PushChannelDef, cd as PushCredentialSummary, ce as PushDeliveryMode, cf as PushEventName, cg as PushFrequencyCap, ch as PushInterruptionLevel, ci as PushPlatformFilter, cj as PushQuietHours, ck as PushSchedule, cl as PushTransactionalRequest, cm as PushUrgency, cn as PushVariant, co as Question, cp as QuestionType, cq as RADIUS_PRESETS, cr as RECIPIENTS_LIMIT, cs as REQUEST_COMMENTED_EVENT_NAME, ct as REQUEST_COMMENT_DELETED_EVENT_NAME, cu as REQUEST_COMMENT_EDITED_EVENT_NAME, cv as REQUEST_FOLLOWED_EVENT_NAME, cw as REQUEST_RESPONDED_EVENT_NAME, cx as REQUEST_STATUS_CHANGED_EVENT_NAME, cy as REQUEST_SUBMITTED_EVENT_NAME, cz as REQUEST_UNFOLLOWED_EVENT_NAME, cA as REQUEST_UNUPVOTED_EVENT_NAME, cB as REQUEST_UPVOTED_EVENT_NAME, cC as RankingQuestion, cD as RatingDisplayMode, cE as RatingQuestion, cF as RebindRequest, cG as RecipientIdentity, cH as RecipientList, cI as RegisterDeviceTokenPayload, cJ as RegisterEventDefinitionRequest, cK as Request, cL as RequestAnalytics, cM as RequestBranding, cN as RequestComment, cO as RequestDetail, cP as RequestFollow, cQ as RequestFollowPayload, cR as RequestFollowSource, cS as RequestNotificationRules, cT as RequestPersonalFilter, cU as RequestPublicBranding, cV as RequestPublicDetail, cW as RequestPublicSummary, cX as RequestSearchResult, cY as RequestSettings, cZ as RequestSort, c_ as RequestStatus, c$ as RequestStatusChangedNotice, d0 as RequestSummary, d1 as RequestTimelineEntry, d2 as RequestTimelineEntryKind, d3 as RequestUpvoterSegmentBreakdown, d4 as RequestVote, d5 as RequestVotePayload, d6 as RequestsHandlers, d7 as ResolveSurveyLinkRequest, d8 as ResolveSurveyLinkResponse, d9 as ResponseAnswer, da as RevokeWorkspacePlanGrantRequest, db as RotateWriteKeyRequest, dc as RotateWriteKeyResponse, dd as SURVEY_END_SENTINEL, de as ScalarList, df as ScalarValue, dg as SdkArmedInAppMessagesResponse, dh as SdkArmedSurveysResponse, di as SdkArmedTriggersResponse, dj as SdkConfig, dk as SdkConsentPayload, dl as SdkIdentifyPayload, dm as SdkIngestRequest, dn as SdkIngestResponse, dp as SdkPlatform, dq as SdkSessionResponse, dr as Segment, ds as SegmentCondition, dt as SegmentDsl, du as SegmentPreview, dv as SerializedSegmentRules, dw as ShortTextQuestion, dx as SilentAck, dy as SilentPushPayload, dz as SingleChoiceQuestion, dA as SingleDateQuestion, dB as SubmitRequestPayload, dC as SubmitResponsePayload, dD as SubmitSurveyAnswersRequest, dE as Subscription, dF as SubscriptionSource, dG as SubscriptionStatus, dH as SurveyAnalytics, dI as SurveyAnswerRecord, dJ as SurveyAnswerValue, dK as SurveyAttempt, dL as SurveyAttemptSource, dM as SurveyBranch, dN as SurveyBranchCondition, dO as SurveyBranchOp, dP as SurveyBranchValue, dQ as SurveyCampaign, dR as SurveyCampaignWithFlow, dS as SurveyChoiceOption, dT as SurveyDeliveryMode, dU as SurveyEndCta, dV as SurveyEndCtaKind, dW as SurveyEndScreen, dX as SurveyFlow, dY as SurveyFollowUp, dZ as SurveyFunnelStep, d_ as SurveyLocalization, d$ as SurveyNpsQuestion, e0 as SurveyOfferInstruction, e1 as SurveyProgressStyle, e2 as SurveyQuestion, e3 as SurveyQuestionDistribution, e4 as SurveyQuestionType, e5 as SurveyRatingQuestion, e6 as SurveyRecipient, e7 as SurveyRecipientStatus, e8 as SurveyResponseRecord, e9 as SurveyShareLinkResponse, ea as SurveyShortTextQuestion, eb as SurveySummary, ec as SurveyTemplate, ed as SurveyTextValidation, ee as THEME_PRESETS, ef as TestPromptOnDeviceRequest, eg as ThemeColors, eh as ThemeMode, ei as ThemePreset, ej as TriggerKind, ek as TriggerOccurrence, el as TriggerOccurrenceMode, em as TriggerSpec, en as USER_IDENTIFIED_EVENT_NAME, eo as UpdateAppRequest, ep as UpdateBrandThemeDefaultsRequest, eq as UpdateBrandThemeRequest, er as UpdateCampaignRequest, es as UpdateDeviceTokenPayload, et as UpdateEventDefinitionRequest, eu as UpdateInAppMessageRequest, ev as UpdateIntegrationRequest, ew as UpdatePromptRequest, ex as UpdateRequestModerationRequest, ey as UpdateRequestResponseRequest, ez as UpdateRequestSettingsRequest, eA as UpdateRequestStatusRequest, eB as UpdateSurveyAttemptProgressRequest, eC as UpdateSurveyRequest, eD as UploadApnsCredentialRequest, eE as UploadCredentialRequest, eF as UploadFcmCredentialRequest, eG as User, eH as UserPropertyCondition, eI as UserPropertyPredicate, eJ as UserPropertyRule, eK as UserState, eL as Workspace, eM as WorkspaceInvite, eN as WorkspaceMember, eO as WorkspacePlanGrant, eP as WorkspaceRole, eQ as WorkspaceWithRole, eR as WriteKey, eS as brandTokensFromPreset, eT as defaultEventTrigger, eU as defaultThemePreset, eV as defaultTriggerSpec, eW as emptyAudienceSpec, eX as emptySegmentDsl, eY as endpoints, eZ as err, e_ as estimateProgress, e$ as evaluateBranchCondition, f0 as evaluateSegment, f1 as evaluateSerializedSegmentRules, f2 as findQuestion, f3 as findQuestionIndex, f4 as getCoreIntegrationEvent, f5 as getThemePresetById, f6 as inAppColorsFromBrandTokens, f7 as isSilentPushPayload, f8 as nextPeriodicFire, f9 as nextQuestionId, fa as ok, fb as promptThemeFromBrandTokens, fc as reachableQuestions, fd as requestAccentFromBrandTokens, fe as sanitizeCoreIntegrationProperties, ff as serializedRulesToDsl, fg as tzOffsetMinutes } from './mobile-H9slSAy8.cjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
interface CommercialPlanDefinition {
|
|
6
|
+
readonly id: 'starter' | 'pro' | 'scale';
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly publicSlug: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly priceKind: BillingPriceKind;
|
|
11
|
+
readonly selfServe: boolean;
|
|
12
|
+
readonly baseAmountCents: number;
|
|
13
|
+
readonly currency: 'USD';
|
|
14
|
+
readonly includedMau: number;
|
|
15
|
+
readonly overagePer1kCents: number;
|
|
16
|
+
readonly appLimit: number | null;
|
|
17
|
+
readonly billingInterval: BillingInterval;
|
|
18
|
+
readonly sortOrder: number;
|
|
19
|
+
readonly accessRank: number;
|
|
20
|
+
readonly catalogVersion: number;
|
|
21
|
+
}
|
|
22
|
+
declare const COMMERCIAL_BILLING_PLANS: ReadonlyArray<CommercialPlanDefinition>;
|
|
23
|
+
declare const TRIAL_DAYS = 14;
|
|
24
|
+
declare const BILLING_GRACE_DAYS = 7;
|
|
25
|
+
declare const TRIAL_APP_LIMIT = 1;
|
|
26
|
+
declare const STARTER_FOUNDING_OFFER_CODE = "starter_founding_100";
|
|
27
|
+
declare const STARTER_FOUNDING_CUSTOMER_LIMIT = 100;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Password policy. Tightening this here flows to: API signup route, dashboard
|
|
31
|
+
* SignupForm, password-reset flow, future SSO bridge. Don't fork it in a form.
|
|
32
|
+
*/
|
|
33
|
+
declare const passwordSchema: z.ZodString;
|
|
34
|
+
declare const signupRequestSchema: z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
password: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
workspaceName: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
email: string;
|
|
41
|
+
password: string;
|
|
42
|
+
workspaceName: string;
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
email: string;
|
|
46
|
+
password: string;
|
|
47
|
+
workspaceName: string;
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
declare const loginPasswordRequestSchema: z.ZodObject<{
|
|
51
|
+
email: z.ZodString;
|
|
52
|
+
password: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
email: string;
|
|
55
|
+
password: string;
|
|
56
|
+
}, {
|
|
57
|
+
email: string;
|
|
58
|
+
password: string;
|
|
59
|
+
}>;
|
|
60
|
+
declare const loginMagicLinkRequestSchema: z.ZodObject<{
|
|
61
|
+
email: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
email: string;
|
|
64
|
+
}, {
|
|
65
|
+
email: string;
|
|
66
|
+
}>;
|
|
67
|
+
declare const loginMagicLinkConsumeRequestSchema: z.ZodObject<{
|
|
68
|
+
token: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
token: string;
|
|
71
|
+
}, {
|
|
72
|
+
token: string;
|
|
73
|
+
}>;
|
|
74
|
+
type SignupBody = z.infer<typeof signupRequestSchema>;
|
|
75
|
+
type LoginPasswordBody = z.infer<typeof loginPasswordRequestSchema>;
|
|
76
|
+
type LoginMagicLinkBody = z.infer<typeof loginMagicLinkRequestSchema>;
|
|
77
|
+
type LoginMagicLinkConsumeBody = z.infer<typeof loginMagicLinkConsumeRequestSchema>;
|
|
78
|
+
|
|
79
|
+
declare const platformSchema: z.ZodEnum<["ios", "android", "react-native", "flutter"]>;
|
|
80
|
+
declare const writeKeyEnvironmentSchema: z.ZodEnum<["production", "staging", "development"]>;
|
|
81
|
+
declare const apiTokenScopeSchema: z.ZodEnum<["sdk:subjects", "push.transactional"]>;
|
|
82
|
+
declare const createAppSchema: z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
85
|
+
platforms: z.ZodArray<z.ZodEnum<["ios", "android", "react-native", "flutter"]>, "many">;
|
|
86
|
+
environment: z.ZodDefault<z.ZodEnum<["production", "staging", "development"]>>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
name: string;
|
|
89
|
+
platforms: ("ios" | "android" | "react-native" | "flutter")[];
|
|
90
|
+
environment: "production" | "staging" | "development";
|
|
91
|
+
slug?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
name: string;
|
|
94
|
+
platforms: ("ios" | "android" | "react-native" | "flutter")[];
|
|
95
|
+
environment?: "production" | "staging" | "development" | undefined;
|
|
96
|
+
slug?: string | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
declare const updateAppSchema: z.ZodEffects<z.ZodObject<{
|
|
99
|
+
name: z.ZodOptional<z.ZodString>;
|
|
100
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["ios", "android", "react-native", "flutter"]>, "many">>;
|
|
101
|
+
piiAllowList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
102
|
+
lifecycleEventsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
name?: string | undefined;
|
|
105
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
106
|
+
piiAllowList?: string[] | undefined;
|
|
107
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
name?: string | undefined;
|
|
110
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
111
|
+
piiAllowList?: string[] | undefined;
|
|
112
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
113
|
+
}>, {
|
|
114
|
+
name?: string | undefined;
|
|
115
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
116
|
+
piiAllowList?: string[] | undefined;
|
|
117
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
121
|
+
piiAllowList?: string[] | undefined;
|
|
122
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
declare const createWriteKeySchema: z.ZodObject<{
|
|
125
|
+
label: z.ZodOptional<z.ZodString>;
|
|
126
|
+
environment: z.ZodDefault<z.ZodEnum<["production", "staging", "development"]>>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
environment: "production" | "staging" | "development";
|
|
129
|
+
label?: string | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
environment?: "production" | "staging" | "development" | undefined;
|
|
132
|
+
label?: string | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
declare const rotateWriteKeySchema: z.ZodObject<{
|
|
135
|
+
graceSeconds: z.ZodDefault<z.ZodNumber>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
graceSeconds: number;
|
|
138
|
+
}, {
|
|
139
|
+
graceSeconds?: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
declare const createApiTokenSchema: z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
scopes: z.ZodEffects<z.ZodArray<z.ZodEnum<["sdk:subjects", "push.transactional"]>, "many">, ("sdk:subjects" | "push.transactional")[], ("sdk:subjects" | "push.transactional")[]>;
|
|
144
|
+
expiresInDays: z.ZodDefault<z.ZodNumber>;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
name: string;
|
|
147
|
+
scopes: ("sdk:subjects" | "push.transactional")[];
|
|
148
|
+
expiresInDays: number;
|
|
149
|
+
}, {
|
|
150
|
+
name: string;
|
|
151
|
+
scopes: ("sdk:subjects" | "push.transactional")[];
|
|
152
|
+
expiresInDays?: number | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
declare const createWorkspaceSchema: z.ZodObject<{
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
name: string;
|
|
159
|
+
slug?: string | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
name: string;
|
|
162
|
+
slug?: string | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
declare const inviteMemberSchema: z.ZodObject<{
|
|
165
|
+
email: z.ZodString;
|
|
166
|
+
role: z.ZodEnum<["admin", "editor", "viewer"]>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
email: string;
|
|
169
|
+
role: "admin" | "editor" | "viewer";
|
|
170
|
+
}, {
|
|
171
|
+
email: string;
|
|
172
|
+
role: "admin" | "editor" | "viewer";
|
|
173
|
+
}>;
|
|
174
|
+
declare const acceptWorkspaceInviteSchema: z.ZodObject<{
|
|
175
|
+
token: z.ZodString;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
token: string;
|
|
178
|
+
}, {
|
|
179
|
+
token: string;
|
|
180
|
+
}>;
|
|
181
|
+
type CreateAppBody = z.infer<typeof createAppSchema>;
|
|
182
|
+
type UpdateAppBody = z.infer<typeof updateAppSchema>;
|
|
183
|
+
type CreateWriteKeyBody = z.infer<typeof createWriteKeySchema>;
|
|
184
|
+
type RotateWriteKeyBody = z.infer<typeof rotateWriteKeySchema>;
|
|
185
|
+
type CreateApiTokenBody = z.infer<typeof createApiTokenSchema>;
|
|
186
|
+
type CreateWorkspaceBody = z.infer<typeof createWorkspaceSchema>;
|
|
187
|
+
type InviteMemberBody = z.infer<typeof inviteMemberSchema>;
|
|
188
|
+
type AcceptWorkspaceInviteBody = z.infer<typeof acceptWorkspaceInviteSchema>;
|
|
189
|
+
|
|
190
|
+
/** Lowercase + digits + dashes; URL-safe slug. */
|
|
191
|
+
declare const slugSchema: z.ZodString;
|
|
192
|
+
/** RFC 5321 max email length. */
|
|
193
|
+
declare const emailSchema: z.ZodString;
|
|
194
|
+
declare const uuidSchema: z.ZodString;
|
|
195
|
+
declare const isoDateTimeSchema: z.ZodString;
|
|
196
|
+
/** Workspace role hierarchy used by tenant middleware. */
|
|
197
|
+
declare const workspaceRoleSchema: z.ZodEnum<["owner", "admin", "editor", "viewer"]>;
|
|
198
|
+
type WorkspaceRoleInput = z.infer<typeof workspaceRoleSchema>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Shared Zod schemas — single source of truth for request/response validation.
|
|
202
|
+
*
|
|
203
|
+
* Both the API (Fastify route handlers) and the dashboard (react-hook-form +
|
|
204
|
+
* runtime response validation) import from here. If you change a schema,
|
|
205
|
+
* every consumer sees the new constraint at compile time.
|
|
206
|
+
*
|
|
207
|
+
* Migration is incremental — pillars are landing here pillar-by-pillar. The
|
|
208
|
+
* API still has duplicate schemas under `apps/api/src/schemas/` for the ones
|
|
209
|
+
* not yet moved; those re-export from here to keep import paths stable.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
type index_AcceptWorkspaceInviteBody = AcceptWorkspaceInviteBody;
|
|
213
|
+
type index_CreateApiTokenBody = CreateApiTokenBody;
|
|
214
|
+
type index_CreateAppBody = CreateAppBody;
|
|
215
|
+
type index_CreateWorkspaceBody = CreateWorkspaceBody;
|
|
216
|
+
type index_CreateWriteKeyBody = CreateWriteKeyBody;
|
|
217
|
+
type index_InviteMemberBody = InviteMemberBody;
|
|
218
|
+
type index_LoginMagicLinkBody = LoginMagicLinkBody;
|
|
219
|
+
type index_LoginMagicLinkConsumeBody = LoginMagicLinkConsumeBody;
|
|
220
|
+
type index_LoginPasswordBody = LoginPasswordBody;
|
|
221
|
+
type index_RotateWriteKeyBody = RotateWriteKeyBody;
|
|
222
|
+
type index_SignupBody = SignupBody;
|
|
223
|
+
type index_UpdateAppBody = UpdateAppBody;
|
|
224
|
+
type index_WorkspaceRoleInput = WorkspaceRoleInput;
|
|
225
|
+
declare const index_acceptWorkspaceInviteSchema: typeof acceptWorkspaceInviteSchema;
|
|
226
|
+
declare const index_apiTokenScopeSchema: typeof apiTokenScopeSchema;
|
|
227
|
+
declare const index_createApiTokenSchema: typeof createApiTokenSchema;
|
|
228
|
+
declare const index_createAppSchema: typeof createAppSchema;
|
|
229
|
+
declare const index_createWorkspaceSchema: typeof createWorkspaceSchema;
|
|
230
|
+
declare const index_createWriteKeySchema: typeof createWriteKeySchema;
|
|
231
|
+
declare const index_emailSchema: typeof emailSchema;
|
|
232
|
+
declare const index_inviteMemberSchema: typeof inviteMemberSchema;
|
|
233
|
+
declare const index_isoDateTimeSchema: typeof isoDateTimeSchema;
|
|
234
|
+
declare const index_loginMagicLinkConsumeRequestSchema: typeof loginMagicLinkConsumeRequestSchema;
|
|
235
|
+
declare const index_loginMagicLinkRequestSchema: typeof loginMagicLinkRequestSchema;
|
|
236
|
+
declare const index_loginPasswordRequestSchema: typeof loginPasswordRequestSchema;
|
|
237
|
+
declare const index_passwordSchema: typeof passwordSchema;
|
|
238
|
+
declare const index_platformSchema: typeof platformSchema;
|
|
239
|
+
declare const index_rotateWriteKeySchema: typeof rotateWriteKeySchema;
|
|
240
|
+
declare const index_signupRequestSchema: typeof signupRequestSchema;
|
|
241
|
+
declare const index_slugSchema: typeof slugSchema;
|
|
242
|
+
declare const index_updateAppSchema: typeof updateAppSchema;
|
|
243
|
+
declare const index_uuidSchema: typeof uuidSchema;
|
|
244
|
+
declare const index_workspaceRoleSchema: typeof workspaceRoleSchema;
|
|
245
|
+
declare const index_writeKeyEnvironmentSchema: typeof writeKeyEnvironmentSchema;
|
|
246
|
+
declare namespace index {
|
|
247
|
+
export { type index_AcceptWorkspaceInviteBody as AcceptWorkspaceInviteBody, type index_CreateApiTokenBody as CreateApiTokenBody, type index_CreateAppBody as CreateAppBody, type index_CreateWorkspaceBody as CreateWorkspaceBody, type index_CreateWriteKeyBody as CreateWriteKeyBody, type index_InviteMemberBody as InviteMemberBody, type index_LoginMagicLinkBody as LoginMagicLinkBody, type index_LoginMagicLinkConsumeBody as LoginMagicLinkConsumeBody, type index_LoginPasswordBody as LoginPasswordBody, type index_RotateWriteKeyBody as RotateWriteKeyBody, type index_SignupBody as SignupBody, type index_UpdateAppBody as UpdateAppBody, type index_WorkspaceRoleInput as WorkspaceRoleInput, index_acceptWorkspaceInviteSchema as acceptWorkspaceInviteSchema, index_apiTokenScopeSchema as apiTokenScopeSchema, index_createApiTokenSchema as createApiTokenSchema, index_createAppSchema as createAppSchema, index_createWorkspaceSchema as createWorkspaceSchema, index_createWriteKeySchema as createWriteKeySchema, index_emailSchema as emailSchema, index_inviteMemberSchema as inviteMemberSchema, index_isoDateTimeSchema as isoDateTimeSchema, index_loginMagicLinkConsumeRequestSchema as loginMagicLinkConsumeRequestSchema, index_loginMagicLinkRequestSchema as loginMagicLinkRequestSchema, index_loginPasswordRequestSchema as loginPasswordRequestSchema, index_passwordSchema as passwordSchema, index_platformSchema as platformSchema, index_rotateWriteKeySchema as rotateWriteKeySchema, index_signupRequestSchema as signupRequestSchema, index_slugSchema as slugSchema, index_updateAppSchema as updateAppSchema, index_uuidSchema as uuidSchema, index_workspaceRoleSchema as workspaceRoleSchema, index_writeKeyEnvironmentSchema as writeKeyEnvironmentSchema };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { BILLING_GRACE_DAYS, BillingInterval, BillingPriceKind, COMMERCIAL_BILLING_PLANS, type CommercialPlanDefinition, STARTER_FOUNDING_CUSTOMER_LIMIT, STARTER_FOUNDING_OFFER_CODE, TRIAL_APP_LIMIT, TRIAL_DAYS, index as schemas };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { B as BillingPriceKind, a as BillingInterval } from './mobile-H9slSAy8.js';
|
|
2
|
+
export { A as APP_OPEN_EVENT_NAME, b as APP_VERSION_CHANGED_EVENT_NAME, c as AUDIENCE_JOIN_EVENT_NAME, d as AUDIENCE_JOIN_TRIGGER_KIND, e as AcceptWorkspaceInviteRequest, f as AcceptWorkspaceInviteResponse, g as ActiveWindow, h as AdminActivityEntry, i as AdminBillingEvent, j as AdminBillingNotification, k as AdminCustomerApp, l as AdminCustomerDetail, m as AdminCustomerListRequest, n as AdminCustomerListResponse, o as AdminCustomerMember, p as AdminCustomerSummary, q as AdminGrantStatus, r as AdminSession, s as AdminWorkspaceSummary, t as AmplitudeIntegrationRegion, u as AndroidImportance, v as AnswerValue, w as ApiError, x as ApiMeta, y as ApiResponse, z as ApiToken, C as ApiTokenScope, D as App, E as AppBrandSettings, F as AppOpenBeacon, G as AppOpenTrigger, H as AppUserDetail, I as AppUserEvent, J as AppUserSummary, K as AppVersionChangedTrigger, L as AppVersionCondition, M as ArmedInAppMessage, N as ArmedSurvey, O as ArmedTrigger, P as AudienceCombinator, Q as AudienceCondition, R as AudienceConditionKind, S as AudienceJoinTrigger, T as AudienceMode, U as AudienceSpec, V as BaseSurveyQuestion, W as BillingAccessState, X as BillingChangePlanRequest, Y as BillingChangePlanResponse, Z as BillingChargeStatus, _ as BillingCheckoutRequest, $ as BillingCheckoutResponse, a0 as BillingOfferAvailability, a1 as BillingPeriod, a2 as BillingPlan, a3 as BillingTrial, a4 as BillingUsage, a5 as BrandPillar, a6 as BrandTheme, a7 as BrandThemeDefaults, a8 as BrandThemeRef, a9 as BrandThemeTokens, aa as BulkUpdateStatusRequest, ab as CORE_INTEGRATION_EVENTS, ac as Campaign, ad as CampaignAnalytics, ae as CampaignMode, af as CampaignStatus, ag as CampaignType, ah as CampaignWithVariants, ai as ChannelCategory, aj as ClientPrompt, ak as CloneSurveyFromTemplateRequest, al as Combinator, am as ComparisonOp, an as CompleteSurveyAttemptRequest, ao as ConnectIntegrationRequest, ap as Consent, aq as ConsentPurpose, ar as CoreEventSubjectRole, as as CoreIntegrationEventDefinition, at as CornerRadiusPreset, au as CountOp, av as CountryCondition, aw as CreateApiTokenRequest, ax as CreateAppRequest, ay as CreateBrandThemeRequest, az as CreateCampaignRequest, aA as CreateInAppMessageRequest, aB as CreatePromptRequest, aC as CreateSegmentRequest, aD as CreateSurveyAttemptRequest, aE as CreateSurveyAttemptResponse, aF as CreateSurveyRequest, aG as CreateWorkspacePlanGrantRequest, aH as CreateWorkspaceRequest, aI as CreateWriteKeyRequest, aJ as CreatedApiToken, aK as CreatedApp, aL as CreatedWriteKey, aM as DeliveryBeacon, aN as DeliveryBeaconKind, aO as EditCommentPayload, aP as EffectivePlanAccess, aQ as Endpoint, aR as EndpointKey, aS as EventCountPredicate, aT as EventCountRule, aU as EventDefinition, aV as EventOccurredPredicate, aW as EventPerformedCondition, aX as EventProperties, aY as EventPropertyFilter, aZ as EventPropertySchema, a_ as EventPropertyType, a$ as EventPropertyValue, b0 as EventTrigger, b1 as ExtendWorkspacePlanGrantRequest, b2 as FeedbackRecipient, b3 as FrequencyCaps, b4 as GdprDeleteRequest, b5 as GdprExportRequest, b6 as GenerateSegmentNameRequest, b7 as GenerateSegmentNameResponse, b8 as GenerateSegmentRulesRequest, b9 as GenerateSegmentRulesResponse, ba as GetRequestsOptions, bb as GetRequestsResult, bc as INAPP_AUTO_DISMISSED_EVENT_NAME, bd as INAPP_CTA_CLICKED_EVENT_NAME, be as INAPP_DISMISSED_EVENT_NAME, bf as INAPP_SHOWN_EVENT_NAME, bg as INTEGRATION_CATEGORIES, bh as INTEGRATION_PROVIDERS, bi as InAppCta, bj as InAppCtaAction, bk as InAppFrequency, bl as InAppMessage, bm as InAppMessageAnalytics, bn as InAppMessageFormat, bo as InAppMessageMode, bp as InAppMessageStatus, bq as InAppRecipient, br as InAppRecipientStatus, bs as InfoScreenQuestion, bt as IngestBatch, bu as IngestContext, bv as IngestEvent, bw as InstallDateCondition, bx as IntegrationCategory, by as IntegrationDeliveriesResponse, bz as IntegrationDeliveryStatus, bA as IntegrationDeliverySummary, bB as IntegrationProvider, bC as IntegrationRegion, bD as IntegrationStatus, bE as IntegrationSummary, bF as IntegrationTestResult, bG as InvalidateDeviceTokenPayload, bH as InviteMemberRequest, bI as JsonAction, bJ as LastActiveCondition, bK as LikertQuestion, bL as ListRequestsQuery, bM as ListResponsesQuery, bN as ListUserEventsQuery, bO as ListUsersQuery, bP as LongTextQuestion, bQ as MergeRequestsRequest, bR as MixpanelIntegrationRegion, bS as MultiChoiceQuestion, bT as MultipleChoiceQuestion, bU as NpsQuestion, bV as PUSH_EVENTS, bW as PaginatedAppUserEvents, bX as PaginatedAppUsers, bY as ParsedPushPayload, bZ as PeriodicFrequency, b_ as PeriodicSchedule, b$ as Platform, c0 as PlatformCondition, c1 as PostCommentPayload, c2 as Predicate, c3 as PredicateGroup, c4 as Prompt, c5 as PromptAnalytics, c6 as PromptResponse, c7 as PromptStatus, c8 as PromptTheme, c9 as PushABConfig, ca as PushActionButton, cb as PushActionType, cc as PushChannelDef, cd as PushCredentialSummary, ce as PushDeliveryMode, cf as PushEventName, cg as PushFrequencyCap, ch as PushInterruptionLevel, ci as PushPlatformFilter, cj as PushQuietHours, ck as PushSchedule, cl as PushTransactionalRequest, cm as PushUrgency, cn as PushVariant, co as Question, cp as QuestionType, cq as RADIUS_PRESETS, cr as RECIPIENTS_LIMIT, cs as REQUEST_COMMENTED_EVENT_NAME, ct as REQUEST_COMMENT_DELETED_EVENT_NAME, cu as REQUEST_COMMENT_EDITED_EVENT_NAME, cv as REQUEST_FOLLOWED_EVENT_NAME, cw as REQUEST_RESPONDED_EVENT_NAME, cx as REQUEST_STATUS_CHANGED_EVENT_NAME, cy as REQUEST_SUBMITTED_EVENT_NAME, cz as REQUEST_UNFOLLOWED_EVENT_NAME, cA as REQUEST_UNUPVOTED_EVENT_NAME, cB as REQUEST_UPVOTED_EVENT_NAME, cC as RankingQuestion, cD as RatingDisplayMode, cE as RatingQuestion, cF as RebindRequest, cG as RecipientIdentity, cH as RecipientList, cI as RegisterDeviceTokenPayload, cJ as RegisterEventDefinitionRequest, cK as Request, cL as RequestAnalytics, cM as RequestBranding, cN as RequestComment, cO as RequestDetail, cP as RequestFollow, cQ as RequestFollowPayload, cR as RequestFollowSource, cS as RequestNotificationRules, cT as RequestPersonalFilter, cU as RequestPublicBranding, cV as RequestPublicDetail, cW as RequestPublicSummary, cX as RequestSearchResult, cY as RequestSettings, cZ as RequestSort, c_ as RequestStatus, c$ as RequestStatusChangedNotice, d0 as RequestSummary, d1 as RequestTimelineEntry, d2 as RequestTimelineEntryKind, d3 as RequestUpvoterSegmentBreakdown, d4 as RequestVote, d5 as RequestVotePayload, d6 as RequestsHandlers, d7 as ResolveSurveyLinkRequest, d8 as ResolveSurveyLinkResponse, d9 as ResponseAnswer, da as RevokeWorkspacePlanGrantRequest, db as RotateWriteKeyRequest, dc as RotateWriteKeyResponse, dd as SURVEY_END_SENTINEL, de as ScalarList, df as ScalarValue, dg as SdkArmedInAppMessagesResponse, dh as SdkArmedSurveysResponse, di as SdkArmedTriggersResponse, dj as SdkConfig, dk as SdkConsentPayload, dl as SdkIdentifyPayload, dm as SdkIngestRequest, dn as SdkIngestResponse, dp as SdkPlatform, dq as SdkSessionResponse, dr as Segment, ds as SegmentCondition, dt as SegmentDsl, du as SegmentPreview, dv as SerializedSegmentRules, dw as ShortTextQuestion, dx as SilentAck, dy as SilentPushPayload, dz as SingleChoiceQuestion, dA as SingleDateQuestion, dB as SubmitRequestPayload, dC as SubmitResponsePayload, dD as SubmitSurveyAnswersRequest, dE as Subscription, dF as SubscriptionSource, dG as SubscriptionStatus, dH as SurveyAnalytics, dI as SurveyAnswerRecord, dJ as SurveyAnswerValue, dK as SurveyAttempt, dL as SurveyAttemptSource, dM as SurveyBranch, dN as SurveyBranchCondition, dO as SurveyBranchOp, dP as SurveyBranchValue, dQ as SurveyCampaign, dR as SurveyCampaignWithFlow, dS as SurveyChoiceOption, dT as SurveyDeliveryMode, dU as SurveyEndCta, dV as SurveyEndCtaKind, dW as SurveyEndScreen, dX as SurveyFlow, dY as SurveyFollowUp, dZ as SurveyFunnelStep, d_ as SurveyLocalization, d$ as SurveyNpsQuestion, e0 as SurveyOfferInstruction, e1 as SurveyProgressStyle, e2 as SurveyQuestion, e3 as SurveyQuestionDistribution, e4 as SurveyQuestionType, e5 as SurveyRatingQuestion, e6 as SurveyRecipient, e7 as SurveyRecipientStatus, e8 as SurveyResponseRecord, e9 as SurveyShareLinkResponse, ea as SurveyShortTextQuestion, eb as SurveySummary, ec as SurveyTemplate, ed as SurveyTextValidation, ee as THEME_PRESETS, ef as TestPromptOnDeviceRequest, eg as ThemeColors, eh as ThemeMode, ei as ThemePreset, ej as TriggerKind, ek as TriggerOccurrence, el as TriggerOccurrenceMode, em as TriggerSpec, en as USER_IDENTIFIED_EVENT_NAME, eo as UpdateAppRequest, ep as UpdateBrandThemeDefaultsRequest, eq as UpdateBrandThemeRequest, er as UpdateCampaignRequest, es as UpdateDeviceTokenPayload, et as UpdateEventDefinitionRequest, eu as UpdateInAppMessageRequest, ev as UpdateIntegrationRequest, ew as UpdatePromptRequest, ex as UpdateRequestModerationRequest, ey as UpdateRequestResponseRequest, ez as UpdateRequestSettingsRequest, eA as UpdateRequestStatusRequest, eB as UpdateSurveyAttemptProgressRequest, eC as UpdateSurveyRequest, eD as UploadApnsCredentialRequest, eE as UploadCredentialRequest, eF as UploadFcmCredentialRequest, eG as User, eH as UserPropertyCondition, eI as UserPropertyPredicate, eJ as UserPropertyRule, eK as UserState, eL as Workspace, eM as WorkspaceInvite, eN as WorkspaceMember, eO as WorkspacePlanGrant, eP as WorkspaceRole, eQ as WorkspaceWithRole, eR as WriteKey, eS as brandTokensFromPreset, eT as defaultEventTrigger, eU as defaultThemePreset, eV as defaultTriggerSpec, eW as emptyAudienceSpec, eX as emptySegmentDsl, eY as endpoints, eZ as err, e_ as estimateProgress, e$ as evaluateBranchCondition, f0 as evaluateSegment, f1 as evaluateSerializedSegmentRules, f2 as findQuestion, f3 as findQuestionIndex, f4 as getCoreIntegrationEvent, f5 as getThemePresetById, f6 as inAppColorsFromBrandTokens, f7 as isSilentPushPayload, f8 as nextPeriodicFire, f9 as nextQuestionId, fa as ok, fb as promptThemeFromBrandTokens, fc as reachableQuestions, fd as requestAccentFromBrandTokens, fe as sanitizeCoreIntegrationProperties, ff as serializedRulesToDsl, fg as tzOffsetMinutes } from './mobile-H9slSAy8.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
interface CommercialPlanDefinition {
|
|
6
|
+
readonly id: 'starter' | 'pro' | 'scale';
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly publicSlug: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly priceKind: BillingPriceKind;
|
|
11
|
+
readonly selfServe: boolean;
|
|
12
|
+
readonly baseAmountCents: number;
|
|
13
|
+
readonly currency: 'USD';
|
|
14
|
+
readonly includedMau: number;
|
|
15
|
+
readonly overagePer1kCents: number;
|
|
16
|
+
readonly appLimit: number | null;
|
|
17
|
+
readonly billingInterval: BillingInterval;
|
|
18
|
+
readonly sortOrder: number;
|
|
19
|
+
readonly accessRank: number;
|
|
20
|
+
readonly catalogVersion: number;
|
|
21
|
+
}
|
|
22
|
+
declare const COMMERCIAL_BILLING_PLANS: ReadonlyArray<CommercialPlanDefinition>;
|
|
23
|
+
declare const TRIAL_DAYS = 14;
|
|
24
|
+
declare const BILLING_GRACE_DAYS = 7;
|
|
25
|
+
declare const TRIAL_APP_LIMIT = 1;
|
|
26
|
+
declare const STARTER_FOUNDING_OFFER_CODE = "starter_founding_100";
|
|
27
|
+
declare const STARTER_FOUNDING_CUSTOMER_LIMIT = 100;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Password policy. Tightening this here flows to: API signup route, dashboard
|
|
31
|
+
* SignupForm, password-reset flow, future SSO bridge. Don't fork it in a form.
|
|
32
|
+
*/
|
|
33
|
+
declare const passwordSchema: z.ZodString;
|
|
34
|
+
declare const signupRequestSchema: z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
password: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
workspaceName: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
email: string;
|
|
41
|
+
password: string;
|
|
42
|
+
workspaceName: string;
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
email: string;
|
|
46
|
+
password: string;
|
|
47
|
+
workspaceName: string;
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
declare const loginPasswordRequestSchema: z.ZodObject<{
|
|
51
|
+
email: z.ZodString;
|
|
52
|
+
password: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
email: string;
|
|
55
|
+
password: string;
|
|
56
|
+
}, {
|
|
57
|
+
email: string;
|
|
58
|
+
password: string;
|
|
59
|
+
}>;
|
|
60
|
+
declare const loginMagicLinkRequestSchema: z.ZodObject<{
|
|
61
|
+
email: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
email: string;
|
|
64
|
+
}, {
|
|
65
|
+
email: string;
|
|
66
|
+
}>;
|
|
67
|
+
declare const loginMagicLinkConsumeRequestSchema: z.ZodObject<{
|
|
68
|
+
token: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
token: string;
|
|
71
|
+
}, {
|
|
72
|
+
token: string;
|
|
73
|
+
}>;
|
|
74
|
+
type SignupBody = z.infer<typeof signupRequestSchema>;
|
|
75
|
+
type LoginPasswordBody = z.infer<typeof loginPasswordRequestSchema>;
|
|
76
|
+
type LoginMagicLinkBody = z.infer<typeof loginMagicLinkRequestSchema>;
|
|
77
|
+
type LoginMagicLinkConsumeBody = z.infer<typeof loginMagicLinkConsumeRequestSchema>;
|
|
78
|
+
|
|
79
|
+
declare const platformSchema: z.ZodEnum<["ios", "android", "react-native", "flutter"]>;
|
|
80
|
+
declare const writeKeyEnvironmentSchema: z.ZodEnum<["production", "staging", "development"]>;
|
|
81
|
+
declare const apiTokenScopeSchema: z.ZodEnum<["sdk:subjects", "push.transactional"]>;
|
|
82
|
+
declare const createAppSchema: z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
85
|
+
platforms: z.ZodArray<z.ZodEnum<["ios", "android", "react-native", "flutter"]>, "many">;
|
|
86
|
+
environment: z.ZodDefault<z.ZodEnum<["production", "staging", "development"]>>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
name: string;
|
|
89
|
+
platforms: ("ios" | "android" | "react-native" | "flutter")[];
|
|
90
|
+
environment: "production" | "staging" | "development";
|
|
91
|
+
slug?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
name: string;
|
|
94
|
+
platforms: ("ios" | "android" | "react-native" | "flutter")[];
|
|
95
|
+
environment?: "production" | "staging" | "development" | undefined;
|
|
96
|
+
slug?: string | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
declare const updateAppSchema: z.ZodEffects<z.ZodObject<{
|
|
99
|
+
name: z.ZodOptional<z.ZodString>;
|
|
100
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["ios", "android", "react-native", "flutter"]>, "many">>;
|
|
101
|
+
piiAllowList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
102
|
+
lifecycleEventsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
name?: string | undefined;
|
|
105
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
106
|
+
piiAllowList?: string[] | undefined;
|
|
107
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
name?: string | undefined;
|
|
110
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
111
|
+
piiAllowList?: string[] | undefined;
|
|
112
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
113
|
+
}>, {
|
|
114
|
+
name?: string | undefined;
|
|
115
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
116
|
+
piiAllowList?: string[] | undefined;
|
|
117
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
platforms?: ("ios" | "android" | "react-native" | "flutter")[] | undefined;
|
|
121
|
+
piiAllowList?: string[] | undefined;
|
|
122
|
+
lifecycleEventsEnabled?: boolean | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
declare const createWriteKeySchema: z.ZodObject<{
|
|
125
|
+
label: z.ZodOptional<z.ZodString>;
|
|
126
|
+
environment: z.ZodDefault<z.ZodEnum<["production", "staging", "development"]>>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
environment: "production" | "staging" | "development";
|
|
129
|
+
label?: string | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
environment?: "production" | "staging" | "development" | undefined;
|
|
132
|
+
label?: string | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
declare const rotateWriteKeySchema: z.ZodObject<{
|
|
135
|
+
graceSeconds: z.ZodDefault<z.ZodNumber>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
graceSeconds: number;
|
|
138
|
+
}, {
|
|
139
|
+
graceSeconds?: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
declare const createApiTokenSchema: z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
scopes: z.ZodEffects<z.ZodArray<z.ZodEnum<["sdk:subjects", "push.transactional"]>, "many">, ("sdk:subjects" | "push.transactional")[], ("sdk:subjects" | "push.transactional")[]>;
|
|
144
|
+
expiresInDays: z.ZodDefault<z.ZodNumber>;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
name: string;
|
|
147
|
+
scopes: ("sdk:subjects" | "push.transactional")[];
|
|
148
|
+
expiresInDays: number;
|
|
149
|
+
}, {
|
|
150
|
+
name: string;
|
|
151
|
+
scopes: ("sdk:subjects" | "push.transactional")[];
|
|
152
|
+
expiresInDays?: number | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
declare const createWorkspaceSchema: z.ZodObject<{
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
name: string;
|
|
159
|
+
slug?: string | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
name: string;
|
|
162
|
+
slug?: string | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
declare const inviteMemberSchema: z.ZodObject<{
|
|
165
|
+
email: z.ZodString;
|
|
166
|
+
role: z.ZodEnum<["admin", "editor", "viewer"]>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
email: string;
|
|
169
|
+
role: "admin" | "editor" | "viewer";
|
|
170
|
+
}, {
|
|
171
|
+
email: string;
|
|
172
|
+
role: "admin" | "editor" | "viewer";
|
|
173
|
+
}>;
|
|
174
|
+
declare const acceptWorkspaceInviteSchema: z.ZodObject<{
|
|
175
|
+
token: z.ZodString;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
token: string;
|
|
178
|
+
}, {
|
|
179
|
+
token: string;
|
|
180
|
+
}>;
|
|
181
|
+
type CreateAppBody = z.infer<typeof createAppSchema>;
|
|
182
|
+
type UpdateAppBody = z.infer<typeof updateAppSchema>;
|
|
183
|
+
type CreateWriteKeyBody = z.infer<typeof createWriteKeySchema>;
|
|
184
|
+
type RotateWriteKeyBody = z.infer<typeof rotateWriteKeySchema>;
|
|
185
|
+
type CreateApiTokenBody = z.infer<typeof createApiTokenSchema>;
|
|
186
|
+
type CreateWorkspaceBody = z.infer<typeof createWorkspaceSchema>;
|
|
187
|
+
type InviteMemberBody = z.infer<typeof inviteMemberSchema>;
|
|
188
|
+
type AcceptWorkspaceInviteBody = z.infer<typeof acceptWorkspaceInviteSchema>;
|
|
189
|
+
|
|
190
|
+
/** Lowercase + digits + dashes; URL-safe slug. */
|
|
191
|
+
declare const slugSchema: z.ZodString;
|
|
192
|
+
/** RFC 5321 max email length. */
|
|
193
|
+
declare const emailSchema: z.ZodString;
|
|
194
|
+
declare const uuidSchema: z.ZodString;
|
|
195
|
+
declare const isoDateTimeSchema: z.ZodString;
|
|
196
|
+
/** Workspace role hierarchy used by tenant middleware. */
|
|
197
|
+
declare const workspaceRoleSchema: z.ZodEnum<["owner", "admin", "editor", "viewer"]>;
|
|
198
|
+
type WorkspaceRoleInput = z.infer<typeof workspaceRoleSchema>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Shared Zod schemas — single source of truth for request/response validation.
|
|
202
|
+
*
|
|
203
|
+
* Both the API (Fastify route handlers) and the dashboard (react-hook-form +
|
|
204
|
+
* runtime response validation) import from here. If you change a schema,
|
|
205
|
+
* every consumer sees the new constraint at compile time.
|
|
206
|
+
*
|
|
207
|
+
* Migration is incremental — pillars are landing here pillar-by-pillar. The
|
|
208
|
+
* API still has duplicate schemas under `apps/api/src/schemas/` for the ones
|
|
209
|
+
* not yet moved; those re-export from here to keep import paths stable.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
type index_AcceptWorkspaceInviteBody = AcceptWorkspaceInviteBody;
|
|
213
|
+
type index_CreateApiTokenBody = CreateApiTokenBody;
|
|
214
|
+
type index_CreateAppBody = CreateAppBody;
|
|
215
|
+
type index_CreateWorkspaceBody = CreateWorkspaceBody;
|
|
216
|
+
type index_CreateWriteKeyBody = CreateWriteKeyBody;
|
|
217
|
+
type index_InviteMemberBody = InviteMemberBody;
|
|
218
|
+
type index_LoginMagicLinkBody = LoginMagicLinkBody;
|
|
219
|
+
type index_LoginMagicLinkConsumeBody = LoginMagicLinkConsumeBody;
|
|
220
|
+
type index_LoginPasswordBody = LoginPasswordBody;
|
|
221
|
+
type index_RotateWriteKeyBody = RotateWriteKeyBody;
|
|
222
|
+
type index_SignupBody = SignupBody;
|
|
223
|
+
type index_UpdateAppBody = UpdateAppBody;
|
|
224
|
+
type index_WorkspaceRoleInput = WorkspaceRoleInput;
|
|
225
|
+
declare const index_acceptWorkspaceInviteSchema: typeof acceptWorkspaceInviteSchema;
|
|
226
|
+
declare const index_apiTokenScopeSchema: typeof apiTokenScopeSchema;
|
|
227
|
+
declare const index_createApiTokenSchema: typeof createApiTokenSchema;
|
|
228
|
+
declare const index_createAppSchema: typeof createAppSchema;
|
|
229
|
+
declare const index_createWorkspaceSchema: typeof createWorkspaceSchema;
|
|
230
|
+
declare const index_createWriteKeySchema: typeof createWriteKeySchema;
|
|
231
|
+
declare const index_emailSchema: typeof emailSchema;
|
|
232
|
+
declare const index_inviteMemberSchema: typeof inviteMemberSchema;
|
|
233
|
+
declare const index_isoDateTimeSchema: typeof isoDateTimeSchema;
|
|
234
|
+
declare const index_loginMagicLinkConsumeRequestSchema: typeof loginMagicLinkConsumeRequestSchema;
|
|
235
|
+
declare const index_loginMagicLinkRequestSchema: typeof loginMagicLinkRequestSchema;
|
|
236
|
+
declare const index_loginPasswordRequestSchema: typeof loginPasswordRequestSchema;
|
|
237
|
+
declare const index_passwordSchema: typeof passwordSchema;
|
|
238
|
+
declare const index_platformSchema: typeof platformSchema;
|
|
239
|
+
declare const index_rotateWriteKeySchema: typeof rotateWriteKeySchema;
|
|
240
|
+
declare const index_signupRequestSchema: typeof signupRequestSchema;
|
|
241
|
+
declare const index_slugSchema: typeof slugSchema;
|
|
242
|
+
declare const index_updateAppSchema: typeof updateAppSchema;
|
|
243
|
+
declare const index_uuidSchema: typeof uuidSchema;
|
|
244
|
+
declare const index_workspaceRoleSchema: typeof workspaceRoleSchema;
|
|
245
|
+
declare const index_writeKeyEnvironmentSchema: typeof writeKeyEnvironmentSchema;
|
|
246
|
+
declare namespace index {
|
|
247
|
+
export { type index_AcceptWorkspaceInviteBody as AcceptWorkspaceInviteBody, type index_CreateApiTokenBody as CreateApiTokenBody, type index_CreateAppBody as CreateAppBody, type index_CreateWorkspaceBody as CreateWorkspaceBody, type index_CreateWriteKeyBody as CreateWriteKeyBody, type index_InviteMemberBody as InviteMemberBody, type index_LoginMagicLinkBody as LoginMagicLinkBody, type index_LoginMagicLinkConsumeBody as LoginMagicLinkConsumeBody, type index_LoginPasswordBody as LoginPasswordBody, type index_RotateWriteKeyBody as RotateWriteKeyBody, type index_SignupBody as SignupBody, type index_UpdateAppBody as UpdateAppBody, type index_WorkspaceRoleInput as WorkspaceRoleInput, index_acceptWorkspaceInviteSchema as acceptWorkspaceInviteSchema, index_apiTokenScopeSchema as apiTokenScopeSchema, index_createApiTokenSchema as createApiTokenSchema, index_createAppSchema as createAppSchema, index_createWorkspaceSchema as createWorkspaceSchema, index_createWriteKeySchema as createWriteKeySchema, index_emailSchema as emailSchema, index_inviteMemberSchema as inviteMemberSchema, index_isoDateTimeSchema as isoDateTimeSchema, index_loginMagicLinkConsumeRequestSchema as loginMagicLinkConsumeRequestSchema, index_loginMagicLinkRequestSchema as loginMagicLinkRequestSchema, index_loginPasswordRequestSchema as loginPasswordRequestSchema, index_passwordSchema as passwordSchema, index_platformSchema as platformSchema, index_rotateWriteKeySchema as rotateWriteKeySchema, index_signupRequestSchema as signupRequestSchema, index_slugSchema as slugSchema, index_updateAppSchema as updateAppSchema, index_uuidSchema as uuidSchema, index_workspaceRoleSchema as workspaceRoleSchema, index_writeKeyEnvironmentSchema as writeKeyEnvironmentSchema };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { BILLING_GRACE_DAYS, BillingInterval, BillingPriceKind, COMMERCIAL_BILLING_PLANS, type CommercialPlanDefinition, STARTER_FOUNDING_CUSTOMER_LIMIT, STARTER_FOUNDING_OFFER_CODE, TRIAL_APP_LIMIT, TRIAL_DAYS, index as schemas };
|