@allyhub/sdk 0.9.0 → 0.10.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/CHANGELOG.md +8 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +3 -0
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
- package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/package.json +5 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
- package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +2 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/docs/README.md +2 -0
- package/docs/canvas.md +28 -0
- package/docs/defaults.md +20 -2
- package/docs/docs.md +8 -8
- package/docs/scenery.md +3 -4
- package/docs/sheets.md +22 -5
- package/docs/slides.md +50 -4
- package/docs/speech.md +1 -1
- package/docs/x.md +73 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as o}from"zod";import{SCRIPT_NAME as g}from"./script.js";const s=o.string().regex(g,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","wipe","fly-in","zoom","disappear","fade-out","wipe-out","fly-out","zoom-out","pulse","path"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right"],LINE_DASHES=["solid","sysDash","sysDot","dash","dashDot","lgDash","lgDashDot","lgDashDotDot"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()});const b=new RegExp(`^(${THEME_COLORS.join("|")}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),f=/^#[0-9A-Fa-f]{6}$/u,w=t=>THEME_COLORS.includes(t);export function colorOfFile(t){if(w(t))return t;if(f.test(t))return{rgb:t.toUpperCase()};const n=b.exec(t),[,i="",e,a=""]=n??[],l=Math.round(Number(a)*1e3);if(!(!n||!w(i)||l<=0||l>1e5))return{theme_color:i,brightness:(e==="lighter"?l:-l)/1e5}}export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.rgb;const n=Math.round(Math.abs(t.brightness)*1e5)/1e3;return n===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(n)}%`}const m=`A colour is one of the theme's (${THEME_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), or #RRGGBB.`;export const ColorFileSchema=o.union([o.enum(THEME_COLORS),o.string().regex(b,m),o.string().regex(f,m)]).refine(t=>colorOfFile(t)!==void 0,m),NUMBERINGS=["arabicPeriod","arabicParenR","alphaLcPeriod","alphaUcPeriod","romanLcPeriod","romanUcPeriod"],TEXT_ANCHORS=["t","ctr","b"],TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.boolean().optional(),strike:o.boolean().optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:o.number().min(0).max(1584).optional(),space_after:o.number().min(0).max(1584).optional(),anchor:o.enum(TEXT_ANCHORS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional()});const A=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),d=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(d),o.record(o.string(),d)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"];const C=o.strictObject({min:o.number().optional(),max:o.number().optional(),major:o.number().positive().optional(),gridlines:o.boolean().optional(),visible:o.boolean().optional(),format:o.string().min(1).optional(),reverse:o.boolean().optional(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.optional(),format:o.string().min(1).optional(),smooth:o.boolean().optional(),line_width:o.number().positive().optional(),marker_size:o.number().int().min(2).max(72).optional()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:C.optional(),category_axis:C.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(n=>n!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()});const S=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:S.optional(),end:S.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),shadow:ShadowSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:A.optional(),movie:o.string().min(1).optional(),poster:o.number().min(0).optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1)}).optional(),chart:ChartSchema.optional(),group:s.optional(),locked:o.literal(!0).optional(),component:o.union([s,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),d).optional(),dur:o.number().positive().optional()}),SHAPE_KINDS=["textbox","picture","movie","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),duration:o.number().positive().optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional()}),SlideSchema=o.strictObject({id:s,layout:o.string().min(1).optional(),generate:s.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,n)=>{const i=new Set;t.slides.forEach((e,a)=>{i.has(e.id)&&n.addIssue({code:"custom",path:["slides",a,"id"],message:`Two slides are "${e.id}".`}),i.add(e.id),(e.layout===void 0?0:1)+(e.generate===void 0?0:1)!==1&&n.addIssue({code:"custom",path:["slides",a],message:`Slide ${e.id} has a layout or a generator: one of them.`}),e.hidden!==void 0&&e.generate===void 0&&e.hidden!==!0&&n.addIssue({code:"custom",path:["slides",a,"hidden"],message:`Slide ${e.id} is hidden (true); a list of ids is a generated block's.`});for(const[r,x]of Object.entries(e.shapes??{})){const h=SHAPE_KINDS.filter(u=>x[u]!==void 0);h.length>1&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:`Shape ${r} is one kind of shape, not ${h.join(" and ")}.`});const p=r.includes("/")?r.split("/"):[r];(!(p.length<=2&&p.every(u=>g.test(u)))||p.length===2&&e.generate===void 0)&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});
|
|
2
|
+
import{z as o}from"zod";import{SCRIPT_NAME as g}from"./script.js";const s=o.string().regex(g,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","wipe","fly-in","zoom","disappear","fade-out","wipe-out","fly-out","zoom-out","pulse","path"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right"],LINE_DASHES=["solid","sysDash","sysDot","dash","dashDot","lgDash","lgDashDot","lgDashDotDot"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],ARROW_SIZES=["sm","med","lg"],LineEndSizeSchema=o.strictObject({w:o.enum(ARROW_SIZES).optional(),len:o.enum(ARROW_SIZES).optional()}),FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()});const b=new RegExp(`^(${THEME_COLORS.join("|")}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),f=/^#[0-9A-Fa-f]{6}$/u,w=t=>THEME_COLORS.includes(t);export function colorOfFile(t){if(w(t))return t;if(f.test(t))return{rgb:t.toUpperCase()};const n=b.exec(t),[,i="",e,a=""]=n??[],l=Math.round(Number(a)*1e3);if(!(!n||!w(i)||l<=0||l>1e5))return{theme_color:i,brightness:(e==="lighter"?l:-l)/1e5}}export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.rgb;const n=Math.round(Math.abs(t.brightness)*1e5)/1e3;return n===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(n)}%`}const m=`A colour is one of the theme's (${THEME_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), or #RRGGBB.`;export const ColorFileSchema=o.union([o.enum(THEME_COLORS),o.string().regex(b,m),o.string().regex(f,m)]).refine(t=>colorOfFile(t)!==void 0,m),NUMBERINGS=["arabicPeriod","arabicParenR","alphaLcPeriod","alphaUcPeriod","romanLcPeriod","romanUcPeriod"],TEXT_ANCHORS=["t","ctr","b"],TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.boolean().optional(),strike:o.boolean().optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:o.number().min(0).max(1584).optional(),space_after:o.number().min(0).max(1584).optional(),anchor:o.enum(TEXT_ANCHORS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional()});const A=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),d=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(d),o.record(o.string(),d)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"];const C=o.strictObject({min:o.number().optional(),max:o.number().optional(),major:o.number().positive().optional(),gridlines:o.boolean().optional(),visible:o.boolean().optional(),format:o.string().min(1).optional(),reverse:o.boolean().optional(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.optional(),format:o.string().min(1).optional(),smooth:o.boolean().optional(),line_width:o.number().positive().optional(),marker_size:o.number().int().min(2).max(72).optional()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:C.optional(),category_axis:C.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(n=>n!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()});const S=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:S.optional(),end:S.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),shadow:ShadowSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),line_begin_size:LineEndSizeSchema.optional(),line_end_size:LineEndSizeSchema.optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:A.optional(),movie:o.string().min(1).optional(),poster:o.number().min(0).optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1)}).optional(),chart:ChartSchema.optional(),group:s.optional(),locked:o.literal(!0).optional(),component:o.union([s,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),d).optional(),dur:o.number().positive().optional()}),SHAPE_KINDS=["textbox","picture","movie","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),duration:o.number().positive().optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional()}),SlideSchema=o.strictObject({id:s,layout:o.string().min(1).optional(),generate:s.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,n)=>{const i=new Set;t.slides.forEach((e,a)=>{i.has(e.id)&&n.addIssue({code:"custom",path:["slides",a,"id"],message:`Two slides are "${e.id}".`}),i.add(e.id),(e.layout===void 0?0:1)+(e.generate===void 0?0:1)!==1&&n.addIssue({code:"custom",path:["slides",a],message:`Slide ${e.id} has a layout or a generator: one of them.`}),e.hidden!==void 0&&e.generate===void 0&&e.hidden!==!0&&n.addIssue({code:"custom",path:["slides",a,"hidden"],message:`Slide ${e.id} is hidden (true); a list of ids is a generated block's.`});for(const[r,x]of Object.entries(e.shapes??{})){const h=SHAPE_KINDS.filter(u=>x[u]!==void 0);h.length>1&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:`Shape ${r} is one kind of shape, not ${h.join(" and ")}.`});const p=r.includes("/")?r.split("/"):[r];(!(p.length<=2&&p.every(u=>g.test(u)))||p.length===2&&e.generate===void 0)&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});
|
|
@@ -719,6 +719,7 @@ export declare const DATA_FILES: {
|
|
|
719
719
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
|
|
720
720
|
formula: z.ZodOptional<z.ZodString>;
|
|
721
721
|
name: z.ZodOptional<z.ZodString>;
|
|
722
|
+
start: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
|
|
722
723
|
}, z.core.$strict>]>>>;
|
|
723
724
|
format: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
724
725
|
format: z.ZodOptional<z.ZodString>;
|
|
@@ -1585,6 +1586,17 @@ export declare const DATA_FILES: {
|
|
|
1585
1586
|
smooth: z.ZodOptional<z.ZodBoolean>;
|
|
1586
1587
|
line_width: z.ZodOptional<z.ZodNumber>;
|
|
1587
1588
|
marker_size: z.ZodOptional<z.ZodNumber>;
|
|
1589
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1590
|
+
line: "line";
|
|
1591
|
+
"column-clustered": "column-clustered";
|
|
1592
|
+
"column-stacked": "column-stacked";
|
|
1593
|
+
"column-stacked-100": "column-stacked-100";
|
|
1594
|
+
"line-markers": "line-markers";
|
|
1595
|
+
area: "area";
|
|
1596
|
+
"area-stacked": "area-stacked";
|
|
1597
|
+
"area-stacked-100": "area-stacked-100";
|
|
1598
|
+
}>>;
|
|
1599
|
+
secondary: z.ZodOptional<z.ZodBoolean>;
|
|
1588
1600
|
}, z.core.$strict>>;
|
|
1589
1601
|
legend: z.ZodOptional<z.ZodEnum<{
|
|
1590
1602
|
left: "left";
|
|
@@ -1649,6 +1661,16 @@ export declare const DATA_FILES: {
|
|
|
1649
1661
|
format: z.ZodOptional<z.ZodString>;
|
|
1650
1662
|
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
1651
1663
|
}, z.core.$strict>>;
|
|
1664
|
+
secondary_axis: z.ZodOptional<z.ZodObject<{
|
|
1665
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1666
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
1667
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1668
|
+
major: z.ZodOptional<z.ZodNumber>;
|
|
1669
|
+
gridlines: z.ZodOptional<z.ZodBoolean>;
|
|
1670
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
1671
|
+
format: z.ZodOptional<z.ZodString>;
|
|
1672
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
1673
|
+
}, z.core.$strict>>;
|
|
1652
1674
|
size: z.ZodOptional<z.ZodNumber>;
|
|
1653
1675
|
title_size: z.ZodOptional<z.ZodNumber>;
|
|
1654
1676
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1723,6 +1745,10 @@ export declare const DATA_FILES: {
|
|
|
1723
1745
|
formula: z.ZodString;
|
|
1724
1746
|
}, z.core.$strict>>>;
|
|
1725
1747
|
scenarios: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>>>;
|
|
1748
|
+
iteration: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
1749
|
+
max_iterations: z.ZodOptional<z.ZodNumber>;
|
|
1750
|
+
max_change: z.ZodOptional<z.ZodNumber>;
|
|
1751
|
+
}, z.core.$strict>]>>;
|
|
1726
1752
|
}, z.core.$strict>;
|
|
1727
1753
|
readonly files: readonly [];
|
|
1728
1754
|
readonly about: "A workbook: its sheets, cells, formulas, formats, names, checks and scenarios.";
|
|
@@ -1852,6 +1878,30 @@ export declare const DATA_FILES: {
|
|
|
1852
1878
|
stealth: "stealth";
|
|
1853
1879
|
oval: "oval";
|
|
1854
1880
|
}>>;
|
|
1881
|
+
line_begin_size: z.ZodOptional<z.ZodObject<{
|
|
1882
|
+
w: z.ZodOptional<z.ZodEnum<{
|
|
1883
|
+
sm: "sm";
|
|
1884
|
+
med: "med";
|
|
1885
|
+
lg: "lg";
|
|
1886
|
+
}>>;
|
|
1887
|
+
len: z.ZodOptional<z.ZodEnum<{
|
|
1888
|
+
sm: "sm";
|
|
1889
|
+
med: "med";
|
|
1890
|
+
lg: "lg";
|
|
1891
|
+
}>>;
|
|
1892
|
+
}, z.core.$strict>>;
|
|
1893
|
+
line_end_size: z.ZodOptional<z.ZodObject<{
|
|
1894
|
+
w: z.ZodOptional<z.ZodEnum<{
|
|
1895
|
+
sm: "sm";
|
|
1896
|
+
med: "med";
|
|
1897
|
+
lg: "lg";
|
|
1898
|
+
}>>;
|
|
1899
|
+
len: z.ZodOptional<z.ZodEnum<{
|
|
1900
|
+
sm: "sm";
|
|
1901
|
+
med: "med";
|
|
1902
|
+
lg: "lg";
|
|
1903
|
+
}>>;
|
|
1904
|
+
}, z.core.$strict>>;
|
|
1855
1905
|
text: z.ZodOptional<z.ZodObject<{
|
|
1856
1906
|
size: z.ZodOptional<z.ZodNumber>;
|
|
1857
1907
|
bold: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{PRESETS as
|
|
2
|
+
import{PRESETS as O}from"../generated/presets.js";export const PRESET_NAMES=Object.keys(O);export function presetAdjustments(s){return(O[s]?.av??[]).map(([e,o])=>({name:e,value:Number(o.split(/\s+/u)[1]??0)}))}const T=6e4,C=s=>s/T*(Math.PI/180);function A(s,e){const o=Math.min(s,e),c=new Map([["w",s],["h",e],["l",0],["t",0],["r",s],["b",e],["hc",s/2],["vc",e/2],["ls",Math.max(s,e)],["ss",o],["cd2",108e5],["cd4",54e5],["cd8",27e5],["3cd4",162e5],["3cd8",81e5],["5cd8",135e5],["7cd8",189e5]]);for(const t of[2,3,4,5,6,8,10,12,32])c.set(`wd${String(t)}`,s/t),c.set(`hd${String(t)}`,e/t);for(const t of[2,4,6,8,16,32])c.set(`ssd${String(t)}`,o/t);return c}function Z(s,e){const[o="",...c]=s.trim().split(/\s+/u),[t=0,n=0,a=0]=c.map(r=>e.get(r)??Number(r));switch(o){case"*/":return a===0?0:t*n/a;case"+-":return t+n-a;case"+/":return a===0?0:(t+n)/a;case"?:":return t>0?n:a;case"abs":return Math.abs(t);case"at2":return Math.atan2(n,t)*180*T/Math.PI;case"cat2":return t*Math.cos(Math.atan2(a,n));case"cos":return t*Math.cos(C(n));case"max":return Math.max(t,n);case"min":return Math.min(t,n);case"mod":return Math.sqrt(t*t+n*n+a*a);case"pin":return n<t?t:n>a?a:n;case"sat2":return t*Math.sin(Math.atan2(a,n));case"sin":return t*Math.sin(C(n));case"sqrt":return Math.sqrt(t);case"tan":return t*Math.tan(C(n));case"val":return t;default:return 0}}const y=s=>String(Math.round(s*1e3)/1e3);function B(s,e,o,c,t,n,a=o,r=c){const _=d=>Math.atan2(a*Math.sin(C(d)),r*Math.cos(C(d))),u=_(t),m=n<0?-1:1,l=Math.floor(Math.abs(n)/216e5),b=Math.abs(n)-l*216e5;let h=_(t+m*b)-u;for(;m*h<0;)h+=m*2*Math.PI;b===0&&(h=0);const i=u+h+m*l*2*Math.PI,M=s-o*Math.cos(u),p=e-c*Math.sin(u),x=Math.max(1,Math.ceil(Math.abs(i-u)/(Math.PI/2)-1e-9)),S=(i-u)/x,$=4/3*Math.tan(S/4),g=[];let f=u;for(let d=0;d<x;d++){const k=f+S,[v,P,I,H]=[Math.cos(f),Math.sin(f),Math.cos(k),Math.sin(k)];g.push(`C ${y(M+o*(v-$*P))} ${y(p+c*(P+$*v))} ${y(M+o*(I+$*H))} ${y(p+c*(H-$*I))} ${y(M+o*I)} ${y(p+c*H)}`),f=k}return{d:g,x:M+o*Math.cos(i),y:p+c*Math.sin(i)}}function q(s,e,o,c){const t=A(e,o);for(const[n,a]of s.av??[])t.set(n,c[n]??Z(a,t));for(const[n,a]of s.gd??[])t.set(n,Z(a,t));return t}const E=(s,e)=>e.get(s)??Number(s);export function evaluate(s,e,o,c={}){const t=q(s,e,o,c),n=l=>E(l,t),a=s.paths.map(l=>{const b=l.w?e/l.w:1,h=l.h?o/l.h:1,i=l.d.split(" "),M=[];let p=0,x=0,S={x:0,y:0};for(let $=0;$<i.length;){const g=i[$++],f=()=>n(i[$++]??"0");if(g==="M"||g==="L")p=f()*b,x=f()*h,g==="M"&&(S={x:p,y:x}),M.push(`${g} ${y(p)} ${y(x)}`);else if(g==="Q"){const[d,k]=[f()*b,f()*h],[v,P]=[f()*b,f()*h];M.push(`C ${y(p+2/3*(d-p))} ${y(x+2/3*(k-x))} ${y(v+2/3*(d-v))} ${y(P+2/3*(k-P))} ${y(v)} ${y(P)}`),[p,x]=[v,P]}else if(g==="C"){const d=[f()*b,f()*h,f()*b,f()*h,f()*b,f()*h];M.push(`C ${d.map(y).join(" ")}`),[p,x]=[d[4]??0,d[5]??0]}else if(g==="A"){const[d,k,v,P]=[f(),f(),f(),f()],I=B(p,x,d*b,k*h,v,P,d,k);M.push(...I.d),[p,x]=[I.x,I.y]}else g==="Z"&&(M.push("Z"),[p,x]=[S.x,S.y])}return{d:M.join(" "),fill:l.fill??"norm",stroke:l.stroke!==!1}}),[r="l",_="t",u="r",m="b"]=s.text??[];return{paths:a,text:{left:n(r),top:n(_),right:n(u),bottom:n(m)}}}export function presetOutline(s,e,o,c=[]){const t=O[s];if(t)return evaluate(t,e,o,N(t,c))}function N(s,e){const o={};return(s.av??[]).forEach(([c],t)=>{const n=e[t];n!==void 0&&(o[c]=n*1e5)}),o}const z=(s,e)=>({x:E(s.pos[0],e),y:E(s.pos[1],e)});export function presetHandles(s,e,o,c=[]){const t=O[s];if(!t?.ah)return[];const n=q(t,e,o,N(t,c));return t.ah.map((a,r)=>({index:r,...z(a,n)}))}export function presetSites(s,e,o,c=[]){const t=O[s];if(!t?.cxn)return[];const n=q(t,e,o,N(t,c));return t.cxn.map(([a,r,_],u)=>({index:u,x:E(a,n),y:E(r,n),angle:E(_,n)/6e4}))}const L=64,j=(Math.sqrt(5)-1)/2;function D(s,e,o){if(o<=e)return e;const c=(o-e)/L;let t=0,n=1/0;for(let h=0;h<=L;h++){const i=s(e+h*c);i<n&&([t,n]=[h,i])}let a=e+Math.max(0,t-1)*c,r=e+Math.min(L,t+1)*c,_=r-j*(r-a),u=a+j*(r-a),m=s(_),l=s(u);for(let h=0;h<80&&r-a>1e-6;h++)m<l?([r,u,l]=[u,_,m],_=r-j*(r-a),m=s(_)):([a,_,m]=[_,u,l],u=a+j*(r-a),l=s(u));const b=(a+r)/2;return s(b)<=n?b:e+t*c}export function adjustedBy(s,e,o,c,t,n){const a=O[s],r=a?.ah?.[t];if(!a||!r)return[...c];const _=q(a,e,o,N(a,c)),u={};for(const[i]of a.av??[])u[i]=_.get(i)??0;const m=[r.x??r.r,r.y??r.ang].filter(i=>i!==void 0),l=i=>{const M=z(r,q(a,e,o,i));return Math.hypot(M.x-n.x,M.y-n.y)},b=1e-9*(Math.abs(e)+Math.abs(o)+1),h=new Set;for(const[i,M,p]of m.length>1?[...m,...m]:m){const x=q(a,e,o,u),[S,$]=[E(M,x),E(p,x)].sort((v,P)=>v-P);if(S===void 0||$===void 0)continue;const g=v=>l({...u,[i]:v}),f=u[i]??0,d=Math.min($,Math.max(S,Math.round(D(g,S,$))));f>=S&&f<=$&&g(f)<=g(d)+b||(u[i]=d,h.add(i))}return(a.av??[]).map(([i],M)=>h.has(i)?(u[i]??0)/1e5:c[M]??(u[i]??0)/1e5)}
|
|
@@ -232,6 +232,12 @@ export interface DeckTextLayout {
|
|
|
232
232
|
scale?: number;
|
|
233
233
|
/** Its first paragraph's alignment: the line it is aligned by. */
|
|
234
234
|
align?: "l" | "ctr" | "r" | "just";
|
|
235
|
+
/** A turned shape's box, glyphs and lines measured unturned, in its own frame: what its text overflowing is judged by. */
|
|
236
|
+
own?: {
|
|
237
|
+
box: Box;
|
|
238
|
+
glyphs: Box | null;
|
|
239
|
+
lines: Box[];
|
|
240
|
+
};
|
|
235
241
|
}
|
|
236
242
|
/** A deck's shape as drawn on its slide. */
|
|
237
243
|
export interface DeckShapeLayout {
|
|
@@ -270,6 +276,16 @@ export interface DeckShapeLayout {
|
|
|
270
276
|
/** The part of them shown (its crop). */
|
|
271
277
|
shown: [width: number, height: number];
|
|
272
278
|
};
|
|
279
|
+
/** A line's two ends, where it begins and where it ends: a connector's, or a freeform's whose outline is left open. */
|
|
280
|
+
ends?: [DeckLineEnd, DeckLineEnd];
|
|
281
|
+
}
|
|
282
|
+
/** An end of a deck's line, in the slide's pixels. */
|
|
283
|
+
export interface DeckLineEnd {
|
|
284
|
+
at: [x: number, y: number];
|
|
285
|
+
/** What it has: `none`, `triangle`, `arrow`, `stealth`, `diamond`, `oval`. */
|
|
286
|
+
head: string;
|
|
287
|
+
/** The shape it is glued to, by name. */
|
|
288
|
+
glued?: string;
|
|
273
289
|
}
|
|
274
290
|
/** A deck's slide as drawn at a still: one of its steps'. */
|
|
275
291
|
export interface DeckSlideLayout {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{touches as
|
|
2
|
+
import{touches as T}from"@allyhub/formats";import{LAYER_NAME as C}from"../layer.js";const A=3,E=120,m=e=>e.width*e.height;function S(e){if(e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGElement||d(e)!=="")return!0;const o=getComputedStyle(e);return o.backgroundColor!=="transparent"&&!/^rgba\(.*,\s*0\)$/u.test(o.backgroundColor)||o.backgroundImage!=="none"||parseFloat(o.borderTopWidth)+parseFloat(o.borderRightWidth)+parseFloat(o.borderBottomWidth)+parseFloat(o.borderLeftWidth)>0}const b=e=>e.closest("[data-ak-piece]")?.dataset.akPiece;function d(e){return[...e.childNodes].filter(o=>o.nodeType===Node.TEXT_NODE).map(o=>o.textContent).join("").trim()}export function locateLayers(e,o){const c=t=>t.width>0&&t.height>0&&T(o,t),u=[],l=[];for(const t of e.querySelectorAll(".ak-layer")){if(!t.checkVisibility({opacityProperty:!0,visibilityProperty:!0})||!c(t.getBoundingClientRect())||![t,...t.querySelectorAll("*")].filter(i=>c(i.getBoundingClientRect())).some(S))continue;const r=t.getAttribute(C)??void 0,a=b(t),p={part:t.closest(".ak-part")?.dataset.key??"",layer:t.dataset.component??"",...r===void 0||r===""?{}:{key:r},...a===void 0?{}:{piece:a}};let n;for(const i of[t,...t.querySelectorAll("*")]){const h=i.getBoundingClientRect();!c(h)||d(i)===""&&!i.hasAttribute("data-ak")||(!n||m(h)<m(n.getBoundingClientRect()))&&(n=i)}if(!n){l.push(p);continue}const g=n.closest("[data-ak]")?.getAttribute("data-ak"),y=d(n).slice(0,E);u.push({...p,...g?{name:g}:{},...y===""?{}:{text:y}})}const f=[];for(const t of e.querySelectorAll(".ak-footage")){const s=t.dataset.akFile,r=(t.querySelector("video")??t).checkVisibility({opacityProperty:!0,visibilityProperty:!0});if(s===void 0||!r||!c(t.getBoundingClientRect()))continue;const a=b(t);f.push({part:t.dataset.akPart??"",layer:"footage",file:s,...a===void 0?{}:{piece:a}})}return[...u,...f,...l].slice(0,A)}
|
|
@@ -219,9 +219,15 @@ export interface LocatedLayer {
|
|
|
219
219
|
part: string;
|
|
220
220
|
/** Its component. */
|
|
221
221
|
layer: string;
|
|
222
|
+
/** Its key in its part, where it has one (`data-ak-layer`). */
|
|
223
|
+
key?: string;
|
|
222
224
|
/** Its `data-ak` name, when what is under the place has one. */
|
|
223
225
|
name?: string;
|
|
224
226
|
text?: string;
|
|
227
|
+
/** The file it shows (a footage's video), project-relative. */
|
|
228
|
+
file?: string;
|
|
229
|
+
/** The module it is written in, where another item's (a video drawn inside this one), project-relative. */
|
|
230
|
+
piece?: string;
|
|
225
231
|
}
|
|
226
232
|
/** Where a player starts: a moment, or a part and how far into it (the same share of it when its length is no longer `dur`). */
|
|
227
233
|
export interface PlayAt {
|
|
@@ -32,6 +32,11 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
32
32
|
name: z.ZodString;
|
|
33
33
|
email: z.ZodString;
|
|
34
34
|
google: z.ZodBoolean;
|
|
35
|
+
v1: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
url: z.ZodURL;
|
|
37
|
+
closesAt: z.ZodISODateTime;
|
|
38
|
+
bonusCredits: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
35
40
|
}, z.core.$strip>;
|
|
36
41
|
export type Profile = z.infer<typeof ProfileSchema>;
|
|
37
42
|
/** The roles of a team, the strongest last. */
|
|
@@ -125,6 +130,103 @@ export declare const ACCOUNT_CALLS: {
|
|
|
125
130
|
byKind: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
126
131
|
}, z.core.$strip>>;
|
|
127
132
|
}, z.core.$strip>>;
|
|
133
|
+
readonly catalog: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
134
|
+
version: z.ZodString;
|
|
135
|
+
works: z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
title: z.ZodString;
|
|
138
|
+
description: z.ZodString;
|
|
139
|
+
kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
140
|
+
data: "data";
|
|
141
|
+
ai: "ai";
|
|
142
|
+
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
|
|
143
|
+
line: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
146
|
+
name: z.ZodString;
|
|
147
|
+
work: z.ZodString;
|
|
148
|
+
title: z.ZodString;
|
|
149
|
+
description: z.ZodString;
|
|
150
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
151
|
+
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
152
|
+
long: z.ZodBoolean;
|
|
153
|
+
example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
154
|
+
price: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
credits: z.ZodNumber;
|
|
156
|
+
per: z.ZodUnion<readonly [z.ZodEnum<{
|
|
157
|
+
call: "call";
|
|
158
|
+
result: "result";
|
|
159
|
+
page: "page";
|
|
160
|
+
second: "second";
|
|
161
|
+
minute: "minute";
|
|
162
|
+
thousand_characters: "thousand_characters";
|
|
163
|
+
image: "image";
|
|
164
|
+
frame: "frame";
|
|
165
|
+
megapixel: "megapixel";
|
|
166
|
+
question: "question";
|
|
167
|
+
phrase: "phrase";
|
|
168
|
+
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
169
|
+
varies: z.ZodBoolean;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
shown: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
line: z.ZodString;
|
|
174
|
+
section: z.ZodUnion<readonly [z.ZodEnum<{
|
|
175
|
+
image: "image";
|
|
176
|
+
video: "video";
|
|
177
|
+
voice: "voice";
|
|
178
|
+
music: "music";
|
|
179
|
+
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
readonly editors: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
184
|
+
editors: z.ZodArray<z.ZodObject<{
|
|
185
|
+
id: z.ZodString;
|
|
186
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
187
|
+
plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
188
|
+
line: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
189
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
190
|
+
color: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
readonly capabilities: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
194
|
+
off: z.ZodObject<{
|
|
195
|
+
works: z.ZodArray<z.ZodString>;
|
|
196
|
+
tools: z.ZodArray<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
readonly "capabilities/set": AccountCall<z.ZodUnion<readonly [z.ZodObject<{
|
|
200
|
+
work: z.ZodString;
|
|
201
|
+
on: z.ZodBoolean;
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
203
|
+
tool: z.ZodString;
|
|
204
|
+
on: z.ZodBoolean;
|
|
205
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
206
|
+
off: z.ZodObject<{
|
|
207
|
+
works: z.ZodArray<z.ZodString>;
|
|
208
|
+
tools: z.ZodArray<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
readonly spends: AccountCall<z.ZodObject<{
|
|
212
|
+
days: z.ZodInt;
|
|
213
|
+
limit: z.ZodOptional<z.ZodInt>;
|
|
214
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
215
|
+
spends: z.ZodArray<z.ZodObject<{
|
|
216
|
+
at: z.ZodString;
|
|
217
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
218
|
+
models: "models";
|
|
219
|
+
tools: "tools";
|
|
220
|
+
studio: "studio";
|
|
221
|
+
other: "other";
|
|
222
|
+
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
223
|
+
what: z.ZodNullable<z.ZodString>;
|
|
224
|
+
seconds: z.ZodNullable<z.ZodNumber>;
|
|
225
|
+
member: z.ZodNullable<z.ZodString>;
|
|
226
|
+
credits: z.ZodNumber;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
more: z.ZodBoolean;
|
|
229
|
+
}, z.core.$strip>>;
|
|
128
230
|
readonly checkout: AccountCall<z.ZodUnion<readonly [z.ZodObject<{
|
|
129
231
|
plan: z.ZodString;
|
|
130
232
|
interval: z.ZodEnum<{
|
|
@@ -208,6 +310,22 @@ export declare const ACCOUNT_CALLS: {
|
|
|
208
310
|
}, z.core.$strip>>;
|
|
209
311
|
email: z.ZodNullable<z.ZodString>;
|
|
210
312
|
}, z.core.$strip>>;
|
|
313
|
+
readonly invoices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
314
|
+
invoices: z.ZodArray<z.ZodObject<{
|
|
315
|
+
id: z.ZodString;
|
|
316
|
+
number: z.ZodNullable<z.ZodString>;
|
|
317
|
+
createdAt: z.ZodString;
|
|
318
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
319
|
+
credits: "credits";
|
|
320
|
+
plan: "plan";
|
|
321
|
+
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
322
|
+
totalCents: z.ZodNumber;
|
|
323
|
+
currency: z.ZodString;
|
|
324
|
+
status: z.ZodString;
|
|
325
|
+
pdf: z.ZodNullable<z.ZodString>;
|
|
326
|
+
url: z.ZodNullable<z.ZodString>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
}, z.core.$strip>>;
|
|
211
329
|
readonly topUp: AccountCall<z.ZodObject<{
|
|
212
330
|
topUpCents: z.ZodNumber;
|
|
213
331
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -316,6 +434,7 @@ export declare const ACCOUNT_CALLS: {
|
|
|
316
434
|
anyone: "anyone";
|
|
317
435
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
318
436
|
sendsLeft: z.ZodNumber;
|
|
437
|
+
sendsPerDay: z.ZodOptional<z.ZodNumber>;
|
|
319
438
|
addresses: z.ZodArray<z.ZodObject<{
|
|
320
439
|
address: z.ZodString;
|
|
321
440
|
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -344,6 +463,7 @@ export declare const ACCOUNT_CALLS: {
|
|
|
344
463
|
anyone: "anyone";
|
|
345
464
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
346
465
|
sendsLeft: z.ZodNumber;
|
|
466
|
+
sendsPerDay: z.ZodOptional<z.ZodNumber>;
|
|
347
467
|
addresses: z.ZodArray<z.ZodObject<{
|
|
348
468
|
address: z.ZodString;
|
|
349
469
|
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -449,6 +569,11 @@ export declare const ACCOUNT_CALLS: {
|
|
|
449
569
|
name: z.ZodString;
|
|
450
570
|
email: z.ZodString;
|
|
451
571
|
google: z.ZodBoolean;
|
|
572
|
+
v1: z.ZodOptional<z.ZodObject<{
|
|
573
|
+
url: z.ZodURL;
|
|
574
|
+
closesAt: z.ZodISODateTime;
|
|
575
|
+
bonusCredits: z.ZodDefault<z.ZodNumber>;
|
|
576
|
+
}, z.core.$strip>>;
|
|
452
577
|
}, z.core.$strip>>;
|
|
453
578
|
readonly "profile/set": AccountCall<z.ZodObject<{
|
|
454
579
|
name: z.ZodString;
|
|
@@ -459,11 +584,18 @@ export declare const ACCOUNT_CALLS: {
|
|
|
459
584
|
client: z.ZodString;
|
|
460
585
|
signedInAt: z.ZodISODateTime;
|
|
461
586
|
lastActiveAt: z.ZodISODateTime;
|
|
587
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
588
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
589
|
+
os: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
590
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
591
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
592
|
+
current: z.ZodOptional<z.ZodBoolean>;
|
|
462
593
|
}, z.core.$strip>>;
|
|
463
594
|
}, z.core.$strip>>;
|
|
464
595
|
readonly "devices/signOut": AccountCall<z.ZodObject<{
|
|
465
596
|
id: z.ZodString;
|
|
466
597
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
598
|
+
readonly "devices/signOutOthers": AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
467
599
|
readonly export: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
468
600
|
readonly close: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
469
601
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as
|
|
2
|
+
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as _,ACCOUNT_EXPORT_PATH as f,DEVICES_PATH as p,DevicesSchema as y}from"./auth.js";import{AUTO_TOP_UP_PATH as b,AutoTopUpRequestSchema as L,BILLING_CHECKOUT_PATH as v,BILLING_PAYMENT_PATH as G,BILLING_PLANS_PATH as j,BILLING_PORTAL_PATH as U,BILLING_REQUEST_PATH as H,BILLING_RESUME_PATH as k,BILLING_SUMMARY_PATH as N,BILLING_TOP_UP_PATH as C,BILLING_USAGE_PATH as R,BillingPaymentSchema as x,BillingPlansSchema as M,BillingSummarySchema as u,BillingUsageSchema as B,CheckoutRequestSchema as D,PortalRequestSchema as $,TopUpRequestSchema as z,BILLING_INVOICES_PATH as q,BILLING_SPENDS_PATH as V,BillingInvoicesSchema as Y,CAPABILITIES_PATH as A,CATALOG_PATH as Z,EDITORS_PATH as K,EditorsSchema as F,CapabilitiesSchema as E,CapabilityRequestSchema as Q,CatalogSchema as X,BillingSpendsSchema as J}from"./cloud.js";import{MAIL_MESSAGES_PATH as g,MAIL_PATH as W,MAIL_PERSON_QUERY as ee,MAIL_SETTINGS_PATH as te,MailMessageSchema as ie,MailSearchResponseSchema as ne,MailSearchSchema as oe,MailSettingsSchema as se,MailboxSchema as S}from"./mail.js";import{MEMBERS_PATH as l,MemberLimitSchema as ae,MembersSchema as re,ORGANIZATIONS_PATH as P,ORGANIZATION_PATH as I}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const i=e.strictObject({}),n=e.object({}),w=e.object({url:e.url()}),d=e.string().trim().min(1).max(100),t=(o,h,m,c,s)=>({http:o,route:h,params:m,result:c,about:s});export const ACCOUNT_CALLS={balance:t("GET",N,i,u,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",j,i,M,"The plans, their prices, and what a top-up buys."),usage:t("GET",R,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),B,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",Z,i,X,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",K,i,F,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",A,i,E,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",A,Q,E,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",V,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),J,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",v,D,w,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",U,$,w,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",k,i,u,"A plan cancelled at its period's end taken up again."),payment:t("GET",G,i,x,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",q,i,Y,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",C,z,e.object({credits:e.number()}),"Credits bought with the saved card at once; answers what was added."),"autoTopUp/set":t("PUT",b,L,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser."),"autoTopUp/off":t("DELETE",b,i,n,"Auto top-up off."),"credits/request":t("POST",H,i,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",l,i,re,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${l}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ae.shape),n,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${l}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),n,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${l}/:userId`,e.strictObject({userId:e.string().min(1)}),n,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,i,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),n,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An invitation cancelled."),"team/create":t("POST",P,e.strictObject({name:d}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",I,e.strictObject({name:d}),n,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,i,n,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",I,i,n,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${P}/:id/restore`,e.strictObject({id:e.string().min(1)}),n,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,i,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:d}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),n,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An API key deleted."),mail:t("GET",W,i,S,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${te}?${ee}`,se,S,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",g,oe,ne,"The mailbox's messages, newest first."),"mail/message":t("GET",`${g}/:id`,e.strictObject({id:e.string().min(1)}),ie,"One message, read whole."),profile:t("GET",PROFILE_PATH,i,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:d}),n,"The person's name."),devices:t("GET",p,i,y,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${p}/:id`,e.strictObject({id:e.string().min(1)}),n,"A computer signed out."),"devices/signOutOthers":t("DELETE",p,i,n,"Every computer signed out but the one that asks."),export:t("GET",f,i,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",_,i,n,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(o,h){const m=h,c=new Set,s=o.route.replace(/:([A-Za-z]+)/gu,(r,a)=>(c.add(a),encodeURIComponent(String(m[a])))),T=Object.entries(m).filter(([r,a])=>!c.has(r)&&a!==void 0);if(o.http==="GET"||o.http==="DELETE"){const r=T.map(([a,O])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(O))}`).join("&");return{method:o.http,path:r===""?s:`${s}?${r}`}}return T.length===0?{method:o.http,path:s}:{method:o.http,path:s,body:Object.fromEntries(T)}}
|
|
@@ -21,8 +21,19 @@ export declare const SCOPES = "openid profile email offline_access";
|
|
|
21
21
|
export declare const ACCOUNT_PATH = "/api/account";
|
|
22
22
|
/** The header that names the organization a request acts in; without it, the person's own. */
|
|
23
23
|
export declare const ORGANIZATION_HEADER = "x-allyhub-organization";
|
|
24
|
-
/** `GET`: the computers signed in as the person; `DELETE <path>/<id>` signs one out. */
|
|
24
|
+
/** `GET`: the computers signed in as the person; `DELETE <path>/<id>` signs one out; `DELETE <path>` signs out every one but the asking computer. */
|
|
25
25
|
export declare const DEVICES_PATH = "/api/account/devices";
|
|
26
|
+
/**
|
|
27
|
+
* The header that names a computer's sign-in: an id it makes once and
|
|
28
|
+
* keeps in its credentials file, sent with its token requests and its
|
|
29
|
+
* calls, so AllyHub tells its sign-ins apart and knows which one asks.
|
|
30
|
+
* It only tells them apart; the sign-in itself authorizes.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEVICE_HEADER = "x-allyhub-device";
|
|
33
|
+
/** With a token request: the computer's name as its owner set it, percent-encoded (RFC 3986). */
|
|
34
|
+
export declare const DEVICE_NAME_HEADER = "x-allyhub-device-name";
|
|
35
|
+
/** A sign-in's id, as a computer makes it. */
|
|
36
|
+
export declare const DeviceIdSchema: z.ZodString;
|
|
26
37
|
/** `GET`: everything kept about the person, as a file. */
|
|
27
38
|
export declare const ACCOUNT_EXPORT_PATH = "/api/account/export";
|
|
28
39
|
/** `POST`, a browser's session alone: mails the link that deletes the account, unless something stands in the way. */
|
|
@@ -33,6 +44,12 @@ export declare const DevicesSchema: z.ZodObject<{
|
|
|
33
44
|
client: z.ZodString;
|
|
34
45
|
signedInAt: z.ZodISODateTime;
|
|
35
46
|
lastActiveAt: z.ZodISODateTime;
|
|
47
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
os: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
current: z.ZodOptional<z.ZodBoolean>;
|
|
36
53
|
}, z.core.$strip>>;
|
|
37
54
|
}, z.core.$strip>;
|
|
38
55
|
export type Devices = z.infer<typeof DevicesSchema>;
|
|
@@ -114,6 +131,7 @@ export declare const CredentialsFileSchema: z.ZodObject<{
|
|
|
114
131
|
}, z.core.$strip>>;
|
|
115
132
|
keychain: z.ZodOptional<z.ZodString>;
|
|
116
133
|
since: z.ZodISODateTime;
|
|
134
|
+
device: z.ZodOptional<z.ZodString>;
|
|
117
135
|
}, z.core.$strip>;
|
|
118
136
|
export type CredentialsFile = z.infer<typeof CredentialsFileSchema>;
|
|
119
137
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0})});
|
|
2
|
+
import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});
|