@columnus/shared 0.1.47

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/dist/apiProfile.d.ts +1072 -0
  3. package/dist/apiProfile.js +4210 -0
  4. package/dist/apiProfile.js.map +1 -0
  5. package/dist/apiProfileSlug.d.ts +11 -0
  6. package/dist/apiProfileSlug.js +39 -0
  7. package/dist/apiProfileSlug.js.map +1 -0
  8. package/dist/apiToken.d.ts +6 -0
  9. package/dist/apiToken.js +35 -0
  10. package/dist/apiToken.js.map +1 -0
  11. package/dist/betterAuthSession.d.ts +8 -0
  12. package/dist/betterAuthSession.js +57 -0
  13. package/dist/betterAuthSession.js.map +1 -0
  14. package/dist/bffHost.d.ts +36 -0
  15. package/dist/bffHost.js +74 -0
  16. package/dist/bffHost.js.map +1 -0
  17. package/dist/bffProtocol.d.ts +1357 -0
  18. package/dist/bffProtocol.js +4362 -0
  19. package/dist/bffProtocol.js.map +1 -0
  20. package/dist/bffRedact.d.ts +30 -0
  21. package/dist/bffRedact.js +55 -0
  22. package/dist/bffRedact.js.map +1 -0
  23. package/dist/ciPreviewEnv.d.ts +49 -0
  24. package/dist/ciPreviewEnv.js +143 -0
  25. package/dist/ciPreviewEnv.js.map +1 -0
  26. package/dist/clipboardTransfer.d.ts +25 -0
  27. package/dist/clipboardTransfer.js +4862 -0
  28. package/dist/clipboardTransfer.js.map +1 -0
  29. package/dist/convexSiteUrl.d.ts +73 -0
  30. package/dist/convexSiteUrl.js +137 -0
  31. package/dist/convexSiteUrl.js.map +1 -0
  32. package/dist/csv.d.ts +54 -0
  33. package/dist/csv.js +5499 -0
  34. package/dist/csv.js.map +1 -0
  35. package/dist/dataTransfer.d.ts +21 -0
  36. package/dist/dataTransfer.js +74 -0
  37. package/dist/dataTransfer.js.map +1 -0
  38. package/dist/dateValues.d.ts +18 -0
  39. package/dist/dateValues.js +73 -0
  40. package/dist/dateValues.js.map +1 -0
  41. package/dist/deployOutput.d.ts +3 -0
  42. package/dist/deployOutput.js +23 -0
  43. package/dist/deployOutput.js.map +1 -0
  44. package/dist/displayLabel.d.ts +13 -0
  45. package/dist/displayLabel.js +4342 -0
  46. package/dist/displayLabel.js.map +1 -0
  47. package/dist/displayTemplateGenerator.d.ts +11 -0
  48. package/dist/displayTemplateGenerator.js +98 -0
  49. package/dist/displayTemplateGenerator.js.map +1 -0
  50. package/dist/displayTypes.d.ts +10 -0
  51. package/dist/displayTypes.js +3 -0
  52. package/dist/displayTypes.js.map +1 -0
  53. package/dist/dotenv.d.ts +8 -0
  54. package/dist/dotenv.js +61 -0
  55. package/dist/dotenv.js.map +1 -0
  56. package/dist/erdLayout.d.ts +27 -0
  57. package/dist/erdLayout.js +78 -0
  58. package/dist/erdLayout.js.map +1 -0
  59. package/dist/fieldTypeFormat.d.ts +5 -0
  60. package/dist/fieldTypeFormat.js +63 -0
  61. package/dist/fieldTypeFormat.js.map +1 -0
  62. package/dist/fieldTypeMeta.d.ts +50 -0
  63. package/dist/fieldTypeMeta.js +84 -0
  64. package/dist/fieldTypeMeta.js.map +1 -0
  65. package/dist/fieldValueEqual.d.ts +4 -0
  66. package/dist/fieldValueEqual.js +58 -0
  67. package/dist/fieldValueEqual.js.map +1 -0
  68. package/dist/importMatch.d.ts +80 -0
  69. package/dist/importMatch.js +5643 -0
  70. package/dist/importMatch.js.map +1 -0
  71. package/dist/index.d.ts +58 -0
  72. package/dist/index.js +10647 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/inferIdentifier.d.ts +18 -0
  75. package/dist/inferIdentifier.js +49 -0
  76. package/dist/inferIdentifier.js.map +1 -0
  77. package/dist/keyboard.d.ts +16 -0
  78. package/dist/keyboard.js +71 -0
  79. package/dist/keyboard.js.map +1 -0
  80. package/dist/manifestDeploy.d.ts +27 -0
  81. package/dist/manifestDeploy.js +16 -0
  82. package/dist/manifestDeploy.js.map +1 -0
  83. package/dist/manifestHash.d.ts +11 -0
  84. package/dist/manifestHash.js +35 -0
  85. package/dist/manifestHash.js.map +1 -0
  86. package/dist/previewDeployName.d.ts +26 -0
  87. package/dist/previewDeployName.js +77 -0
  88. package/dist/previewDeployName.js.map +1 -0
  89. package/dist/proposePolicy.d.ts +17 -0
  90. package/dist/proposePolicy.js +33 -0
  91. package/dist/proposePolicy.js.map +1 -0
  92. package/dist/queryBetween.d.ts +20 -0
  93. package/dist/queryBetween.js +28 -0
  94. package/dist/queryBetween.js.map +1 -0
  95. package/dist/queryExecution.d.ts +5 -0
  96. package/dist/queryExecution.js +58 -0
  97. package/dist/queryExecution.js.map +1 -0
  98. package/dist/queryFieldOps.d.ts +66 -0
  99. package/dist/queryFieldOps.js +138 -0
  100. package/dist/queryFieldOps.js.map +1 -0
  101. package/dist/queryMerge.d.ts +29 -0
  102. package/dist/queryMerge.js +4277 -0
  103. package/dist/queryMerge.js.map +1 -0
  104. package/dist/queryPlan.d.ts +97 -0
  105. package/dist/queryPlan.js +4564 -0
  106. package/dist/queryPlan.js.map +1 -0
  107. package/dist/queryStudio.d.ts +25 -0
  108. package/dist/queryStudio.js +4658 -0
  109. package/dist/queryStudio.js.map +1 -0
  110. package/dist/queryTypes.d.ts +402 -0
  111. package/dist/queryTypes.js +4239 -0
  112. package/dist/queryTypes.js.map +1 -0
  113. package/dist/queryValidators.d.ts +99 -0
  114. package/dist/queryValidators.js +76 -0
  115. package/dist/queryValidators.js.map +1 -0
  116. package/dist/readApiQuery.d.ts +10 -0
  117. package/dist/readApiQuery.js +24 -0
  118. package/dist/readApiQuery.js.map +1 -0
  119. package/dist/recordTableColumns.d.ts +21 -0
  120. package/dist/recordTableColumns.js +4469 -0
  121. package/dist/recordTableColumns.js.map +1 -0
  122. package/dist/refDisplayRequests.d.ts +17 -0
  123. package/dist/refDisplayRequests.js +4877 -0
  124. package/dist/refDisplayRequests.js.map +1 -0
  125. package/dist/refGraph.d.ts +23 -0
  126. package/dist/refGraph.js +102 -0
  127. package/dist/refGraph.js.map +1 -0
  128. package/dist/refsRecompute.d.ts +8 -0
  129. package/dist/refsRecompute.js +12 -0
  130. package/dist/refsRecompute.js.map +1 -0
  131. package/dist/richDoc.d.ts +67 -0
  132. package/dist/richDoc.js +4408 -0
  133. package/dist/richDoc.js.map +1 -0
  134. package/dist/schemaGenerator.d.ts +31 -0
  135. package/dist/schemaGenerator.js +198 -0
  136. package/dist/schemaGenerator.js.map +1 -0
  137. package/dist/schemaShrink.d.ts +74 -0
  138. package/dist/schemaShrink.js +132 -0
  139. package/dist/schemaShrink.js.map +1 -0
  140. package/dist/schemaShrinkValidators.d.ts +72 -0
  141. package/dist/schemaShrinkValidators.js +31 -0
  142. package/dist/schemaShrinkValidators.js.map +1 -0
  143. package/dist/schemaTypes.d.ts +454 -0
  144. package/dist/schemaTypes.js +4557 -0
  145. package/dist/schemaTypes.js.map +1 -0
  146. package/dist/share.d.ts +8 -0
  147. package/dist/share.js +4755 -0
  148. package/dist/share.js.map +1 -0
  149. package/dist/shareApiBridge.d.ts +18 -0
  150. package/dist/shareApiBridge.js +4283 -0
  151. package/dist/shareApiBridge.js.map +1 -0
  152. package/dist/shareGuestPolicy.d.ts +14 -0
  153. package/dist/shareGuestPolicy.js +90 -0
  154. package/dist/shareGuestPolicy.js.map +1 -0
  155. package/dist/shareProposal.d.ts +113 -0
  156. package/dist/shareProposal.js +4810 -0
  157. package/dist/shareProposal.js.map +1 -0
  158. package/dist/shareProposalDiff.d.ts +13 -0
  159. package/dist/shareProposalDiff.js +91 -0
  160. package/dist/shareProposalDiff.js.map +1 -0
  161. package/dist/shareScopes.d.ts +14 -0
  162. package/dist/shareScopes.js +223 -0
  163. package/dist/shareScopes.js.map +1 -0
  164. package/dist/shareTokenCrypto.d.ts +9 -0
  165. package/dist/shareTokenCrypto.js +87 -0
  166. package/dist/shareTokenCrypto.js.map +1 -0
  167. package/dist/shareTokens.d.ts +6 -0
  168. package/dist/shareTokens.js +26 -0
  169. package/dist/shareTokens.js.map +1 -0
  170. package/dist/shareTypes.d.ts +107 -0
  171. package/dist/shareTypes.js +3 -0
  172. package/dist/shareTypes.js.map +1 -0
  173. package/dist/shareValidators.d.ts +168 -0
  174. package/dist/shareValidators.js +124 -0
  175. package/dist/shareValidators.js.map +1 -0
  176. package/dist/shareWizard.d.ts +14 -0
  177. package/dist/shareWizard.js +200 -0
  178. package/dist/shareWizard.js.map +1 -0
  179. package/dist/spaceBundle.d.ts +67 -0
  180. package/dist/spaceBundle.js +4664 -0
  181. package/dist/spaceBundle.js.map +1 -0
  182. package/dist/storageFieldValues.d.ts +10 -0
  183. package/dist/storageFieldValues.js +4421 -0
  184. package/dist/storageFieldValues.js.map +1 -0
  185. package/dist/studioBoot.d.ts +49 -0
  186. package/dist/studioBoot.js +167 -0
  187. package/dist/studioBoot.js.map +1 -0
  188. package/dist/syncClampMembership.d.ts +22 -0
  189. package/dist/syncClampMembership.js +74 -0
  190. package/dist/syncClampMembership.js.map +1 -0
  191. package/dist/tenantHosts.d.ts +30 -0
  192. package/dist/tenantHosts.js +60 -0
  193. package/dist/tenantHosts.js.map +1 -0
  194. package/dist/tenantSecretsCrypto.d.ts +31 -0
  195. package/dist/tenantSecretsCrypto.js +145 -0
  196. package/dist/tenantSecretsCrypto.js.map +1 -0
  197. package/dist/useDebouncedCommit.d.ts +11 -0
  198. package/dist/useDebouncedCommit.js +34 -0
  199. package/dist/useDebouncedCommit.js.map +1 -0
  200. package/dist/useDebouncedValue.d.ts +1 -0
  201. package/dist/useDebouncedValue.js +15 -0
  202. package/dist/useDebouncedValue.js.map +1 -0
  203. package/dist/useModifierHeld.d.ts +2 -0
  204. package/dist/useModifierHeld.js +28 -0
  205. package/dist/useModifierHeld.js.map +1 -0
  206. package/package.json +36 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/refGraph.ts","../src/shareScopes.ts","../src/shareWizard.ts"],"names":[],"mappings":";AAQA,SAAS,gBAAgB,IAAA,EAAiC;AACxD,EAAA,QAAQ,KAAK,IAAA;AAAM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U,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,KAAA,EAAO,MAAM,CAAA,MAAO,EAAE,OAAO,GAAG,MAAA,GAAS,CAAA,GAC/D;AAAA,GACR;AACF","file":"shareWizard.js","sourcesContent":["import type { FieldType, Manifest, Table } from \"./schemaTypes.ts\";\n\nexport type RefFieldEdge = {\n field: string;\n targetTable: string;\n array: boolean;\n};\n\nfunction refEdgesForType(type: FieldType): RefFieldEdge[] {\n switch (type.kind) {\n case \"id\":\n return [{ field: \"\", targetTable: type.table, array: false }];\n case \"array\":\n if (type.element.kind === \"id\") {\n return [{ field: \"\", targetTable: type.element.table, array: true }];\n }\n return [];\n default:\n return [];\n }\n}\n\nfunction collectTargetIdsFromValue(\n value: unknown,\n edge: RefFieldEdge,\n refs: Map<string, Set<string>>,\n): void {\n if (edge.array) {\n if (!Array.isArray(value)) return;\n for (const item of value) {\n if (typeof item === \"string\" && item.length > 0) addRef(refs, edge.targetTable, item);\n }\n return;\n }\n if (typeof value === \"string\" && value.length > 0) addRef(refs, edge.targetTable, value);\n}\n\nexport function collectReferencedIds(\n table: Table,\n rows: Record<string, unknown>[],\n): Map<string, Set<string>> {\n const refs = new Map<string, Set<string>>();\n for (const edge of refFieldsForTable(table)) {\n for (const row of rows) {\n collectTargetIdsFromValue(row[edge.field], edge, refs);\n }\n }\n return refs;\n}\n\nexport function collectIdsFromField(\n rows: Record<string, unknown>[],\n fieldName: string,\n type: FieldType,\n refs: Map<string, Set<string>>,\n): void {\n for (const template of refEdgesForType(type)) {\n const edge: RefFieldEdge = { ...template, field: fieldName };\n for (const row of rows) {\n collectTargetIdsFromValue(row[fieldName], edge, refs);\n }\n }\n}\n\n/** Collect referenced document ids from raw field values (selection chips, formula bar). */\nexport function collectIdsFromValues(\n values: readonly unknown[],\n type: FieldType,\n refs: Map<string, Set<string>>,\n): void {\n for (const template of refEdgesForType(type)) {\n for (const value of values) {\n collectTargetIdsFromValue(value, template, refs);\n }\n }\n}\n\nexport function addRef(refs: Map<string, Set<string>>, table: string, id: string): void {\n const set = refs.get(table) ?? new Set<string>();\n set.add(id);\n refs.set(table, set);\n}\n\n/** Manifest `id` / `id[]` ref topology for one table (field names + targets). */\nexport function refFieldsForTable(table: Table): RefFieldEdge[] {\n const edges: RefFieldEdge[] = [];\n for (const field of table.fields) {\n for (const template of refEdgesForType(field.type)) {\n edges.push({ ...template, field: field.name });\n }\n }\n return edges.sort(\n (a, b) => a.field.localeCompare(b.field) || a.targetTable.localeCompare(b.targetTable),\n );\n}\n\n/** Tables that have at least one outgoing `id` / `id[]` field. */\nexport function tablesWithOutgoingRefs(manifest: Manifest): string[] {\n return manifest.tables\n .filter((table) => refFieldsForTable(table).length > 0)\n .map((table) => table.name)\n .sort((a, b) => a.localeCompare(b));\n}\n\nfunction tableRefFingerprint(table: Table): string {\n return JSON.stringify(refFieldsForTable(table));\n}\n\n/** Stable fingerprint of manifest ref topology (ignores labels, indexes, display templates). */\nexport function computeRefGraphFingerprint(manifest: Manifest): string {\n const tables = [...manifest.tables]\n .sort((a, b) => a.name.localeCompare(b.name))\n .map((table) => ({ name: table.name, refs: refFieldsForTable(table) }));\n return JSON.stringify(tables);\n}\n\n/** Tables whose ref-field topology changed between two manifests. */\nexport function listTablesWithRefGraphChanges(before: Manifest, after: Manifest): string[] {\n const beforeMap = new Map(before.tables.map((t) => [t.name, tableRefFingerprint(t)]));\n const afterMap = new Map(after.tables.map((t) => [t.name, tableRefFingerprint(t)]));\n const changed = new Set<string>();\n for (const [name, fp] of afterMap) {\n if (beforeMap.get(name) !== fp) changed.add(name);\n }\n for (const table of before.tables) {\n if (!afterMap.has(table.name) && refFieldsForTable(table).length > 0) {\n changed.add(table.name);\n }\n }\n return [...changed].sort((a, b) => a.localeCompare(b));\n}\n\n/** Whether a field type can hold outgoing `id` / `id[]` references. */\nexport function fieldTypeHasOutgoingRefs(type: FieldType): boolean {\n return refEdgesForType(type).length > 0;\n}\n\n/** Flatten `collectReferencedIds` output to unique target document ids. */\nexport function referencedTargetIds(refs: Map<string, Set<string>>): Set<string> {\n const out = new Set<string>();\n for (const ids of refs.values()) {\n for (const id of ids) out.add(id);\n }\n return out;\n}\n","import { assertProposalAccess, type ProposalAccess } from \"./proposePolicy.ts\";\nimport { refFieldsForTable } from \"./refGraph.ts\";\nimport type { Manifest } from \"./schemaTypes.ts\";\nimport type {\n ShareInviteKind,\n ShareLinkType,\n ShareOperation,\n ShareScope,\n ShareScopeConflictPatch,\n ShareWizardReferenceInput,\n} from \"./shareTypes.ts\";\n\nfunction inferLegacyPrimary(scope: ShareScope): boolean {\n const access = scope.formAccess;\n return !(access && !access.submit && (access.searchReferences || access.createReferences));\n}\n\nexport function normalizeShareScopes(scopes: ShareScope[]): ShareScope[] {\n const tables = new Set<string>();\n return scopes.map((scope) => {\n const table = scope.table.trim();\n if (!table) throw new Error(\"Every share scope needs a table\");\n if (tables.has(table)) throw new Error(`Duplicate share scope for ${table}`);\n tables.add(table);\n\n const recordIds = scope.recordIds\n ? [...new Set(scope.recordIds.map((id) => id.trim()).filter(Boolean))]\n : undefined;\n const allowedFields = scope.allowedFields\n ? [...new Set(scope.allowedFields.map((field) => field.trim()).filter(Boolean))]\n : undefined;\n\n if (scope.access === \"referenced\" && recordIds) {\n throw new Error(`Referenced scope ${table} cannot specify recordIds`);\n }\n if (recordIds && scope.permission === \"propose\" && scope.ops.insert) {\n throw new Error(`Record-picked scope ${table} cannot allow inserts`);\n }\n if (\n scope.allowCreate &&\n (scope.access !== \"referenced\" || scope.permission !== \"propose\" || !scope.ops.insert)\n ) {\n throw new Error(`allowCreate requires referenced propose insert access for ${table}`);\n }\n\n return {\n ...scope,\n table,\n primary: scope.primary ?? inferLegacyPrimary(scope),\n recordIds,\n allowedFields,\n ops:\n scope.permission === \"view\"\n ? { insert: false, update: false, delete: false }\n : { ...scope.ops },\n };\n });\n}\n\nexport function isReferenceOnlyScope(scope: ShareScope): boolean {\n return scope.primary === false;\n}\n\nexport function mergeReferenceScopes(\n scopes: ShareScope[],\n references: ShareWizardReferenceInput[],\n): ShareScope[] {\n const next = normalizeShareScopes(scopes);\n for (const reference of references) {\n const existing = next.find((scope) => scope.table === reference.table.trim());\n const formAccess = {\n submit: existing?.formAccess?.submit ?? false,\n searchReferences:\n (existing?.formAccess?.searchReferences ?? false) || reference.searchReferences,\n createReferences:\n (existing?.formAccess?.createReferences ?? false) || reference.createReferences,\n };\n if (existing) {\n existing.formAccess = formAccess;\n if (formAccess.createReferences && !existing.primary) {\n existing.permission = \"propose\";\n existing.ops = { insert: true, update: false, delete: false };\n }\n continue;\n }\n next.push({\n table: reference.table,\n primary: false,\n access: \"full\",\n permission: formAccess.createReferences ? \"propose\" : \"view\",\n ops: formAccess.createReferences\n ? { insert: true, update: false, delete: false }\n : { insert: false, update: false, delete: false },\n formAccess,\n });\n }\n return next;\n}\n\nfunction isInsertOnlyScope(scope: ShareScope): boolean {\n return (\n scope.permission === \"propose\" && scope.ops.insert && !scope.ops.update && !scope.ops.delete\n );\n}\n\nexport function isFormSubmissionScope(scope: ShareScope): boolean {\n return scope.formAccess?.submit === true;\n}\n\nexport function canSearchFormReferences(scope: ShareScope): boolean {\n return scope.formAccess?.searchReferences === true;\n}\n\nexport function canCreateFormReferences(scope: ShareScope | undefined): boolean {\n return scope?.formAccess?.createReferences === true;\n}\n\nexport function assertShareLinkTypeConsistency(\n type: ShareLinkType,\n scopes: ShareScope[],\n inviteKind?: ShareInviteKind,\n): void {\n const normalized = normalizeShareScopes(scopes);\n if (normalized.length === 0) throw new Error(\"Add at least one table scope\");\n if (type === \"propose\" && inviteKind === \"public\") {\n throw new Error(\"Proposal shares require a recipient invite\");\n }\n for (const scope of normalized) {\n if (type === \"view\" && scope.permission !== \"view\") {\n throw new Error(`View shares require read-only access for ${scope.table}`);\n }\n if (\n type === \"propose\" &&\n scope.permission !== \"propose\" &&\n (!isReferenceOnlyScope(scope) || scope.permission !== \"view\")\n ) {\n throw new Error(`Proposal shares require proposal access for ${scope.table}`);\n }\n if (type === \"propose\" && scope.formAccess?.submit) {\n throw new Error(`Proposal shares cannot use form submission scopes for ${scope.table}`);\n }\n if (type === \"propose\" && isReferenceOnlyScope(scope)) {\n const formAccess = scope.formAccess;\n if (!formAccess) throw new Error(`Reference scope ${scope.table} needs reference access`);\n if (scope.access !== \"full\") {\n throw new Error(`Reference picker scopes must use full-table access for ${scope.table}`);\n }\n if (formAccess.createReferences && !isInsertOnlyScope(scope)) {\n throw new Error(`Reference creation requires insert-only access for ${scope.table}`);\n }\n if (!formAccess.createReferences && scope.permission !== \"view\") {\n throw new Error(`Read-only reference picker access is required for ${scope.table}`);\n }\n }\n if (type === \"form\") assertFormScope(scope);\n }\n}\n\nfunction assertFormScope(scope: ShareScope): void {\n const access = scope.formAccess;\n if (!access) throw new Error(`Form shares require explicit form access for ${scope.table}`);\n if (!access.submit && !access.searchReferences && !access.createReferences) {\n throw new Error(`Form scope ${scope.table} does not grant any capability`);\n }\n if (scope.access !== \"full\")\n throw new Error(`Form scopes must use full-table access for ${scope.table}`);\n if ((access.submit || access.createReferences) && !isInsertOnlyScope(scope)) {\n throw new Error(\n `Form submission and reference creation require insert-only access for ${scope.table}`,\n );\n }\n if (!access.submit && !access.createReferences && scope.permission !== \"view\") {\n throw new Error(`Read-only form reference access is required for ${scope.table}`);\n }\n}\n\nexport function canProposeOperation(\n scope: ShareScope | undefined,\n operation: ShareOperation,\n): boolean {\n if (scope?.permission !== \"propose\" || !scope.ops[operation]) return false;\n return operation !== \"insert\" || scope.access !== \"referenced\" || Boolean(scope.allowCreate);\n}\n\nexport function canProposeInsert(scope: ShareScope | undefined): boolean {\n return canProposeOperation(scope, \"insert\");\n}\n\nexport function eligibleReferencedParents(\n manifest: Manifest,\n scopes: ShareScope[],\n targetTable: string,\n): ShareScope[] {\n return scopes.filter((scope) => {\n const table = manifest.tables.find((candidate) => candidate.name === scope.table);\n return Boolean(\n table &&\n table.name !== targetTable &&\n refFieldsForTable(table).some((edge) => edge.targetTable === targetTable),\n );\n });\n}\n\nexport function assertShareOperation(\n scopes: ShareScope[],\n table: string,\n operation: ShareOperation,\n rowId?: string,\n fields?: string[],\n): ShareScope {\n const scope = scopes.find((candidate) => candidate.table === table);\n if (scope?.permission !== \"propose\") throw new Error(`${operation} is not allowed for ${table}`);\n const access = {\n table: scope.table,\n ops: scope.ops,\n recordIds: scope.recordIds,\n allowedFields: scope.allowedFields,\n } satisfies ProposalAccess;\n assertProposalAccess([access], { table, operation, rowId, fields });\n if (operation === \"insert\" && scope.access === \"referenced\" && !scope.allowCreate) {\n throw new Error(`Creating referenced ${table} rows is not allowed`);\n }\n return scope;\n}\n\nexport function findShareScopeConflicts(\n scopes: ShareScope[],\n patches: ShareScopeConflictPatch[],\n): ShareScopeConflictPatch[] {\n return patches.filter((patch) => {\n try {\n assertShareOperation(\n scopes,\n patch.table,\n patch.op,\n patch.rowId.startsWith(\"new:\") ? undefined : patch.rowId,\n Object.keys(patch.fields),\n );\n return false;\n } catch {\n return true;\n }\n });\n}\n","import { refFieldsForTable } from \"./refGraph.ts\";\nimport type { Manifest } from \"./schemaTypes.ts\";\nimport { mergeReferenceScopes, normalizeShareScopes } from \"./shareScopes.ts\";\nimport type {\n ShareConfiguratorState,\n ShareLinkType,\n ShareOps,\n ShareRefChoice,\n ShareScope,\n ShareWizardInput,\n} from \"./shareTypes.ts\";\n\nexport function shareTypeDefaultScopes(type: ShareLinkType, input: ShareWizardInput): ShareScope[] {\n const scopes: ShareScope[] = input.tables.map(({ table, recordIds, allowedFields }) => {\n if (type === \"form\") {\n return {\n table,\n primary: true,\n access: \"full\",\n permission: \"propose\",\n ops: { insert: true, update: false, delete: false },\n allowedFields,\n formAccess: { submit: true, searchReferences: false, createReferences: false },\n };\n }\n if (type === \"view\") {\n return {\n table,\n primary: true,\n access: \"full\",\n recordIds,\n permission: \"view\",\n ops: { insert: false, update: false, delete: false },\n allowedFields,\n };\n }\n return {\n table,\n primary: true,\n access: \"full\",\n permission: \"propose\",\n ops: {\n insert: input.ops?.insert ?? true,\n update: input.ops?.update ?? true,\n delete: input.ops?.delete ?? false,\n },\n allowedFields,\n };\n });\n return type === \"form\" || type === \"propose\"\n ? normalizeShareScopes(mergeReferenceScopes(scopes, input.references ?? []))\n : normalizeShareScopes(scopes);\n}\n\nexport function isPrimaryShareScope(_type: ShareLinkType, scope: ShareScope): boolean {\n return scope.primary === true;\n}\n\nexport function scopesToWizardInput(\n type: ShareLinkType,\n rawScopes: ShareScope[],\n manifest: Manifest,\n): ShareConfiguratorState {\n const scopes = normalizeShareScopes(rawScopes);\n const primaryScopes = scopes.filter((scope) => isPrimaryShareScope(type, scope));\n const tables = primaryScopes.map((scope) => scope.table);\n const allowedFields: Record<string, string[]> = {};\n const recordIds: Record<string, string> = {};\n const refChoices: Record<string, ShareRefChoice> = {};\n\n for (const scope of primaryScopes) {\n const manifestTable = manifest.tables.find((candidate) => candidate.name === scope.table);\n if (!manifestTable) continue;\n allowedFields[scope.table] =\n scope.allowedFields ?? manifestTable.fields.map((field) => field.name);\n if (type === \"view\" && scope.recordIds?.length)\n recordIds[scope.table] = scope.recordIds.join(\", \");\n for (const ref of refFieldsForTable(manifestTable)) {\n const key = `${scope.table}:${ref.field}`;\n if (!allowedFields[scope.table]!.includes(ref.field)) {\n refChoices[key] = \"hide\";\n continue;\n }\n const access = scopes.find((candidate) => candidate.table === ref.targetTable)?.formAccess;\n refChoices[key] = access?.createReferences ? \"create\" : \"pick\";\n }\n }\n\n const ops: ShareOps =\n type === \"propose\" && primaryScopes[0]\n ? { ...primaryScopes[0].ops }\n : { insert: true, update: true, delete: false };\n return { tables, allowedFields, recordIds, refChoices, ops };\n}\n\nexport function buildShareWizardInput(args: {\n type: ShareLinkType;\n manifest: Manifest;\n tables: string[];\n allowedFields: Record<string, string[]>;\n recordIds: Record<string, string>;\n refChoices: Record<string, ShareRefChoice>;\n ops?: ShareOps;\n}): ShareWizardInput {\n const { type, manifest, tables, allowedFields, recordIds, refChoices, ops } = args;\n const selectedTables = tables.flatMap((name) => {\n const table = manifest.tables.find((candidate) => candidate.name === name);\n return table ? [table] : [];\n });\n const references = new Map<string, { searchReferences: boolean; createReferences: boolean }>();\n const wizardTables = selectedTables.map((table) => {\n let fields = allowedFields[table.name] ?? table.fields.map((field) => field.name);\n if (type === \"form\" || type === \"propose\") {\n for (const ref of refFieldsForTable(table)) {\n const choice = refChoices[`${table.name}:${ref.field}`] ?? \"pick\";\n if (choice === \"hide\") fields = fields.filter((field) => field !== ref.field);\n else if (fields.includes(ref.field)) {\n const current = references.get(ref.targetTable) ?? {\n searchReferences: false,\n createReferences: false,\n };\n references.set(ref.targetTable, {\n searchReferences: current.searchReferences || choice === \"pick\",\n createReferences: current.createReferences || choice === \"create\",\n });\n }\n }\n }\n const ids = recordIds[table.name]\n ?.split(\",\")\n .map((id) => id.trim())\n .filter(Boolean);\n const usesAllowlist =\n type === \"form\" || (type === \"propose\" && fields.length < table.fields.length);\n return {\n table: table.name,\n allowedFields: usesAllowlist ? fields : undefined,\n recordIds: type === \"view\" && ids?.length ? [...new Set(ids)] : undefined,\n };\n });\n return {\n tables: wizardTables,\n ops: type === \"propose\" ? ops : undefined,\n references:\n type === \"form\" || type === \"propose\"\n ? [...references].map(([table, access]) => ({ table, ...access }))\n : undefined,\n };\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { type Manifest, type Table } from "./schemaTypes.ts";
