@domino-sdk/relay 1.0.0-next.2 → 1.0.0-next.34

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 (61) hide show
  1. package/README.md +13 -1
  2. package/build.mjs +18 -1
  3. package/dist/activity-B8k9Sa_a.d.ts +9112 -0
  4. package/dist/authoring.d.ts +1355 -182
  5. package/dist/authoring.js +658 -225
  6. package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
  7. package/dist/avatar.d.ts +29 -0
  8. package/dist/avatar.js +21 -0
  9. package/dist/browser-J7tUpXxy.d.ts +4154 -0
  10. package/dist/browser.d.ts +11 -4580
  11. package/dist/browser.js +8 -6
  12. package/dist/capability-error-DNMwKmlL.d.ts +458 -0
  13. package/dist/chunk-36HTX2BM.js +1223 -0
  14. package/dist/chunk-6QJ3LADK.js +112 -0
  15. package/dist/chunk-BGGKNIRP.js +171 -0
  16. package/dist/chunk-EYH5RDIE.js +496 -0
  17. package/dist/chunk-GQKYAQM6.js +84 -0
  18. package/dist/chunk-GUP7YRR4.js +42 -0
  19. package/dist/chunk-GZ6FJAXN.js +1659 -0
  20. package/dist/chunk-JON5SESL.js +2986 -0
  21. package/dist/chunk-MC6V6VMG.js +49 -0
  22. package/dist/chunk-NPGENI7K.js +37 -0
  23. package/dist/chunk-V7UKZLHA.js +35 -0
  24. package/dist/chunk-VFHHLN6A.js +284 -0
  25. package/dist/chunk-WJSSJ7AF.js +151 -0
  26. package/dist/{chunk-VH4OQ5VX.js → chunk-XFMSUPNS.js} +26 -5
  27. package/dist/{chunk-FDWRBMB3.js → chunk-ZVIRG24J.js} +150 -33
  28. package/dist/client-XiuFnug_.d.ts +4262 -0
  29. package/dist/groups-Ck-OxzjD.d.ts +2449 -0
  30. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  31. package/dist/images-Dv-P5VBw.d.ts +234 -0
  32. package/dist/index.d.ts +15 -13115
  33. package/dist/index.js +30 -689
  34. package/dist/internal.d.ts +159 -0
  35. package/dist/internal.js +79 -0
  36. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  37. package/dist/outcomes-kVB-Juzs.d.ts +4902 -0
  38. package/dist/pages-BBYD21IE.d.ts +359 -0
  39. package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
  40. package/dist/portal-proxy.js +26 -9
  41. package/dist/profiles-D2aFcOxu.d.ts +297 -0
  42. package/dist/react/index.d.ts +3378 -3318
  43. package/dist/react/index.js +1635 -783
  44. package/dist/request-error-DWduJCGV.d.ts +62 -0
  45. package/dist/schema-DfJzH2ci.d.ts +5644 -0
  46. package/dist/schema.d.ts +15 -3388
  47. package/dist/schema.js +790 -3
  48. package/dist/server/index.d.ts +81498 -0
  49. package/dist/server/index.js +2520 -0
  50. package/dist/streaks-CWyq8Px5.d.ts +71 -0
  51. package/dist/submission-input-BZkm6ohU.d.ts +290 -0
  52. package/dist/units-CwgsPB_r.d.ts +9 -0
  53. package/dist/vite.d.ts +1 -1
  54. package/dist/vite.js +1 -0
  55. package/dist/wallet-YssWxGg8.d.ts +228 -0
  56. package/package.json +24 -5
  57. package/dist/chunk-4KNTMNXA.js +0 -1847
  58. package/dist/chunk-B76BAJ25.js +0 -624
  59. package/dist/chunk-NKGJEYZM.js +0 -1833
  60. package/dist/chunk-ONDBQSMU.js +0 -373
  61. package/dist/submission-input-JDwq3EVK.d.ts +0 -4986
