@gravity-rail/sdk 0.14.0 → 0.15.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.
- package/dist/{chunk-V7ZKEH4V.js → chunk-2YLKG4TT.js} +1 -1
- package/dist/chunk-2YLKG4TT.js.map +1 -0
- package/dist/{chunk-K4MDFGMO.js → chunk-QTJQTTIR.js} +45 -2
- package/dist/chunk-QTJQTTIR.js.map +1 -0
- package/dist/{client-CKudWmUT.d.cts → client-BLuz00Qr.d.cts} +166 -11
- package/dist/{client-EAvh7w0y.d.ts → client-CefA5Mxe.d.ts} +166 -11
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/index.cjs +48 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +48 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +5 -5
- package/dist/internal.d.ts +5 -5
- package/dist/internal.js +10 -2
- package/dist/internal.js.map +1 -1
- package/dist/{revision-state-BUBt9Rir.d.ts → revision-state-DL1ViZ57.d.ts} +21 -3
- package/dist/{revision-state-CY4LBdfa.d.cts → revision-state-axZ62kJk.d.cts} +21 -3
- package/dist/schemas.cjs +35 -20
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +54 -23
- package/dist/schemas.d.ts +54 -23
- package/dist/schemas.js +33 -20
- package/dist/schemas.js.map +1 -1
- package/dist/{tasks-iRrM4SaF.d.cts → tasks-Boi6AxGp.d.cts} +72 -7
- package/dist/{tasks-iRrM4SaF.d.ts → tasks-Boi6AxGp.d.ts} +72 -7
- package/package.json +1 -1
- package/dist/chunk-K4MDFGMO.js.map +0 -1
- package/dist/chunk-V7ZKEH4V.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/generated/data.ts","../src/types/data-types.ts","../src/types/calendar-types.ts"],"sourcesContent":["/**\n * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts\n * (group map from emit_openapi.py). Do not edit manually.\n * Group: data\n */\n\nimport type { EventRuleResponse } from './event_rule';\nimport type { EnumOption } from './schema_field';\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 * Result for a single record in a bulk import operation.\n */\nexport interface BulkRecordResult {\n index: number;\n status: BulkRecordResultStatus;\n recordId?: number | null;\n externalId?: string | null;\n error?: string | null;\n}\n\nexport type BulkRecordResultStatus = typeof BulkRecordResultStatus[keyof typeof BulkRecordResultStatus];\n\n\nexport const BulkRecordResultStatus = {\n created: 'created',\n updated: 'updated',\n failed: 'failed',\n} as const;\n\nexport type DataFieldType = typeof DataFieldType[keyof typeof DataFieldType];\n\n\nexport const DataFieldType = {\n enum: 'enum',\n email: 'email',\n phone: 'phone',\n text: 'text',\n longtext: 'longtext',\n number: 'number',\n integer: 'integer',\n boolean: 'boolean',\n date: 'date',\n datetime: 'datetime',\n time_of_day: 'time_of_day',\n us_zip_code: 'us_zip_code',\n array: 'array',\n object: 'object',\n function: 'function',\n} as const;\n\nexport interface DataRecordResponse {\n id: number;\n dataTypeId: number;\n memberId: number | null;\n memberName?: string | null;\n fieldValues: DataRecordResponseFieldValues;\n createdAt: string;\n updatedAt: string;\n externalId?: string | null;\n accessMode?: number | null;\n retirement?: DataRecordRetirementResponse | null;\n}\n\nexport type DataRecordResponseFieldValues = { [key: string]: unknown };\n\n/**\n * Derived lifecycle-retirement status for a connector-backed record.\n *\n * Populated only on the human Forms/CRUD read responses (list + single GET)\n * so the UI can show an \"Archived in Monday\" / \"Deleted in Monday\" badge.\n * Derived at read time from ``ConnectionEntityExclusion`` + active-link\n * state — there is no stored retirement column on ``DataRecord``.\n *\n * PHI-safe: closed-vocabulary ``status`` / ``reason`` / ``source`` codes\n * only. No field values, no remote item/board IDs, no connection metadata.\n */\nexport interface DataRecordRetirementResponse {\n status?: 'retired';\n reason: DataRecordRetirementResponseReason;\n source?: 'monday';\n}\n\nexport type DataRecordRetirementResponseReason = typeof DataRecordRetirementResponseReason[keyof typeof DataRecordRetirementResponseReason];\n\n\nexport const DataRecordRetirementResponseReason = {\n monday_item_archived: 'monday_item_archived',\n monday_item_deleted: 'monday_item_deleted',\n} as const;\n\nexport interface DataRecordUpdateResponse {\n id: number;\n dataRecordId: number;\n actorMemberId?: number | null;\n recordMemberId?: number | null;\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 source?: string | null;\n}\n\nexport interface DataTypeMemberRoleAccessResponse {\n memberRoleId: number;\n memberRoleName: string;\n accessMode: number;\n}\n\nexport interface DataTypeResponse {\n id: number;\n name: string;\n uuid: string;\n slug: string;\n accessMode?: number | null;\n description: string | null;\n prompt: string | null;\n isCollection: boolean;\n pinned?: boolean | null;\n archived?: boolean;\n ownerId?: number | null;\n recordScope: string;\n sensitivity: string;\n categories: string[];\n createdAt: string;\n updatedAt: string;\n eventRules: EventRuleResponse[];\n fields: SchemaField[];\n memberRoleAccess?: DataTypeMemberRoleAccessResponse[];\n recordCount?: number | null;\n}\n\nexport interface IndexStatusResponse {\n fieldId: string;\n fieldName: string;\n shouldIndex: string;\n indexStatus: string;\n message?: string | null;\n}\n\n/**\n * Strongly-typed field definition for DataType schemas.\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 | null;\n /** Field type (text, email, enum, etc.) */\n fieldType?: typeof SchemaFieldFieldType[keyof typeof SchemaFieldFieldType];\n /** Whether field is required */\n required?: boolean;\n /** Deprecated: Display order is now determined by array position */\n order?: number | null;\n /** Options for enum fields as {label, value} objects. */\n options?: EnumOption[] | null;\n /** Referenced DataType ID for reference fields */\n referencedTypeId?: number | null;\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?: unknown;\n /** CEL expression that computes this field's value. CONSTRAINT: Can ONLY reference regular fields (TEXT, NUMBER, DATE, etc.). Cannot reference other FUNCTION fields. Syntax: record.data.<field_slug>. Example: 'record.data.score1 + record.data.score2' */\n celFunction?: string | null;\n /** CEL expression for cross-field validation. Context: 'value' (current field value), 'record.data.<field_slug>' (other fields). Returns: true if valid, or a string error message if invalid. CONSTRAINT: Can only reference non-FUNCTION fields. Example: 'value >= record.data.min_score' or 'value < record.data.min_score ? \"Must be >= \" + string(record.data.min_score) : true' */\n validateCel?: string | null;\n /** Disclosure severity for audit and access policy */\n sensitivity?: SchemaFieldSensitivity;\n /** Regulatory or content categories for audit and policy */\n categories?: SchemaFieldCategoriesItem[];\n}\n\nexport type SchemaFieldCategoriesItem = typeof SchemaFieldCategoriesItem[keyof typeof SchemaFieldCategoriesItem];\n\n\nexport const SchemaFieldCategoriesItem = {\n personal: 'personal',\n identifier: 'identifier',\n phi: 'phi',\n credential: 'credential',\n} as const;\n\nexport const SchemaFieldFieldType = { enum: 'enum',\n email: 'email',\n phone: 'phone',\n text: 'text',\n longtext: 'longtext',\n number: 'number',\n integer: 'integer',\n boolean: 'boolean',\n date: 'date',\n datetime: 'datetime',\n time_of_day: 'time_of_day',\n us_zip_code: 'us_zip_code',\n array: 'array',\n object: 'object',\n function: 'function'} as const\n\n/**\n * Disclosure severity for audit and access policy\n */\nexport type SchemaFieldSensitivity = typeof SchemaFieldSensitivity[keyof typeof SchemaFieldSensitivity];\n\n\nexport const SchemaFieldSensitivity = {\n public: 'public',\n internal: 'internal',\n confidential: 'confidential',\n restricted: 'restricted',\n secret: 'secret',\n} as const;\n","// Data-related types.\n// Server response shapes are generated from Pydantic via emit_openapi.py → Orval.\n// Client-only shapes (enums, forms, report items) are defined below.\n\nimport type { SchemaField } from './generated/data';\n\n// ===== GENERATED SERVER TYPES =====\n\nexport type {\n DataRecordResponse,\n DataRecordResponse as DataRecord,\n DataRecordRetirementResponse,\n DataRecordUpdateResponse,\n DataRecordUpdateResponse as DataRecordUpdate,\n DataTypeMemberRoleAccessResponse,\n DataTypeResponse,\n DataTypeResponse as DataType,\n IndexStatusResponse,\n SchemaField,\n} from './generated/data';\n\nexport type {\n DataRecordFilterResponse,\n DataRecordFilterResponse as DataRecordFilter,\n CreateDataRecordFilterRequest,\n UpdateDataRecordFilterRequest,\n} from './generated/data_record_filter';\n\nexport { DataRecordRetirementResponseReason } from './generated/data';\n\nimport type { DataRecordFilterResponse as GeneratedDataRecordFilterResponse } from './generated/data_record_filter';\nimport type { QueryPredicate } from './query-engine-types';\n\n/** DataRecordFilter with the query-engine predicate column narrowed to IR. */\nexport type DataRecordFilterWithQuery = GeneratedDataRecordFilterResponse & {\n query?: QueryPredicate | null;\n};\n\nexport interface DataRecordFilterFormData {\n dataTypeId: number;\n name: string;\n description?: string;\n pinned?: boolean;\n /** Query-engine predicate (JSON IR). Pass null to author an empty filter. */\n query: QueryPredicate | null;\n}\n\n// Pagination wrapper for data records (the backend uses an inline shape, not\n// a top-level Pydantic generic, so there is no generated equivalent).\nexport interface DataRecordsPaginatedResponse {\n items: DataRecordResponse[];\n total: number;\n page: number;\n pageSize: number;\n totalPages: number;\n}\n\n// Local import for use in `extends` clauses\nimport type { DataRecordResponse } from './generated/data';\n\n// ===== CLIENT-ONLY SURFACE =====\n// Enums, form shapes, report items, and query helpers that have no direct\n// Pydantic counterpart (or that the frontend builds in a different shape).\n\nimport type { AccountReportItem } from './account-types';\nimport type { EventRuleInput } from './event-types';\nimport type { MemberReportItem } from './member-types';\n\n// Field type enum (kept as TypeScript enum; widely used for comparisons)\nexport enum DataFieldType {\n ENUM = 'enum',\n EMAIL = 'email',\n PHONE = 'phone',\n TEXT = 'text',\n LONGTEXT = 'longtext',\n NUMBER = 'number',\n INTEGER = 'integer',\n DATE = 'date',\n DATETIME = 'datetime',\n TIME_OF_DAY = 'time_of_day',\n BOOLEAN = 'boolean',\n FILE = 'file',\n REFERENCE = 'reference',\n FUNCTION = 'function',\n ARRAY = 'array',\n OBJECT = 'object',\n US_ZIP_CODE = 'us_zip_code',\n}\n\nexport enum IndexStatus {\n NOT_INDEXED = 'not_indexed',\n INDEXING = 'indexing',\n INDEXED = 'indexed',\n ERROR = 'error',\n}\n\nexport enum DataTypeRecordScope {\n WORKSPACE = 'workspace',\n MEMBER = 'member',\n}\n\nexport enum DataSensitivity {\n PUBLIC = 'public',\n INTERNAL = 'internal',\n CONFIDENTIAL = 'confidential',\n RESTRICTED = 'restricted',\n SECRET = 'secret',\n}\n\nexport enum DataCategory {\n PHI = 'phi',\n PII = 'pii',\n FINANCIAL = 'financial',\n OPERATIONAL = 'operational',\n CREDENTIAL = 'credential',\n PERSONAL = 'personal',\n IDENTIFIER = 'identifier',\n}\n\n// DataField — the legacy client-side shape used in forms and the data-type editor.\n// SchemaField (from generated) is the canonical server representation.\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\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 | null;\n}\n\nexport interface DataTypeFormData {\n name: string;\n slug?: string;\n description?: string;\n prompt?: string;\n isCollection?: boolean;\n recordScope?: DataTypeRecordScope;\n sensitivity?: DataSensitivity;\n categories?: DataCategory[];\n // The update/create endpoints accept full SchemaField payloads (including\n // celFunction / validateCel); a narrower \"form data\" type here forced\n // unsafe double-casts at every call site.\n fields?: SchemaField[];\n memberRoleAccess?: DataTypeMemberRoleAccessInput[];\n pinned?: boolean;\n ownerId?: number | null;\n /**\n * Inline Actions. The same flat list ``DataType.eventRules`` returns, so a\n * form round-trips one shape. (``createRules``/``updateRules`` used to sit\n * here too, marked as the preferred pair — but the API never read them:\n * ``UpdateDataTypeRequest`` accepts ``eventRules`` and nothing else.)\n */\n eventRules?: EventRuleInput[];\n}\n\nexport interface DataRecordFormData {\n dataTypeId: number;\n memberId?: number | null;\n externalId?: string;\n fieldValues: Record<string, unknown>;\n}\n\nexport interface DataTypeMemberRoleAccessInput {\n memberRoleId: number;\n accessMode: number;\n}\n\nexport interface DataRecordAssociationFormData {\n dataRecordId: number;\n accessMode?: number;\n}\n\nexport interface DataRecordWithAccessMode extends DataRecordResponse {\n accessMode?: number | null;\n}\n\nexport interface DataRecordReportItem {\n id: number;\n dataTypeId: number;\n dataTypeSlug: string;\n member?: MemberReportItem;\n account?: AccountReportItem;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface DataIntegrityReportItem {\n dataTypeId: number;\n dataTypeSlug: string;\n dataTypeName: string;\n totalRecords: number;\n invalidRecords: number;\n issues: string[];\n}\n\nexport interface DataTypeExportItem {\n id: number;\n slug: string;\n name: string;\n fields: DataField[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface TaskExportDataTypeRelation {\n dataTypeId: number;\n dataTypeSlug: string;\n accessMode: number;\n}\n\nexport interface BulkRecordResult {\n index: number;\n status: 'created' | 'updated' | 'failed';\n recordId?: number;\n error?: string;\n}\n\nexport interface BulkCreateDataRecordResponse {\n importedCount: number;\n totalCount: number;\n success: boolean;\n results: BulkRecordResult[];\n errors?: string[];\n}\n\nexport interface BulkCreateDataRecordRequest {\n dataTypeId: number;\n records: DataRecordFormData[];\n upsert?: boolean;\n}\n","/**\n * Calendar-related types for the Gravity Rail calendar and appointment booking system.\n * Server response shapes are generated from Pydantic via emit_openapi.py → Orval.\n * Client-only shapes (forms, enums, query params) are defined below.\n */\n\n// ===== GENERATED SERVER TYPES =====\n\nexport type {\n AttendeeResponse,\n AttendeeResponse as CalendarEventAttendee,\n AvailabilityResponse,\n AvailableSlotsResponse,\n CalendarResponse as GeneratedCalendarResponse,\n CalendarScheduleResponse as GeneratedCalendarScheduleResponse,\n EventResponse,\n EventResponse as CalendarEvent,\n EventTypeResponse,\n EventTypeResponse as CalendarEventType,\n ExternalAttendeeData,\n GoogleCalendarInfo,\n GoogleCalendarInsufficientScopesResponse,\n GoogleCalendarStatusResponse,\n ICalFeedTokenResponse,\n ICalFeedUrlResponse,\n TimeSlot,\n} from './generated/calendar';\n\nimport type {\n CalendarResponse as GeneratedCalendarResponse,\n CalendarScheduleResponse as GeneratedCalendarScheduleResponse,\n ExternalAttendeeData as GeneratedExternalAttendeeData,\n} from './generated/calendar';\nimport type { EventRuleInput } from './event-types';\n\nexport type Calendar = Omit<GeneratedCalendarResponse, never> & {\n /** Present on detail responses; omitted from some list payloads. */\n eventTypeIds?: number[];\n};\nexport type CalendarResponse = Calendar;\n\nexport type CalendarSchedule = Omit<\n GeneratedCalendarScheduleResponse,\n 'availabilityType' | 'recurrenceType'\n> & {\n availabilityType: CalendarScheduleAvailabilityType | string;\n recurrenceType: CalendarScheduleRecurrence | string;\n};\nexport type CalendarScheduleResponse = CalendarSchedule;\n\n// ===== CLIENT-ONLY TYPES =====\n\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\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 * Ordered event rules to attach to the calendar in the same request.\n * Server syncs by UUID: same-UUID updates, new UUID creates, omitted\n * UUIDs are deleted. Omit (undefined) to leave existing rules unchanged.\n */\n eventRules?: EventRuleInput[];\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\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 * Ordered event rules scoped to this event type. Server syncs by UUID:\n * same-UUID updates, new UUID creates, omitted UUIDs are deleted.\n */\n eventRules?: EventRuleInput[];\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 externalAttendees?: GeneratedExternalAttendeeData[];\n workflowRevisionId?: number | null;\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 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\nexport interface UpdateAttendeeRequest {\n responseStatus: AttendeeResponseStatus;\n note?: string | null;\n}\n\nexport interface AvailabilityCheck {\n eventTypeId: number;\n startTime: string;\n endTime?: string | null;\n}\n\nexport interface AvailableSlotsRequest {\n eventTypeId: number;\n startDate: string;\n endDate: string;\n slotIntervalMinutes?: number;\n}\n\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\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":";AAgGO,IAAM,qCAAqC;AAAA,EAChD,sBAAsB;AAAA,EACtB,qBAAqB;AACvB;;;AC9BO,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,aAAU;AACV,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AACd,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,iBAAc;AAjBL,SAAAA;AAAA,GAAA;AAoBL,IAAK,cAAL,kBAAKC,iBAAL;AACJ,EAAAA,aAAA,iBAAc;AACd,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,aAAU;AACV,EAAAA,aAAA,WAAQ;AAJC,SAAAA;AAAA,GAAA;AAOL,IAAK,sBAAL,kBAAKC,yBAAL;AACJ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,YAAS;AAFA,SAAAA;AAAA,GAAA;AAKL,IAAK,kBAAL,kBAAKC,qBAAL;AACJ,EAAAA,iBAAA,YAAS;AACT,EAAAA,iBAAA,cAAW;AACX,EAAAA,iBAAA,kBAAe;AACf,EAAAA,iBAAA,gBAAa;AACb,EAAAA,iBAAA,YAAS;AALA,SAAAA;AAAA,GAAA;AAQL,IAAK,eAAL,kBAAKC,kBAAL;AACJ,EAAAA,cAAA,SAAM;AACN,EAAAA,cAAA,SAAM;AACN,EAAAA,cAAA,eAAY;AACZ,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,gBAAa;AAPJ,SAAAA;AAAA,GAAA;;;ACzDL,IAAK,yBAAL,kBAAKC,4BAAL;AACJ,EAAAA,wBAAA,UAAO;AACP,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,UAAO;AACP,EAAAA,wBAAA,WAAQ;AACR,EAAAA,wBAAA,WAAQ;AALC,SAAAA;AAAA,GAAA;AAQL,IAAK,iBAAL,kBAAKC,oBAAL;AACJ,EAAAA,gBAAA,cAAW;AACX,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,aAAU;AAHD,SAAAA;AAAA,GAAA;AAoCL,IAAK,6BAAL,kBAAKC,gCAAL;AACJ,EAAAA,4BAAA,UAAO;AACP,EAAAA,4BAAA,WAAQ;AACR,EAAAA,4BAAA,YAAS;AACT,EAAAA,4BAAA,aAAU;AACV,EAAAA,4BAAA,YAAS;AALA,SAAAA;AAAA,GAAA;AAQL,IAAK,mCAAL,kBAAKC,sCAAL;AACJ,EAAAA,kCAAA,eAAY;AACZ,EAAAA,kCAAA,iBAAc;AAFL,SAAAA;AAAA,GAAA;AAsCL,IAAK,sBAAL,kBAAKC,yBAAL;AACJ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,eAAY;AALH,SAAAA;AAAA,GAAA;AAQL,IAAK,iBAAL,kBAAKC,oBAAL;AACJ,EAAAA,gBAAA,cAAW;AACX,EAAAA,gBAAA,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","DataTypeRecordScope","DataSensitivity","DataCategory","CalendarPermissionType","CalendarSource","CalendarScheduleRecurrence","CalendarScheduleAvailabilityType","CalendarEventStatus","AttendeeStatus","AttendeeResponseStatus"]}
|
|
@@ -1302,6 +1302,8 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
1302
1302
|
if (options.mine !== void 0) params.append("mine", options.mine.toString());
|
|
1303
1303
|
if (options.needsResponse !== void 0)
|
|
1304
1304
|
params.append("needsResponse", options.needsResponse.toString());
|
|
1305
|
+
if (options.needsResponseFirst !== void 0)
|
|
1306
|
+
params.append("needsResponseFirst", options.needsResponseFirst.toString());
|
|
1305
1307
|
if (options.paused !== void 0) params.append("paused", options.paused.toString());
|
|
1306
1308
|
if (options.archived !== void 0) params.append("archived", options.archived.toString());
|
|
1307
1309
|
if (options.channel) params.append("channel", options.channel);
|
|
@@ -1351,6 +1353,25 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
1351
1353
|
async getChat(wid, id) {
|
|
1352
1354
|
return this.fetch(`w/${wid}/chats/${id}`);
|
|
1353
1355
|
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Create-chat preflight for SMS: is a conversation already live between this
|
|
1358
|
+
* workspace number and this member?
|
|
1359
|
+
*
|
|
1360
|
+
* An SMS conversation with a member is a single stream — inbound SMS resolves
|
|
1361
|
+
* to ONE current chat per (member phone, workspace phone) pair — so creating
|
|
1362
|
+
* a new SMS chat SUPERSEDES the existing one and the member's next reply
|
|
1363
|
+
* lands on the new chat. Callers use this to say so before committing.
|
|
1364
|
+
*
|
|
1365
|
+
* Read-only, `chats:read`, and PHI-safe by construction: status and timing
|
|
1366
|
+
* only, no message content and no chat title.
|
|
1367
|
+
*/
|
|
1368
|
+
async getCurrentSmsChat(wid, options) {
|
|
1369
|
+
const params = new URLSearchParams({
|
|
1370
|
+
memberId: options.memberId.toString(),
|
|
1371
|
+
phoneNumberId: options.phoneNumberId.toString()
|
|
1372
|
+
});
|
|
1373
|
+
return this.fetch(`w/${wid}/chats/current-sms?${params}`);
|
|
1374
|
+
}
|
|
1354
1375
|
/** Get token usage statistics for a chat. */
|
|
1355
1376
|
async getChatTokenUsage(wid, chatId) {
|
|
1356
1377
|
return this.fetch(`w/${wid}/chats/${chatId}/token-usage`);
|
|
@@ -7549,6 +7570,21 @@ function encodePermissions(permissions) {
|
|
|
7549
7570
|
if (permissions.delete) accessMode |= PERMISSION_DELETE;
|
|
7550
7571
|
return accessMode;
|
|
7551
7572
|
}
|
|
7573
|
+
var WORKFLOW_IMPLICIT_USE_SCOPE = "workflows:admin";
|
|
7574
|
+
function roleImplicitWorkflowUseScope(role) {
|
|
7575
|
+
return (role.grantedScopes ?? []).includes(WORKFLOW_IMPLICIT_USE_SCOPE) ? WORKFLOW_IMPLICIT_USE_SCOPE : null;
|
|
7576
|
+
}
|
|
7577
|
+
function roleWorkflowAccess(role, workflowId) {
|
|
7578
|
+
const viaScope = roleImplicitWorkflowUseScope(role);
|
|
7579
|
+
if (viaScope) {
|
|
7580
|
+
return { accessMode: PERMISSION_USE | PERMISSION_EDIT, viaScope };
|
|
7581
|
+
}
|
|
7582
|
+
const entry = (role.workflowAccess ?? []).find((wa) => wa.workflowId === workflowId);
|
|
7583
|
+
return { accessMode: entry?.accessMode ?? PERMISSION_NONE, viaScope: null };
|
|
7584
|
+
}
|
|
7585
|
+
function roleCanUseWorkflow(role, workflowId) {
|
|
7586
|
+
return (roleWorkflowAccess(role, workflowId).accessMode & PERMISSION_USE) !== 0;
|
|
7587
|
+
}
|
|
7552
7588
|
var Scope = /* @__PURE__ */ ((Scope2) => {
|
|
7553
7589
|
Scope2["WORKSPACE_READ"] = "workspace:read";
|
|
7554
7590
|
Scope2["WORKSPACE_WRITE"] = "workspace:write";
|
|
@@ -7707,6 +7743,7 @@ var EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
|
|
|
7707
7743
|
EventRuleEventType2["ROUTINE_TRIGGERED"] = "routine:triggered";
|
|
7708
7744
|
EventRuleEventType2["ASSISTANT_MESSAGE"] = "workflow:assistant_message";
|
|
7709
7745
|
EventRuleEventType2["USER_MESSAGE"] = "workflow:user_message";
|
|
7746
|
+
EventRuleEventType2["WORKFLOW_EXECUTE"] = "workflow:execute";
|
|
7710
7747
|
EventRuleEventType2["CALENDAR_EVENT_CREATED"] = "calendar_event:created";
|
|
7711
7748
|
EventRuleEventType2["CALENDAR_EVENT_UPDATED"] = "calendar_event:updated";
|
|
7712
7749
|
EventRuleEventType2["CALENDAR_EVENT_CANCELLED"] = "calendar_event:cancelled";
|
|
@@ -7776,7 +7813,6 @@ var WorkspaceFeature = /* @__PURE__ */ ((WorkspaceFeature2) => {
|
|
|
7776
7813
|
WorkspaceFeature2["WEB_SEARCH"] = "web_search";
|
|
7777
7814
|
WorkspaceFeature2["CALENDAR"] = "calendar";
|
|
7778
7815
|
WorkspaceFeature2["EXPERIMENTS"] = "experiments";
|
|
7779
|
-
WorkspaceFeature2["OPERATOR"] = "operator";
|
|
7780
7816
|
WorkspaceFeature2["GMAIL"] = "gmail";
|
|
7781
7817
|
WorkspaceFeature2["GCALENDAR"] = "gcalendar";
|
|
7782
7818
|
WorkspaceFeature2["GDRIVE"] = "gdrive";
|
|
@@ -9183,6 +9219,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
9183
9219
|
"getConnectionSyncConfig",
|
|
9184
9220
|
"getCredentialUpdateInvites",
|
|
9185
9221
|
"getCurrentMember",
|
|
9222
|
+
"getCurrentSmsChat",
|
|
9186
9223
|
"getCustomToolkit",
|
|
9187
9224
|
"getCustomToolkits",
|
|
9188
9225
|
"getDashboard",
|
|
@@ -9718,6 +9755,7 @@ function bindTasksMethods(target, tasks, abilities) {
|
|
|
9718
9755
|
function bindChatsMethods(target, chats) {
|
|
9719
9756
|
target.getChats = chats.getChats.bind(chats);
|
|
9720
9757
|
target.getChat = chats.getChat.bind(chats);
|
|
9758
|
+
target.getCurrentSmsChat = chats.getCurrentSmsChat.bind(chats);
|
|
9721
9759
|
target.getChatCallbacks = chats.getChatCallbacks.bind(chats);
|
|
9722
9760
|
target.cancelChatCallback = chats.cancelChatCallback.bind(chats);
|
|
9723
9761
|
target.getChatTokenUsage = chats.getChatTokenUsage.bind(chats);
|
|
@@ -10756,6 +10794,7 @@ var GravityRailClient = class {
|
|
|
10756
10794
|
// Chats API
|
|
10757
10795
|
getChats;
|
|
10758
10796
|
getChat;
|
|
10797
|
+
getCurrentSmsChat;
|
|
10759
10798
|
getChatCallbacks;
|
|
10760
10799
|
cancelChatCallback;
|
|
10761
10800
|
getChatTokenUsage;
|
|
@@ -13111,6 +13150,10 @@ export {
|
|
|
13111
13150
|
PERMISSION_DELETE,
|
|
13112
13151
|
decodePermissions,
|
|
13113
13152
|
encodePermissions,
|
|
13153
|
+
WORKFLOW_IMPLICIT_USE_SCOPE,
|
|
13154
|
+
roleImplicitWorkflowUseScope,
|
|
13155
|
+
roleWorkflowAccess,
|
|
13156
|
+
roleCanUseWorkflow,
|
|
13114
13157
|
Scope,
|
|
13115
13158
|
BulkMemberResultStatus,
|
|
13116
13159
|
MemberImportMatchInfoMatchType,
|
|
@@ -13265,4 +13308,4 @@ export {
|
|
|
13265
13308
|
SCOPE_PRESETS,
|
|
13266
13309
|
getRevisionState
|
|
13267
13310
|
};
|
|
13268
|
-
//# sourceMappingURL=chunk-
|
|
13311
|
+
//# sourceMappingURL=chunk-QTJQTTIR.js.map
|