@crevio/sdk 0.6.0 → 0.6.5

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 (234) hide show
  1. package/README.md +12 -40
  2. package/dist/commonjs/funcs/accessCheck.d.ts +19 -0
  3. package/dist/commonjs/funcs/accessCheck.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/accessCheck.js +129 -0
  5. package/dist/commonjs/funcs/accessCheck.js.map +1 -0
  6. package/dist/commonjs/funcs/experiencesFilesCreate.d.ts +1 -1
  7. package/dist/commonjs/funcs/experiencesFilesCreate.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/experiencesFilesCreate.js +3 -24
  9. package/dist/commonjs/funcs/experiencesFilesCreate.js.map +1 -1
  10. package/dist/commonjs/funcs/lessonsFilesCreate.d.ts +1 -1
  11. package/dist/commonjs/funcs/lessonsFilesCreate.d.ts.map +1 -1
  12. package/dist/commonjs/funcs/lessonsFilesCreate.js +3 -24
  13. package/dist/commonjs/funcs/lessonsFilesCreate.js.map +1 -1
  14. package/dist/commonjs/funcs/usersGet.d.ts +19 -0
  15. package/dist/commonjs/funcs/usersGet.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/usersGet.js +125 -0
  17. package/dist/commonjs/funcs/usersGet.js.map +1 -0
  18. package/dist/commonjs/index.d.ts +1 -0
  19. package/dist/commonjs/index.d.ts.map +1 -1
  20. package/dist/commonjs/index.js +1 -0
  21. package/dist/commonjs/index.js.map +1 -1
  22. package/dist/commonjs/lib/config.d.ts +3 -3
  23. package/dist/commonjs/lib/config.js +3 -3
  24. package/dist/commonjs/lib/verify-user-token.d.ts +35 -0
  25. package/dist/commonjs/lib/verify-user-token.d.ts.map +1 -0
  26. package/dist/commonjs/lib/verify-user-token.js +75 -0
  27. package/dist/commonjs/lib/verify-user-token.js.map +1 -0
  28. package/dist/commonjs/models/accesscheck.d.ts +13 -0
  29. package/dist/commonjs/models/accesscheck.d.ts.map +1 -0
  30. package/dist/commonjs/models/accesscheck.js +60 -0
  31. package/dist/commonjs/models/accesscheck.js.map +1 -0
  32. package/dist/commonjs/models/booking.d.ts +7 -7
  33. package/dist/commonjs/models/booking.d.ts.map +1 -1
  34. package/dist/commonjs/models/booking.js +9 -9
  35. package/dist/commonjs/models/booking.js.map +1 -1
  36. package/dist/commonjs/models/eventtype.d.ts +22 -51
  37. package/dist/commonjs/models/eventtype.d.ts.map +1 -1
  38. package/dist/commonjs/models/eventtype.js +22 -73
  39. package/dist/commonjs/models/eventtype.js.map +1 -1
  40. package/dist/commonjs/models/formation.d.ts +5 -25
  41. package/dist/commonjs/models/formation.d.ts.map +1 -1
  42. package/dist/commonjs/models/formation.js +6 -37
  43. package/dist/commonjs/models/formation.js.map +1 -1
  44. package/dist/commonjs/models/formationdocument.d.ts +2 -10
  45. package/dist/commonjs/models/formationdocument.d.ts.map +1 -1
  46. package/dist/commonjs/models/formationdocument.js +3 -16
  47. package/dist/commonjs/models/formationdocument.js.map +1 -1
  48. package/dist/commonjs/models/index.d.ts +2 -0
  49. package/dist/commonjs/models/index.d.ts.map +1 -1
  50. package/dist/commonjs/models/index.js +2 -0
  51. package/dist/commonjs/models/index.js.map +1 -1
  52. package/dist/commonjs/models/me.d.ts +1 -1
  53. package/dist/commonjs/models/me.d.ts.map +1 -1
  54. package/dist/commonjs/models/me.js +1 -1
  55. package/dist/commonjs/models/me.js.map +1 -1
  56. package/dist/commonjs/models/operations/checkaccess.d.ts +20 -0
  57. package/dist/commonjs/models/operations/checkaccess.d.ts.map +1 -0
  58. package/dist/commonjs/models/operations/checkaccess.js +55 -0
  59. package/dist/commonjs/models/operations/checkaccess.js.map +1 -0
  60. package/dist/commonjs/models/operations/createdigitaldownloadfile.d.ts +3 -15
  61. package/dist/commonjs/models/operations/createdigitaldownloadfile.d.ts.map +1 -1
  62. package/dist/commonjs/models/operations/createdigitaldownloadfile.js +6 -16
  63. package/dist/commonjs/models/operations/createdigitaldownloadfile.js.map +1 -1
  64. package/dist/commonjs/models/operations/createlessonfile.d.ts +3 -15
  65. package/dist/commonjs/models/operations/createlessonfile.d.ts.map +1 -1
  66. package/dist/commonjs/models/operations/createlessonfile.js +6 -16
  67. package/dist/commonjs/models/operations/createlessonfile.js.map +1 -1
  68. package/dist/commonjs/models/operations/getuser.d.ts +15 -0
  69. package/dist/commonjs/models/operations/getuser.d.ts.map +1 -0
  70. package/dist/commonjs/models/operations/getuser.js +49 -0
  71. package/dist/commonjs/models/operations/getuser.js.map +1 -0
  72. package/dist/commonjs/models/operations/index.d.ts +2 -0
  73. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  74. package/dist/commonjs/models/operations/index.js +2 -0
  75. package/dist/commonjs/models/operations/index.js.map +1 -1
  76. package/dist/commonjs/models/operations/retryformationpayment.d.ts +5 -25
  77. package/dist/commonjs/models/operations/retryformationpayment.d.ts.map +1 -1
  78. package/dist/commonjs/models/operations/retryformationpayment.js +6 -36
  79. package/dist/commonjs/models/operations/retryformationpayment.js.map +1 -1
  80. package/dist/commonjs/models/operations/submitformation.d.ts +5 -25
  81. package/dist/commonjs/models/operations/submitformation.d.ts.map +1 -1
  82. package/dist/commonjs/models/operations/submitformation.js +6 -36
  83. package/dist/commonjs/models/operations/submitformation.js.map +1 -1
  84. package/dist/commonjs/models/user.d.ts +14 -0
  85. package/dist/commonjs/models/user.d.ts.map +1 -0
  86. package/dist/commonjs/models/user.js +61 -0
  87. package/dist/commonjs/models/user.js.map +1 -0
  88. package/dist/commonjs/sdk/access.d.ts +13 -0
  89. package/dist/commonjs/sdk/access.d.ts.map +1 -0
  90. package/dist/commonjs/sdk/access.js +22 -0
  91. package/dist/commonjs/sdk/access.js.map +1 -0
  92. package/dist/commonjs/sdk/experiencesfiles.d.ts +1 -1
  93. package/dist/commonjs/sdk/experiencesfiles.js +1 -1
  94. package/dist/commonjs/sdk/lessonsfiles.d.ts +1 -1
  95. package/dist/commonjs/sdk/lessonsfiles.js +1 -1
  96. package/dist/commonjs/sdk/sdk.d.ts +6 -0
  97. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  98. package/dist/commonjs/sdk/sdk.js +8 -0
  99. package/dist/commonjs/sdk/sdk.js.map +1 -1
  100. package/dist/commonjs/sdk/users.d.ts +13 -0
  101. package/dist/commonjs/sdk/users.d.ts.map +1 -0
  102. package/dist/commonjs/sdk/users.js +22 -0
  103. package/dist/commonjs/sdk/users.js.map +1 -0
  104. package/dist/esm/funcs/accessCheck.d.ts +19 -0
  105. package/dist/esm/funcs/accessCheck.d.ts.map +1 -0
  106. package/dist/esm/funcs/accessCheck.js +93 -0
  107. package/dist/esm/funcs/accessCheck.js.map +1 -0
  108. package/dist/esm/funcs/experiencesFilesCreate.d.ts +1 -1
  109. package/dist/esm/funcs/experiencesFilesCreate.d.ts.map +1 -1
  110. package/dist/esm/funcs/experiencesFilesCreate.js +4 -25
  111. package/dist/esm/funcs/experiencesFilesCreate.js.map +1 -1
  112. package/dist/esm/funcs/lessonsFilesCreate.d.ts +1 -1
  113. package/dist/esm/funcs/lessonsFilesCreate.d.ts.map +1 -1
  114. package/dist/esm/funcs/lessonsFilesCreate.js +4 -25
  115. package/dist/esm/funcs/lessonsFilesCreate.js.map +1 -1
  116. package/dist/esm/funcs/usersGet.d.ts +19 -0
  117. package/dist/esm/funcs/usersGet.d.ts.map +1 -0
  118. package/dist/esm/funcs/usersGet.js +89 -0
  119. package/dist/esm/funcs/usersGet.js.map +1 -0
  120. package/dist/esm/index.d.ts +1 -0
  121. package/dist/esm/index.d.ts.map +1 -1
  122. package/dist/esm/index.js +1 -0
  123. package/dist/esm/index.js.map +1 -1
  124. package/dist/esm/lib/config.d.ts +3 -3
  125. package/dist/esm/lib/config.js +3 -3
  126. package/dist/esm/lib/verify-user-token.d.ts +35 -0
  127. package/dist/esm/lib/verify-user-token.d.ts.map +1 -0
  128. package/dist/esm/lib/verify-user-token.js +72 -0
  129. package/dist/esm/lib/verify-user-token.js.map +1 -0
  130. package/dist/esm/models/accesscheck.d.ts +13 -0
  131. package/dist/esm/models/accesscheck.d.ts.map +1 -0
  132. package/dist/esm/models/accesscheck.js +23 -0
  133. package/dist/esm/models/accesscheck.js.map +1 -0
  134. package/dist/esm/models/booking.d.ts +7 -7
  135. package/dist/esm/models/booking.d.ts.map +1 -1
  136. package/dist/esm/models/booking.js +7 -7
  137. package/dist/esm/models/booking.js.map +1 -1
  138. package/dist/esm/models/eventtype.d.ts +22 -51
  139. package/dist/esm/models/eventtype.d.ts.map +1 -1
  140. package/dist/esm/models/eventtype.js +21 -62
  141. package/dist/esm/models/eventtype.js.map +1 -1
  142. package/dist/esm/models/formation.d.ts +5 -25
  143. package/dist/esm/models/formation.d.ts.map +1 -1
  144. package/dist/esm/models/formation.js +5 -31
  145. package/dist/esm/models/formation.js.map +1 -1
  146. package/dist/esm/models/formationdocument.d.ts +2 -10
  147. package/dist/esm/models/formationdocument.d.ts.map +1 -1
  148. package/dist/esm/models/formationdocument.js +2 -13
  149. package/dist/esm/models/formationdocument.js.map +1 -1
  150. package/dist/esm/models/index.d.ts +2 -0
  151. package/dist/esm/models/index.d.ts.map +1 -1
  152. package/dist/esm/models/index.js +2 -0
  153. package/dist/esm/models/index.js.map +1 -1
  154. package/dist/esm/models/me.d.ts +1 -1
  155. package/dist/esm/models/me.d.ts.map +1 -1
  156. package/dist/esm/models/me.js +1 -1
  157. package/dist/esm/models/me.js.map +1 -1
  158. package/dist/esm/models/operations/checkaccess.d.ts +20 -0
  159. package/dist/esm/models/operations/checkaccess.d.ts.map +1 -0
  160. package/dist/esm/models/operations/checkaccess.js +18 -0
  161. package/dist/esm/models/operations/checkaccess.js.map +1 -0
  162. package/dist/esm/models/operations/createdigitaldownloadfile.d.ts +3 -15
  163. package/dist/esm/models/operations/createdigitaldownloadfile.d.ts.map +1 -1
  164. package/dist/esm/models/operations/createdigitaldownloadfile.js +5 -14
  165. package/dist/esm/models/operations/createdigitaldownloadfile.js.map +1 -1
  166. package/dist/esm/models/operations/createlessonfile.d.ts +3 -15
  167. package/dist/esm/models/operations/createlessonfile.d.ts.map +1 -1
  168. package/dist/esm/models/operations/createlessonfile.js +5 -14
  169. package/dist/esm/models/operations/createlessonfile.js.map +1 -1
  170. package/dist/esm/models/operations/getuser.d.ts +15 -0
  171. package/dist/esm/models/operations/getuser.d.ts.map +1 -0
  172. package/dist/esm/models/operations/getuser.js +12 -0
  173. package/dist/esm/models/operations/getuser.js.map +1 -0
  174. package/dist/esm/models/operations/index.d.ts +2 -0
  175. package/dist/esm/models/operations/index.d.ts.map +1 -1
  176. package/dist/esm/models/operations/index.js +2 -0
  177. package/dist/esm/models/operations/index.js.map +1 -1
  178. package/dist/esm/models/operations/retryformationpayment.d.ts +5 -25
  179. package/dist/esm/models/operations/retryformationpayment.d.ts.map +1 -1
  180. package/dist/esm/models/operations/retryformationpayment.js +5 -30
  181. package/dist/esm/models/operations/retryformationpayment.js.map +1 -1
  182. package/dist/esm/models/operations/submitformation.d.ts +5 -25
  183. package/dist/esm/models/operations/submitformation.d.ts.map +1 -1
  184. package/dist/esm/models/operations/submitformation.js +5 -30
  185. package/dist/esm/models/operations/submitformation.js.map +1 -1
  186. package/dist/esm/models/user.d.ts +14 -0
  187. package/dist/esm/models/user.d.ts.map +1 -0
  188. package/dist/esm/models/user.js +24 -0
  189. package/dist/esm/models/user.js.map +1 -0
  190. package/dist/esm/sdk/access.d.ts +13 -0
  191. package/dist/esm/sdk/access.d.ts.map +1 -0
  192. package/dist/esm/sdk/access.js +18 -0
  193. package/dist/esm/sdk/access.js.map +1 -0
  194. package/dist/esm/sdk/experiencesfiles.d.ts +1 -1
  195. package/dist/esm/sdk/experiencesfiles.js +1 -1
  196. package/dist/esm/sdk/lessonsfiles.d.ts +1 -1
  197. package/dist/esm/sdk/lessonsfiles.js +1 -1
  198. package/dist/esm/sdk/sdk.d.ts +6 -0
  199. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  200. package/dist/esm/sdk/sdk.js +8 -0
  201. package/dist/esm/sdk/sdk.js.map +1 -1
  202. package/dist/esm/sdk/users.d.ts +13 -0
  203. package/dist/esm/sdk/users.d.ts.map +1 -0
  204. package/dist/esm/sdk/users.js +18 -0
  205. package/dist/esm/sdk/users.js.map +1 -0
  206. package/jsr.json +1 -1
  207. package/package.json +2 -1
  208. package/src/funcs/accessCheck.ts +182 -0
  209. package/src/funcs/experiencesFilesCreate.ts +4 -38
  210. package/src/funcs/lessonsFilesCreate.ts +4 -38
  211. package/src/funcs/usersGet.ts +178 -0
  212. package/src/index.ts +1 -0
  213. package/src/lib/config.ts +3 -3
  214. package/src/lib/verify-user-token.ts +118 -0
  215. package/src/models/accesscheck.ts +44 -0
  216. package/src/models/booking.ts +15 -15
  217. package/src/models/eventtype.ts +37 -212
  218. package/src/models/formation.ts +10 -102
  219. package/src/models/formationdocument.ts +4 -39
  220. package/src/models/index.ts +2 -0
  221. package/src/models/me.ts +2 -2
  222. package/src/models/operations/checkaccess.ts +45 -0
  223. package/src/models/operations/createdigitaldownloadfile.ts +8 -40
  224. package/src/models/operations/createlessonfile.ts +8 -38
  225. package/src/models/operations/getuser.ts +30 -0
  226. package/src/models/operations/index.ts +2 -0
  227. package/src/models/operations/retryformationpayment.ts +10 -105
  228. package/src/models/operations/submitformation.ts +10 -105
  229. package/src/models/user.ts +42 -0
  230. package/src/sdk/access.ts +28 -0
  231. package/src/sdk/experiencesfiles.ts +1 -1
  232. package/src/sdk/lessonsfiles.ts +1 -1
  233. package/src/sdk/sdk.ts +12 -0
  234. package/src/sdk/users.ts +28 -0
