gymmonk-schema 0.2.0 → 0.3.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 (97) hide show
  1. package/dist/announcement.d.ts +56 -0
  2. package/dist/announcement.d.ts.map +1 -0
  3. package/dist/announcement.js +40 -0
  4. package/dist/announcement.js.map +1 -0
  5. package/dist/center.d.ts +381 -0
  6. package/dist/center.d.ts.map +1 -0
  7. package/dist/center.js +96 -0
  8. package/dist/center.js.map +1 -0
  9. package/dist/common.d.ts +28 -0
  10. package/dist/common.d.ts.map +1 -1
  11. package/dist/common.js +37 -0
  12. package/dist/common.js.map +1 -1
  13. package/dist/equipment.d.ts +93 -0
  14. package/dist/equipment.d.ts.map +1 -0
  15. package/dist/equipment.js +54 -0
  16. package/dist/equipment.js.map +1 -0
  17. package/dist/exercise.d.ts +234 -0
  18. package/dist/exercise.d.ts.map +1 -0
  19. package/dist/exercise.js +93 -0
  20. package/dist/exercise.js.map +1 -0
  21. package/dist/feedback.d.ts +119 -0
  22. package/dist/feedback.d.ts.map +1 -0
  23. package/dist/feedback.js +77 -0
  24. package/dist/feedback.js.map +1 -0
  25. package/dist/home.d.ts +74 -0
  26. package/dist/home.d.ts.map +1 -0
  27. package/dist/home.js +28 -0
  28. package/dist/home.js.map +1 -0
  29. package/dist/index.d.ts +27 -4
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +33 -5
  32. package/dist/index.js.map +1 -1
  33. package/dist/insights.d.ts +143 -0
  34. package/dist/insights.d.ts.map +1 -0
  35. package/dist/insights.js +79 -0
  36. package/dist/insights.js.map +1 -0
  37. package/dist/member-profile.d.ts +312 -0
  38. package/dist/member-profile.d.ts.map +1 -0
  39. package/dist/member-profile.js +103 -0
  40. package/dist/member-profile.js.map +1 -0
  41. package/dist/member.d.ts +365 -0
  42. package/dist/member.d.ts.map +1 -0
  43. package/dist/member.js +169 -0
  44. package/dist/member.js.map +1 -0
  45. package/dist/membership-plan.d.ts +244 -0
  46. package/dist/membership-plan.d.ts.map +1 -0
  47. package/dist/membership-plan.js +80 -0
  48. package/dist/membership-plan.js.map +1 -0
  49. package/dist/membership.d.ts +154 -0
  50. package/dist/membership.d.ts.map +1 -0
  51. package/dist/membership.js +103 -0
  52. package/dist/membership.js.map +1 -0
  53. package/dist/notification.d.ts +59 -0
  54. package/dist/notification.d.ts.map +1 -0
  55. package/dist/notification.js +49 -0
  56. package/dist/notification.js.map +1 -0
  57. package/dist/onboarding.d.ts +361 -0
  58. package/dist/onboarding.d.ts.map +1 -0
  59. package/dist/onboarding.js +74 -0
  60. package/dist/onboarding.js.map +1 -0
  61. package/dist/organisation.d.ts +199 -0
  62. package/dist/organisation.d.ts.map +1 -0
  63. package/dist/organisation.js +51 -0
  64. package/dist/organisation.js.map +1 -0
  65. package/dist/owner-profile.d.ts +50 -0
  66. package/dist/owner-profile.d.ts.map +1 -0
  67. package/dist/owner-profile.js +34 -0
  68. package/dist/owner-profile.js.map +1 -0
  69. package/dist/pricing.d.ts +103 -0
  70. package/dist/pricing.d.ts.map +1 -0
  71. package/dist/pricing.js +73 -0
  72. package/dist/pricing.js.map +1 -0
  73. package/dist/session.d.ts +90 -0
  74. package/dist/session.d.ts.map +1 -0
  75. package/dist/session.js +59 -0
  76. package/dist/session.js.map +1 -0
  77. package/dist/shared.d.ts +199 -0
  78. package/dist/shared.d.ts.map +1 -0
  79. package/dist/shared.js +107 -0
  80. package/dist/shared.js.map +1 -0
  81. package/dist/staff.d.ts +288 -0
  82. package/dist/staff.d.ts.map +1 -0
  83. package/dist/staff.js +115 -0
  84. package/dist/staff.js.map +1 -0
  85. package/dist/subscription.d.ts +69 -0
  86. package/dist/subscription.d.ts.map +1 -0
  87. package/dist/subscription.js +47 -0
  88. package/dist/subscription.js.map +1 -0
  89. package/dist/user.d.ts +63 -0
  90. package/dist/user.d.ts.map +1 -0
  91. package/dist/user.js +44 -0
  92. package/dist/user.js.map +1 -0
  93. package/dist/workout-plan.d.ts +201 -0
  94. package/dist/workout-plan.d.ts.map +1 -0
  95. package/dist/workout-plan.js +71 -0
  96. package/dist/workout-plan.js.map +1 -0
  97. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ /**
2
+ * gymmonk-schema — Owner announcements
3
+ * ====================================
4
+ * Broadcasts an owner sends to a center's members (now or scheduled). Delivered
5
+ * as notifications + push.
6
+ *
7
+ * @module gymmonk-schema/announcement
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const announcementIconSchema: z.ZodEnum<{
11
+ megaphone: "megaphone";
12
+ warning: "warning";
13
+ }>;
14
+ export type AnnouncementIcon = z.infer<typeof announcementIconSchema>;
15
+ export declare const announcementStatusSchema: z.ZodEnum<{
16
+ draft: "draft";
17
+ scheduled: "scheduled";
18
+ sent: "sent";
19
+ }>;
20
+ export type AnnouncementStatus = z.infer<typeof announcementStatusSchema>;
21
+ export declare const announcementSchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ centerId: z.ZodString;
24
+ icon: z.ZodEnum<{
25
+ megaphone: "megaphone";
26
+ warning: "warning";
27
+ }>;
28
+ title: z.ZodString;
29
+ body: z.ZodString;
30
+ status: z.ZodEnum<{
31
+ draft: "draft";
32
+ scheduled: "scheduled";
33
+ sent: "sent";
34
+ }>;
35
+ scheduledAt: z.ZodNullable<z.ZodISODateTime>;
36
+ sentAt: z.ZodNullable<z.ZodISODateTime>;
37
+ createdAt: z.ZodISODateTime;
38
+ updatedAt: z.ZodISODateTime;
39
+ }, z.core.$strip>;
40
+ export type Announcement = z.infer<typeof announcementSchema>;
41
+ export declare const createAnnouncementBodySchema: z.ZodObject<{
42
+ icon: z.ZodDefault<z.ZodEnum<{
43
+ megaphone: "megaphone";
44
+ warning: "warning";
45
+ }>>;
46
+ title: z.ZodString;
47
+ body: z.ZodString;
48
+ scheduledAt: z.ZodOptional<z.ZodISODateTime>;
49
+ status: z.ZodDefault<z.ZodEnum<{
50
+ draft: "draft";
51
+ scheduled: "scheduled";
52
+ sent: "sent";
53
+ }>>;
54
+ }, z.core.$strip>;
55
+ export type CreateAnnouncementBody = z.infer<typeof createAnnouncementBodySchema>;
56
+ //# sourceMappingURL=announcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"announcement.d.ts","sourceRoot":"","sources":["../src/announcement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,sBAAsB;;;EAAmC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;;EAAyC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;iBAW7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAYrC,CAAC;AACL,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * gymmonk-schema — Owner announcements
3
+ * ====================================
4
+ * Broadcasts an owner sends to a center's members (now or scheduled). Delivered
5
+ * as notifications + push.
6
+ *
7
+ * @module gymmonk-schema/announcement
8
+ */
9
+ import { z } from 'zod';
10
+ import { isoDateTimeSchema, objectIdSchema } from './common.js';
11
+ export const announcementIconSchema = z.enum(['megaphone', 'warning']);
12
+ export const announcementStatusSchema = z.enum(['draft', 'scheduled', 'sent']);
13
+ // ─── Entity ──────────────────────────────────────────────────────────────────
14
+ export const announcementSchema = z.object({
15
+ id: objectIdSchema,
16
+ centerId: objectIdSchema,
17
+ icon: announcementIconSchema,
18
+ title: z.string(),
19
+ body: z.string(),
20
+ status: announcementStatusSchema,
21
+ scheduledAt: isoDateTimeSchema.nullable(),
22
+ sentAt: isoDateTimeSchema.nullable(),
23
+ createdAt: isoDateTimeSchema,
24
+ updatedAt: isoDateTimeSchema,
25
+ });
26
+ // ─── Create body ─────────────────────────────────────────────────────────────
27
+ export const createAnnouncementBodySchema = z
28
+ .object({
29
+ icon: announcementIconSchema.default('megaphone'),
30
+ title: z.string().trim().min(1, 'Title is required').max(120),
31
+ body: z.string().trim().min(1, 'Message is required').max(250),
32
+ /** Required when `status` is `scheduled`; otherwise sent immediately. */
33
+ scheduledAt: isoDateTimeSchema.optional(),
34
+ status: announcementStatusSchema.default('sent'),
35
+ })
36
+ .refine((v) => v.status !== 'scheduled' || v.scheduledAt != null, {
37
+ message: 'Pick a schedule time',
38
+ path: ['scheduledAt'],
39
+ });
40
+ //# sourceMappingURL=announcement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"announcement.js","sourceRoot":"","sources":["../src/announcement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAGvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AAG/E,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,cAAc;IAClB,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,wBAAwB;IAChC,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAGH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,IAAI,EAAE,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9D,yEAAyE;IACzE,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC;CACjD,CAAC;KACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,EAAE;IAChE,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,CAAC,aAAa,CAAC;CACtB,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Owner announcements\n * ====================================\n * Broadcasts an owner sends to a center's members (now or scheduled). Delivered\n * as notifications + push.\n *\n * @module gymmonk-schema/announcement\n */\n\nimport { z } from 'zod';\nimport { isoDateTimeSchema, objectIdSchema } from './common.js';\n\nexport const announcementIconSchema = z.enum(['megaphone', 'warning']);\nexport type AnnouncementIcon = z.infer<typeof announcementIconSchema>;\n\nexport const announcementStatusSchema = z.enum(['draft', 'scheduled', 'sent']);\nexport type AnnouncementStatus = z.infer<typeof announcementStatusSchema>;\n\n// ─── Entity ──────────────────────────────────────────────────────────────────\n\nexport const announcementSchema = z.object({\n id: objectIdSchema,\n centerId: objectIdSchema,\n icon: announcementIconSchema,\n title: z.string(),\n body: z.string(),\n status: announcementStatusSchema,\n scheduledAt: isoDateTimeSchema.nullable(),\n sentAt: isoDateTimeSchema.nullable(),\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n});\nexport type Announcement = z.infer<typeof announcementSchema>;\n\n// ─── Create body ─────────────────────────────────────────────────────────────\n\nexport const createAnnouncementBodySchema = z\n .object({\n icon: announcementIconSchema.default('megaphone'),\n title: z.string().trim().min(1, 'Title is required').max(120),\n body: z.string().trim().min(1, 'Message is required').max(250),\n /** Required when `status` is `scheduled`; otherwise sent immediately. */\n scheduledAt: isoDateTimeSchema.optional(),\n status: announcementStatusSchema.default('sent'),\n })\n .refine((v) => v.status !== 'scheduled' || v.scheduledAt != null, {\n message: 'Pick a schedule time',\n path: ['scheduledAt'],\n });\nexport type CreateAnnouncementBody = z.infer<typeof createAnnouncementBodySchema>;\n"]}
@@ -0,0 +1,381 @@
1
+ /**
2
+ * gymmonk-schema — Center (branch)
3
+ * ================================
4
+ * A physical gym location belonging to an organisation. Carries the public gym
5
+ * code members use to join, opening hours, equipment scope, and contact info.
6
+ * v1 memberships are single-center, so a Center is the unit a member joins.
7
+ *
8
+ * @module gymmonk-schema/center
9
+ */
10
+ import { z } from 'zod';
11
+ /** The activity types a center offers (multi-select). */
12
+ export declare const CENTER_TYPES: readonly ["gym", "crossfit", "yoga", "pilates", "zumba", "cardio", "strength", "mma", "boxing", "swimming", "aerobics", "personal-training"];
13
+ export declare const centerTypeSchema: z.ZodEnum<{
14
+ gym: "gym";
15
+ crossfit: "crossfit";
16
+ yoga: "yoga";
17
+ pilates: "pilates";
18
+ zumba: "zumba";
19
+ cardio: "cardio";
20
+ strength: "strength";
21
+ mma: "mma";
22
+ boxing: "boxing";
23
+ swimming: "swimming";
24
+ aerobics: "aerobics";
25
+ "personal-training": "personal-training";
26
+ }>;
27
+ export type CenterType = z.infer<typeof centerTypeSchema>;
28
+ export declare const centerStatusSchema: z.ZodEnum<{
29
+ active: "active";
30
+ inactive: "inactive";
31
+ }>;
32
+ export type CenterStatus = z.infer<typeof centerStatusSchema>;
33
+ /**
34
+ * The public gym code a member enters at onboarding to join, `GYM-YYYY-NNN`.
35
+ * Server-generated and unique; never accepted in a create body.
36
+ */
37
+ export declare const gymCodeSchema: z.ZodString;
38
+ export type GymCode = z.infer<typeof gymCodeSchema>;
39
+ export declare const createCenterBodySchema: z.ZodObject<{
40
+ name: z.ZodString;
41
+ description: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
42
+ types: z.ZodArray<z.ZodEnum<{
43
+ gym: "gym";
44
+ crossfit: "crossfit";
45
+ yoga: "yoga";
46
+ pilates: "pilates";
47
+ zumba: "zumba";
48
+ cardio: "cardio";
49
+ strength: "strength";
50
+ mma: "mma";
51
+ boxing: "boxing";
52
+ swimming: "swimming";
53
+ aerobics: "aerobics";
54
+ "personal-training": "personal-training";
55
+ }>>;
56
+ address: z.ZodObject<{
57
+ street: z.ZodString;
58
+ city: z.ZodString;
59
+ state: z.ZodEnum<{
60
+ "Andhra Pradesh": "Andhra Pradesh";
61
+ "Arunachal Pradesh": "Arunachal Pradesh";
62
+ Assam: "Assam";
63
+ Bihar: "Bihar";
64
+ Chhattisgarh: "Chhattisgarh";
65
+ Goa: "Goa";
66
+ Gujarat: "Gujarat";
67
+ Haryana: "Haryana";
68
+ "Himachal Pradesh": "Himachal Pradesh";
69
+ Jharkhand: "Jharkhand";
70
+ Karnataka: "Karnataka";
71
+ Kerala: "Kerala";
72
+ "Madhya Pradesh": "Madhya Pradesh";
73
+ Maharashtra: "Maharashtra";
74
+ Manipur: "Manipur";
75
+ Meghalaya: "Meghalaya";
76
+ Mizoram: "Mizoram";
77
+ Nagaland: "Nagaland";
78
+ Odisha: "Odisha";
79
+ Punjab: "Punjab";
80
+ Rajasthan: "Rajasthan";
81
+ Sikkim: "Sikkim";
82
+ "Tamil Nadu": "Tamil Nadu";
83
+ Telangana: "Telangana";
84
+ Tripura: "Tripura";
85
+ "Uttar Pradesh": "Uttar Pradesh";
86
+ Uttarakhand: "Uttarakhand";
87
+ "West Bengal": "West Bengal";
88
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
89
+ Chandigarh: "Chandigarh";
90
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
91
+ Delhi: "Delhi";
92
+ "Jammu and Kashmir": "Jammu and Kashmir";
93
+ Ladakh: "Ladakh";
94
+ Lakshadweep: "Lakshadweep";
95
+ Puducherry: "Puducherry";
96
+ }>;
97
+ pincode: z.ZodString;
98
+ }, z.core.$strip>;
99
+ floorAreaSqft: z.ZodOptional<z.ZodNumber>;
100
+ primaryPhone: z.ZodString;
101
+ secondaryPhone: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
102
+ email: z.ZodPreprocess<z.ZodOptional<z.ZodEmail>>;
103
+ website: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
104
+ hours: z.ZodObject<{
105
+ mon: z.ZodObject<{
106
+ open: z.ZodBoolean;
107
+ from: z.ZodString;
108
+ to: z.ZodString;
109
+ }, z.core.$strip>;
110
+ tue: z.ZodObject<{
111
+ open: z.ZodBoolean;
112
+ from: z.ZodString;
113
+ to: z.ZodString;
114
+ }, z.core.$strip>;
115
+ wed: z.ZodObject<{
116
+ open: z.ZodBoolean;
117
+ from: z.ZodString;
118
+ to: z.ZodString;
119
+ }, z.core.$strip>;
120
+ thu: z.ZodObject<{
121
+ open: z.ZodBoolean;
122
+ from: z.ZodString;
123
+ to: z.ZodString;
124
+ }, z.core.$strip>;
125
+ fri: z.ZodObject<{
126
+ open: z.ZodBoolean;
127
+ from: z.ZodString;
128
+ to: z.ZodString;
129
+ }, z.core.$strip>;
130
+ sat: z.ZodObject<{
131
+ open: z.ZodBoolean;
132
+ from: z.ZodString;
133
+ to: z.ZodString;
134
+ }, z.core.$strip>;
135
+ sun: z.ZodObject<{
136
+ open: z.ZodBoolean;
137
+ from: z.ZodString;
138
+ to: z.ZodString;
139
+ }, z.core.$strip>;
140
+ }, z.core.$strip>;
141
+ photos: z.ZodDefault<z.ZodArray<z.ZodString>>;
142
+ }, z.core.$strip>;
143
+ export type CreateCenterBody = z.infer<typeof createCenterBodySchema>;
144
+ export declare const updateCenterBodySchema: z.ZodObject<{
145
+ name: z.ZodOptional<z.ZodString>;
146
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
147
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
148
+ gym: "gym";
149
+ crossfit: "crossfit";
150
+ yoga: "yoga";
151
+ pilates: "pilates";
152
+ zumba: "zumba";
153
+ cardio: "cardio";
154
+ strength: "strength";
155
+ mma: "mma";
156
+ boxing: "boxing";
157
+ swimming: "swimming";
158
+ aerobics: "aerobics";
159
+ "personal-training": "personal-training";
160
+ }>>>;
161
+ address: z.ZodOptional<z.ZodObject<{
162
+ street: z.ZodString;
163
+ city: z.ZodString;
164
+ state: z.ZodEnum<{
165
+ "Andhra Pradesh": "Andhra Pradesh";
166
+ "Arunachal Pradesh": "Arunachal Pradesh";
167
+ Assam: "Assam";
168
+ Bihar: "Bihar";
169
+ Chhattisgarh: "Chhattisgarh";
170
+ Goa: "Goa";
171
+ Gujarat: "Gujarat";
172
+ Haryana: "Haryana";
173
+ "Himachal Pradesh": "Himachal Pradesh";
174
+ Jharkhand: "Jharkhand";
175
+ Karnataka: "Karnataka";
176
+ Kerala: "Kerala";
177
+ "Madhya Pradesh": "Madhya Pradesh";
178
+ Maharashtra: "Maharashtra";
179
+ Manipur: "Manipur";
180
+ Meghalaya: "Meghalaya";
181
+ Mizoram: "Mizoram";
182
+ Nagaland: "Nagaland";
183
+ Odisha: "Odisha";
184
+ Punjab: "Punjab";
185
+ Rajasthan: "Rajasthan";
186
+ Sikkim: "Sikkim";
187
+ "Tamil Nadu": "Tamil Nadu";
188
+ Telangana: "Telangana";
189
+ Tripura: "Tripura";
190
+ "Uttar Pradesh": "Uttar Pradesh";
191
+ Uttarakhand: "Uttarakhand";
192
+ "West Bengal": "West Bengal";
193
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
194
+ Chandigarh: "Chandigarh";
195
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
196
+ Delhi: "Delhi";
197
+ "Jammu and Kashmir": "Jammu and Kashmir";
198
+ Ladakh: "Ladakh";
199
+ Lakshadweep: "Lakshadweep";
200
+ Puducherry: "Puducherry";
201
+ }>;
202
+ pincode: z.ZodString;
203
+ }, z.core.$strip>>;
204
+ floorAreaSqft: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
205
+ primaryPhone: z.ZodOptional<z.ZodString>;
206
+ secondaryPhone: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
207
+ email: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodEmail>>>;
208
+ website: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
209
+ hours: z.ZodOptional<z.ZodObject<{
210
+ mon: z.ZodObject<{
211
+ open: z.ZodBoolean;
212
+ from: z.ZodString;
213
+ to: z.ZodString;
214
+ }, z.core.$strip>;
215
+ tue: z.ZodObject<{
216
+ open: z.ZodBoolean;
217
+ from: z.ZodString;
218
+ to: z.ZodString;
219
+ }, z.core.$strip>;
220
+ wed: z.ZodObject<{
221
+ open: z.ZodBoolean;
222
+ from: z.ZodString;
223
+ to: z.ZodString;
224
+ }, z.core.$strip>;
225
+ thu: z.ZodObject<{
226
+ open: z.ZodBoolean;
227
+ from: z.ZodString;
228
+ to: z.ZodString;
229
+ }, z.core.$strip>;
230
+ fri: z.ZodObject<{
231
+ open: z.ZodBoolean;
232
+ from: z.ZodString;
233
+ to: z.ZodString;
234
+ }, z.core.$strip>;
235
+ sat: z.ZodObject<{
236
+ open: z.ZodBoolean;
237
+ from: z.ZodString;
238
+ to: z.ZodString;
239
+ }, z.core.$strip>;
240
+ sun: z.ZodObject<{
241
+ open: z.ZodBoolean;
242
+ from: z.ZodString;
243
+ to: z.ZodString;
244
+ }, z.core.$strip>;
245
+ }, z.core.$strip>>;
246
+ photos: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
247
+ }, z.core.$strip>;
248
+ export type UpdateCenterBody = z.infer<typeof updateCenterBodySchema>;
249
+ export declare const centerSchema: z.ZodObject<{
250
+ id: z.ZodString;
251
+ organisationId: z.ZodString;
252
+ code: z.ZodString;
253
+ name: z.ZodString;
254
+ description: z.ZodNullable<z.ZodString>;
255
+ types: z.ZodArray<z.ZodEnum<{
256
+ gym: "gym";
257
+ crossfit: "crossfit";
258
+ yoga: "yoga";
259
+ pilates: "pilates";
260
+ zumba: "zumba";
261
+ cardio: "cardio";
262
+ strength: "strength";
263
+ mma: "mma";
264
+ boxing: "boxing";
265
+ swimming: "swimming";
266
+ aerobics: "aerobics";
267
+ "personal-training": "personal-training";
268
+ }>>;
269
+ address: z.ZodObject<{
270
+ street: z.ZodString;
271
+ city: z.ZodString;
272
+ state: z.ZodEnum<{
273
+ "Andhra Pradesh": "Andhra Pradesh";
274
+ "Arunachal Pradesh": "Arunachal Pradesh";
275
+ Assam: "Assam";
276
+ Bihar: "Bihar";
277
+ Chhattisgarh: "Chhattisgarh";
278
+ Goa: "Goa";
279
+ Gujarat: "Gujarat";
280
+ Haryana: "Haryana";
281
+ "Himachal Pradesh": "Himachal Pradesh";
282
+ Jharkhand: "Jharkhand";
283
+ Karnataka: "Karnataka";
284
+ Kerala: "Kerala";
285
+ "Madhya Pradesh": "Madhya Pradesh";
286
+ Maharashtra: "Maharashtra";
287
+ Manipur: "Manipur";
288
+ Meghalaya: "Meghalaya";
289
+ Mizoram: "Mizoram";
290
+ Nagaland: "Nagaland";
291
+ Odisha: "Odisha";
292
+ Punjab: "Punjab";
293
+ Rajasthan: "Rajasthan";
294
+ Sikkim: "Sikkim";
295
+ "Tamil Nadu": "Tamil Nadu";
296
+ Telangana: "Telangana";
297
+ Tripura: "Tripura";
298
+ "Uttar Pradesh": "Uttar Pradesh";
299
+ Uttarakhand: "Uttarakhand";
300
+ "West Bengal": "West Bengal";
301
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
302
+ Chandigarh: "Chandigarh";
303
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
304
+ Delhi: "Delhi";
305
+ "Jammu and Kashmir": "Jammu and Kashmir";
306
+ Ladakh: "Ladakh";
307
+ Lakshadweep: "Lakshadweep";
308
+ Puducherry: "Puducherry";
309
+ }>;
310
+ pincode: z.ZodString;
311
+ }, z.core.$strip>;
312
+ floorAreaSqft: z.ZodNullable<z.ZodNumber>;
313
+ primaryPhone: z.ZodString;
314
+ secondaryPhone: z.ZodNullable<z.ZodString>;
315
+ email: z.ZodNullable<z.ZodString>;
316
+ website: z.ZodNullable<z.ZodString>;
317
+ hours: z.ZodObject<{
318
+ mon: z.ZodObject<{
319
+ open: z.ZodBoolean;
320
+ from: z.ZodString;
321
+ to: z.ZodString;
322
+ }, z.core.$strip>;
323
+ tue: z.ZodObject<{
324
+ open: z.ZodBoolean;
325
+ from: z.ZodString;
326
+ to: z.ZodString;
327
+ }, z.core.$strip>;
328
+ wed: z.ZodObject<{
329
+ open: z.ZodBoolean;
330
+ from: z.ZodString;
331
+ to: z.ZodString;
332
+ }, z.core.$strip>;
333
+ thu: z.ZodObject<{
334
+ open: z.ZodBoolean;
335
+ from: z.ZodString;
336
+ to: z.ZodString;
337
+ }, z.core.$strip>;
338
+ fri: z.ZodObject<{
339
+ open: z.ZodBoolean;
340
+ from: z.ZodString;
341
+ to: z.ZodString;
342
+ }, z.core.$strip>;
343
+ sat: z.ZodObject<{
344
+ open: z.ZodBoolean;
345
+ from: z.ZodString;
346
+ to: z.ZodString;
347
+ }, z.core.$strip>;
348
+ sun: z.ZodObject<{
349
+ open: z.ZodBoolean;
350
+ from: z.ZodString;
351
+ to: z.ZodString;
352
+ }, z.core.$strip>;
353
+ }, z.core.$strip>;
354
+ photos: z.ZodArray<z.ZodString>;
355
+ status: z.ZodEnum<{
356
+ active: "active";
357
+ inactive: "inactive";
358
+ }>;
359
+ memberCount: z.ZodNumber;
360
+ createdAt: z.ZodISODateTime;
361
+ updatedAt: z.ZodISODateTime;
362
+ }, z.core.$strip>;
363
+ export type Center = z.infer<typeof centerSchema>;
364
+ /** A lightweight public directory result for the "find your gym" step. */
365
+ export declare const nearbyGymSchema: z.ZodObject<{
366
+ id: z.ZodString;
367
+ code: z.ZodString;
368
+ name: z.ZodString;
369
+ area: z.ZodString;
370
+ distanceKm: z.ZodNumber;
371
+ memberCount: z.ZodOptional<z.ZodNumber>;
372
+ }, z.core.$strip>;
373
+ export type NearbyGym = z.infer<typeof nearbyGymSchema>;
374
+ /** Query params for the nearby-gyms search. */
375
+ export declare const nearbyGymsQuerySchema: z.ZodObject<{
376
+ lat: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
377
+ lng: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
378
+ q: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
379
+ }, z.core.$strip>;
380
+ export type NearbyGymsQuery = z.infer<typeof nearbyGymsQuerySchema>;
381
+ //# sourceMappingURL=center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.d.ts","sourceRoot":"","sources":["../src/center.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yDAAyD;AACzD,eAAO,MAAM,YAAY,8IAaf,CAAC;AACX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;EAAuB,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D,e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KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/center.js ADDED
@@ -0,0 +1,96 @@
1
+ /**
2
+ * gymmonk-schema — Center (branch)
3
+ * ================================
4
+ * A physical gym location belonging to an organisation. Carries the public gym
5
+ * code members use to join, opening hours, equipment scope, and contact info.
6
+ * v1 memberships are single-center, so a Center is the unit a member joins.
7
+ *
8
+ * @module gymmonk-schema/center
9
+ */
10
+ import { z } from 'zod';
11
+ import { isoDateTimeSchema, objectIdSchema, optionalEmailSchema, optionalPhoneSchema, optionalTrimmedString, phoneSchema, } from './common.js';
12
+ import { addressSchema, weeklyHoursSchema } from './shared.js';
13
+ // ─── Center type ─────────────────────────────────────────────────────────────
14
+ /** The activity types a center offers (multi-select). */
15
+ export const CENTER_TYPES = [
16
+ 'gym',
17
+ 'crossfit',
18
+ 'yoga',
19
+ 'pilates',
20
+ 'zumba',
21
+ 'cardio',
22
+ 'strength',
23
+ 'mma',
24
+ 'boxing',
25
+ 'swimming',
26
+ 'aerobics',
27
+ 'personal-training',
28
+ ];
29
+ export const centerTypeSchema = z.enum(CENTER_TYPES);
30
+ // ─── Status ──────────────────────────────────────────────────────────────────
31
+ export const centerStatusSchema = z.enum(['active', 'inactive']);
32
+ /**
33
+ * The public gym code a member enters at onboarding to join, `GYM-YYYY-NNN`.
34
+ * Server-generated and unique; never accepted in a create body.
35
+ */
36
+ export const gymCodeSchema = z
37
+ .string()
38
+ .trim()
39
+ .regex(/^GYM-\d{4}-\d{3,}$/, 'Invalid gym code');
40
+ // ─── Create / update bodies ──────────────────────────────────────────────────
41
+ export const createCenterBodySchema = z.object({
42
+ name: z.string().trim().min(1, 'Center name is required').max(160),
43
+ description: optionalTrimmedString(2000),
44
+ types: z.array(centerTypeSchema).min(1, 'Pick at least one type'),
45
+ address: addressSchema,
46
+ /** Usable floor area in square feet. */
47
+ floorAreaSqft: z.number().int().min(0).max(1_000_000).optional(),
48
+ primaryPhone: phoneSchema,
49
+ secondaryPhone: optionalPhoneSchema,
50
+ email: optionalEmailSchema,
51
+ website: optionalTrimmedString(200),
52
+ hours: weeklyHoursSchema,
53
+ /** Uploaded gallery image URLs. */
54
+ photos: z.array(z.string().trim().max(2000)).max(20).default([]),
55
+ });
56
+ export const updateCenterBodySchema = createCenterBodySchema.partial();
57
+ // ─── Entity (API response) ───────────────────────────────────────────────────
58
+ export const centerSchema = z.object({
59
+ id: objectIdSchema,
60
+ organisationId: objectIdSchema,
61
+ /** Public join code, `GYM-YYYY-NNN`. */
62
+ code: gymCodeSchema,
63
+ name: z.string(),
64
+ description: z.string().nullable(),
65
+ types: z.array(centerTypeSchema),
66
+ address: addressSchema,
67
+ floorAreaSqft: z.number().int().nullable(),
68
+ primaryPhone: z.string(),
69
+ secondaryPhone: z.string().nullable(),
70
+ email: z.string().nullable(),
71
+ website: z.string().nullable(),
72
+ hours: weeklyHoursSchema,
73
+ photos: z.array(z.string()),
74
+ status: centerStatusSchema,
75
+ /** Denormalised active-member count for roster headers. */
76
+ memberCount: z.number().int().nonnegative(),
77
+ createdAt: isoDateTimeSchema,
78
+ updatedAt: isoDateTimeSchema,
79
+ });
80
+ // ─── Nearby / directory card ─────────────────────────────────────────────────
81
+ /** A lightweight public directory result for the "find your gym" step. */
82
+ export const nearbyGymSchema = z.object({
83
+ id: objectIdSchema,
84
+ code: gymCodeSchema,
85
+ name: z.string(),
86
+ area: z.string(),
87
+ distanceKm: z.number().nonnegative(),
88
+ memberCount: z.number().int().nonnegative().optional(),
89
+ });
90
+ /** Query params for the nearby-gyms search. */
91
+ export const nearbyGymsQuerySchema = z.object({
92
+ lat: z.coerce.number().min(-90).max(90).optional(),
93
+ lng: z.coerce.number().min(-180).max(180).optional(),
94
+ q: optionalTrimmedString(120),
95
+ });
96
+ //# sourceMappingURL=center.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.js","sourceRoot":"","sources":["../src/center.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,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AAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,kBAAkB;IAC1B,2DAA2D;IAC3D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC3C,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAGH,gFAAgF;AAEhF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC;AAGH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClD,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACpD,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC;CAC9B,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Center (branch)\n * ================================\n * A physical gym location belonging to an organisation. Carries the public gym\n * code members use to join, opening hours, equipment scope, and contact info.\n * v1 memberships are single-center, so a Center is the unit a member joins.\n *\n * @module gymmonk-schema/center\n */\n\nimport { z } from 'zod';\nimport {\n isoDateTimeSchema,\n objectIdSchema,\n optionalEmailSchema,\n optionalPhoneSchema,\n optionalTrimmedString,\n phoneSchema,\n} from './common.js';\nimport { addressSchema, weeklyHoursSchema } from './shared.js';\n\n// ─── Center type ─────────────────────────────────────────────────────────────\n\n/** The activity types a center offers (multi-select). */\nexport const CENTER_TYPES = [\n 'gym',\n 'crossfit',\n 'yoga',\n 'pilates',\n 'zumba',\n 'cardio',\n 'strength',\n 'mma',\n 'boxing',\n 'swimming',\n 'aerobics',\n 'personal-training',\n] as const;\nexport const centerTypeSchema = z.enum(CENTER_TYPES);\nexport type CenterType = z.infer<typeof centerTypeSchema>;\n\n// ─── Status ──────────────────────────────────────────────────────────────────\n\nexport const centerStatusSchema = z.enum(['active', 'inactive']);\nexport type CenterStatus = z.infer<typeof centerStatusSchema>;\n\n/**\n * The public gym code a member enters at onboarding to join, `GYM-YYYY-NNN`.\n * Server-generated and unique; never accepted in a create body.\n */\nexport const gymCodeSchema = z\n .string()\n .trim()\n .regex(/^GYM-\\d{4}-\\d{3,}$/, 'Invalid gym code');\nexport type GymCode = z.infer<typeof gymCodeSchema>;\n\n// ─── Create / update bodies ──────────────────────────────────────────────────\n\nexport const createCenterBodySchema = z.object({\n name: z.string().trim().min(1, 'Center name is required').max(160),\n description: optionalTrimmedString(2000),\n types: z.array(centerTypeSchema).min(1, 'Pick at least one type'),\n address: addressSchema,\n /** Usable floor area in square feet. */\n floorAreaSqft: z.number().int().min(0).max(1_000_000).optional(),\n primaryPhone: phoneSchema,\n secondaryPhone: optionalPhoneSchema,\n email: optionalEmailSchema,\n website: optionalTrimmedString(200),\n hours: weeklyHoursSchema,\n /** Uploaded gallery image URLs. */\n photos: z.array(z.string().trim().max(2000)).max(20).default([]),\n});\nexport type CreateCenterBody = z.infer<typeof createCenterBodySchema>;\n\nexport const updateCenterBodySchema = createCenterBodySchema.partial();\nexport type UpdateCenterBody = z.infer<typeof updateCenterBodySchema>;\n\n// ─── Entity (API response) ───────────────────────────────────────────────────\n\nexport const centerSchema = z.object({\n id: objectIdSchema,\n organisationId: objectIdSchema,\n /** Public join code, `GYM-YYYY-NNN`. */\n code: gymCodeSchema,\n name: z.string(),\n description: z.string().nullable(),\n types: z.array(centerTypeSchema),\n address: addressSchema,\n floorAreaSqft: z.number().int().nullable(),\n primaryPhone: z.string(),\n secondaryPhone: z.string().nullable(),\n email: z.string().nullable(),\n website: z.string().nullable(),\n hours: weeklyHoursSchema,\n photos: z.array(z.string()),\n status: centerStatusSchema,\n /** Denormalised active-member count for roster headers. */\n memberCount: z.number().int().nonnegative(),\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n});\nexport type Center = z.infer<typeof centerSchema>;\n\n// ─── Nearby / directory card ─────────────────────────────────────────────────\n\n/** A lightweight public directory result for the \"find your gym\" step. */\nexport const nearbyGymSchema = z.object({\n id: objectIdSchema,\n code: gymCodeSchema,\n name: z.string(),\n area: z.string(),\n distanceKm: z.number().nonnegative(),\n memberCount: z.number().int().nonnegative().optional(),\n});\nexport type NearbyGym = z.infer<typeof nearbyGymSchema>;\n\n/** Query params for the nearby-gyms search. */\nexport const nearbyGymsQuerySchema = z.object({\n lat: z.coerce.number().min(-90).max(90).optional(),\n lng: z.coerce.number().min(-180).max(180).optional(),\n q: optionalTrimmedString(120),\n});\nexport type NearbyGymsQuery = z.infer<typeof nearbyGymsQuerySchema>;\n"]}
package/dist/common.d.ts CHANGED
@@ -24,4 +24,32 @@ export declare const paginationSchema: z.ZodObject<{
24
24
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
25
25
  }, z.core.$strip>;