2
+ import { type ColumnusDataTransferManifest } from "./dataTransfer.ts";
3
+ export declare const COLUMNUS_BUNDLE_VERSION: 1;
4
+ export type SpaceBundleSpace = {
5
+ name: string;
6
+ slug: string;
7
+ description?: string;
8
+ icon?: string;
9
+ order?: number;
10
+ tables: string[];
11
+ };
12
+ export type ColumnusSpaceBundle = {
13
+ columnusBundle: typeof COLUMNUS_BUNDLE_VERSION;
14
+ manifest: {
15
+ tables: Table[];
16
+ };
17
+ spaces: [SpaceBundleSpace];
18
+ dataTransfer?: ColumnusDataTransferManifest;
19
+ };
20
+ export type ParsedImportPaste = {
21
+ tables: Table[];
22
+ spaces?: [SpaceBundleSpace];
23
+ columnusBundle?: number;
24
+ dataTransfer?: ColumnusDataTransferManifest;
25
+ };
26
+ export type ImportPreviewError = {
27
+ kind: "validation" | "type_change";
28
+ message: string;
29
+ table?: string;
30
+ field?: string;
31
+ };
32
+ export type ImportPreviewWarning = {
33
+ kind: "removed_field" | "index_change" | "search_index_change" | "display_template_change";
34
+ message: string;
35
+ table: string;
36
+ };
37
+ export type ImportPreview = {
38
+ errors: ImportPreviewError[];
39
+ warnings: ImportPreviewWarning[];
40
+ nextDraft: Manifest | null;
41
+ importedTableNames: string[];
42
+ };
43
+ export type ParseImportResult = {
44
+ ok: true;
45
+ parsed: ParsedImportPaste;
46
+ } | {
47
+ ok: false;
48
+ error: string;
49
+ };
50
+ export type SpaceExportResult = {
51
+ bundle: ColumnusSpaceBundle;
52
+ listedTables: string[];
53
+ closureExtra: string[];
54
+ };
55
+ /** Transitive closure of `id(Table)` reference targets from `seedTableNames`. */
56
+ export declare function collectIdReferenceClosure(manifest: Manifest, seedTableNames: string[]): string[];
57
+ export declare function buildSpaceExport(savedManifest: Manifest, space: {
58
+ name: string;
59
+ slug: string;
60
+ description?: string;
61
+ icon?: string;
62
+ order: number;
63
+ tables: string[];
64
+ }): SpaceExportResult;
65
+ export declare function parseImportPaste(text: string): ParseImportResult;
66
+ export declare function previewImportMerge(savedManifest: Manifest, currentDraft: Manifest, parsed: ParsedImportPaste): ImportPreview;
67
+ export declare function unionTableNames(existing: string[], imported: string[]): string[];