@@ -20,7 +20,7 @@ export const BookingStatus = {
20
20
  } as const;
21
21
  export type BookingStatus = ClosedEnum<typeof BookingStatus>;
22
22
 
23
- export type IntakeAnswers = {};
23
+ export type IntakeAnswer = {};
24
24
 
25
25
  /**
26
26
  * ID by default, full object when expanded
@@ -35,9 +35,9 @@ export type CheckoutUnion = Checkout | string;
35
35
  export type Booking = {
36
36
  object: string;
37
37
  id: string;
38
- eventTypeId: number;
39
- customerId: number | null;
40
- orderId: number | null;
38
+ eventTypeId: string;
39
+ customerId: string | null;
40
+ orderId: string | null;
41
41
  status: BookingStatus;
42
42
  timeZone: string;
43
43
  attendeeName: string | null;
@@ -48,7 +48,7 @@ export type Booking = {
48
48
  cancelReason: string | null;
49
49
  createdAt: Date;
50
50
  updatedAt: Date;
51
- intakeAnswers: IntakeAnswers;
51
+ intakeAnswers: Array<IntakeAnswer>;
52
52
  startTime: Date;
53
53
  endTime: Date;
54
54
  cancelledAt: Date | null;
@@ -68,19 +68,19 @@ export const BookingStatus$inboundSchema: z.ZodNativeEnum<
68
68
  > = z.nativeEnum(BookingStatus);
69
69
 
70
70
  /** @internal */