26
26
  export type Pagination = z.infer<typeof paginationSchema>;
27
+ /**
28
+ * A bare 10-digit Indian mobile number. Stored RAW (no `+91`) app-wide — the
29
+ * country code is display-only. Mirrors the jansathi phone-number standard.
30
+ */
31
+ export declare const phoneSchema: z.ZodString;
32
+ export type Phone = z.infer<typeof phoneSchema>;
33
+ /** Optional phone — empty/whitespace becomes `undefined`. */
34
+ export declare const optionalPhoneSchema: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
35
+ /** A 6-digit Indian postal PIN code. */
36
+ export declare const pincodeSchema: z.ZodString;
37
+ export type Pincode = z.infer<typeof pincodeSchema>;
38
+ /** Optional email — empty/whitespace becomes `undefined`, else validated. */
39
+ export declare const optionalEmailSchema: z.ZodPreprocess<z.ZodOptional<z.ZodEmail>>;
40
+ /** A calendar date with no time component, `YYYY-MM-DD`. */
41
+ export declare const isoDateSchema: z.ZodString;
42
+ export type IsoDate = z.infer<typeof isoDateSchema>;
43
+ /** A full ISO-8601 timestamp, e.g. `2026-08-06T09:30:00.000Z`. */
44
+ export declare const isoDateTimeSchema: z.ZodISODateTime;
45
+ export type IsoDateTime = z.infer<typeof isoDateTimeSchema>;
46
+ /** Time of day in 24-hour `HH:MM`. */
47
+ export declare const timeOfDaySchema: z.ZodString;
48
+ export type TimeOfDay = z.infer<typeof timeOfDaySchema>;
49
+ /**
50
+ * A whole-rupee (INR) amount. GymMonk prices are whole rupees; format with a
51
+ * `₹` and grouping at the edge, never store the formatted string.
52
+ */
53
+ export declare const priceInrSchema: z.ZodNumber;
54
+ export type PriceInr = z.infer<typeof priceInrSchema>;
27
55
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,OAGvD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,GAAI,kBAAe,gDAC8B,CAAC;AAIpF,kDAAkD;AAClD,eAAO,MAAM,cAAc,aAGgB,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAI5D,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB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