@gravity-rail/sdk 0.47.0 → 0.50.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/README.md +117 -9
- package/dist/agui.cjs +17 -2
- package/dist/agui.cjs.map +1 -1
- package/dist/agui.d.cts +9 -1
- package/dist/agui.d.ts +9 -1
- package/dist/agui.js +15 -1
- package/dist/agui.js.map +1 -1
- package/dist/{chat-interaction-Bqj3Vbst.d.cts → chat-interaction-CmGKKlnL.d.ts} +244 -37
- package/dist/{chat-interaction-DiZVtDRE.d.ts → chat-interaction-THDGF4ko.d.cts} +244 -37
- package/dist/{chunk-72SWNLVD.js → chunk-MMDSZ25F.js} +1 -1
- package/dist/chunk-MMDSZ25F.js.map +1 -0
- package/dist/{chunk-N4GQWNGU.js → chunk-QRZVXPR4.js} +204 -50
- package/dist/chunk-QRZVXPR4.js.map +1 -0
- package/dist/{chunk-67QXTQVL.js → chunk-TGL72KPS.js} +59 -118
- package/dist/chunk-TGL72KPS.js.map +1 -0
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +4 -4
- package/dist/helpers.d.ts +4 -4
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +262 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +262 -164
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +148 -6
- package/dist/internal.d.ts +148 -6
- package/dist/internal.js +9 -3
- package/dist/internal.js.map +1 -1
- package/dist/{member-import-D7U4kDIy.d.cts → member-import-9zHkUjcn.d.cts} +1 -1
- package/dist/{member-import-C2Xt_o5d.d.ts → member-import-ocJ_K474.d.ts} +1 -1
- package/dist/{revision-state-ZC4qP3CS.d.cts → path-BQgkft9c.d.ts} +64 -3
- package/dist/{revision-state-DaVz2528.d.ts → path-DZbDwvpS.d.cts} +64 -3
- package/dist/schemas.cjs +59 -16
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +22 -3
- package/dist/schemas.d.ts +22 -3
- package/dist/schemas.js +59 -17
- package/dist/schemas.js.map +1 -1
- package/dist/{tasks-Ca6yfsj2.d.cts → tasks-DsNsbco5.d.cts} +66 -14
- package/dist/{tasks-Ca6yfsj2.d.ts → tasks-DsNsbco5.d.ts} +66 -14
- package/package.json +2 -2
- package/dist/chunk-67QXTQVL.js.map +0 -1
- package/dist/chunk-72SWNLVD.js.map +0 -1
- package/dist/chunk-N4GQWNGU.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 reference: 'reference',\n} as const;\n\nexport interface DataRecordResponse {\n id: number;\n uuid: string;\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 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 webhookEventsEnabled?: boolean;\n archived?: boolean;\n ownerId?: number | null;\n recordScope: string;\n adminOnly?: boolean;\n sensitivity: string;\n categories: string[];\n createdAt: string;\n updatedAt: string;\n eventRules: EventRuleResponse[];\n fields: SchemaField[];\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 /** Server-issued reference field identity; preserve on schema round trips */\n referenceFieldId?: 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',\n reference: 'reference'} 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\nexport type {\n DataTypeDraftResponse,\n DataTypeVersionResponse,\n PublishDataTypeDraftRequest,\n SaveDataTypeDraftRequest,\n} from './generated/data_type_version';\n\n// ===== GENERATED SERVER TYPES =====\n\nexport type {\n DataRecordResponse,\n DataRecordResponse as DataRecord,\n DataRecordRetirementResponse,\n DataRecordUpdateResponse,\n DataRecordUpdateResponse as DataRecordUpdate,\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\n// Forms CSV import result (`POST /data-types/{id}/import`). The envelope keeps\n// its established snake_case keys (`Raw`); `outcomes` counts each row once.\nexport type {\n DataRecordImportOutcomes,\n RawDataRecordImportResponse,\n} from './generated/data_record_import';\n\n// Field-slug rename (preview + apply). Value-free by construction: counts, ids,\n// schema slugs and closed-vocabulary blocker codes only.\nexport type {\n FieldReferenceImpact,\n FieldSlugRenamePreview,\n FieldSlugRenameResult,\n} from './generated/data_type_field_rename_service';\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 /** Filled in by anonymous visitors; submissions are immutable and never DataRecords. */\n ANONYMOUS = 'anonymous',\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 /** Server-issued reference definition identity. */\n referenceFieldId?: 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 /** Hide this Form and its records from Members without `records:admin`. */\n adminOnly?: boolean;\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 pinned?: boolean;\n /**\n * Publish this Form's record writes to the organization's webhook endpoints.\n * An egress decision, not a display preference: off by default, and clone and\n * import deliberately reset it (see `DataTypeExport`), so it is always set\n * explicitly by a person. Omitted means \"leave the stored value alone\".\n */\n webhookEventsEnabled?: 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 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 ICalFeedGrantSummary,\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":"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","names":["DataFieldType","IndexStatus","DataTypeRecordScope","DataSensitivity","DataCategory","CalendarPermissionType","CalendarSource","CalendarScheduleRecurrence","CalendarScheduleAvailabilityType","CalendarEventStatus","AttendeeStatus","AttendeeResponseStatus"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ApiError,
|
|
3
3
|
BaseApiClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TGL72KPS.js";
|
|
5
5
|
|
|
6
6
|
// src/api/abilities.ts
|
|
7
7
|
var AbilitiesApi = class extends BaseApiClient {
|
|
@@ -1028,18 +1028,13 @@ var AuthApi = class extends BaseApiClient {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
return await response.json();
|
|
1030
1030
|
}
|
|
1031
|
-
/**
|
|
1031
|
+
/** @deprecated Browser continuity uses top-level /auth/continue navigation. */
|
|
1032
1032
|
async requestCrossDomainToken() {
|
|
1033
|
-
|
|
1034
|
-
method: "POST"
|
|
1035
|
-
});
|
|
1033
|
+
throw new Error("Use top-level /auth/continue navigation. CLI login uses OAuth with PKCE.");
|
|
1036
1034
|
}
|
|
1037
|
-
/**
|
|
1038
|
-
async exchangeToken(
|
|
1039
|
-
|
|
1040
|
-
method: "POST",
|
|
1041
|
-
body: JSON.stringify({ token })
|
|
1042
|
-
});
|
|
1035
|
+
/** @deprecated Browser handoffs redeem only at the destination Next server. */
|
|
1036
|
+
async exchangeToken(_token) {
|
|
1037
|
+
throw new Error("Use top-level /auth/continue navigation. CLI login uses OAuth with PKCE.");
|
|
1043
1038
|
}
|
|
1044
1039
|
/** Exchange a global Account login for an opaque org-scoped session handle. */
|
|
1045
1040
|
async exchangeSession(request) {
|
|
@@ -1220,9 +1215,17 @@ var AuthApi = class extends BaseApiClient {
|
|
|
1220
1215
|
);
|
|
1221
1216
|
}
|
|
1222
1217
|
// ===== ORGANIZATION MEMBERSHIP METHODS =====
|
|
1223
|
-
/**
|
|
1224
|
-
async getMyOrganizations() {
|
|
1225
|
-
|
|
1218
|
+
/** A searchable page of the current account's organizations. */
|
|
1219
|
+
async getMyOrganizations(options) {
|
|
1220
|
+
const params = new URLSearchParams();
|
|
1221
|
+
if (options?.page) params.set("page", String(options.page));
|
|
1222
|
+
if (options?.pageSize) params.set("pageSize", String(options.pageSize));
|
|
1223
|
+
if (options?.canCreateWorkspace) params.set("canCreateWorkspace", "true");
|
|
1224
|
+
if (options?.search) params.set("search", options.search);
|
|
1225
|
+
if (options?.organizationSlug !== void 0)
|
|
1226
|
+
params.set("organizationSlug", options.organizationSlug);
|
|
1227
|
+
for (const uuid of options?.organizationUuids ?? []) params.append("organizationUuids", uuid);
|
|
1228
|
+
return this.fetch(`o/mine?${params}`);
|
|
1226
1229
|
}
|
|
1227
1230
|
// ===== CREDENTIAL CHANGE METHODS =====
|
|
1228
1231
|
/**
|
|
@@ -4134,14 +4137,7 @@ var InquiriesApi = class extends BaseApiClient {
|
|
|
4134
4137
|
}
|
|
4135
4138
|
const queryString = params.toString();
|
|
4136
4139
|
const url = queryString ? `inquiries/export/csv?${queryString}` : "inquiries/export/csv";
|
|
4137
|
-
const response = await
|
|
4138
|
-
method: "GET",
|
|
4139
|
-
credentials: "include"
|
|
4140
|
-
});
|
|
4141
|
-
if (!response.ok) {
|
|
4142
|
-
const error = await response.json();
|
|
4143
|
-
throw new Error(error.detail || "Export failed");
|
|
4144
|
-
}
|
|
4140
|
+
const response = await this.fetchRaw(url, { method: "GET" });
|
|
4145
4141
|
return response.blob();
|
|
4146
4142
|
}
|
|
4147
4143
|
};
|
|
@@ -5421,8 +5417,12 @@ var OrgApi = class extends BaseApiClient {
|
|
|
5421
5417
|
* figure — the caps belong to the organization, so `cap - oneWorkspace`
|
|
5422
5418
|
* describes nothing.
|
|
5423
5419
|
*/
|
|
5424
|
-
async getOrgWorkspaceUsage(orgIdOrUuid) {
|
|
5425
|
-
|
|
5420
|
+
async getOrgWorkspaceUsage(orgIdOrUuid, options) {
|
|
5421
|
+
const params = new URLSearchParams();
|
|
5422
|
+
if (options?.page) params.set("page", String(options.page));
|
|
5423
|
+
if (options?.pageSize) params.set("pageSize", String(options.pageSize));
|
|
5424
|
+
if (options?.search) params.set("search", options.search);
|
|
5425
|
+
return this.fetch(`o/${orgIdOrUuid}/usage/workspaces?${params}`);
|
|
5426
5426
|
}
|
|
5427
5427
|
/**
|
|
5428
5428
|
* List members of an organization.
|
|
@@ -5546,8 +5546,14 @@ var OrgApi = class extends BaseApiClient {
|
|
|
5546
5546
|
* counts. Any org member may call it — members get the workspaces they
|
|
5547
5547
|
* belong to, org:read holders get all of them.
|
|
5548
5548
|
*/
|
|
5549
|
-
async getOrganizationWorkspaceSummaries(orgIdOrUuid) {
|
|
5550
|
-
|
|
5549
|
+
async getOrganizationWorkspaceSummaries(orgIdOrUuid, options) {
|
|
5550
|
+
const params = new URLSearchParams();
|
|
5551
|
+
if (options?.page) params.set("page", String(options.page));
|
|
5552
|
+
if (options?.pageSize) params.set("pageSize", String(options.pageSize));
|
|
5553
|
+
if (options?.search) params.set("search", options.search);
|
|
5554
|
+
return this.fetch(
|
|
5555
|
+
`o/${orgIdOrUuid}/workspaces/summary?${params}`
|
|
5556
|
+
);
|
|
5551
5557
|
}
|
|
5552
5558
|
/**
|
|
5553
5559
|
* Workspace-schema aggregates for one card, plus the caller's own member
|
|
@@ -6284,18 +6290,18 @@ function businessProfilePath(orgUuid, legalEntityUuid) {
|
|
|
6284
6290
|
// src/api/oauth.ts
|
|
6285
6291
|
function getOAuthPath(providerSlug, action) {
|
|
6286
6292
|
if (providerSlug === "google_calendar") {
|
|
6287
|
-
return `oauth/google/calendar/${action}`;
|
|
6293
|
+
return `api/v2/oauth/google/calendar/${action}`;
|
|
6288
6294
|
}
|
|
6289
6295
|
if (providerSlug === "gmail") {
|
|
6290
|
-
return `oauth/google/gmail/${action}`;
|
|
6296
|
+
return `api/v2/oauth/google/gmail/${action}`;
|
|
6291
6297
|
}
|
|
6292
6298
|
if (providerSlug === "gdrive") {
|
|
6293
|
-
return `oauth/google/drive/${action}`;
|
|
6299
|
+
return `api/v2/oauth/google/drive/${action}`;
|
|
6294
6300
|
}
|
|
6295
6301
|
if (providerSlug === "gsheets") {
|
|
6296
|
-
return `oauth/google/sheets/${action}`;
|
|
6302
|
+
return `api/v2/oauth/google/sheets/${action}`;
|
|
6297
6303
|
}
|
|
6298
|
-
return `oauth/${providerSlug}/${action}`;
|
|
6304
|
+
return `api/v2/oauth/${providerSlug}/${action}`;
|
|
6299
6305
|
}
|
|
6300
6306
|
function buildAuthorizeQuery(options) {
|
|
6301
6307
|
if (!options) return "";
|
|
@@ -8932,7 +8938,8 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
8932
8938
|
/**
|
|
8933
8939
|
* Classify the prompts of a Workflow's draft revision.
|
|
8934
8940
|
*
|
|
8935
|
-
* A decision model reads each Task
|
|
8941
|
+
* A decision model reads each live Task with Workflow or Task instructions
|
|
8942
|
+
* and reports which
|
|
8936
8943
|
* prompt classifications probably apply. Each call asks the model again.
|
|
8937
8944
|
*/
|
|
8938
8945
|
async getWorkflowPromptClassifications(wid, workflowId) {
|
|
@@ -10317,22 +10324,32 @@ function planFields(options) {
|
|
|
10317
10324
|
}
|
|
10318
10325
|
return fields;
|
|
10319
10326
|
}
|
|
10327
|
+
function workspaceDirectoryParams(options = {}) {
|
|
10328
|
+
const params = new URLSearchParams();
|
|
10329
|
+
if (options.page !== void 0) params.set("page", String(options.page));
|
|
10330
|
+
if (options.pageSize !== void 0) params.set("pageSize", String(options.pageSize));
|
|
10331
|
+
if (options.search) params.set("search", options.search);
|
|
10332
|
+
if (options.organizationUuid) params.set("organizationUuid", options.organizationUuid);
|
|
10333
|
+
for (const uuid of options.workspaceUuids ?? []) params.append("workspaceUuids", uuid);
|
|
10334
|
+
for (const id of options.workspaceIds ?? []) params.append("workspaceIds", String(id));
|
|
10335
|
+
return params;
|
|
10336
|
+
}
|
|
10320
10337
|
var WorkspacesApi = class extends BaseApiClient {
|
|
10321
|
-
/**
|
|
10322
|
-
async getWorkspaces() {
|
|
10323
|
-
return this.fetch(
|
|
10338
|
+
/** A bounded page of workspaces accessible to the current account. */
|
|
10339
|
+
async getWorkspaces(options) {
|
|
10340
|
+
return this.fetch(`w/?${workspaceDirectoryParams(options)}`);
|
|
10324
10341
|
}
|
|
10325
|
-
/**
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
async getDeviceAdmissibleWorkspaces() {
|
|
10331
|
-
return this.fetch("w/?can_use_device=1");
|
|
10342
|
+
/** A bounded page of companion-device candidates, with admission checked per row. */
|
|
10343
|
+
async getDeviceAdmissibleWorkspaces(options) {
|
|
10344
|
+
const params = workspaceDirectoryParams(options);
|
|
10345
|
+
params.set("can_use_device", "1");
|
|
10346
|
+
return this.fetch(`w/?${params}`);
|
|
10332
10347
|
}
|
|
10333
|
-
/**
|
|
10334
|
-
async getPublicWorkspaces() {
|
|
10335
|
-
return this.fetch(
|
|
10348
|
+
/** A bounded page of publicly visible workspaces. */
|
|
10349
|
+
async getPublicWorkspaces(options) {
|
|
10350
|
+
return this.fetch(
|
|
10351
|
+
`w/public?${workspaceDirectoryParams(options)}`
|
|
10352
|
+
);
|
|
10336
10353
|
}
|
|
10337
10354
|
/** Get a single workspace by ID. */
|
|
10338
10355
|
async getWorkspace(wid) {
|
|
@@ -10615,13 +10632,22 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
10615
10632
|
* @param scope - Export scope ("workflows" for all workflows only). Cannot be combined with workflowId.
|
|
10616
10633
|
* @param exclude - Comma-separated entity categories to exclude (e.g. "channels")
|
|
10617
10634
|
*/
|
|
10618
|
-
async exportWorkspace(wid, workflowId, scope, exclude) {
|
|
10635
|
+
async exportWorkspace(wid, workflowId, scope, exclude, options) {
|
|
10619
10636
|
const searchParams = new URLSearchParams();
|
|
10620
10637
|
if (workflowId !== void 0) searchParams.set("workflow_id", String(workflowId));
|
|
10621
10638
|
if (scope !== void 0) searchParams.set("scope", scope);
|
|
10622
10639
|
if (exclude !== void 0) searchParams.set("exclude", exclude);
|
|
10640
|
+
if (options?.revisionId !== void 0)
|
|
10641
|
+
searchParams.set("revision_id", String(options.revisionId));
|
|
10642
|
+
if (options?.revisionMode !== void 0) {
|
|
10643
|
+
searchParams.set("revision_mode", options.revisionMode);
|
|
10644
|
+
} else if (options?.revisionId === void 0) {
|
|
10645
|
+
searchParams.set("revision_mode", "active");
|
|
10646
|
+
}
|
|
10623
10647
|
const qs = searchParams.toString();
|
|
10624
|
-
|
|
10648
|
+
const data = await this.fetch(`w/${wid}/export${qs ? `?${qs}` : ""}`);
|
|
10649
|
+
this.verifyExportSelection(data, workflowId, options);
|
|
10650
|
+
return data;
|
|
10625
10651
|
}
|
|
10626
10652
|
/** Preview the result of importing workspace configuration without applying changes.
|
|
10627
10653
|
*
|
|
@@ -10680,15 +10706,60 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
10680
10706
|
* target workspace.
|
|
10681
10707
|
*/
|
|
10682
10708
|
/** Download a workspace export ZIP (``export.json`` + file blobs). */
|
|
10683
|
-
async exportWorkspaceZip(wid, workflowId, scope, exclude) {
|
|
10709
|
+
async exportWorkspaceZip(wid, workflowId, scope, exclude, options) {
|
|
10684
10710
|
const searchParams = new URLSearchParams();
|
|
10685
10711
|
if (workflowId !== void 0) searchParams.set("workflow_id", String(workflowId));
|
|
10686
10712
|
if (scope !== void 0) searchParams.set("scope", scope);
|
|
10687
10713
|
if (exclude !== void 0) searchParams.set("exclude", exclude);
|
|
10714
|
+
if (options?.revisionId !== void 0)
|
|
10715
|
+
searchParams.set("revision_id", String(options.revisionId));
|
|
10716
|
+
if (options?.revisionMode !== void 0) {
|
|
10717
|
+
searchParams.set("revision_mode", options.revisionMode);
|
|
10718
|
+
} else if (options?.revisionId === void 0) {
|
|
10719
|
+
searchParams.set("revision_mode", "active");
|
|
10720
|
+
}
|
|
10688
10721
|
const qs = searchParams.toString();
|
|
10689
10722
|
const response = await this.fetchRaw(`w/${wid}/export.zip${qs ? `?${qs}` : ""}`);
|
|
10723
|
+
if (options?.revisionId !== void 0 || options?.revisionMode === "all") {
|
|
10724
|
+
const version = response.headers.get("X-Gravityrail-Export-Version");
|
|
10725
|
+
const selection = response.headers.get("X-Gravityrail-Export-Selection");
|
|
10726
|
+
const selected = options?.revisionId !== void 0;
|
|
10727
|
+
if (version !== (selected ? "1.0" : "2.0") || selection !== (selected ? "selected" : "all") || selected && (workflowId === void 0 || !response.headers.get("X-Gravityrail-Export-Revision-Uuid")?.trim() || !response.headers.get("X-Gravityrail-Export-Workflow-Uuid")?.trim())) {
|
|
10728
|
+
try {
|
|
10729
|
+
await response.body?.cancel();
|
|
10730
|
+
} catch {
|
|
10731
|
+
}
|
|
10732
|
+
throw new Error(
|
|
10733
|
+
"Server did not return verified Workflow revision export headers. Request an explicit active snapshot or use a server that supports export provenance."
|
|
10734
|
+
);
|
|
10735
|
+
}
|
|
10736
|
+
}
|
|
10690
10737
|
return response.arrayBuffer();
|
|
10691
10738
|
}
|
|
10739
|
+
// Compatibility shape check only. The backend WorkspaceExportData
|
|
10740
|
+
// _validate_revision_archive owns full graph/publication invariants.
|
|
10741
|
+
verifyExportSelection(data, workflowId, options) {
|
|
10742
|
+
const hasUuid = (value) => typeof value === "string" && value.trim().length > 0;
|
|
10743
|
+
if (options?.revisionId !== void 0) {
|
|
10744
|
+
const revisions = data?.workflowRevisions;
|
|
10745
|
+
if (workflowId === void 0 || data?.version !== "1.0" || data.workflowRevisionSelection !== "selected" || !Array.isArray(revisions) || revisions.length !== 1) {
|
|
10746
|
+
throw new Error(
|
|
10747
|
+
"Server did not return the requested Workflow revision. Use a server that supports revision selection."
|
|
10748
|
+
);
|
|
10749
|
+
}
|
|
10750
|
+
if (!hasUuid(revisions[0]?.uuid) || !hasUuid(revisions[0]?.workflow?.uuid) || !hasUuid(data.workflows?.[0]?.uuid) || data.workflows?.length !== 1 || revisions[0]?.workflow?.uuid !== data.workflows[0]?.uuid) {
|
|
10751
|
+
throw new Error("Server export does not match the requested Workflow revision.");
|
|
10752
|
+
}
|
|
10753
|
+
} else if (options?.revisionMode === "all" && (data?.version !== "2.0" || data.workflowRevisionSelection !== "all" || !Array.isArray(data.workflowRevisions) || !Array.isArray(data.workflows) || data.workflows.some(
|
|
10754
|
+
(workflow) => !hasUuid(workflow?.uuid) || !data.workflowRevisions?.some(
|
|
10755
|
+
(revision) => hasUuid(revision?.uuid) && revision?.workflow?.uuid === workflow.uuid
|
|
10756
|
+
)
|
|
10757
|
+
))) {
|
|
10758
|
+
throw new Error(
|
|
10759
|
+
"Server did not return all Workflow revisions. Request an explicit active snapshot or use a server that supports revision archives."
|
|
10760
|
+
);
|
|
10761
|
+
}
|
|
10762
|
+
}
|
|
10692
10763
|
/** Import workspace configuration from exported JSON, or from a ZIP archive.
|
|
10693
10764
|
* Pass ``archive`` (the ZIP from ``exportWorkspaceZip``) to restore file
|
|
10694
10765
|
* contents. ``exportData`` may be omitted when the ZIP contains it.
|
|
@@ -16662,6 +16733,86 @@ function getRevisionState(workflow, revision) {
|
|
|
16662
16733
|
};
|
|
16663
16734
|
}
|
|
16664
16735
|
|
|
16736
|
+
// src/workflows/path.ts
|
|
16737
|
+
function getPathDefinition(path) {
|
|
16738
|
+
if (path.routing != null) {
|
|
16739
|
+
const routing = path.routing;
|
|
16740
|
+
if (typeof routing !== "object" || Array.isArray(routing)) return null;
|
|
16741
|
+
const fields = routing;
|
|
16742
|
+
if (fields.kind !== void 0 && fields.kind !== "outcome" || typeof fields.outcome !== "string" || !/^[a-z][a-z0-9_]{0,31}$/.test(fields.outcome) || Object.keys(fields).some((key) => key !== "kind" && key !== "outcome"))
|
|
16743
|
+
return null;
|
|
16744
|
+
return {
|
|
16745
|
+
availability: { kind: "always", expression: null, decisionPrompt: null },
|
|
16746
|
+
selection: {
|
|
16747
|
+
mode: "automatic",
|
|
16748
|
+
rule: "task_outcome",
|
|
16749
|
+
choicePrompt: null,
|
|
16750
|
+
condition: null,
|
|
16751
|
+
outcome: fields.outcome,
|
|
16752
|
+
policy: "matching_outcome",
|
|
16753
|
+
priority: null
|
|
16754
|
+
}
|
|
16755
|
+
};
|
|
16756
|
+
}
|
|
16757
|
+
const expression = path.celCondition?.trim() ? path.celCondition : null;
|
|
16758
|
+
const automatic = expression !== null && Boolean(path.required || path.autoNext);
|
|
16759
|
+
return {
|
|
16760
|
+
availability: {
|
|
16761
|
+
kind: expression === null ? "always" : "cel",
|
|
16762
|
+
expression,
|
|
16763
|
+
decisionPrompt: null
|
|
16764
|
+
},
|
|
16765
|
+
selection: {
|
|
16766
|
+
mode: automatic ? "automatic" : "choice",
|
|
16767
|
+
rule: automatic ? "when_available" : "choice",
|
|
16768
|
+
choicePrompt: automatic ? null : path.choicePrompt?.trim() || null,
|
|
16769
|
+
condition: null,
|
|
16770
|
+
outcome: null,
|
|
16771
|
+
policy: automatic ? "first_match" : "choose_one",
|
|
16772
|
+
priority: automatic ? path.order ?? 0 : null
|
|
16773
|
+
}
|
|
16774
|
+
};
|
|
16775
|
+
}
|
|
16776
|
+
function pathDraftFromStorage(path) {
|
|
16777
|
+
const definition = getPathDefinition(path);
|
|
16778
|
+
if (!definition || definition.selection.rule === "task_outcome") {
|
|
16779
|
+
throw new Error("This Path requires its dedicated routing editor.");
|
|
16780
|
+
}
|
|
16781
|
+
return {
|
|
16782
|
+
availabilityCondition: path.celCondition ?? "",
|
|
16783
|
+
selectionMode: definition.selection.mode,
|
|
16784
|
+
choicePrompt: path.choicePrompt ?? "",
|
|
16785
|
+
selectionPriority: path.order ?? 0
|
|
16786
|
+
};
|
|
16787
|
+
}
|
|
16788
|
+
function pathDraftToStorage(draft, original) {
|
|
16789
|
+
const initial = pathDraftFromStorage(original);
|
|
16790
|
+
const hasCondition = draft.availabilityCondition.trim() !== "";
|
|
16791
|
+
if (draft.selectionMode === "automatic" && !hasCondition) {
|
|
16792
|
+
throw new Error("Automatic Path selection requires a CEL condition.");
|
|
16793
|
+
}
|
|
16794
|
+
if (draft.availabilityCondition === initial.availabilityCondition && draft.selectionMode === initial.selectionMode && draft.choicePrompt === initial.choicePrompt && draft.selectionPriority === initial.selectionPriority)
|
|
16795
|
+
return original;
|
|
16796
|
+
const celCondition = draft.availabilityCondition === initial.availabilityCondition ? original.celCondition : draft.availabilityCondition.trim() ? draft.availabilityCondition : null;
|
|
16797
|
+
const choicePrompt = draft.choicePrompt === initial.choicePrompt ? original.choicePrompt : draft.choicePrompt.trim() ? draft.choicePrompt : null;
|
|
16798
|
+
let autoNext = original.autoNext;
|
|
16799
|
+
let required = original.required;
|
|
16800
|
+
if (draft.selectionMode === "automatic" && initial.selectionMode !== "automatic") {
|
|
16801
|
+
autoNext = true;
|
|
16802
|
+
} else if (draft.selectionMode === "choice" && (hasCondition || initial.availabilityCondition.trim() !== "") && Boolean(autoNext || required)) {
|
|
16803
|
+
autoNext = false;
|
|
16804
|
+
required = false;
|
|
16805
|
+
}
|
|
16806
|
+
return {
|
|
16807
|
+
...original,
|
|
16808
|
+
celCondition,
|
|
16809
|
+
choicePrompt,
|
|
16810
|
+
autoNext,
|
|
16811
|
+
required,
|
|
16812
|
+
...draft.selectionPriority === initial.selectionPriority ? {} : { order: draft.selectionPriority }
|
|
16813
|
+
};
|
|
16814
|
+
}
|
|
16815
|
+
|
|
16665
16816
|
export {
|
|
16666
16817
|
AbilitiesApi,
|
|
16667
16818
|
ResourceWorkflowsApi,
|
|
@@ -16967,6 +17118,9 @@ export {
|
|
|
16967
17118
|
SCOPES,
|
|
16968
17119
|
ScopeManager,
|
|
16969
17120
|
SCOPE_PRESETS,
|
|
16970
|
-
getRevisionState
|
|
17121
|
+
getRevisionState,
|
|
17122
|
+
getPathDefinition,
|
|
17123
|
+
pathDraftFromStorage,
|
|
17124
|
+
pathDraftToStorage
|
|
16971
17125
|
};
|
|
16972
|
-
//# sourceMappingURL=chunk-
|
|
17126
|
+
//# sourceMappingURL=chunk-QRZVXPR4.js.map
|