71
- export const IntakeAnswers$inboundSchema: z.ZodType<
72
- IntakeAnswers,
71
+ export const IntakeAnswer$inboundSchema: z.ZodType<
72
+ IntakeAnswer,
73
73
  z.ZodTypeDef,
74
74
  unknown
75
75
  > = z.object({});
76
76
 
77
- export function intakeAnswersFromJSON(
77
+ export function intakeAnswerFromJSON(
78
78
  jsonString: string,
79
- ): SafeParseResult<IntakeAnswers, SDKValidationError> {
79
+ ): SafeParseResult<IntakeAnswer, SDKValidationError> {
80
80
  return safeParse(
81
81
  jsonString,
82
- (x) => IntakeAnswers$inboundSchema.parse(JSON.parse(x)),
83
- `Failed to parse 'IntakeAnswers' from JSON`,
82
+ (x) => IntakeAnswer$inboundSchema.parse(JSON.parse(x)),
83
+ `Failed to parse 'IntakeAnswer' from JSON`,
84
84
  );
85
85
  }
86
86
 
@@ -123,9 +123,9 @@ export const Booking$inboundSchema: z.ZodType<Booking, z.ZodTypeDef, unknown> =
123
123
  z.object({
124
124
  object: z.string(),
125
125
  id: z.string(),
126
- event_type_id: z.number().int(),
127
- customer_id: z.nullable(z.number().int()),
128
- order_id: z.nullable(z.number().int()),
126
+ event_type_id: z.string(),
127
+ customer_id: z.nullable(z.string()),
128
+ order_id: z.nullable(z.string()),
129
129
  status: BookingStatus$inboundSchema,
130
130
  time_zone: z.string(),
131
131
  attendee_name: z.nullable(z.string()),
@@ -140,7 +140,7 @@ export const Booking$inboundSchema: z.ZodType<Booking, z.ZodTypeDef, unknown> =
140
140
  updated_at: z.string().datetime({ offset: true }).transform(v =>
141
141
  new Date(v)
142
142
  ),
143
- intake_answers: z.lazy(() => IntakeAnswers$inboundSchema),
143
+ intake_answers: z.array(z.lazy(() => IntakeAnswer$inboundSchema)),
144
144
  start_time: z.string().datetime({ offset: true }).transform(v =>
145
145
  new Date(v)
146
146
  ),
@@ -5,30 +5,20 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
+ import { ClosedEnum } from "../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../types/fp.js";
9
10
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
11
  import { Form, Form$inboundSchema } from "./form.js";
11
12
  import { PriceVariant, PriceVariant$inboundSchema } from "./pricevariant.js";
12
13
 
13
- export type DurationMinutes = {};
14
-
15
- export type BufferBeforeMinutes = {};
16
-
17
- export type BufferAfterMinutes = {};
18
-
19
- export type MinNoticeMinutes = {};
20
-
21
- export type BookingWindowDays = {};
22
-
23
- export type MaxPerDay = {};
24
-
25
- export type EventTypeLocationType = {};
26
-
27
- export type LocationDetails = {};
28
-
29
- export type EventTypeCreatedAt = {};
30
-
31
- export type EventTypeUpdatedAt = {};
14
+ export const EventTypeLocationType = {
15
+ GoogleMeet: "google_meet",
16
+ Zoom: "zoom",
17
+ CustomLink: "custom_link",
18
+ Physical: "physical",
19
+ Phone: "phone",
20
+ } as const;
21
+ export type EventTypeLocationType = ClosedEnum<typeof EventTypeLocationType>;
32
22
 
33
23
  /**
34
24
  * ID by default, full object when expanded
@@ -40,197 +30,32 @@ export type EventType = {
40
30
  id: string;
41
31
  name: string;
42
32
  slug: string;
43
- durationMinutes: DurationMinutes;
44
- bufferBeforeMinutes: BufferBeforeMinutes;
45
- bufferAfterMinutes: BufferAfterMinutes;
46
- minNoticeMinutes: MinNoticeMinutes;
47
- bookingWindowDays: BookingWindowDays;
48
- maxPerDay: MaxPerDay;
33
+ durationMinutes: number;
34
+ bufferBeforeMinutes: number;
35
+ bufferAfterMinutes: number;
36
+ minNoticeMinutes: number;
37
+ bookingWindowDays: number;
38
+ maxPerDay: number | null;
49
39
  reminderMinutes: Array<number>;
50
40
  locationType: EventTypeLocationType;
51
- locationDetails: LocationDetails;
52
- createdAt: EventTypeCreatedAt;
53
- updatedAt: EventTypeUpdatedAt;
54
- formId: string;
41
+ locationDetails: string | null;
42
+ createdAt: Date;
43
+ updatedAt: Date;
44
+ formId: string | null;
55
45
  /**
56
46
  * ID by default, full object when expanded
57
47
  */
58
48
  form?: Form | string | null | undefined;
59
49
  free: boolean;
60
- scheduleId: string;
61
- productId: string;
50
+ scheduleId: string | null;
51
+ productId: string | null;
62
52
  priceVariants: Array<PriceVariant>;
63
53
  };
64
54
 
65
55
  /** @internal */
66
- export const DurationMinutes$inboundSchema: z.ZodType<
67
- DurationMinutes,
68
- z.ZodTypeDef,
69
- unknown
70
- > = z.object({});
71
-
72
- export function durationMinutesFromJSON(
73
- jsonString: string,
74
- ): SafeParseResult<DurationMinutes, SDKValidationError> {
75
- return safeParse(
76
- jsonString,
77
- (x) => DurationMinutes$inboundSchema.parse(JSON.parse(x)),
78
- `Failed to parse 'DurationMinutes' from JSON`,
79
- );
80
- }
81
-
82
- /** @internal */
83
- export const BufferBeforeMinutes$inboundSchema: z.ZodType<
84
- BufferBeforeMinutes,
85
- z.ZodTypeDef,
86
- unknown
87
- > = z.object({});
88
-
89
- export function bufferBeforeMinutesFromJSON(
90
- jsonString: string,
91
- ): SafeParseResult<BufferBeforeMinutes, SDKValidationError> {
92
- return safeParse(
93
- jsonString,
94
- (x) => BufferBeforeMinutes$inboundSchema.parse(JSON.parse(x)),
95
- `Failed to parse 'BufferBeforeMinutes' from JSON`,
96
- );
97
- }
98
-
99
- /** @internal */
100
- export const BufferAfterMinutes$inboundSchema: z.ZodType<
101
- BufferAfterMinutes,
102
- z.ZodTypeDef,
103
- unknown
104
- > = z.object({});
105
-
106
- export function bufferAfterMinutesFromJSON(
107
- jsonString: string,
108
- ): SafeParseResult<BufferAfterMinutes, SDKValidationError> {
109
- return safeParse(
110
- jsonString,
111
- (x) => BufferAfterMinutes$inboundSchema.parse(JSON.parse(x)),
112
- `Failed to parse 'BufferAfterMinutes' from JSON`,
113
- );
114
- }
115
-
116
- /** @internal */
117
- export const MinNoticeMinutes$inboundSchema: z.ZodType<
118
- MinNoticeMinutes,
119
- z.ZodTypeDef,
120
- unknown
121
- > = z.object({});
122
-
123
- export function minNoticeMinutesFromJSON(
124
- jsonString: string,
125
- ): SafeParseResult<MinNoticeMinutes, SDKValidationError> {
126
- return safeParse(
127
- jsonString,
128
- (x) => MinNoticeMinutes$inboundSchema.parse(JSON.parse(x)),
129
- `Failed to parse 'MinNoticeMinutes' from JSON`,
130
- );
131
- }
132
-
133
- /** @internal */
134
- export const BookingWindowDays$inboundSchema: z.ZodType<
135
- BookingWindowDays,
136
- z.ZodTypeDef,
137
- unknown
138
- > = z.object({});
139
-
140
- export function bookingWindowDaysFromJSON(
141
- jsonString: string,
142
- ): SafeParseResult<BookingWindowDays, SDKValidationError> {
143
- return safeParse(
144
- jsonString,
145
- (x) => BookingWindowDays$inboundSchema.parse(JSON.parse(x)),
146
- `Failed to parse 'BookingWindowDays' from JSON`,
147
- );
148
- }
149
-
150
- /** @internal */
151
- export const MaxPerDay$inboundSchema: z.ZodType<
152
- MaxPerDay,
153
- z.ZodTypeDef,
154
- unknown
155
- > = z.object({});
156
-
157
- export function maxPerDayFromJSON(
158
- jsonString: string,
159
- ): SafeParseResult<MaxPerDay, SDKValidationError> {
160
- return safeParse(
161
- jsonString,
162
- (x) => MaxPerDay$inboundSchema.parse(JSON.parse(x)),
163
- `Failed to parse 'MaxPerDay' from JSON`,
164
- );
165
- }
166
-
167
- /** @internal */
168
- export const EventTypeLocationType$inboundSchema: z.ZodType<
169
- EventTypeLocationType,
170
- z.ZodTypeDef,
171
- unknown
172
- > = z.object({});
173
-
174
- export function eventTypeLocationTypeFromJSON(
175
- jsonString: string,
176
- ): SafeParseResult<EventTypeLocationType, SDKValidationError> {
177
- return safeParse(
178
- jsonString,
179
- (x) => EventTypeLocationType$inboundSchema.parse(JSON.parse(x)),
180
- `Failed to parse 'EventTypeLocationType' from JSON`,
181
- );
182
- }
183
-
184
- /** @internal */
185
- export const LocationDetails$inboundSchema: z.ZodType<
186
- LocationDetails,
187
- z.ZodTypeDef,
188
- unknown
189
- > = z.object({});
190
-
191
- export function locationDetailsFromJSON(
192
- jsonString: string,
193
- ): SafeParseResult<LocationDetails, SDKValidationError> {
194
- return safeParse(
195
- jsonString,
196
- (x) => LocationDetails$inboundSchema.parse(JSON.parse(x)),
197
- `Failed to parse 'LocationDetails' from JSON`,
198
- );
199
- }
200
-
201
- /** @internal */
202
- export const EventTypeCreatedAt$inboundSchema: z.ZodType<
203
- EventTypeCreatedAt,
204
- z.ZodTypeDef,
205
- unknown
206
- > = z.object({});
207
-
208
- export function eventTypeCreatedAtFromJSON(
209
- jsonString: string,
210
- ): SafeParseResult<EventTypeCreatedAt, SDKValidationError> {
211
- return safeParse(
212
- jsonString,
213
- (x) => EventTypeCreatedAt$inboundSchema.parse(JSON.parse(x)),
214
- `Failed to parse 'EventTypeCreatedAt' from JSON`,
215
- );
216
- }
217
-
218
- /** @internal */
219
- export const EventTypeUpdatedAt$inboundSchema: z.ZodType<
220
- EventTypeUpdatedAt,
221
- z.ZodTypeDef,
222
- unknown
223
- > = z.object({});
224
-
225
- export function eventTypeUpdatedAtFromJSON(
226
- jsonString: string,
227
- ): SafeParseResult<EventTypeUpdatedAt, SDKValidationError> {
228
- return safeParse(
229
- jsonString,
230
- (x) => EventTypeUpdatedAt$inboundSchema.parse(JSON.parse(x)),
231
- `Failed to parse 'EventTypeUpdatedAt' from JSON`,
232
- );
233
- }
56
+ export const EventTypeLocationType$inboundSchema: z.ZodNativeEnum<
57
+ typeof EventTypeLocationType
58
+ > = z.nativeEnum(EventTypeLocationType);
234
59
 
235
60
  /** @internal */
236
61
  export const FormUnion$inboundSchema: z.ZodType<
@@ -259,22 +84,22 @@ export const EventType$inboundSchema: z.ZodType<
259
84
  id: z.string(),
260
85
  name: z.string(),
261
86
  slug: z.string(),
262
- duration_minutes: z.lazy(() => DurationMinutes$inboundSchema),
263
- buffer_before_minutes: z.lazy(() => BufferBeforeMinutes$inboundSchema),
264
- buffer_after_minutes: z.lazy(() => BufferAfterMinutes$inboundSchema),
265
- min_notice_minutes: z.lazy(() => MinNoticeMinutes$inboundSchema),
266
- booking_window_days: z.lazy(() => BookingWindowDays$inboundSchema),
267
- max_per_day: z.lazy(() => MaxPerDay$inboundSchema),
87
+ duration_minutes: z.number().int(),
88
+ buffer_before_minutes: z.number().int(),
89
+ buffer_after_minutes: z.number().int(),
90
+ min_notice_minutes: z.number().int(),
91
+ booking_window_days: z.number().int(),
92
+ max_per_day: z.nullable(z.number().int()),
268
93
  reminder_minutes: z.array(z.number()),
269
- location_type: z.lazy(() => EventTypeLocationType$inboundSchema),
270
- location_details: z.lazy(() => LocationDetails$inboundSchema),
271
- created_at: z.lazy(() => EventTypeCreatedAt$inboundSchema),
272
- updated_at: z.lazy(() => EventTypeUpdatedAt$inboundSchema),
273
- form_id: z.string(),
94
+ location_type: EventTypeLocationType$inboundSchema,
95
+ location_details: z.nullable(z.string()),
96
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
97
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
98
+ form_id: z.nullable(z.string()),
274
99
  form: z.nullable(z.union([Form$inboundSchema, z.string()])).optional(),
275
100
  free: z.boolean(),
276
- schedule_id: z.string(),
277
- product_id: z.string(),
101
+ schedule_id: z.nullable(z.string()),
102
+ product_id: z.nullable(z.string()),
278
103
  price_variants: z.array(PriceVariant$inboundSchema),
279
104
  }).transform((v) => {
280
105
  return remap$(v, {
@@ -27,20 +27,10 @@ export const EntityType = {
27
27
  } as const;
28
28
  export type EntityType = ClosedEnum<typeof EntityType>;
29
29
 
30
- export type State = {};
31
-
32
- export type NaicsCode = {};
33
-
34
- export type Description = {};
35
-
36
30
  export type ResponsibleParty = {};
37
31
 
38
32
  export type MailingAddress = {};
39
33
 
40
- export type FormationCreatedAt = {};
41
-
42
- export type FormationUpdatedAt = {};
43
-
44
34
  export const PaymentStatus = {
45
35
  Unpaid: "unpaid",
46
36
  Paid: "paid",
@@ -53,9 +43,9 @@ export type Formation = {
53
43
  object: string;
54
44
  status: FormationStatus;
55
45
  entityType: EntityType;
56
- state: State;
57
- naicsCode: NaicsCode;
58
- description: Description;
46
+ state: string;
47
+ naicsCode: string;
48
+ description: string;
59
49
  nameOptions: Array<any>;
60
50
  members: Array<any>;
61
51
  responsibleParty: ResponsibleParty;
@@ -66,8 +56,8 @@ export type Formation = {
66
56
  doolaError: string | null;
67
57
  stripeCheckoutSessionId: string | null;
68
58
  submittedAt: string | null;
69
- createdAt: FormationCreatedAt;
70
- updatedAt: FormationUpdatedAt;
59
+ createdAt: Date;
60
+ updatedAt: Date;
71
61
  doolaCompanyId: string | null;
72
62
  verificationId: string | null;
73
63
  paymentStatus: PaymentStatus;
@@ -83,54 +73,6 @@ export const FormationStatus$inboundSchema: z.ZodNativeEnum<
83
73
  export const EntityType$inboundSchema: z.ZodNativeEnum<typeof EntityType> = z
84
74
  .nativeEnum(EntityType);
85
75
 
86
- /** @internal */
87
- export const State$inboundSchema: z.ZodType<State, z.ZodTypeDef, unknown> = z
88
- .object({});
89
-
90
- export function stateFromJSON(
91
- jsonString: string,
92
- ): SafeParseResult<State, SDKValidationError> {
93
- return safeParse(
94
- jsonString,
95
- (x) => State$inboundSchema.parse(JSON.parse(x)),
96
- `Failed to parse 'State' from JSON`,
97
- );
98
- }
99
-
100
- /** @internal */
101
- export const NaicsCode$inboundSchema: z.ZodType<
102
- NaicsCode,
103
- z.ZodTypeDef,
104
- unknown
105
- > = z.object({});
106
-
107
- export function naicsCodeFromJSON(
108
- jsonString: string,
109
- ): SafeParseResult<NaicsCode, SDKValidationError> {
110
- return safeParse(
111
- jsonString,
112
- (x) => NaicsCode$inboundSchema.parse(JSON.parse(x)),
113
- `Failed to parse 'NaicsCode' from JSON`,
114
- );
115
- }
116
-
117
- /** @internal */
118
- export const Description$inboundSchema: z.ZodType<
119
- Description,
120
- z.ZodTypeDef,
121
- unknown
122
- > = z.object({});
123
-
124
- export function descriptionFromJSON(
125
- jsonString: string,
126
- ): SafeParseResult<Description, SDKValidationError> {
127
- return safeParse(
128
- jsonString,
129
- (x) => Description$inboundSchema.parse(JSON.parse(x)),
130
- `Failed to parse 'Description' from JSON`,
131
- );
132
- }
133
-
134
76
  /** @internal */
135
77
  export const ResponsibleParty$inboundSchema: z.ZodType<
136
78
  ResponsibleParty,
@@ -165,40 +107,6 @@ export function mailingAddressFromJSON(
165
107
  );
166
108
  }
167
109
 
168
- /** @internal */
169
- export const FormationCreatedAt$inboundSchema: z.ZodType<
170
- FormationCreatedAt,
171
- z.ZodTypeDef,
172
- unknown
173
- > = z.object({});
174
-
175
- export function formationCreatedAtFromJSON(
176
- jsonString: string,
177
- ): SafeParseResult<FormationCreatedAt, SDKValidationError> {
178
- return safeParse(
179
- jsonString,
180
- (x) => FormationCreatedAt$inboundSchema.parse(JSON.parse(x)),
181
- `Failed to parse 'FormationCreatedAt' from JSON`,
182
- );
183
- }
184
-
185
- /** @internal */
186
- export const FormationUpdatedAt$inboundSchema: z.ZodType<
187
- FormationUpdatedAt,
188
- z.ZodTypeDef,
189
- unknown
190
- > = z.object({});
191
-
192
- export function formationUpdatedAtFromJSON(
193
- jsonString: string,
194
- ): SafeParseResult<FormationUpdatedAt, SDKValidationError> {
195
- return safeParse(
196
- jsonString,
197
- (x) => FormationUpdatedAt$inboundSchema.parse(JSON.parse(x)),
198
- `Failed to parse 'FormationUpdatedAt' from JSON`,
199
- );
200
- }
201
-
202
110
  /** @internal */
203
111
  export const PaymentStatus$inboundSchema: z.ZodNativeEnum<
204
112
  typeof PaymentStatus
@@ -214,9 +122,9 @@ export const Formation$inboundSchema: z.ZodType<
214
122
  object: z.string(),
215
123
  status: FormationStatus$inboundSchema,
216
124
  entity_type: EntityType$inboundSchema,
217
- state: z.lazy(() => State$inboundSchema),
218
- naics_code: z.lazy(() => NaicsCode$inboundSchema),
219
- description: z.lazy(() => Description$inboundSchema),
125
+ state: z.string(),
126
+ naics_code: z.string(),
127
+ description: z.string(),
220
128
  name_options: z.array(z.any()),
221
129
  members: z.array(z.any()),
222
130
  responsible_party: z.lazy(() => ResponsibleParty$inboundSchema),
@@ -227,8 +135,8 @@ export const Formation$inboundSchema: z.ZodType<
227
135
  doola_error: z.nullable(z.string()),
228
136
  stripe_checkout_session_id: z.nullable(z.string()),
229
137
  submitted_at: z.nullable(z.string()),
230
- created_at: z.lazy(() => FormationCreatedAt$inboundSchema),
231
- updated_at: z.lazy(() => FormationUpdatedAt$inboundSchema),
138
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
139
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
232
140
  doola_company_id: z.nullable(z.string()),
233
141
  verification_id: z.nullable(z.string()),
234
142
  payment_status: PaymentStatus$inboundSchema,
@@ -16,16 +16,12 @@ export const DocumentType = {
16
16
  } as const;
17
17
  export type DocumentType = ClosedEnum<typeof DocumentType>;
18
18
 
19
- export type Name = {};
20
-
21
- export type ContentType = {};
22
-
23
19
  export type FormationDocument = {
24
20
  id: string;
25
21
  object: string;
26
22
  documentType: DocumentType;
27
- name: Name;
28
- contentType: ContentType;
23
+ name: string;
24
+ contentType: string | null;
29
25
  doolaCreatedAt: string | null;
30
26
  doolaLastModifiedAt: string | null;
31
27
  doolaCompanyId: string;
@@ -36,37 +32,6 @@ export type FormationDocument = {
36
32
  export const DocumentType$inboundSchema: z.ZodNativeEnum<typeof DocumentType> =
37
33
  z.nativeEnum(DocumentType);
38
34
 
39
- /** @internal */
40
- export const Name$inboundSchema: z.ZodType<Name, z.ZodTypeDef, unknown> = z
41
- .object({});
42
-
43
- export function nameFromJSON(
44
- jsonString: string,
45
- ): SafeParseResult<Name, SDKValidationError> {
46
- return safeParse(
47
- jsonString,
48
- (x) => Name$inboundSchema.parse(JSON.parse(x)),
49
- `Failed to parse 'Name' from JSON`,
50
- );
51
- }
52
-
53
- /** @internal */
54
- export const ContentType$inboundSchema: z.ZodType<
55
- ContentType,
56
- z.ZodTypeDef,
57
- unknown
58
- > = z.object({});
59
-
60
- export function contentTypeFromJSON(
61
- jsonString: string,
62
- ): SafeParseResult<ContentType, SDKValidationError> {
63
- return safeParse(
64
- jsonString,
65
- (x) => ContentType$inboundSchema.parse(JSON.parse(x)),
66
- `Failed to parse 'ContentType' from JSON`,
67
- );
68
- }
69
-
70
35
  /** @internal */
71
36
  export const FormationDocument$inboundSchema: z.ZodType<
72
37
  FormationDocument,
@@ -76,8 +41,8 @@ export const FormationDocument$inboundSchema: z.ZodType<
76
41
  id: z.string(),
77
42
  object: z.string(),
78
43
  document_type: DocumentType$inboundSchema,
79
- name: z.lazy(() => Name$inboundSchema),
80
- content_type: z.lazy(() => ContentType$inboundSchema),
44
+ name: z.string(),
45
+ content_type: z.nullable(z.string()),
81
46
  doola_created_at: z.nullable(z.string()),
82
47
  doola_last_modified_at: z.nullable(z.string()),
83
48
  doola_company_id: z.string(),
@@ -2,6 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ export * from "./accesscheck.js";
5
6
  export * from "./account.js";
6
7
  export * from "./accountrequest.js";
7
8
  export * from "./aisite.js";
@@ -199,6 +200,7 @@ export * from "./usageoperationspend.js";
199
200
  export * from "./usageplan.js";
200
201
  export * from "./usagespend.js";
201
202
  export * from "./usagetransaction.js";
203
+ export * from "./user.js";
202
204
  export * from "./videogeneraterequest.js";
203
205
  export * from "./webhookendpoint.js";
204
206
  export * from "./webhookendpointrequest.js";
package/src/models/me.ts CHANGED
@@ -14,7 +14,7 @@ export type Me = {
14
14
  name: string | null;
15
15
  username: string;
16
16
  email: string;
17
- preferredLanguage: string | null;
17
+ preferredLanguage: string;
18
18
  timeZone: string | null;
19
19
  createdAt: Date;
20
20
  avatarUrl: string | null;
@@ -28,7 +28,7 @@ export const Me$inboundSchema: z.ZodType<Me, z.ZodTypeDef, unknown> = z.object({
28
28
  name: z.nullable(z.string()),
29
29
  username: z.string(),
30
30
  email: z.string(),
31
- preferred_language: z.nullable(z.string()),
31
+ preferred_language: z.string(),
32
32
  time_zone: z.nullable(z.string()),
33
33
  created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
34
34
  avatar_url: z.nullable(z.string()),
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+
8
+ export type CheckAccessRequest = {
9
+ /**
10
+ * The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
11
+ */
12
+ id: string;
13
+ /**
14
+ * The resource to check access to: the account id (acct_…), a product (prod_…) or an experience (exp_…).
15
+ */
16
+ resourceId: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export type CheckAccessRequest$Outbound = {
21
+ id: string;
22
+ resource_id: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const CheckAccessRequest$outboundSchema: z.ZodType<
27
+ CheckAccessRequest$Outbound,
28
+ z.ZodTypeDef,
29
+ CheckAccessRequest
30
+ > = z.object({
31
+ id: z.string(),
32
+ resourceId: z.string(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ resourceId: "resource_id",
36
+ });
37
+ });
38
+
39
+ export function checkAccessRequestToJSON(
40
+ checkAccessRequest: CheckAccessRequest,
41
+ ): string {
42
+ return JSON.stringify(
43
+ CheckAccessRequest$outboundSchema.parse(checkAccessRequest),
44
+ );
45
+ }