@gravity-rail/sdk 0.1.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.
@@ -1,4 +1,4 @@
1
- // ../client/dist/chunk-KQW7D2GX.mjs
1
+ // src/types/dataTypes.ts
2
2
  var DataFieldType = /* @__PURE__ */ ((DataFieldType2) => {
3
3
  DataFieldType2["ENUM"] = "enum";
4
4
  DataFieldType2["EMAIL"] = "email";
@@ -26,6 +26,8 @@ var IndexStatus = /* @__PURE__ */ ((IndexStatus2) => {
26
26
  IndexStatus2["ERROR"] = "error";
27
27
  return IndexStatus2;
28
28
  })(IndexStatus || {});
29
+
30
+ // src/types/calendarTypes.ts
29
31
  var CalendarPermissionType = /* @__PURE__ */ ((CalendarPermissionType2) => {
30
32
  CalendarPermissionType2["NONE"] = "NONE";
31
33
  CalendarPermissionType2["FREE_BUSY"] = "FREE_BUSY";
@@ -85,4 +87,4 @@ export {
85
87
  AttendeeStatus,
86
88
  AttendeeResponseStatus
87
89
  };
88
- //# sourceMappingURL=chunk-KQJR26B5.js.map
90
+ //# sourceMappingURL=chunk-MFEEPNXO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/dataTypes.ts","../src/types/calendarTypes.ts"],"sourcesContent":["// Data-related types extracted from main types.ts file\n// This file contains all types related to data types, data records, data fields, and data integrity management\n\nimport type { AccountReportItem } from './accountTypes';\nimport type { MemberReportItem } from './memberTypes';\n\n// ===== DATA FIELD TYPES =====\n\nexport enum DataFieldType {\n ENUM = 'enum',\n EMAIL = 'email',\n PHONE = 'phone',\n TEXT = 'text',\n LONGTEXT = 'longtext',\n NUMBER = 'number',\n DATE = 'date',\n DATETIME = 'datetime',\n TIME_OF_DAY = 'time_of_day',\n US_ZIP_CODE = 'us_zip_code',\n INTEGER = 'integer',\n BOOLEAN = 'boolean',\n ARRAY = 'array',\n OBJECT = 'object',\n FUNCTION = 'function',\n}\n\nexport enum IndexStatus {\n NONE = 'none',\n PENDING = 'pending',\n CREATING = 'creating',\n REMOVING = 'removing',\n READY = 'ready',\n ERROR = 'error',\n}\n\nexport interface DataField {\n id?: number;\n name: string;\n slug: string;\n description?: string;\n required: boolean;\n fieldType: DataFieldType;\n options?: EnumOption[];\n referencedTypeId?: number;\n shouldIndex?: boolean;\n indexStatus?: IndexStatus;\n adminOnly?: boolean;\n defaultValue?: any;\n order: number;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface DataFieldFormData {\n name: string;\n slug: string;\n description?: string;\n required: boolean;\n fieldType: DataFieldType;\n options?: EnumOption[];\n referencedTypeId?: number;\n shouldIndex?: boolean;\n indexStatus?: IndexStatus;\n adminOnly?: boolean;\n defaultValue?: any;\n}\n\n// ===== SCHEMA FIELD TYPES =====\n// Strongly-typed field definitions (canonical representation)\n\n/**\n * Label-value pair for enum field options.\n * Allows enum fields to have user-friendly labels while storing clean values\n * (e.g., numbers for scoring calculations in CEL expressions).\n */\nexport interface EnumOption {\n /** Display label shown to users */\n label: string;\n /** Stored value (can be string or number) */\n value: string | number;\n /**\n * CEL expression that must return true for this option to be visible.\n * Uses record.data.<field_slug> syntax to reference other field values.\n * CONSTRAINT: Can only reference non-FUNCTION fields.\n */\n visibleWhen?: string;\n}\n\n/**\n * SchemaField is the canonical representation of a data type field.\n * This is the type returned by the API and stored in the database.\n * Display order is determined by array position, not the order field.\n */\nexport interface SchemaField {\n /** Unique field identifier */\n slug: string;\n /** Display name for the field */\n name: string;\n /** Optional field description */\n description?: string;\n /** Field type (text, email, enum, etc.) */\n fieldType: DataFieldType;\n /** Whether field is required */\n required: boolean;\n /** @deprecated Display order is now determined by array position */\n order?: number;\n /** Options for enum fields as {label, value} objects. */\n options?: EnumOption[];\n /** Referenced DataType ID for reference fields */\n referencedTypeId?: number;\n /** Whether to index this field */\n shouldIndex?: boolean;\n /** Whether only admins can see this field */\n adminOnly?: boolean;\n /** Default value for the field */\n defaultValue?: any;\n /** CEL expression that computes this field's value from other fields */\n celFunction?: string;\n /**\n * CEL expression for cross-field validation.\n * Context: 'value' (current field value), 'record.data.<field_slug>' (other fields).\n * Returns: true if valid, or a string error message if invalid.\n * CONSTRAINT: Can only reference non-FUNCTION fields.\n */\n validateCel?: string;\n}\n\n// ===== DATA TYPE TYPES =====\n\nexport interface DataType {\n id: number;\n name: string;\n slug: string;\n uuid: string;\n description?: string;\n prompt?: string;\n isCollection: boolean;\n pinned?: boolean;\n archived: boolean;\n ownerId: number | null;\n createdAt: string;\n updatedAt: string;\n /** Typed field definitions */\n fields: SchemaField[];\n}\n\nexport interface DataTypeFormData {\n name: string;\n slug: string;\n description?: string;\n prompt?: string;\n isCollection: boolean;\n pinned?: boolean;\n /** Typed field definitions */\n fields: SchemaField[];\n ownerId?: number | null;\n}\n\n// ===== DATA RECORD TYPES =====\n\nexport interface DataRecord {\n id: number;\n dataTypeId: number;\n memberId: number;\n fieldValues: Record<string, any>;\n externalId?: string;\n assignmentTaskId?: number;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface DataRecordFormData {\n memberId?: number;\n /** Member external ID (alternative to memberId). Cannot be used with memberId. */\n memberExternalId?: string;\n fieldValues: Record<string, any>;\n externalId?: string;\n assignmentTaskId?: number;\n}\n\n// ===== DATA RECORD AUDIT TRAIL =====\n\nexport interface DataRecordUpdate {\n id: number;\n dataRecordId: number;\n memberId: number;\n fieldName: string;\n oldValue?: string | null;\n newValue?: string | null;\n createdAt: string;\n updatedAt: string;\n assignmentTaskId?: number | null;\n memberName?: string | null;\n}\n\n// ===== DATA RECORD PAGINATION =====\n\nexport interface DataRecordsPaginatedResponse {\n items: DataRecord[];\n total: number;\n page: number;\n pageSize: number;\n totalPages: number;\n}\n\n// ===== DATA RECORD ACCESS MODE TYPES =====\n// Used by Assignment data record associations\n\nexport interface DataRecordWithAccessMode extends DataRecord {\n accessMode: number;\n}\n\nexport interface DataRecordAssociationFormData {\n id: number;\n accessMode: number;\n}\n\n// ===== DATA INTEGRITY TYPES =====\n\nexport interface DataRecordReportItem {\n id: number;\n data_type_id: number;\n data_type_name: string;\n data_type_slug: string;\n values: Record<string, any>;\n created_at: string;\n updated_at: string;\n external_id?: string | null;\n}\n\nexport interface DataIntegrityReportItem {\n member: MemberReportItem;\n account: AccountReportItem;\n data_records: DataRecordReportItem[];\n possible_matches: DataIntegrityReportItem[];\n issues: string[];\n normalized_phone?: string | null;\n}\n\n// ===== DATA EXPORT/IMPORT TYPES =====\n\nexport interface DataTypeExportItem {\n uuid: string;\n name: string;\n description: string | null;\n}\n\nexport interface TaskExportDataTypeRelation {\n taskUuid: string;\n dataTypeUuid: string;\n accessMode: number;\n}\n\n// ===== BULK IMPORT TYPES =====\n\n/**\n * Result for a single record in a bulk import operation.\n */\nexport interface BulkRecordResult {\n index: number;\n status: 'created' | 'updated' | 'failed';\n recordId?: number | null;\n externalId?: string | null;\n error?: string | null;\n}\n\n/**\n * Response for bulk create data records operation.\n */\nexport interface BulkCreateDataRecordResponse {\n importedCount: number;\n totalCount: number;\n success: boolean;\n results: BulkRecordResult[];\n errors?: string[] | null;\n}\n\n/**\n * Request body for bulk create data records.\n */\nexport interface BulkCreateDataRecordRequest {\n records: DataRecordFormData[];\n upsert?: boolean;\n}\n","/**\n * Calendar-related types for the Gravity Rail calendar and appointment booking system.\n */\n\n// Calendar Permission Types\nexport enum CalendarPermissionType {\n NONE = 'NONE',\n FREE_BUSY = 'FREE_BUSY',\n READ = 'READ',\n WRITE = 'WRITE',\n ADMIN = 'ADMIN',\n}\n\nexport enum CalendarSource {\n INTERNAL = 'internal',\n GOOGLE = 'google',\n OUTLOOK = 'outlook',\n}\n\n// Calendar types\nexport interface Calendar {\n id: number;\n uuid: string;\n templateUuid: string | null;\n name: string;\n slug: string;\n description: string | null;\n timezone: string;\n color: string | null;\n isPublic: boolean;\n ownerId: number;\n ownerName: string | null;\n remoteCalendarId?: string | null;\n syncStatus?: string | null;\n syncError?: string | null;\n lastSyncedAt?: string | null;\n calendarSource: CalendarSource;\n eventTypeIds: number[];\n schedules: CalendarSchedule[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CalendarFormData {\n name: string;\n slug?: string;\n description?: string | null;\n timezone?: string;\n color?: string | null;\n isPublic?: boolean;\n eventTypeIds?: number[];\n}\n\nexport interface CalendarSchedule {\n id: number;\n uuid: string;\n name: string;\n description: string | null;\n availabilityType: CalendarScheduleAvailabilityType;\n recurrenceType: CalendarScheduleRecurrence;\n startTime: string;\n endTime: string;\n recurrenceRule: Record<string, any> | null;\n recurrenceEndDate: string | null;\n daysOfWeek: string[] | null;\n priority: number;\n eventTypeIds: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CalendarScheduleFormData {\n name: string;\n description?: string | null;\n availabilityType: CalendarScheduleAvailabilityType;\n recurrenceType: CalendarScheduleRecurrence;\n startTime: string;\n endTime: string;\n recurrenceRule?: Record<string, any> | null;\n recurrenceEndDate?: string | null;\n daysOfWeek?: string[] | null;\n priority?: number;\n eventTypeIds?: number[] | null;\n}\n\nexport enum CalendarScheduleRecurrence {\n ONCE = 'ONCE',\n DAILY = 'DAILY',\n WEEKLY = 'WEEKLY',\n MONTHLY = 'MONTHLY',\n CUSTOM = 'CUSTOM',\n}\n\nexport enum CalendarScheduleAvailabilityType {\n AVAILABLE = 'AVAILABLE',\n UNAVAILABLE = 'UNAVAILABLE',\n}\n\n// Event type types\nexport interface CalendarEventType {\n id: number;\n uuid: string;\n templateUuid: string | null;\n name: string;\n slug: string;\n description: string | null;\n defaultDurationMinutes: number;\n bufferBeforeMinutes: number;\n bufferAfterMinutes: number;\n minAttendees: number;\n maxAttendees: number | null;\n color: string | null;\n active: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CalendarEventTypeFormData {\n name: string;\n slug?: string;\n description?: string | null;\n defaultDurationMinutes: number;\n bufferBeforeMinutes?: number;\n bufferAfterMinutes?: number;\n minAttendees?: number;\n maxAttendees?: number | null;\n color?: string | null;\n active?: boolean;\n}\n\n// Event types\nexport interface CalendarEvent {\n id: number;\n uuid: string;\n calendarId: number;\n calendarName: string;\n eventTypeId: number;\n eventTypeName: string;\n eventTypeColor: string | null;\n title: string;\n description: string | null;\n location: string | null;\n startTime: string;\n endTime: string;\n status: CalendarEventStatus;\n creatorMemberId: number | null;\n workflowId: number | null;\n taskId: number | null;\n assignmentId: number | null;\n chatId: number | null;\n messageId: number | null;\n cancelledAt: string | null;\n cancelledByMemberId: number | null;\n cancellationReason: string | null;\n recurrenceRule: string | null;\n recurringEventId: string | null;\n isRecurringInstance: boolean;\n originalStartTime: string | null;\n remoteEventId: string | null;\n attendees: CalendarEventAttendee[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CalendarEventFormData {\n calendarId: number;\n eventTypeId: number;\n title: string;\n description?: string | null;\n location?: string | null;\n startTime: string;\n attendeeIds: number[];\n workflowId?: number | null;\n taskId?: number | null;\n assignmentId?: number | null;\n}\n\nexport enum CalendarEventStatus {\n TENTATIVE = 'TENTATIVE',\n CONFIRMED = 'CONFIRMED',\n CANCELLED = 'CANCELLED',\n NO_SHOW = 'NO_SHOW',\n COMPLETED = 'COMPLETED',\n}\n\nexport interface CalendarEventAttendee {\n id: number;\n memberId: number;\n status: AttendeeStatus;\n responseStatus: AttendeeResponseStatus;\n responseAt: string | null;\n note: string | null;\n}\n\nexport enum AttendeeStatus {\n REQUIRED = 'REQUIRED',\n OPTIONAL = 'OPTIONAL',\n}\n\nexport enum AttendeeResponseStatus {\n PENDING = 'PENDING',\n ACCEPTED = 'ACCEPTED',\n DECLINED = 'DECLINED',\n TENTATIVE = 'TENTATIVE',\n}\n\n// iCal Feed Types\nexport interface ICalFeedTokenResponse {\n feedUrl: string;\n tokenGeneratedAt: string; // ISO 8601 datetime\n calendarId: number;\n calendarUuid: string;\n}\n\nexport interface ICalFeedUrlResponse {\n feedUrl: string | null;\n hasToken: boolean;\n tokenGeneratedAt: string | null; // ISO 8601 datetime\n}\n\nexport interface UpdateAttendeeRequest {\n responseStatus: AttendeeResponseStatus;\n note?: string | null;\n}\n\n// Availability types\nexport interface AvailabilityCheck {\n eventTypeId: number;\n startTime: string;\n endTime?: string | null;\n}\n\nexport interface AvailabilityResponse {\n available: boolean;\n reason?: string | null;\n}\n\nexport interface AvailableSlotsRequest {\n eventTypeId: number;\n startDate: string;\n endDate: string;\n slotIntervalMinutes?: number;\n}\n\nexport interface AvailableSlotsResponse {\n slots: string[];\n eventTypeId: number;\n calendarId: number;\n}\n\n// Query params\nexport interface CalendarEventsQueryParams {\n calendarId?: number;\n startDate?: string;\n endDate?: string;\n status?: CalendarEventStatus;\n memberId?: number;\n limit?: number;\n offset?: number;\n}\n\n// Google Calendar Integration Types\nexport interface GoogleCalendarInfo {\n id: string;\n summary: string;\n description?: string;\n timeZone: string;\n backgroundColor?: string;\n accessRole: string;\n primary: boolean;\n}\n\nexport interface GoogleCalendarStatusResponse {\n connected: boolean;\n email?: string;\n calendars: GoogleCalendarInfo[];\n insufficientScopes?: boolean;\n}\n\nexport interface GoogleCalendarInsufficientScopesResponse {\n connected: boolean;\n insufficientScopes: true;\n email?: string;\n reAuthUrl: string;\n}\n\nexport interface LinkCalendarRequest {\n googleCalendarId: string;\n}\n\nexport interface LinkCalendarResponse {\n status: string;\n message: string;\n googleCalendarId: string;\n googleCalendarName?: string;\n}\n\nexport interface UnlinkCalendarResponse {\n status: string;\n message: string;\n}\n\nexport interface SyncCalendarResponse {\n status: string;\n message: string;\n created: number;\n updated: number;\n errors: Array<{ event_id: string; error: string }>;\n}\n"],"mappings":";AAQO,IAAK,gBAAL,kBAAKA,mBAAL;AACJ,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AACd,EAAAA,eAAA,iBAAc;AACd,EAAAA,eAAA,aAAU;A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AA,cAAW;AAFF,SAAAA;AAAA,GAAA;AAKL,IAAK,yBAAL,kBAAKC,4BAAL;AACJ,EAAAA,wBAAA,aAAU;AACV,EAAAA,wBAAA,cAAW;AACX,EAAAA,wBAAA,cAAW;AACX,EAAAA,wBAAA,eAAY;AAJH,SAAAA;AAAA,GAAA;","names":["DataFieldType","IndexStatus","CalendarPermissionType","CalendarSource","CalendarScheduleRecurrence","CalendarScheduleAvailabilityType","CalendarEventStatus","AttendeeStatus","AttendeeResponseStatus"]}