@@ -0,0 +1,159 @@
1
+ import { u as PublishedRelease, ad as TrackerSource, a1 as TrackerDataSchema, af as TrackerSourceResponse, w as QuestDescription } from './schema-DfJzH2ci.js';
2
+ export { cM as TrackerDataBudget, cN as schemaCheckedReader, cO as trackerDataBatchSteps, cP as trackerDataIssue, cQ as trackerDataIssues, cR as trackerDataPathTypes, cS as trackerDataRecordSteps, cT as whereSchemaIssue } from './schema-DfJzH2ci.js';
3
+ export { I as IdentityKindClaim, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, c as identityKindClaimSchema, p as participantExchangeSchema } from './identity-integration-GxAHdKR2.js';
4
+ import { c as ImageFields, g as ImageRequest } from './images-Dv-P5VBw.js';
5
+ export { E as Extracted } from './images-Dv-P5VBw.js';
6
+ import { b as RequestErrorKind } from './request-error-DWduJCGV.js';
7
+ import { z } from 'zod';
8
+
9
+ /** Older releases did not record ownership. Preserve every value, including defaults. */
10
+ declare function questConfiguration(release: PublishedRelease): {
11
+ defaults: Record<string, string | number | boolean | {
12
+ id: string;
13
+ prompt: string;
14
+ choices: {
15
+ id: string;
16
+ label: string;
17
+ }[];
18
+ correct: string;
19
+ }[]>;
20
+ overrides: Record<string, string | number | boolean | {
21
+ id: string;
22
+ prompt: string;
23
+ choices: {
24
+ id: string;
25
+ label: string;
26
+ }[];
27
+ correct: string;
28
+ }[]>;
29
+ preserved: string[];
30
+ };
31
+
32
+ /** Every declared field is present with its declared type or null; nothing else is returned. */
33
+ declare function parseImageExtraction(raw: ImageFields, value: unknown): {
34
+ values: Record<string, string | number | boolean | null>;
35
+ reason: string;
36
+ };
37
+ declare function parseImageResult(request: ImageRequest, value: unknown): {
38
+ kind: "pass" | "fail" | "unclear";
39
+ reason: string;
40
+ } | {
41
+ width: number;
42
+ height: number;
43
+ format: "jpeg" | "png" | "webp" | "gif" | "avif";
44
+ bytes: number;
45
+ sha256: string;
46
+ phash: string;
47
+ dhash: string;
48
+ } | {
49
+ identical: boolean;
50
+ phashDistance: number;
51
+ dhashDistance: number;
52
+ } | {
53
+ values: Record<string, string | number | boolean | null>;
54
+ reason: string;
55
+ } | {
56
+ matches: number;
57
+ closestDistance: number | null;
58
+ firstSeenAt: number | null;
59
+ };
60
+
61
+ /** Cursor polling of a participant's own committed activity. */
62
+ declare function isActivityParticipantRoute(path: string, method: string): boolean;
63
+ /** The signed-in participant's earned rewards and delivery states. */
64
+ declare function isRewardsParticipantRoute(path: string, method: string): boolean;
65
+ /** Content stage and engagement reads. */
66
+ declare function isContentParticipantRoute(path: string, method: string): boolean;
67
+ /**
68
+ * The member's automatic-quest outcomes, campaign and quest enrollment, and historical claims.
69
+ */
70
+ declare function isQuestOutcomeParticipantRoute(path: string, method: string): boolean;
71
+ /** The member's own point balances and the history of one ledger (`me.balances`, `me.pointHistory`). */
72
+ declare function isPointsParticipantRoute(path: string, method: string): boolean;
73
+ declare function isOfferParticipantRoute(path: string, method: string): boolean;
74
+ /**
75
+ * The profile routes, with their methods: the member's own profile, and the reads keyed by a
76
+ * public profile ID.
77
+ */
78
+ declare function isProfileParticipantRoute(path: string, method: string): boolean;
79
+ /**
80
+ * The participant wallet paths the client calls. The gates admit GET and POST; the API answers
81
+ * another method on a wallet path with 405.
82
+ */
83
+ declare function isWalletParticipantRoute(path: string): boolean;
84
+ /**
85
+ * Wallet sign-in (`/v1/auth/wallet/start` and `/verify`). Hosted proxies admit it; identity
86
+ * integrations do not, because their apps have their own login.
87
+ */
88
+ declare function isWalletSignInRoute(path: string): boolean;
89
+
90
+ /** The management client's and the CLI's default deadline per call. */
91
+ declare const MANAGEMENT_TIMEOUT = 30000;
92
+ /** One call's deadline and the caller's signal, shared by every attempt and the body read. */
93
+ type Lifetime = {
94
+ /** Aborts when the caller cancels or the deadline passes; pass it to `fetch`. */
95
+ readonly signal: AbortSignal;
96
+ readonly timeout: number;
97
+ /** Why the call ended early, if it did: the caller's signal wins over the deadline. */
98
+ ended(): "aborted" | "timeout" | undefined;
99
+ /** Milliseconds left before the deadline. */
100
+ remaining(): number;
101
+ /** The caller's abort reason, or the deadline's. */
102
+ reason(): unknown;
103
+ /** Stops the deadline once the call has everything it needs. */
104
+ end(): void;
105
+ };
106
+ declare function lifetime(timeout: number, caller?: AbortSignal): Lifetime;
107
+ /**
108
+ * The wait a `Retry-After` header asks for, in milliseconds: delay-seconds or an HTTP date.
109
+ * Undefined when the header is absent or unreadable.
110
+ */
111
+ declare function retryAfter(headers: Pick<Headers, "get">, now?: number): number | undefined;
112
+ /** What a failed attempt tells the retry loop. */
113
+ type AttemptFailure = {
114
+ kind: RequestErrorKind;
115
+ status?: number;
116
+ /** The attempt was a write that may have been applied. */
117
+ uncertain: boolean;
118
+ /** The server's `Retry-After`, in milliseconds. */
119
+ retryAfter?: number;
120
+ };
121
+ type Rules = {
122
+ /** The call is a read, or a write its route applies at most once (`retryDelay`). */
123
+ replaySafe: boolean;
124
+ /** Reads a failed attempt; undefined for an error that is not a request failure. */
125
+ describe?: (error: unknown) => AttemptFailure | undefined;
126
+ /** The error to throw when an earlier attempt may have applied the write. */
127
+ uncertain?: (error: unknown) => unknown;
128
+ };
129
+ /**
130
+ * Runs `attempt` until it succeeds or `retryDelay` says stop. A caller abort during a wait goes
131
+ * straight to the next attempt, which refuses to send and fails as `aborted`.
132
+ */
133
+ declare function retrying<T>(life: Lifetime, rules: Rules, attempt: () => Promise<T>): Promise<T>;
134
+
135
+ /**
136
+ * How Relay reads back a cursor it issued over a numeric position. Clients treat cursors as
137
+ * opaque strings (`pageCursorSchema`); only the server parses them, so the format can change.
138
+ */
139
+ declare const sequenceCursorSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodNumber>;
140
+
141
+ /** The account roles a source's records can name: `author` and any others the source declares. */
142
+ declare function sourceRoles(source: TrackerSourceResponse): readonly string[];
143
+ /**
144
+ * The schema a source's record `data` matches: a custom source's declared schema, a Discord
145
+ * source's fixed one, or undefined for X (provider payloads) and untyped custom trackers.
146
+ */
147
+ declare function sourceDataSchema(source: TrackerSource): TrackerDataSchema | undefined;
148
+
149
+ /** Rules independent of published resources, permissions and another release. */
150
+ type QuestShape = Pick<QuestDescription, "trigger" | "performance"> & {
151
+ completion: Pick<QuestDescription["completion"], "kind">;
152
+ requires: readonly unknown[];
153
+ };
154
+ /** The same trigger/completion matrix for authoring, publication and graph validation. */
155
+ declare function validateQuestShape(description: QuestShape, options?: {
156
+ template?: boolean;
157
+ }): void;
158
+
159
+ export { type AttemptFailure, type Lifetime, MANAGEMENT_TIMEOUT, isActivityParticipantRoute, isContentParticipantRoute, isOfferParticipantRoute, isPointsParticipantRoute, isProfileParticipantRoute, isQuestOutcomeParticipantRoute, isRewardsParticipantRoute, isWalletParticipantRoute, isWalletSignInRoute, lifetime, parseImageExtraction, parseImageResult, questConfiguration, retryAfter, retrying, sequenceCursorSchema, sourceDataSchema, sourceRoles, validateQuestShape };
@@ -0,0 +1,79 @@
1
+ import {
2
+ identityIntegrationInputSchema,
3
+ identityIntegrationSchema,
4
+ identityIntegrationSecretSchema,
5
+ identityKindClaimSchema,
6
+ parseImageExtraction,
7
+ parseImageResult,
8
+ participantExchangeSchema,
9
+ questConfiguration,
10
+ sequenceCursorSchema
11
+ } from "./chunk-WJSSJ7AF.js";
12
+ import "./chunk-BGGKNIRP.js";
13
+ import {
14
+ sourceDataSchema,
15
+ sourceRoles,
16
+ validateQuestShape
17
+ } from "./chunk-GQKYAQM6.js";
18
+ import {
19
+ isActivityParticipantRoute,
20
+ isContentParticipantRoute,
21
+ isOfferParticipantRoute,
22
+ isPointsParticipantRoute,
23
+ isProfileParticipantRoute,
24
+ isQuestOutcomeParticipantRoute,
25
+ isRewardsParticipantRoute,
26
+ isWalletParticipantRoute,
27
+ isWalletSignInRoute
28
+ } from "./chunk-GUP7YRR4.js";
29
+ import {
30
+ MANAGEMENT_TIMEOUT,
31
+ lifetime,
32
+ retryAfter,
33
+ retrying
34
+ } from "./chunk-6QJ3LADK.js";
35
+ import "./chunk-NPGENI7K.js";
36
+ import "./chunk-XFMSUPNS.js";
37
+ import {
38
+ schemaCheckedReader,
39
+ trackerDataBatchSteps,
40
+ trackerDataIssue,
41
+ trackerDataIssues,
42
+ trackerDataPathTypes,
43
+ trackerDataRecordSteps,
44
+ whereSchemaIssue
45
+ } from "./chunk-JON5SESL.js";
46
+ export {
47
+ MANAGEMENT_TIMEOUT,
48
+ identityIntegrationInputSchema,
49
+ identityIntegrationSchema,
50
+ identityIntegrationSecretSchema,
51
+ identityKindClaimSchema,
52
+ isActivityParticipantRoute,
53
+ isContentParticipantRoute,
54
+ isOfferParticipantRoute,
55
+ isPointsParticipantRoute,
56
+ isProfileParticipantRoute,
57
+ isQuestOutcomeParticipantRoute,
58
+ isRewardsParticipantRoute,
59
+ isWalletParticipantRoute,
60
+ isWalletSignInRoute,
61
+ lifetime,
62
+ parseImageExtraction,
63
+ parseImageResult,
64
+ participantExchangeSchema,
65
+ questConfiguration,
66
+ retryAfter,
67
+ retrying,
68
+ schemaCheckedReader,
69
+ sequenceCursorSchema,
70
+ sourceDataSchema,
71
+ sourceRoles,
72
+ trackerDataBatchSteps,
73
+ trackerDataIssue,
74
+ trackerDataIssues,
75
+ trackerDataPathTypes,
76
+ trackerDataRecordSteps,
77
+ validateQuestShape,
78
+ whereSchemaIssue
79
+ };
@@ -0,0 +1,431 @@
1
+ import { cF as ResourceHandle } from './schema-DfJzH2ci.js';
2
+ import { aQ as AuthoringIdentity } from './groups-Ck-OxzjD.js';
3
+ import { z } from 'zod';
4
+
5
+ declare const offerPriceSchema: z.ZodObject<{
6
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
7
+ balance: z.ZodString;
8
+ amount: z.ZodNumber;
9
+ }, z.core.$strict>;
10
+ type OfferPrice = z.infer<typeof offerPriceSchema>;
11
+ declare const offerLimitSchema: z.ZodObject<{
12
+ perMember: z.ZodNumber;
13
+ }, z.core.$strict>;
14
+ declare const offerDefinitionSchema: z.ZodObject<{
15
+ id: z.ZodString;
16
+ key: z.ZodOptional<z.ZodString>;
17
+ title: z.ZodString;
18
+ price: z.ZodObject<{
19
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
20
+ balance: z.ZodString;
21
+ amount: z.ZodNumber;
22
+ }, z.core.$strict>;
23
+ reward: z.ZodObject<{
24
+ kind: z.ZodLiteral<"tier">;
25
+ reward: z.ZodObject<{
26
+ id: z.ZodString;
27
+ title: z.ZodString;
28
+ tiers: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ title: z.ZodString;
31
+ }, z.core.$strict>>;
32
+ inventory: z.ZodObject<{
33
+ kind: z.ZodLiteral<"untracked">;
34
+ }, z.core.$strict>;
35
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
36
+ kind: z.ZodLiteral<"staff-handover">;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"automatic">;
39
+ }, z.core.$strict>], "kind">;
40
+ }, z.core.$strict>;
41
+ tier: z.ZodString;
42
+ }, z.core.$strict>;
43
+ stock: z.ZodNumber;
44
+ limit: z.ZodDefault<z.ZodObject<{
45
+ perMember: z.ZodNumber;
46
+ }, z.core.$strict>>;
47
+ enabled: z.ZodDefault<z.ZodBoolean>;
48
+ }, z.core.$strict>;
49
+ type OfferDefinition = z.infer<typeof offerDefinitionSchema>;
50
+ declare const offerAuthoringSchema: z.ZodPipe<z.ZodObject<{
51
+ limit: z.ZodDefault<z.ZodObject<{
52
+ perMember: z.ZodNumber;
53
+ }, z.core.$strict>>;
54
+ reward: z.ZodObject<{
55
+ kind: z.ZodLiteral<"tier">;
56
+ reward: z.ZodObject<{
57
+ id: z.ZodString;
58
+ title: z.ZodString;
59
+ tiers: z.ZodArray<z.ZodObject<{
60
+ id: z.ZodString;
61
+ title: z.ZodString;
62
+ }, z.core.$strict>>;
63
+ inventory: z.ZodObject<{
64
+ kind: z.ZodLiteral<"untracked">;
65
+ }, z.core.$strict>;
66
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
67
+ kind: z.ZodLiteral<"staff-handover">;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ kind: z.ZodLiteral<"automatic">;
70
+ }, z.core.$strict>], "kind">;
71
+ }, z.core.$strict>;
72
+ tier: z.ZodString;
73
+ }, z.core.$strict>;
74
+ price: z.ZodObject<{
75
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
76
+ balance: z.ZodString;
77
+ amount: z.ZodNumber;
78
+ }, z.core.$strict>;
79
+ stock: z.ZodNumber;
80
+ title: z.ZodOptional<z.ZodString>;
81
+ key: z.ZodString;
82
+ }, z.core.$strict>, z.ZodTransform<{
83
+ title: string;
84
+ enabled: boolean;
85
+ limit: {
86
+ perMember: number;
87
+ };
88
+ reward: {
89
+ kind: "tier";
90
+ reward: {
91
+ id: string;
92
+ title: string;
93
+ tiers: {
94
+ id: string;
95
+ title: string;
96
+ }[];
97
+ inventory: {
98
+ kind: "untracked";
99
+ };
100
+ fulfillment: {
101
+ kind: "staff-handover";
102
+ } | {
103
+ kind: "automatic";
104
+ };
105
+ };
106
+ tier: string;
107
+ };
108
+ price: {
109
+ kind: "points";
110
+ balance: string;
111
+ amount: number;
112
+ };
113
+ stock: number;
114
+ key: string;
115
+ }, {
116
+ limit: {
117
+ perMember: number;
118
+ };
119
+ reward: {
120
+ kind: "tier";
121
+ reward: {
122
+ id: string;
123
+ title: string;
124
+ tiers: {
125
+ id: string;
126
+ title: string;
127
+ }[];
128
+ inventory: {
129
+ kind: "untracked";
130
+ };
131
+ fulfillment: {
132
+ kind: "staff-handover";
133
+ } | {
134
+ kind: "automatic";
135
+ };
136
+ };
137
+ tier: string;
138
+ };
139
+ price: {
140
+ kind: "points";
141
+ balance: string;
142
+ amount: number;
143
+ };
144
+ stock: number;
145
+ key: string;
146
+ title?: string | undefined;
147
+ }>>;
148
+ type OfferAuthoring = z.input<typeof offerAuthoringSchema>;
149
+ declare const offerArtifactSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
150
+ limit: z.ZodDefault<z.ZodObject<{
151
+ perMember: z.ZodNumber;
152
+ }, z.core.$strict>>;
153
+ reward: z.ZodObject<{
154
+ kind: z.ZodLiteral<"tier">;
155
+ reward: z.ZodObject<{
156
+ id: z.ZodString;
157
+ title: z.ZodString;
158
+ tiers: z.ZodArray<z.ZodObject<{
159
+ id: z.ZodString;
160
+ title: z.ZodString;
161
+ }, z.core.$strict>>;
162
+ inventory: z.ZodObject<{
163
+ kind: z.ZodLiteral<"untracked">;
164
+ }, z.core.$strict>;
165
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
166
+ kind: z.ZodLiteral<"staff-handover">;
167
+ }, z.core.$strict>, z.ZodObject<{
168
+ kind: z.ZodLiteral<"automatic">;
169
+ }, z.core.$strict>], "kind">;
170
+ }, z.core.$strict>;
171
+ tier: z.ZodString;
172
+ }, z.core.$strict>;
173
+ price: z.ZodObject<{
174
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
175
+ balance: z.ZodString;
176
+ amount: z.ZodNumber;
177
+ }, z.core.$strict>;
178
+ stock: z.ZodNumber;
179
+ title: z.ZodOptional<z.ZodString>;
180
+ key: z.ZodString;
181
+ }, z.core.$strict>, z.ZodTransform<{
182
+ title: string;
183
+ enabled: boolean;
184
+ limit: {
185
+ perMember: number;
186
+ };
187
+ reward: {
188
+ kind: "tier";
189
+ reward: {
190
+ id: string;
191
+ title: string;
192
+ tiers: {
193
+ id: string;
194
+ title: string;
195
+ }[];
196
+ inventory: {
197
+ kind: "untracked";
198
+ };
199
+ fulfillment: {
200
+ kind: "staff-handover";
201
+ } | {
202
+ kind: "automatic";
203
+ };
204
+ };
205
+ tier: string;
206
+ };
207
+ price: {
208
+ kind: "points";
209
+ balance: string;
210
+ amount: number;
211
+ };
212
+ stock: number;
213
+ key: string;
214
+ }, {
215
+ limit: {
216
+ perMember: number;
217
+ };
218
+ reward: {
219
+ kind: "tier";
220
+ reward: {
221
+ id: string;
222
+ title: string;
223
+ tiers: {
224
+ id: string;
225
+ title: string;
226
+ }[];
227
+ inventory: {
228
+ kind: "untracked";
229
+ };
230
+ fulfillment: {
231
+ kind: "staff-handover";
232
+ } | {
233
+ kind: "automatic";
234
+ };
235
+ };
236
+ tier: string;
237
+ };
238
+ price: {
239
+ kind: "points";
240
+ balance: string;
241
+ amount: number;
242
+ };
243
+ stock: number;
244
+ key: string;
245
+ title?: string | undefined;
246
+ }>>, z.ZodObject<{
247
+ code: z.ZodString;
248
+ }, z.core.$strict>]>;
249
+ declare const offerAvailabilitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
250
+ kind: z.ZodLiteral<"available">;
251
+ remaining: z.ZodNumber;
252
+ }, z.core.$strict>, z.ZodObject<{
253
+ kind: z.ZodLiteral<"out-of-stock">;
254
+ }, z.core.$strict>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"limit-reached">;
256
+ }, z.core.$strict>, z.ZodObject<{
257
+ kind: z.ZodLiteral<"paused">;
258
+ }, z.core.$strict>], "kind">;
259
+ declare const offerSchema: z.ZodObject<{
260
+ id: z.ZodString;
261
+ key: z.ZodOptional<z.ZodString>;
262
+ title: z.ZodString;
263
+ price: z.ZodObject<{
264
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
265
+ balance: z.ZodString;
266
+ amount: z.ZodNumber;
267
+ }, z.core.$strict>;
268
+ reward: z.ZodObject<{
269
+ kind: z.ZodLiteral<"tier">;
270
+ reward: z.ZodObject<{
271
+ id: z.ZodString;
272
+ title: z.ZodString;
273
+ tiers: z.ZodArray<z.ZodObject<{
274
+ id: z.ZodString;
275
+ title: z.ZodString;
276
+ }, z.core.$strict>>;
277
+ inventory: z.ZodObject<{
278
+ kind: z.ZodLiteral<"untracked">;
279
+ }, z.core.$strict>;
280
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
281
+ kind: z.ZodLiteral<"staff-handover">;
282
+ }, z.core.$strict>, z.ZodObject<{
283
+ kind: z.ZodLiteral<"automatic">;
284
+ }, z.core.$strict>], "kind">;
285
+ }, z.core.$strict>;
286
+ tier: z.ZodString;
287
+ }, z.core.$strict>;
288
+ stock: z.ZodNumber;
289
+ limit: z.ZodDefault<z.ZodObject<{
290
+ perMember: z.ZodNumber;
291
+ }, z.core.$strict>>;
292
+ enabled: z.ZodDefault<z.ZodBoolean>;
293
+ revision: z.ZodNumber;
294
+ available: z.ZodNumber;
295
+ redeemed: z.ZodNumber;
296
+ availability: z.ZodDiscriminatedUnion<[z.ZodObject<{
297
+ kind: z.ZodLiteral<"available">;
298
+ remaining: z.ZodNumber;
299
+ }, z.core.$strict>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"out-of-stock">;
301
+ }, z.core.$strict>, z.ZodObject<{
302
+ kind: z.ZodLiteral<"limit-reached">;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ kind: z.ZodLiteral<"paused">;
305
+ }, z.core.$strict>], "kind">;
306
+ }, z.core.$strict>;
307
+ type Offer = z.infer<typeof offerSchema>;
308
+ declare const redeemOfferSchema: z.ZodObject<{
309
+ actionId: z.ZodString;
310
+ }, z.core.$strict>;
311
+ type RedeemOfferInput = z.input<typeof redeemOfferSchema>;
312
+ declare const redemptionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ status: z.ZodLiteral<"fulfilled">;
314
+ id: z.ZodString;
315
+ offer: z.ZodString;
316
+ member: z.ZodString;
317
+ reservation: z.ZodString;
318
+ price: z.ZodObject<{
319
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
320
+ balance: z.ZodString;
321
+ amount: z.ZodNumber;
322
+ }, z.core.$strict>;
323
+ reward: z.ZodObject<{
324
+ kind: z.ZodLiteral<"tier">;
325
+ reward: z.ZodObject<{
326
+ id: z.ZodString;
327
+ title: z.ZodString;
328
+ tiers: z.ZodArray<z.ZodObject<{
329
+ id: z.ZodString;
330
+ title: z.ZodString;
331
+ }, z.core.$strict>>;
332
+ inventory: z.ZodObject<{
333
+ kind: z.ZodLiteral<"untracked">;
334
+ }, z.core.$strict>;
335
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
336
+ kind: z.ZodLiteral<"staff-handover">;
337
+ }, z.core.$strict>, z.ZodObject<{
338
+ kind: z.ZodLiteral<"automatic">;
339
+ }, z.core.$strict>], "kind">;
340
+ }, z.core.$strict>;
341
+ tier: z.ZodString;
342
+ }, z.core.$strict>;
343
+ entitlement: z.ZodString;
344
+ revision: z.ZodNumber;
345
+ redeemedAt: z.ZodNumber;
346
+ }, z.core.$strict>, z.ZodObject<{
347
+ status: z.ZodLiteral<"canceled">;
348
+ canceledAt: z.ZodNumber;
349
+ reason: z.ZodString;
350
+ id: z.ZodString;
351
+ offer: z.ZodString;
352
+ member: z.ZodString;
353
+ reservation: z.ZodString;
354
+ price: z.ZodObject<{
355
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
356
+ balance: z.ZodString;
357
+ amount: z.ZodNumber;
358
+ }, z.core.$strict>;
359
+ reward: z.ZodObject<{
360
+ kind: z.ZodLiteral<"tier">;
361
+ reward: z.ZodObject<{
362
+ id: z.ZodString;
363
+ title: z.ZodString;
364
+ tiers: z.ZodArray<z.ZodObject<{
365
+ id: z.ZodString;
366
+ title: z.ZodString;
367
+ }, z.core.$strict>>;
368
+ inventory: z.ZodObject<{
369
+ kind: z.ZodLiteral<"untracked">;
370
+ }, z.core.$strict>;
371
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
372
+ kind: z.ZodLiteral<"staff-handover">;
373
+ }, z.core.$strict>, z.ZodObject<{
374
+ kind: z.ZodLiteral<"automatic">;
375
+ }, z.core.$strict>], "kind">;
376
+ }, z.core.$strict>;
377
+ tier: z.ZodString;
378
+ }, z.core.$strict>;
379
+ entitlement: z.ZodString;
380
+ revision: z.ZodNumber;
381
+ redeemedAt: z.ZodNumber;
382
+ }, z.core.$strict>], "status">;
383
+ type Redemption = z.infer<typeof redemptionSchema>;
384
+ declare const offerControlSchema: z.ZodObject<{
385
+ actionId: z.ZodString;
386
+ revision: z.ZodNumber;
387
+ enabled: z.ZodBoolean;
388
+ reason: z.ZodString;
389
+ }, z.core.$strict>;
390
+ declare const redemptionCancellationSchema: z.ZodObject<{
391
+ actionId: z.ZodString;
392
+ revision: z.ZodNumber;
393
+ reason: z.ZodString;
394
+ }, z.core.$strict>;
395
+ /** Define one points-priced offer for a tier reward. The reward title is used when no title is set. */
396
+ declare function defineOffer(input: OfferAuthoring & AuthoringIdentity): {
397
+ title: string;
398
+ enabled: boolean;
399
+ limit: {
400
+ perMember: number;
401
+ };
402
+ reward: {
403
+ kind: "tier";
404
+ reward: {
405
+ id: string;
406
+ title: string;
407
+ tiers: {
408
+ id: string;
409
+ title: string;
410
+ }[];
411
+ inventory: {
412
+ kind: "untracked";
413
+ };
414
+ fulfillment: {
415
+ kind: "staff-handover";
416
+ } | {
417
+ kind: "automatic";
418
+ };
419
+ };
420
+ tier: string;
421
+ };
422
+ price: {
423
+ kind: "points";
424
+ balance: string;
425
+ amount: number;
426
+ };
427
+ stock: number;
428
+ key: string;
429
+ } & ResourceHandle<"offer">;
430
+
431
+ export { type Offer as O, type RedeemOfferInput as R, type OfferDefinition as a, type OfferPrice as b, type Redemption as c, type OfferAuthoring as d, defineOffer as e, offerAuthoringSchema as f, offerAvailabilitySchema as g, offerControlSchema as h, offerDefinitionSchema as i, offerLimitSchema as j, offerPriceSchema as k, offerSchema as l, redemptionCancellationSchema as m, redemptionSchema as n, offerArtifactSchema as o, redeemOfferSchema as r };