@getrheo/contracts 1.0.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.
Files changed (81) hide show
  1. package/dist/animations.d.ts +226 -0
  2. package/dist/animations.js +1160 -0
  3. package/dist/animations.js.map +1 -0
  4. package/dist/appIntegrations.d.ts +175 -0
  5. package/dist/appIntegrations.js +60 -0
  6. package/dist/appIntegrations.js.map +1 -0
  7. package/dist/billingPeriod.d.ts +26 -0
  8. package/dist/billingPeriod.js +39 -0
  9. package/dist/billingPeriod.js.map +1 -0
  10. package/dist/canvasEditorGates.d.ts +81 -0
  11. package/dist/canvasEditorGates.js +1460 -0
  12. package/dist/canvasEditorGates.js.map +1 -0
  13. package/dist/constants/index.d.ts +30 -0
  14. package/dist/constants/index.js +67 -0
  15. package/dist/constants/index.js.map +1 -0
  16. package/dist/dashboard.d.ts +181856 -0
  17. package/dist/dashboard.js +3348 -0
  18. package/dist/dashboard.js.map +1 -0
  19. package/dist/decisions.d.ts +575 -0
  20. package/dist/decisions.js +1209 -0
  21. package/dist/decisions.js.map +1 -0
  22. package/dist/events.d.ts +231 -0
  23. package/dist/events.js +63 -0
  24. package/dist/events.js.map +1 -0
  25. package/dist/experiments-DN8pQa_D.d.ts +530 -0
  26. package/dist/externalSurfaceIntegrations.d.ts +20 -0
  27. package/dist/externalSurfaceIntegrations.js +49 -0
  28. package/dist/externalSurfaceIntegrations.js.map +1 -0
  29. package/dist/externalSurfaces.d.ts +177 -0
  30. package/dist/externalSurfaces.js +1190 -0
  31. package/dist/externalSurfaces.js.map +1 -0
  32. package/dist/fields.d.ts +8 -0
  33. package/dist/fields.js +15 -0
  34. package/dist/fields.js.map +1 -0
  35. package/dist/flowManifestSchema-CtqygXCK.d.ts +50857 -0
  36. package/dist/flowTemplateComments.d.ts +23 -0
  37. package/dist/flowTemplateComments.js +14 -0
  38. package/dist/flowTemplateComments.js.map +1 -0
  39. package/dist/flowTemplates.d.ts +22 -0
  40. package/dist/flowTemplates.js +73 -0
  41. package/dist/flowTemplates.js.map +1 -0
  42. package/dist/identity.d.ts +35 -0
  43. package/dist/identity.js +18 -0
  44. package/dist/identity.js.map +1 -0
  45. package/dist/imageContentType.d.ts +11 -0
  46. package/dist/imageContentType.js +54 -0
  47. package/dist/imageContentType.js.map +1 -0
  48. package/dist/index.d.ts +224 -0
  49. package/dist/index.js +4557 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/layerUnion-BzXoAJLY.d.ts +34 -0
  52. package/dist/layers.d.ts +89844 -0
  53. package/dist/layers.js +1507 -0
  54. package/dist/layers.js.map +1 -0
  55. package/dist/layout-D0LpaKG-.d.ts +12896 -0
  56. package/dist/localized.d.ts +17 -0
  57. package/dist/localized.js +18 -0
  58. package/dist/localized.js.map +1 -0
  59. package/dist/manifest.d.ts +22192 -0
  60. package/dist/manifest.js +2163 -0
  61. package/dist/manifest.js.map +1 -0
  62. package/dist/media.d.ts +53 -0
  63. package/dist/media.js +55 -0
  64. package/dist/media.js.map +1 -0
  65. package/dist/planEntitlements.d.ts +65 -0
  66. package/dist/planEntitlements.js +117 -0
  67. package/dist/planEntitlements.js.map +1 -0
  68. package/dist/publish-exports.json +102 -0
  69. package/dist/screens.d.ts +33586 -0
  70. package/dist/screens.js +1439 -0
  71. package/dist/screens.js.map +1 -0
  72. package/dist/sdk.d.ts +145942 -0
  73. package/dist/sdk.js +3424 -0
  74. package/dist/sdk.js.map +1 -0
  75. package/dist/sdkAttributes.d.ts +11 -0
  76. package/dist/sdkAttributes.js +17 -0
  77. package/dist/sdkAttributes.js.map +1 -0
  78. package/dist/workspaceCapabilities.d.ts +15 -0
  79. package/dist/workspaceCapabilities.js +116 -0
  80. package/dist/workspaceCapabilities.js.map +1 -0
  81. package/package.json +162 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/billingPeriod.ts"],"names":[],"mappings":";AACO,IAAM,4BAAA,GAA+B;AACrC,IAAM,4BAAA,GAA+B;AAErC,IAAM,sBA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GAAsB,CACjC,SAAA,KACwB;AACxB,EAAA,IAAI,SAAA,KAAc,aAAa,OAAO,KAAA;AACtC,EAAA,IAAI,SAAA,KAAc,MAAM,OAAO,IAAA;AAC/B,EAAA,OAAO,IAAA;AACT;AAGO,IAAM,uBAAA,GAA0B,CACrC,SAAA,KAC8B;AAC9B,EAAA,IAAI,SAAA,KAAc,QAAQ,OAAO,IAAA;AACjC,EAAA,IAAI,SAAA,KAAc,aAAa,OAAO,KAAA;AACtC,EAAA,OAAO,SAAA;AACT","file":"billingPeriod.js","sourcesContent":["/** Fraction of included MAU at which Indie usage alerts fire. */\nexport const MAU_USAGE_ALERT_THRESHOLD_50 = 0.5;\nexport const MAU_USAGE_ALERT_THRESHOLD_80 = 0.8;\n\nexport const MAU_USAGE_ALERT_LEVELS = ['50', '80', '100'] as const;\nexport type MauUsageAlertLevel = (typeof MAU_USAGE_ALERT_LEVELS)[number];\n\nexport type MauUsageThreshold =\n | 'none'\n | '50'\n | '80'\n | '100'\n | 'suspended';\n\nexport type UtcCalendarMonthPeriod = {\n periodKey: string;\n startIso: string;\n endIso: string;\n};\n\n/** UTC calendar month bounds for Indie MAU billing (inclusive start, inclusive end instants). */\nexport const getUtcCalendarMonthPeriod = (now: Date = new Date()): UtcCalendarMonthPeriod => {\n const y = now.getUTCFullYear();\n const m = now.getUTCMonth();\n const start = new Date(Date.UTC(y, m, 1, 0, 0, 0, 0));\n const end = new Date(Date.UTC(y, m + 1, 0, 23, 59, 59, 999));\n const periodKey = `${y}-${String(m + 1).padStart(2, '0')}`;\n return {\n periodKey,\n startIso: start.toISOString(),\n endIso: end.toISOString(),\n };\n};\n\n/**\n * Indie MAU alert tier from live usage vs included cap.\n * - 50%: email only (>= 50% and < 80%)\n * - 80%: email + banner (>= 80% and <= cap — still serving at exactly cap)\n * - 100% / suspended: > cap (SDK paused)\n */\nexport const mauUsageThreshold = (\n liveMau: number,\n includedMau: number,\n): MauUsageThreshold => {\n if (includedMau <= 0) return 'none';\n if (liveMau > includedMau) return 'suspended';\n const at80 = includedMau * MAU_USAGE_ALERT_THRESHOLD_80;\n const at50 = includedMau * MAU_USAGE_ALERT_THRESHOLD_50;\n if (liveMau >= at80) return '80';\n if (liveMau >= at50) return '50';\n return 'none';\n};\n\n/** Alert levels that trigger dashboard banners (not email-only 50%). */\nexport const mauUsageBannerLevel = (\n threshold: MauUsageThreshold,\n): '80' | '100' | null => {\n if (threshold === 'suspended') return '100';\n if (threshold === '80') return '80';\n return null;\n};\n\n/** Threshold keys eligible for one-time email per billing period. */\nexport const mauUsageEmailAlertLevel = (\n threshold: MauUsageThreshold,\n): MauUsageAlertLevel | null => {\n if (threshold === 'none') return null;\n if (threshold === 'suspended') return '100';\n return threshold;\n};\n"]}
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ import { F as FlowManifest } from './flowManifestSchema-CtqygXCK.js';
3
+ import './decisions.js';
4
+ import './layout-D0LpaKG-.js';
5
+ import './localized.js';
6
+ import './media.js';
7
+
8
+ /** Keys stored in DB / API; false = capability disabled in the canvas editor. */
9
+ declare const CANVAS_EDITOR_GATE_KEYS: readonly ["lottie", "oauthLogin", "oauthProviderPreset", "oauthProviderCustom", "emailPasswordAuth", "emailPasswordField", "emailPasswordSubmit", "requestOsPermission"];
10
+ type CanvasEditorGateKey = (typeof CANVAS_EDITOR_GATE_KEYS)[number];
11
+ type ResolvedCanvasEditorGates = Record<CanvasEditorGateKey, boolean>;
12
+ declare const CanvasEditorGatesResolvedSchema: z.ZodObject<{
13
+ lottie: z.ZodBoolean;
14
+ oauthLogin: z.ZodBoolean;
15
+ oauthProviderPreset: z.ZodBoolean;
16
+ oauthProviderCustom: z.ZodBoolean;
17
+ emailPasswordAuth: z.ZodBoolean;
18
+ emailPasswordField: z.ZodBoolean;
19
+ emailPasswordSubmit: z.ZodBoolean;
20
+ requestOsPermission: z.ZodBoolean;
21
+ }, "strip", z.ZodTypeAny, {
22
+ lottie: boolean;
23
+ oauthLogin: boolean;
24
+ oauthProviderPreset: boolean;
25
+ oauthProviderCustom: boolean;
26
+ emailPasswordAuth: boolean;
27
+ emailPasswordField: boolean;
28
+ emailPasswordSubmit: boolean;
29
+ requestOsPermission: boolean;
30
+ }, {
31
+ lottie: boolean;
32
+ oauthLogin: boolean;
33
+ oauthProviderPreset: boolean;
34
+ oauthProviderCustom: boolean;
35
+ emailPasswordAuth: boolean;
36
+ emailPasswordField: boolean;
37
+ emailPasswordSubmit: boolean;
38
+ requestOsPermission: boolean;
39
+ }>;
40
+ type CanvasEditorGatesResolved = z.infer<typeof CanvasEditorGatesResolvedSchema>;
41
+ /** Partial overrides; omitted keys default to enabled (true). */
42
+ declare const CanvasEditorGatesPatchSchema: z.ZodObject<{
43
+ lottie: z.ZodOptional<z.ZodBoolean>;
44
+ oauthLogin: z.ZodOptional<z.ZodBoolean>;
45
+ oauthProviderPreset: z.ZodOptional<z.ZodBoolean>;
46
+ oauthProviderCustom: z.ZodOptional<z.ZodBoolean>;
47
+ emailPasswordAuth: z.ZodOptional<z.ZodBoolean>;
48
+ emailPasswordField: z.ZodOptional<z.ZodBoolean>;
49
+ emailPasswordSubmit: z.ZodOptional<z.ZodBoolean>;
50
+ requestOsPermission: z.ZodOptional<z.ZodBoolean>;
51
+ }, "strict", z.ZodTypeAny, {
52
+ lottie?: boolean | undefined;
53
+ oauthLogin?: boolean | undefined;
54
+ oauthProviderPreset?: boolean | undefined;
55
+ oauthProviderCustom?: boolean | undefined;
56
+ emailPasswordAuth?: boolean | undefined;
57
+ emailPasswordField?: boolean | undefined;
58
+ emailPasswordSubmit?: boolean | undefined;
59
+ requestOsPermission?: boolean | undefined;
60
+ }, {
61
+ lottie?: boolean | undefined;
62
+ oauthLogin?: boolean | undefined;
63
+ oauthProviderPreset?: boolean | undefined;
64
+ oauthProviderCustom?: boolean | undefined;
65
+ emailPasswordAuth?: boolean | undefined;
66
+ emailPasswordField?: boolean | undefined;
67
+ emailPasswordSubmit?: boolean | undefined;
68
+ requestOsPermission?: boolean | undefined;
69
+ }>;
70
+ type CanvasEditorGatesPatch = z.infer<typeof CanvasEditorGatesPatchSchema>;
71
+ declare const parseCanvasEditorGates: (raw: unknown | null | undefined) => ResolvedCanvasEditorGates;
72
+ /**
73
+ * Returns human-readable issues when the manifest uses capabilities that are
74
+ * turned off for the app. Empty when allowed.
75
+ */
76
+ declare const collectCanvasGateViolations: (manifest: FlowManifest, gates: ResolvedCanvasEditorGates) => string[];
77
+ declare const manifestPassesCanvasGates: (manifest: FlowManifest, gates: ResolvedCanvasEditorGates) => boolean;
78
+ /** One-line constraints for AI system prompts. */
79
+ declare const describeCanvasGatesForAi: (gates: ResolvedCanvasEditorGates) => string;
80
+
81
+ export { CANVAS_EDITOR_GATE_KEYS, type CanvasEditorGateKey, type CanvasEditorGatesPatch, CanvasEditorGatesPatchSchema, type CanvasEditorGatesResolved, CanvasEditorGatesResolvedSchema, type ResolvedCanvasEditorGates, collectCanvasGateViolations, describeCanvasGatesForAi, manifestPassesCanvasGates, parseCanvasEditorGates };