@corsair-dev/figma 0.1.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/LICENSE +191 -0
- package/dist/client.d.ts +13 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/endpoints/activityLogs.d.ts +3 -0
- package/dist/endpoints/activityLogs.d.ts.map +1 -0
- package/dist/endpoints/comments.d.ts +8 -0
- package/dist/endpoints/comments.d.ts.map +1 -0
- package/dist/endpoints/components.d.ts +8 -0
- package/dist/endpoints/components.d.ts.map +1 -0
- package/dist/endpoints/designTools.d.ts +7 -0
- package/dist/endpoints/designTools.d.ts.map +1 -0
- package/dist/endpoints/devResources.d.ts +6 -0
- package/dist/endpoints/devResources.d.ts.map +1 -0
- package/dist/endpoints/example.d.ts +3 -0
- package/dist/endpoints/example.d.ts.map +1 -0
- package/dist/endpoints/files.d.ts +10 -0
- package/dist/endpoints/files.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +717 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/libraryAnalytics.d.ts +8 -0
- package/dist/endpoints/libraryAnalytics.d.ts.map +1 -0
- package/dist/endpoints/payments.d.ts +3 -0
- package/dist/endpoints/payments.d.ts.map +1 -0
- package/dist/endpoints/projects.d.ts +3 -0
- package/dist/endpoints/projects.d.ts.map +1 -0
- package/dist/endpoints/styles.d.ts +4 -0
- package/dist/endpoints/styles.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +5643 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/endpoints/users.d.ts +3 -0
- package/dist/endpoints/users.d.ts.map +1 -0
- package/dist/endpoints/variables.d.ts +5 -0
- package/dist/endpoints/variables.d.ts.map +1 -0
- package/dist/endpoints/webhooks.d.ts +8 -0
- package/dist/endpoints/webhooks.d.ts.map +1 -0
- package/dist/error-handlers.d.ts +40 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +3035 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/schema/database.d.ts +168 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +167 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/webhooks/example.d.ts +3 -0
- package/dist/webhooks/example.d.ts.map +1 -0
- package/dist/webhooks/fileComment.d.ts +3 -0
- package/dist/webhooks/fileComment.d.ts.map +1 -0
- package/dist/webhooks/fileDelete.d.ts +3 -0
- package/dist/webhooks/fileDelete.d.ts.map +1 -0
- package/dist/webhooks/fileUpdate.d.ts +3 -0
- package/dist/webhooks/fileUpdate.d.ts.map +1 -0
- package/dist/webhooks/fileVersionUpdate.d.ts +3 -0
- package/dist/webhooks/fileVersionUpdate.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +38 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/libraryPublish.d.ts +3 -0
- package/dist/webhooks/libraryPublish.d.ts.map +1 -0
- package/dist/webhooks/ping.d.ts +3 -0
- package/dist/webhooks/ping.d.ts.map +1 -0
- package/dist/webhooks/types.d.ts +488 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EAKjB,uBAAuB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAk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EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAMzD,YAAY,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,mCAAmC,EACnC,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,wCAAwC,EACxC,uCAAuC,EACvC,oCAAoC,EACpC,mCAAmC,EACnC,uCAAuC,EACvC,sCAAsC,EACtC,wBAAwB,EACxB,mBAAmB,EACnB,oCAAoC,EACpC,sCAAsC,EACtC,+CAA+C,EAC/C,iCAAiC,EACjC,yCAAyC,GACzC,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{z as e}from"zod";var U=e.object({id:e.string(),handle:e.string().optional(),img_url:e.string().optional()}),H=e.object({user:U.optional(),emoji:e.string().optional(),created_at:e.string().optional()}),K=e.object({id:e.string(),uuid:e.string().nullable().optional(),message:e.string().optional(),file_key:e.string().optional(),order_id:e.string().nullable().optional(),parent_id:e.string().nullable().optional(),reactions:e.array(H).optional(),created_at:e.string().optional(),client_meta:e.unknown().optional(),resolved_at:e.string().nullable().optional(),user:U.optional()}),z=e.object({id:e.string(),status:e.enum(["ACTIVE","PAUSED"]).optional(),context:e.enum(["team","project","file"]).nullable().optional(),team_id:e.string().nullable().optional(),endpoint:e.string().optional(),passcode:e.string().optional(),client_id:e.string().nullable().optional(),context_id:e.string().nullable().optional(),event_type:e.string().optional(),description:e.string().nullable().optional()}),q=e.object({key:e.string(),file_key:e.string().optional(),node_id:e.string().optional(),thumbnail_url:e.string().optional(),name:e.string().optional(),description:e.string().optional(),created_at:e.string().optional(),updated_at:e.string().optional(),containing_frame:e.object({name:e.string().optional(),node_id:e.string().optional()}).optional(),user:U.optional()}),ht=e.object({message:e.string(),file_key:e.string(),comment_id:e.string().optional(),client_meta:e.unknown().optional()}),kt=K,Et=e.object({file_key:e.string(),comment_id:e.string()}),vt=e.object({status:e.number().optional(),error:e.boolean().optional()}),Rt=e.object({file_key:e.string(),as_md:e.boolean().optional()}),Gt=e.object({comments:e.array(K).optional()}),_t=e.object({file_key:e.string(),comment_id:e.string(),cursor:e.string().optional()}),wt=e.object({reactions:e.array(H).optional(),pagination:e.object({cursor:e.string().optional()}).optional()}),St=e.object({file_key:e.string(),comment_id:e.string(),emoji:e.string()}),Tt=e.object({status:e.number().optional(),error:e.boolean().optional()}),Ct=e.object({file_key:e.string(),comment_id:e.string(),emoji:e.string()}),At=e.object({status:e.number().optional(),error:e.boolean().optional()}),It=e.object({event_type:e.string(),endpoint:e.string(),passcode:e.string(),status:e.enum(["ACTIVE","PAUSED"]).optional(),context:e.string().optional(),context_id:e.string().optional(),team_id:e.string().optional(),description:e.string().optional()}),Dt=z,Pt=e.object({webhook_id:e.string()}),jt=e.object({id:e.string().optional(),status:e.enum(["ACTIVE","PAUSED"]).optional(),context:e.enum(["team","project","file"]).nullable().optional(),team_id:e.string().nullable().optional(),endpoint:e.string().optional(),passcode:e.string().optional(),client_id:e.string().nullable().optional(),context_id:e.string().nullable().optional(),event_type:e.string().optional(),description:e.string().nullable().optional()}),Lt=e.object({webhook_id:e.string()}),xt=e.object({id:e.string(),status:e.enum(["ACTIVE","PAUSED"]).optional(),context:e.enum(["team","project","file"]).nullable().optional(),team_id:e.string().nullable().optional(),endpoint:e.string().optional(),passcode:e.string().optional(),client_id:e.string().nullable().optional(),context_id:e.string().nullable().optional(),event_type:e.string().optional(),description:e.string().nullable().optional()}),Ot=e.object({context:e.string().optional(),context_id:e.string().optional()}),Ut=e.object({webhooks:e.array(z).optional()}),Mt=e.object({webhook_id:e.string()}),Vt=e.object({requests:e.array(e.object({id:e.string(),webhook_id:e.string(),status:e.string().optional(),created_at:e.string().optional(),error:e.object({}).passthrough().optional()})).optional()}),Wt=e.object({webhook_id:e.string(),event_type:e.string().optional(),endpoint:e.string().optional(),passcode:e.string().optional(),status:e.enum(["ACTIVE","PAUSED"]).optional(),description:e.string().optional()}),zt=z,qt=e.object({dev_resources:e.array(e.object({url:e.string(),name:e.string(),node_id:e.string(),file_key:e.string()}))}),Nt=e.object({links_created:e.array(e.object({id:e.string(),url:e.string(),name:e.string(),node_id:e.string(),file_key:e.string()})).optional(),errors:e.array(e.object({error:e.string(),node_id:e.string().optional(),file_key:e.string().optional()})).optional()}),$t=e.object({file_key:e.string(),dev_resource_id:e.string()}),Bt=e.object({}),Jt=e.object({file_key:e.string(),node_ids:e.string().optional()}),Ht=e.object({dev_resources:e.array(e.object({id:e.string(),url:e.string(),name:e.string(),node_id:e.string(),file_key:e.string()})).optional()}),Kt=e.object({dev_resources:e.array(e.object({id:e.string(),url:e.string().optional(),name:e.string().optional()}))}),Yt=e.object({links_updated:e.array(e.object({id:e.string(),url:e.string().optional(),name:e.string().optional()})).optional(),errors:e.array(e.object({error:e.string(),dev_resource_id:e.string().optional()})).optional()}),Xt=e.object({file_key:e.string(),variables:e.array(e.unknown()).optional(),variableModes:e.array(e.unknown()).optional(),variableModeValues:e.array(e.unknown()).optional(),variableCollections:e.array(e.unknown()).optional()}),Qt=e.object({meta:e.object({tempIdToRealId:e.record(e.string()).optional()}).optional(),status:e.number().optional(),error:e.boolean().optional()}),Zt=e.object({file_key:e.string()}),eo=e.object({meta:e.object({variables:e.record(e.unknown()).optional(),variableCollections:e.record(e.unknown()).optional()}).optional(),status:e.number().optional(),error:e.boolean().optional()}),to=e.object({file_key:e.string()}),oo=e.object({meta:e.object({variables:e.record(e.unknown()).optional(),variableCollections:e.record(e.unknown()).optional()}).optional(),status:e.number().optional(),error:e.boolean().optional()}),so=e.object({key:e.string()}),no=e.object({meta:e.object({component:q.optional()}).optional(),status:e.number().optional()}),io=e.object({key:e.string()}),ao=e.object({meta:e.object({component_set:e.object({key:e.string(),name:e.string().optional(),description:e.string().optional(),thumbnail_url:e.string().optional()}).optional()}).optional(),status:e.number().optional()}),ro=e.object({file_key:e.string()}),lo=e.object({meta:e.object({components:e.array(q).optional()}).optional(),status:e.number().optional()}),po=e.object({file_key:e.string()}),mo=e.object({meta:e.object({component_sets:e.array(e.object({key:e.string(),name:e.string().optional()})).optional()}).optional()}),co=e.object({team_id:e.string(),page_size:e.number().optional(),after:e.number().optional(),before:e.number().optional()}),go=e.object({meta:e.object({components:e.array(q).optional()}).optional(),cursor:e.string().optional()}),yo=e.object({team_id:e.string(),page_size:e.number().optional(),after:e.number().optional(),before:e.number().optional()}),uo=e.object({meta:e.object({component_sets:e.array(e.object({key:e.string(),name:e.string().optional()})).optional()}).optional(),cursor:e.string().optional()}),fo=e.object({file_key:e.string(),version:e.string().optional(),ids:e.string().optional(),depth:e.number().optional(),geometry:e.string().optional(),plugin_data:e.string().optional(),branch_data:e.boolean().optional(),simplify:e.boolean().optional(),include_raw:e.boolean().optional()}),bo=e.object({name:e.string().optional(),role:e.string().optional(),lastModified:e.string().optional(),editorType:e.string().optional(),thumbnailUrl:e.string().optional(),version:e.string().optional(),document:e.unknown().optional(),components:e.record(e.unknown()).optional(),styles:e.record(e.unknown()).optional()}),Fo=e.object({file_key:e.string()}),ho=e.object({name:e.string().optional(),role:e.string().optional(),last_modified:e.string().optional(),editorType:e.string().optional(),thumbnail_url:e.string().optional(),version:e.string().optional()}),ko=e.object({file_key:e.string(),ids:e.string(),version:e.string().optional(),depth:e.number().optional(),geometry:e.string().optional(),plugin_data:e.string().optional()}),Eo=e.object({name:e.string().optional(),nodes:e.record(e.unknown()).optional()}),vo=e.object({file_key:e.string()}),Ro=e.object({meta:e.object({styles:e.array(e.object({key:e.string(),file_key:e.string().optional(),node_id:e.string().optional(),style_type:e.string().optional(),name:e.string().optional(),description:e.string().optional()})).optional()}).optional()}),Go=e.object({file_key:e.string()}),_o=e.object({meta:e.object({images:e.record(e.string()).optional()}).optional(),error:e.boolean().optional()}),wo=e.object({file_key:e.string(),page_size:e.number().optional(),before:e.number().optional(),after:e.number().optional()}),So=e.object({versions:e.array(e.object({id:e.string(),created_at:e.string().optional(),label:e.string().nullable().optional(),description:e.string().nullable().optional(),user:U.optional()})).optional(),pagination:e.object({cursor:e.string().optional()}).optional()}),To=e.object({file_key:e.string(),ids:e.string(),scale:e.number().optional(),format:e.enum(["jpg","png","svg","pdf"]).optional(),version:e.string().optional(),contents_only:e.boolean().optional(),svg_include_id:e.boolean().optional(),svg_outline_text:e.boolean().optional(),svg_include_node_id:e.boolean().optional(),svg_simplify_stroke:e.boolean().optional(),use_absolute_bounds:e.boolean().optional()}),Co=e.object({images:e.record(e.string().nullable()).optional(),err:e.string().nullable().optional()}),Ao=e.object({project_id:e.string(),branch_data:e.boolean().optional()}),Io=e.object({name:e.string().optional(),files:e.array(e.object({key:e.string(),name:e.string().optional(),thumbnail_url:e.string().nullable().optional(),last_modified:e.string().optional()})).optional()}),Do=e.object({key:e.string()}),Po=e.object({meta:e.object({style:e.object({key:e.string(),file_key:e.string().optional(),node_id:e.string().optional(),style_type:e.string().optional(),name:e.string().optional(),description:e.string().optional()}).optional()}).optional()}),jo=e.object({team_id:e.string(),page_size:e.number().optional(),after:e.number().optional(),before:e.number().optional()}),Lo=e.object({meta:e.object({styles:e.array(e.object({key:e.string(),name:e.string().optional(),style_type:e.string().optional()})).optional()}).optional()}),xo=e.object({team_id:e.string()}),Oo=e.object({name:e.string().optional(),projects:e.array(e.object({id:e.string(),name:e.string().optional()})).optional()}),Uo=e.object({}),Mo=e.object({id:e.string(),handle:e.string().optional(),img_url:e.string().optional(),email:e.string().optional()}),Vo=e.object({file_key:e.string(),start_date:e.string().optional(),end_date:e.string().optional(),group_by:e.string().optional(),cursor:e.string().optional()}),Wo=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),zo=e.object({file_key:e.string(),group_by:e.string().optional(),cursor:e.string().optional()}),qo=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),No=e.object({file_key:e.string(),start_date:e.string().optional(),end_date:e.string().optional(),group_by:e.string().optional(),cursor:e.string().optional()}),$o=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),Bo=e.object({file_key:e.string(),group_by:e.string().optional(),cursor:e.string().optional()}),Jo=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),Ho=e.object({file_key:e.string(),start_date:e.string().optional(),end_date:e.string().optional(),group_by:e.string().optional(),cursor:e.string().optional()}),Ko=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),Yo=e.object({file_key:e.string(),group_by:e.string().optional(),cursor:e.string().optional()}),Xo=e.object({rows:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),Qo=e.object({start_time:e.number().optional(),end_time:e.number().optional(),limit:e.number().optional(),order:e.string().optional(),events:e.string().optional()}),Zo=e.object({activity_logs:e.array(e.unknown()).optional(),cursor:e.string().optional(),next_page:e.boolean().optional()}),es=e.object({user_id:e.string().optional(),plugin_id:e.string().optional(),widget_id:e.string().optional(),community_file_id:e.string().optional(),plugin_payment_token:e.string().optional()}),ts=e.object({meta:e.object({payment_information:e.unknown().optional()}).optional(),status:e.number().optional()}),os=e.object({figma_url:e.string().optional(),file_key:e.string().optional(),team_id:e.string().optional(),project_id:e.string().optional(),max_depth:e.number().optional()}),ss=e.object({files:e.array(e.unknown()).optional(),projects:e.array(e.unknown()).optional(),teams:e.array(e.unknown()).optional()}),ns=e.object({file_key:e.string(),include_variables:e.boolean().optional(),include_local_styles:e.boolean().optional(),extract_from_nodes:e.string().optional()}),is=e.object({tokens:e.record(e.unknown()).optional()}),as=e.object({file_key:e.string(),analyze_components:e.boolean().optional(),include_animations:e.boolean().optional()}),rs=e.object({interactions:e.array(e.unknown()).optional(),flows:e.array(e.unknown()).optional()}),ls=e.object({file_key:e.string(),images:e.array(e.object({node_id:e.string()})),scale:e.number().optional(),svg_include_id:e.boolean().optional(),svg_outline_text:e.boolean().optional(),svg_simplify_stroke:e.boolean().optional()}),ps=e.object({images:e.record(e.string().nullable()).optional()}),ms=e.object({tokens:e.record(e.unknown()),prefix:e.string().optional(),config_format:e.string().optional(),include_font_imports:e.boolean().optional()}),cs=e.object({config:e.string().optional(),css:e.string().optional()}),m={commentsAdd:ht,commentsDelete:Et,commentsList:Rt,commentsGetReactions:_t,commentsAddReaction:St,commentsDeleteReaction:Ct,webhooksCreate:It,webhooksDelete:Pt,webhooksGet:Lt,webhooksList:Ot,webhooksGetRequests:Mt,webhooksUpdate:Wt,devResourcesCreate:qt,devResourcesDelete:$t,devResourcesGet:Jt,devResourcesUpdate:Kt,variablesCreateModifyDelete:Xt,variablesGetLocal:Zt,variablesGetPublished:to,componentsGet:so,componentSetsGet:io,componentsGetForFile:ro,componentSetsGetForFile:po,componentsGetForTeam:co,componentSetsGetForTeam:yo,filesGetJSON:fo,filesGetMetadata:Fo,filesGetNodes:ko,filesGetStyles:vo,filesGetImageFills:Go,filesGetVersions:wo,filesRenderImages:To,filesGetProjectFiles:Ao,stylesGet:Do,stylesGetForTeam:jo,projectsGetTeamProjects:xo,usersGetCurrent:Uo,libraryAnalyticsComponentActions:Vo,libraryAnalyticsComponentUsages:zo,libraryAnalyticsStyleActions:No,libraryAnalyticsStyleUsages:Bo,libraryAnalyticsVariableActions:Ho,libraryAnalyticsVariableUsages:Yo,activityLogsList:Qo,paymentsGet:es,designToolsDiscoverResources:os,designToolsExtractDesignTokens:ns,designToolsExtractPrototypeInteractions:as,designToolsDownloadImages:ls,designToolsDesignTokensToTailwind:ms},c={commentsAdd:kt,commentsDelete:vt,commentsList:Gt,commentsGetReactions:wt,commentsAddReaction:Tt,commentsDeleteReaction:At,webhooksCreate:Dt,webhooksDelete:jt,webhooksGet:xt,webhooksList:Ut,webhooksGetRequests:Vt,webhooksUpdate:zt,devResourcesCreate:Nt,devResourcesDelete:Bt,devResourcesGet:Ht,devResourcesUpdate:Yt,variablesCreateModifyDelete:Qt,variablesGetLocal:eo,variablesGetPublished:oo,componentsGet:no,componentSetsGet:ao,componentsGetForFile:lo,componentSetsGetForFile:mo,componentsGetForTeam:go,componentSetsGetForTeam:uo,filesGetJSON:bo,filesGetMetadata:ho,filesGetNodes:Eo,filesGetStyles:Ro,filesGetImageFills:_o,filesGetVersions:So,filesRenderImages:Co,filesGetProjectFiles:Io,stylesGet:Po,stylesGetForTeam:Lo,projectsGetTeamProjects:Oo,usersGetCurrent:Mo,libraryAnalyticsComponentActions:Wo,libraryAnalyticsComponentUsages:qo,libraryAnalyticsStyleActions:$o,libraryAnalyticsStyleUsages:Jo,libraryAnalyticsVariableActions:Ko,libraryAnalyticsVariableUsages:Xo,activityLogsList:Zo,paymentsGet:ts,designToolsDiscoverResources:ss,designToolsExtractDesignTokens:is,designToolsExtractPrototypeInteractions:rs,designToolsDownloadImages:ps,designToolsDesignTokensToTailwind:cs};import{logEventFromContext as T}from"corsair/core";import{ApiError as ds}from"corsair/http";import{request as gs}from"corsair/http";var u=class extends Error{constructor(s,i,n,a){super(s);this.status=i;this.retryAfter=n;this.code=a;this.name="FigmaAPIError"}},ys="https://api.figma.com",us={enabled:!0,maxRetries:3,initialRetryDelay:1e3,backoffMultiplier:2,headerNames:{retryAfter:"Retry-After"}};async function r(t,o,s={}){let{method:i="GET",body:n,query:a,authType:d="api_key"}=s,b={BASE:ys,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:d==="oauth_2"?o:void 0,HEADERS:d==="api_key"?{"Content-Type":"application/json","X-Figma-Token":o}:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}},k={method:i,url:t,body:i==="POST"||i==="PUT"||i==="PATCH"?n:void 0,mediaType:"application/json; charset=utf-8",query:i==="GET"||i==="DELETE"?a:void 0};try{return await gs(b,k,{rateLimitConfig:us})}catch(F){throw F instanceof ds?new u(F.message,F.status,F.retryAfter):F instanceof Error?new u(F.message):new u("Unknown error")}}var Y=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/files/${s}/comments`,t.key,{method:"POST",body:{...i,client_meta:i.client_meta}});if(n.id&&t.db.comments)try{let{user:a,...d}=n;await t.db.comments.upsertByEntityId(n.id,{...d,file_key:d.file_key??s,user_id:a?.id,user_handle:a?.handle})}catch(a){console.warn("Failed to save comment to database:",a)}return await T(t,"figma.comments.add",{...o},"completed"),n},X=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/comments/${o.comment_id}`,t.key,{method:"DELETE"});if(t.db.comments)try{let i=await t.db.comments.findByEntityId(o.comment_id);i&&await t.db.comments.upsertByEntityId(o.comment_id,{...i.data,resolved_at:new Date().toISOString()})}catch(i){console.warn("Failed to update comment in database:",i)}return await T(t,"figma.comments.delete",{...o},"completed"),s},Q=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/comments`,t.key,{method:"GET",query:{as_md:o.as_md}});if(s.comments&&t.db.comments)try{for(let i of s.comments)if(i.id){let{user:n,...a}=i;await t.db.comments.upsertByEntityId(i.id,{...a,file_key:a.file_key??o.file_key,user_id:n?.id,user_handle:n?.handle})}}catch(i){console.warn("Failed to save comments to database:",i)}return await T(t,"figma.comments.list",{...o},"completed"),s},Z=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/comments/${o.comment_id}/reactions`,t.key,{method:"GET",query:{cursor:o.cursor}});return await T(t,"figma.comments.getReactions",{...o},"completed"),s},ee=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/comments/${o.comment_id}/reactions`,t.key,{method:"POST",body:{emoji:o.emoji}});return await T(t,"figma.comments.addReaction",{...o},"completed"),s},te=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/comments/${o.comment_id}/reactions`,t.key,{method:"DELETE",query:{emoji:o.emoji}});return await T(t,"figma.comments.deleteReaction",{...o},"completed"),s};import{logEventFromContext as C}from"corsair/core";var oe=async(t,o)=>{let s=await r("v2/webhooks",t.key,{method:"POST",body:{...o}});if(s.id&&t.db.webhookConfigs)try{await t.db.webhookConfigs.upsertByEntityId(s.id,{...s})}catch(i){console.warn("Failed to save webhook config to database:",i)}return await C(t,"figma.webhooks.create",{...o},"completed"),s},se=async(t,o)=>{let s=await r(`v2/webhooks/${o.webhook_id}`,t.key,{method:"DELETE"});if(s.id&&t.db.webhookConfigs)try{await t.db.webhookConfigs.upsertByEntityId(s.id,{...s,id:s.id})}catch(i){console.warn("Failed to update deleted webhook config in database:",i)}return await C(t,"figma.webhooks.delete",{...o},"completed"),s},ne=async(t,o)=>{let s=await r(`v2/webhooks/${o.webhook_id}`,t.key,{method:"GET"});if(s.id&&t.db.webhookConfigs)try{await t.db.webhookConfigs.upsertByEntityId(s.id,{...s})}catch(i){console.warn("Failed to save webhook config to database:",i)}return await C(t,"figma.webhooks.get",{...o},"completed"),s},ie=async(t,o)=>{let s=await r("v2/webhooks",t.key,{method:"GET",query:{...o}});if(s.webhooks&&t.db.webhookConfigs)try{for(let i of s.webhooks)i.id&&await t.db.webhookConfigs.upsertByEntityId(i.id,{...i})}catch(i){console.warn("Failed to save webhook configs to database:",i)}return await C(t,"figma.webhooks.list",{...o},"completed"),s},ae=async(t,o)=>{let s=await r(`v2/webhooks/${o.webhook_id}/requests`,t.key,{method:"GET"});return await C(t,"figma.webhooks.getRequests",{...o},"completed"),s},re=async(t,o)=>{let{webhook_id:s,...i}=o,n=await r(`v2/webhooks/${s}`,t.key,{method:"PUT",body:{...i}});if(n.id&&t.db.webhookConfigs)try{await t.db.webhookConfigs.upsertByEntityId(n.id,{...n})}catch(a){console.warn("Failed to update webhook config in database:",a)}return await C(t,"figma.webhooks.update",{...o},"completed"),n};import{logEventFromContext as M}from"corsair/core";var le=async(t,o)=>{let s=await r("v1/dev_resources",t.key,{method:"POST",body:{...o}});if(s.links_created&&t.db.fileMetadata)try{let i=new Set;for(let n of s.links_created)n.file_key&&!i.has(n.file_key)&&(i.add(n.file_key),await t.db.fileMetadata.upsertByEntityId(n.file_key,{id:n.file_key}))}catch(i){console.warn("Failed to save dev resource file metadata to database:",i)}return await M(t,"figma.devResources.create",{...o},"completed"),s},pe=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/dev_resources/${o.dev_resource_id}`,t.key,{method:"DELETE"});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(o.file_key,{id:o.file_key})}catch(i){console.warn("Failed to update file metadata after dev resource deletion:",i)}return await M(t,"figma.devResources.delete",{...o},"completed"),s},me=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/dev_resources`,t.key,{method:"GET",query:{node_ids:o.node_ids}});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(o.file_key,{id:o.file_key})}catch(i){console.warn("Failed to save file metadata to database:",i)}return await M(t,"figma.devResources.get",{...o},"completed"),s},ce=async(t,o)=>{let s=await r("v1/dev_resources",t.key,{method:"PUT",body:{...o}});return await M(t,"figma.devResources.update",{...o},"completed"),s};import{logEventFromContext as N}from"corsair/core";var de=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/files/${s}/variables`,t.key,{method:"POST",body:{...i}});return await N(t,"figma.variables.createModifyDelete",{...o},"completed"),n},ge=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/variables/local`,t.key,{method:"GET"});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(o.file_key,{id:o.file_key})}catch(i){console.warn("Failed to save file metadata to database:",i)}return await N(t,"figma.variables.getLocal",{...o},"completed"),s},ye=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/variables/published`,t.key,{method:"GET"});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(o.file_key,{id:o.file_key})}catch(i){console.warn("Failed to save file metadata to database:",i)}return await N(t,"figma.variables.getPublished",{...o},"completed"),s};import{logEventFromContext as A}from"corsair/core";var ue=async(t,o)=>{let s=await r(`v1/components/${o.key}`,t.key,{method:"GET"});if(s.meta?.component?.key&&t.db.components)try{let{containing_frame:i,user:n,...a}=s.meta.component;await t.db.components.upsertByEntityId(a.key,{...a})}catch(i){console.warn("Failed to save component to database:",i)}return await A(t,"figma.components.get",{...o},"completed"),s},fe=async(t,o)=>{let s=await r(`v1/component_sets/${o.key}`,t.key,{method:"GET"});if(s.meta?.component_set?.key&&t.db.components)try{await t.db.components.upsertByEntityId(s.meta.component_set.key,{...s.meta.component_set})}catch(i){console.warn("Failed to save component set to database:",i)}return await A(t,"figma.components.getComponentSet",{...o},"completed"),s},be=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/components`,t.key,{method:"GET"});if(s.meta?.components&&t.db.components)try{for(let i of s.meta.components)if(i.key){let{containing_frame:n,user:a,...d}=i;await t.db.components.upsertByEntityId(d.key,{...d})}}catch(i){console.warn("Failed to save components to database:",i)}return await A(t,"figma.components.getForFile",{...o},"completed"),s},Fe=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/component_sets`,t.key,{method:"GET"});if(s.meta?.component_sets&&t.db.components)try{for(let i of s.meta.component_sets)i.key&&await t.db.components.upsertByEntityId(i.key,{...i})}catch(i){console.warn("Failed to save component sets to database:",i)}return await A(t,"figma.components.getComponentSetsForFile",{...o},"completed"),s},he=async(t,o)=>{let{team_id:s,...i}=o,n=await r(`v1/teams/${s}/components`,t.key,{method:"GET",query:{...i}});if(n.meta?.components&&t.db.components)try{for(let a of n.meta.components)if(a.key){let{containing_frame:d,user:b,...k}=a;await t.db.components.upsertByEntityId(k.key,{...k})}}catch(a){console.warn("Failed to save team components to database:",a)}return await A(t,"figma.components.getForTeam",{...o},"completed"),n},ke=async(t,o)=>{let{team_id:s,...i}=o,n=await r(`v1/teams/${s}/component_sets`,t.key,{method:"GET",query:{...i}});if(n.meta?.component_sets&&t.db.components)try{for(let a of n.meta.component_sets)a.key&&await t.db.components.upsertByEntityId(a.key,{...a})}catch(a){console.warn("Failed to save team component sets to database:",a)}return await A(t,"figma.components.getComponentSetsForTeam",{...o},"completed"),n};import{logEventFromContext as v}from"corsair/core";var Ee=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/files/${s}`,t.key,{method:"GET",query:{...i}});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(s,{id:s,name:n.name,role:n.role,last_modified:n.lastModified,editorType:n.editorType,thumbnail_url:n.thumbnailUrl,version:n.version})}catch(a){console.warn("Failed to save file metadata to database:",a)}return await v(t,"figma.files.getJSON",{...o},"completed"),n},ve=async(t,o)=>{let s=await r(`v1/files/${o.file_key}`,t.key,{method:"GET"});if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(o.file_key,{...s,id:o.file_key})}catch(i){console.warn("Failed to save file metadata to database:",i)}return await v(t,"figma.files.getMetadata",{...o},"completed"),s},Re=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/files/${s}/nodes`,t.key,{method:"GET",query:{...i}});return await v(t,"figma.files.getNodes",{...o},"completed"),n},Ge=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/styles`,t.key,{method:"GET"});return await v(t,"figma.files.getStyles",{...o},"completed"),s},_e=async(t,o)=>{let s=await r(`v1/files/${o.file_key}/images`,t.key,{method:"GET"});return await v(t,"figma.files.getImageFills",{...o},"completed"),s},we=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/files/${s}/versions`,t.key,{method:"GET",query:{...i}});if(n.versions&&t.db.versions)try{for(let a of n.versions)if(a.id){let{user:d,...b}=a;await t.db.versions.upsertByEntityId(a.id,{...b,file_key:s,user_id:d?.id,user_handle:d?.handle})}}catch(a){console.warn("Failed to save file versions to database:",a)}return await v(t,"figma.files.getVersions",{...o},"completed"),n},Se=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/images/${s}`,t.key,{method:"GET",query:{...i}});return await v(t,"figma.files.renderImages",{...o},"completed"),n},Te=async(t,o)=>{let{project_id:s,...i}=o,n=await r(`v1/projects/${s}/files`,t.key,{method:"GET",query:{...i}});if(n.files&&t.db.fileMetadata)try{for(let a of n.files)a.key&&await t.db.fileMetadata.upsertByEntityId(a.key,{...a,id:a.key})}catch(a){console.warn("Failed to save project file metadata to database:",a)}return await v(t,"figma.files.getProjectFiles",{...o},"completed"),n};import{logEventFromContext as Ce}from"corsair/core";var Ae=async(t,o)=>{let s=await r(`v1/styles/${o.key}`,t.key,{method:"GET"});return await Ce(t,"figma.styles.get",{...o},"completed"),s},Ie=async(t,o)=>{let{team_id:s,...i}=o,n=await r(`v1/teams/${s}/styles`,t.key,{method:"GET",query:{...i}});return await Ce(t,"figma.styles.getForTeam",{...o},"completed"),n};import{logEventFromContext as Rs}from"corsair/core";var De=async(t,o)=>{let s=await r(`v1/teams/${o.team_id}/projects`,t.key,{method:"GET"});return await Rs(t,"figma.projects.getTeamProjects",{...o},"completed"),s};import{logEventFromContext as _s}from"corsair/core";var Pe=async(t,o)=>{let s=await r("v1/me",t.key,{method:"GET"});return await _s(t,"figma.users.getCurrent",{...o},"completed"),s};import{logEventFromContext as I}from"corsair/core";var je=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/component/actions`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.componentActions",{...o},"completed"),n},Le=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/component/usages`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.componentUsages",{...o},"completed"),n},xe=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/style/actions`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.styleActions",{...o},"completed"),n},Oe=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/style/usages`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.styleUsages",{...o},"completed"),n},Ue=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/variable/actions`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.variableActions",{...o},"completed"),n},Me=async(t,o)=>{let{file_key:s,...i}=o,n=await r(`v1/analytics/libraries/${s}/variable/usages`,t.key,{method:"GET",query:{...i}});return await I(t,"figma.libraryAnalytics.variableUsages",{...o},"completed"),n};import{logEventFromContext as Ts}from"corsair/core";var Ve=async(t,o)=>{let s=await r("v1/activity_logs",t.key,{method:"GET",query:{...o}});return await Ts(t,"figma.activityLogs.list",{...o},"completed"),s};import{logEventFromContext as As}from"corsair/core";var We=async(t,o)=>{let s=await r("v1/payments",t.key,{method:"GET",query:{...o}});return await As(t,"figma.payments.get",{...o},"completed"),s};import{logEventFromContext as L}from"corsair/core";var ze=async(t,o)=>{let s=[],i=[],n=[];if(o.file_key)try{let d=await r(`v1/files/${o.file_key}`,t.key,{method:"GET",query:{depth:o.max_depth}});s.push({key:o.file_key,...d})}catch(d){console.warn("Failed to fetch file during discoverResources:",d)}if(o.project_id)try{let d=await r(`v1/projects/${o.project_id}/files`,t.key,{method:"GET"});i.push({id:o.project_id,...d}),d.files&&s.push(...d.files)}catch(d){console.warn("Failed to fetch project during discoverResources:",d)}if(o.team_id)try{let d=await r(`v1/teams/${o.team_id}/projects`,t.key,{method:"GET"});n.push({id:o.team_id,...d}),d.projects&&i.push(...d.projects)}catch(d){console.warn("Failed to fetch team during discoverResources:",d)}let a={files:s,projects:i,teams:n};return await L(t,"figma.designTools.discoverResources",{...o},"completed"),a},qe=async(t,o)=>{let s={};if(o.include_variables)try{let n=await r(`v1/files/${o.file_key}/variables/local`,t.key,{method:"GET"});n.meta?.variables&&(s.variables=n.meta.variables),n.meta?.variableCollections&&(s.variableCollections=n.meta.variableCollections)}catch(n){console.warn("Failed to fetch variables during extractDesignTokens:",n)}if(o.include_local_styles)try{let n=await r(`v1/files/${o.file_key}/styles`,t.key,{method:"GET"});n.meta?.styles&&(s.styles=n.meta.styles)}catch(n){console.warn("Failed to fetch styles during extractDesignTokens:",n)}if(o.extract_from_nodes)try{let n=await r(`v1/files/${o.file_key}/nodes`,t.key,{method:"GET",query:{ids:o.extract_from_nodes}});n.nodes&&(s.nodes=n.nodes)}catch(n){console.warn("Failed to fetch nodes during extractDesignTokens:",n)}let i={tokens:s};return await L(t,"figma.designTools.extractDesignTokens",{...o},"completed"),i},Ne=async(t,o)=>{let s=[],i=[];try{let a=await r(`v1/files/${o.file_key}`,t.key,{method:"GET",query:{geometry:"paths"}});a.flows&&i.push(...a.flows),a.document&&s.push({source:"document",data:a.document})}catch(a){console.warn("Failed to fetch file document during extractPrototypeInteractions:",a)}let n={interactions:s,flows:i};return await L(t,"figma.designTools.extractPrototypeInteractions",{...o},"completed"),n},$e=async(t,o)=>{let s=o.images.map(a=>a.node_id).join(","),n={images:(await r(`v1/images/${o.file_key}`,t.key,{method:"GET",query:{ids:s,scale:o.scale,svg_include_id:o.svg_include_id,svg_outline_text:o.svg_outline_text,svg_simplify_stroke:o.svg_simplify_stroke}})).images};return await L(t,"figma.designTools.downloadImages",{...o},"completed"),n},Be=async(t,o)=>{let s=Object.entries(o.tokens),i=o.prefix??"",n={},a={},d={},b={},k={};for(let[S,E]of s){let P=i?`${i}-${S}`:S;if(typeof E=="object"&&E!==null&&"type"in E){let J=E,j=J.type,f=J.value;j==="color"&&typeof f=="string"?n[P]=f:j==="spacing"&&typeof f=="string"?a[P]=f:j==="fontSize"&&typeof f=="string"?d[P]=f:j==="fontFamily"&&typeof f=="string"?b[P]=f:j==="borderRadius"&&typeof f=="string"&&(k[P]=f)}}let F=o.config_format??"cjs",B=JSON.stringify({colors:n,spacing:a,fontSize:d,fontFamily:b,borderRadius:k},null,2),W;F==="esm"?W=`export default {
|
|
2
|
+
theme: {
|
|
3
|
+
extend: ${B}
|
|
4
|
+
}
|
|
5
|
+
};
|
|
6
|
+
`:W=`module.exports = {
|
|
7
|
+
theme: {
|
|
8
|
+
extend: ${B}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
`;let O=[":root {"];for(let[S,E]of Object.entries(n))O.push(` --color-${S}: ${E};`);for(let[S,E]of Object.entries(a))O.push(` --spacing-${S}: ${E};`);O.push("}");let bt=O.join(`
|
|
12
|
+
`)+`
|
|
13
|
+
`,Ft={config:W,css:bt};return await L(t,"figma.designTools.designTokensToTailwind",{file_key:"transform"},"completed"),Ft};var R={add:Y,delete:X,list:Q,getReactions:Z,addReaction:ee,deleteReaction:te},G={create:oe,delete:se,get:ne,list:ie,getRequests:ae,update:re},x={create:le,delete:pe,get:me,update:ce},V={createModifyDelete:de,getLocal:ge,getPublished:ye},_={get:ue,getComponentSet:fe,getForFile:be,getComponentSetsForFile:Fe,getForTeam:he,getComponentSetsForTeam:ke},h={getJSON:Ee,getMetadata:ve,getNodes:Re,getStyles:Ge,getImageFills:_e,getVersions:we,renderImages:Se,getProjectFiles:Te},$={get:Ae,getForTeam:Ie},Je={getTeamProjects:De},He={getCurrent:Pe},w={componentActions:je,componentUsages:Le,styleActions:xe,styleUsages:Oe,variableActions:Ue,variableUsages:Me},Ke={list:Ve},Ye={get:We},D={discoverResources:ze,extractDesignTokens:qe,extractPrototypeInteractions:Ne,downloadImages:$e,designTokensToTailwind:Be};import{z as p}from"zod";var Xe=p.object({id:p.string(),uuid:p.string().nullable().optional(),message:p.string().optional(),file_key:p.string().optional(),order_id:p.string().nullable().optional(),parent_id:p.string().nullable().optional(),created_at:p.string().nullable().optional(),resolved_at:p.string().nullable().optional(),createdAt:p.coerce.date().nullable().optional(),user_id:p.string().optional(),user_handle:p.string().optional()}),Qe=p.object({id:p.string(),status:p.enum(["ACTIVE","PAUSED"]).optional(),context:p.enum(["team","project","file"]).nullable().optional(),team_id:p.string().nullable().optional(),endpoint:p.string().optional(),passcode:p.string().optional(),client_id:p.string().nullable().optional(),context_id:p.string().nullable().optional(),event_type:p.string().optional(),description:p.string().nullable().optional(),createdAt:p.coerce.date().nullable().optional()}),Ze=p.object({key:p.string(),file_key:p.string().optional(),node_id:p.string().optional(),name:p.string().optional(),description:p.string().optional(),thumbnail_url:p.string().optional(),created_at:p.string().nullable().optional(),updated_at:p.string().nullable().optional(),createdAt:p.coerce.date().nullable().optional()}),et=p.object({id:p.string(),name:p.string().optional(),role:p.string().optional(),last_modified:p.string().nullable().optional(),editorType:p.string().optional(),thumbnail_url:p.string().nullable().optional(),version:p.string().optional(),createdAt:p.coerce.date().nullable().optional()}),tt=p.object({id:p.string(),file_key:p.string().optional(),label:p.string().nullable().optional(),description:p.string().nullable().optional(),created_at:p.string().nullable().optional(),user_id:p.string().optional(),user_handle:p.string().optional(),createdAt:p.coerce.date().nullable().optional()});var ot={version:"1.0.0",entities:{comments:Xe,webhookConfigs:Qe,components:Ze,fileMetadata:et,versions:tt}};import{logEventFromContext as Vs}from"corsair/core";import{z as l}from"zod";import Ps from"crypto";function st(t){return typeof t=="string"?JSON.parse(t):t}function g(t){return o=>st(o.body).event_type===t}function y(t,o){let i=st(t.payload).passcode;if(!i||typeof i!="string")return{valid:!1,error:"Missing passcode in payload"};try{let n=Ps.timingSafeEqual(Buffer.from(i),Buffer.from(o));return{valid:n,error:n?void 0:"Invalid passcode"}}catch{return{valid:!1,error:"Invalid passcode"}}}var js=l.object({event_type:l.literal("FILE_COMMENT"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string(),file_name:l.string(),comment:l.object({id:l.string(),message:l.string().optional(),created_at:l.string().optional(),user:l.object({id:l.string(),handle:l.string().optional(),img_url:l.string().optional()}).optional()})}),Ls=l.object({event_type:l.literal("FILE_UPDATE"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string(),file_name:l.string()}),xs=l.object({event_type:l.literal("FILE_DELETE"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string(),file_name:l.string()}),Os=l.object({event_type:l.literal("FILE_VERSION_UPDATE"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string(),file_name:l.string(),version_id:l.string(),label:l.string().optional(),description:l.string().optional(),created_components:l.array(l.string()).optional(),modified_components:l.array(l.string()).optional(),created_styles:l.array(l.string()).optional(),modified_styles:l.array(l.string()).optional()}),Us=l.object({event_type:l.literal("LIBRARY_PUBLISH"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string(),file_name:l.string(),description:l.string().optional()}),Ms=l.object({event_type:l.literal("PING"),timestamp:l.string(),webhook_id:l.string(),passcode:l.string().optional(),file_key:l.string().optional()});var nt={match:g("FILE_COMMENT"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;if(n.event_type!=="FILE_COMMENT")return{success:!0,data:void 0};let a="";if(t.db.comments&&n.comment?.id)try{let{user:d,...b}=n.comment;a=(await t.db.comments.upsertByEntityId(n.comment.id,{...b,file_key:n.file_key,user_id:d?.id,user_handle:d?.handle}))?.id||""}catch(d){console.warn("Failed to save comment from webhook to database:",d)}return await Vs(t,"figma.webhook.fileComment",{...n},"completed"),{success:!0,corsairEntityId:a,data:n}}};import{logEventFromContext as Ws}from"corsair/core";var it={match:g("FILE_UPDATE"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;if(n.event_type!=="FILE_UPDATE")return{success:!0,data:void 0};if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(n.file_key,{id:n.file_key,name:n.file_name,last_modified:n.timestamp})}catch(a){console.warn("Failed to save file update event to database:",a)}return await Ws(t,"figma.webhook.fileUpdate",{...n},"completed"),{success:!0,data:n}}};import{logEventFromContext as zs}from"corsair/core";var at={match:g("FILE_DELETE"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;if(n.event_type!=="FILE_DELETE")return{success:!0,data:void 0};if(t.db.fileMetadata)try{let a=await t.db.fileMetadata.findByEntityId(n.file_key);await t.db.fileMetadata.upsertByEntityId(n.file_key,{...a?.data??{},id:n.file_key,name:n.file_name})}catch(a){console.warn("Failed to record file deletion in database:",a)}return await zs(t,"figma.webhook.fileDelete",{...n},"completed"),{success:!0,data:n}}};import{logEventFromContext as qs}from"corsair/core";var rt={match:g("FILE_VERSION_UPDATE"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;if(n.event_type!=="FILE_VERSION_UPDATE")return{success:!0,data:void 0};let a="";if(t.db.versions&&n.version_id)try{a=(await t.db.versions.upsertByEntityId(n.version_id,{id:n.version_id,file_key:n.file_key,label:n.label,description:n.description,created_at:n.timestamp}))?.id||""}catch(d){console.warn("Failed to save version from webhook to database:",d)}if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(n.file_key,{id:n.file_key,name:n.file_name,last_modified:n.timestamp,version:n.version_id})}catch(d){console.warn("Failed to save file metadata from version update to database:",d)}return await qs(t,"figma.webhook.fileVersionUpdate",{...n},"completed"),{success:!0,corsairEntityId:a,data:n}}};import{logEventFromContext as Ns}from"corsair/core";var lt={match:g("LIBRARY_PUBLISH"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;if(n.event_type!=="LIBRARY_PUBLISH")return{success:!0,data:void 0};if(t.db.fileMetadata)try{await t.db.fileMetadata.upsertByEntityId(n.file_key,{id:n.file_key,name:n.file_name,last_modified:n.timestamp})}catch(a){console.warn("Failed to save library publish event to database:",a)}return await Ns(t,"figma.webhook.libraryPublish",{...n},"completed"),{success:!0,data:n}}};import{logEventFromContext as $s}from"corsair/core";var pt={match:g("PING"),handler:async(t,o)=>{let s=t.key,i=y(o,s);if(!i.valid)return{success:!1,statusCode:401,error:i.error||"Passcode verification failed"};let n=o.payload;return n.event_type!=="PING"?{success:!0,data:void 0}:(await $s(t,"figma.webhook.ping",{...n},"completed"),{success:!0,data:n})}};var mt={fileComment:nt},ct={fileUpdate:it},dt={fileDelete:at},gt={fileVersionUpdate:rt},yt={libraryPublish:lt},ut={ping:pt};var ft={RATE_LIMIT_ERROR:{match:(t,o)=>{if(t instanceof u&&t.status===429)return!0;let s=t.message.toLowerCase();return s.includes("rate_limited")||s.includes("ratelimited")||t.message.includes("429")},handler:async(t,o)=>{let s;return t instanceof u&&t.retryAfter!==void 0&&(s=t.retryAfter),{maxRetries:5,headersRetryAfterMs:s}}},AUTH_ERROR:{match:(t,o)=>{if(t instanceof u&&t.status===401)return!0;let s=t.message.toLowerCase();return s.includes("invalid_token")||s.includes("unauthorized")},handler:async(t,o)=>(console.warn(`[FIGMA:${o.operation}] Authentication failed - check your access token`),{maxRetries:0})},PERMISSION_ERROR:{match:(t,o)=>{if(t instanceof u&&t.status===403)return!0;let s=t.message.toLowerCase();return s.includes("forbidden")||s.includes("insufficient_permissions")},handler:async(t,o)=>(console.warn(`[FIGMA:${o.operation}] Permission denied: ${t.message}`),{maxRetries:0})},NOT_FOUND_ERROR:{match:(t,o)=>t instanceof u&&t.status===404?!0:t.message.toLowerCase().includes("not_found"),handler:async(t,o)=>(console.warn(`[FIGMA:${o.operation}] Resource not found: ${t.message}`),{maxRetries:0})},NETWORK_ERROR:{match:(t,o)=>{let s=t.message.toLowerCase();return s.includes("network")||s.includes("connection")||s.includes("econnrefused")||s.includes("enotfound")||s.includes("etimedout")||s.includes("fetch failed")||s.includes("network error")},handler:async(t,o)=>(console.warn(`[FIGMA:${o.operation}] Network error: ${t.message}`),{maxRetries:3})},DEFAULT:{match:(t,o)=>!0,handler:async(t,o)=>(console.error(`[FIGMA:${o.operation}] Unhandled error: ${t.message}`),{maxRetries:0})}};var Bs={comments:{add:R.add,delete:R.delete,list:R.list,getReactions:R.getReactions,addReaction:R.addReaction,deleteReaction:R.deleteReaction},webhooks:{create:G.create,delete:G.delete,get:G.get,list:G.list,getRequests:G.getRequests,update:G.update},devResources:{create:x.create,delete:x.delete,get:x.get,update:x.update},variables:{createModifyDelete:V.createModifyDelete,getLocal:V.getLocal,getPublished:V.getPublished},components:{get:_.get,getComponentSet:_.getComponentSet,getForFile:_.getForFile,getComponentSetsForFile:_.getComponentSetsForFile,getForTeam:_.getForTeam,getComponentSetsForTeam:_.getComponentSetsForTeam},files:{getJSON:h.getJSON,getMetadata:h.getMetadata,getNodes:h.getNodes,getStyles:h.getStyles,getImageFills:h.getImageFills,getVersions:h.getVersions,renderImages:h.renderImages,getProjectFiles:h.getProjectFiles},styles:{get:$.get,getForTeam:$.getForTeam},projects:{getTeamProjects:Je.getTeamProjects},users:{getCurrent:He.getCurrent},libraryAnalytics:{componentActions:w.componentActions,componentUsages:w.componentUsages,styleActions:w.styleActions,styleUsages:w.styleUsages,variableActions:w.variableActions,variableUsages:w.variableUsages},activityLogs:{list:Ke.list},payments:{get:Ye.get},designTools:{discoverResources:D.discoverResources,extractDesignTokens:D.extractDesignTokens,extractPrototypeInteractions:D.extractPrototypeInteractions,downloadImages:D.downloadImages,designTokensToTailwind:D.designTokensToTailwind}},Js={files:{fileComment:mt.fileComment,fileUpdate:ct.fileUpdate,fileDelete:dt.fileDelete,fileVersionUpdate:gt.fileVersionUpdate},library:{libraryPublish:yt.libraryPublish},ping:{ping:ut.ping}},Hs={"comments.add":{input:m.commentsAdd,output:c.commentsAdd},"comments.delete":{input:m.commentsDelete,output:c.commentsDelete},"comments.list":{input:m.commentsList,output:c.commentsList},"comments.getReactions":{input:m.commentsGetReactions,output:c.commentsGetReactions},"comments.addReaction":{input:m.commentsAddReaction,output:c.commentsAddReaction},"comments.deleteReaction":{input:m.commentsDeleteReaction,output:c.commentsDeleteReaction},"webhooks.create":{input:m.webhooksCreate,output:c.webhooksCreate},"webhooks.delete":{input:m.webhooksDelete,output:c.webhooksDelete},"webhooks.get":{input:m.webhooksGet,output:c.webhooksGet},"webhooks.list":{input:m.webhooksList,output:c.webhooksList},"webhooks.getRequests":{input:m.webhooksGetRequests,output:c.webhooksGetRequests},"webhooks.update":{input:m.webhooksUpdate,output:c.webhooksUpdate},"devResources.create":{input:m.devResourcesCreate,output:c.devResourcesCreate},"devResources.delete":{input:m.devResourcesDelete,output:c.devResourcesDelete},"devResources.get":{input:m.devResourcesGet,output:c.devResourcesGet},"devResources.update":{input:m.devResourcesUpdate,output:c.devResourcesUpdate},"variables.createModifyDelete":{input:m.variablesCreateModifyDelete,output:c.variablesCreateModifyDelete},"variables.getLocal":{input:m.variablesGetLocal,output:c.variablesGetLocal},"variables.getPublished":{input:m.variablesGetPublished,output:c.variablesGetPublished},"components.get":{input:m.componentsGet,output:c.componentsGet},"components.getComponentSet":{input:m.componentSetsGet,output:c.componentSetsGet},"components.getForFile":{input:m.componentsGetForFile,output:c.componentsGetForFile},"components.getComponentSetsForFile":{input:m.componentSetsGetForFile,output:c.componentSetsGetForFile},"components.getForTeam":{input:m.componentsGetForTeam,output:c.componentsGetForTeam},"components.getComponentSetsForTeam":{input:m.componentSetsGetForTeam,output:c.componentSetsGetForTeam},"files.getJSON":{input:m.filesGetJSON,output:c.filesGetJSON},"files.getMetadata":{input:m.filesGetMetadata,output:c.filesGetMetadata},"files.getNodes":{input:m.filesGetNodes,output:c.filesGetNodes},"files.getStyles":{input:m.filesGetStyles,output:c.filesGetStyles},"files.getImageFills":{input:m.filesGetImageFills,output:c.filesGetImageFills},"files.getVersions":{input:m.filesGetVersions,output:c.filesGetVersions},"files.renderImages":{input:m.filesRenderImages,output:c.filesRenderImages},"files.getProjectFiles":{input:m.filesGetProjectFiles,output:c.filesGetProjectFiles},"styles.get":{input:m.stylesGet,output:c.stylesGet},"styles.getForTeam":{input:m.stylesGetForTeam,output:c.stylesGetForTeam},"projects.getTeamProjects":{input:m.projectsGetTeamProjects,output:c.projectsGetTeamProjects},"users.getCurrent":{input:m.usersGetCurrent,output:c.usersGetCurrent},"libraryAnalytics.componentActions":{input:m.libraryAnalyticsComponentActions,output:c.libraryAnalyticsComponentActions},"libraryAnalytics.componentUsages":{input:m.libraryAnalyticsComponentUsages,output:c.libraryAnalyticsComponentUsages},"libraryAnalytics.styleActions":{input:m.libraryAnalyticsStyleActions,output:c.libraryAnalyticsStyleActions},"libraryAnalytics.styleUsages":{input:m.libraryAnalyticsStyleUsages,output:c.libraryAnalyticsStyleUsages},"libraryAnalytics.variableActions":{input:m.libraryAnalyticsVariableActions,output:c.libraryAnalyticsVariableActions},"libraryAnalytics.variableUsages":{input:m.libraryAnalyticsVariableUsages,output:c.libraryAnalyticsVariableUsages},"activityLogs.list":{input:m.activityLogsList,output:c.activityLogsList},"payments.get":{input:m.paymentsGet,output:c.paymentsGet},"designTools.discoverResources":{input:m.designToolsDiscoverResources,output:c.designToolsDiscoverResources},"designTools.extractDesignTokens":{input:m.designToolsExtractDesignTokens,output:c.designToolsExtractDesignTokens},"designTools.extractPrototypeInteractions":{input:m.designToolsExtractPrototypeInteractions,output:c.designToolsExtractPrototypeInteractions},"designTools.downloadImages":{input:m.designToolsDownloadImages,output:c.designToolsDownloadImages},"designTools.designTokensToTailwind":{input:m.designToolsDesignTokensToTailwind,output:c.designToolsDesignTokensToTailwind}},Ks="api_key",Ys={"comments.add":{riskLevel:"write",description:"Add a comment to a Figma file"},"comments.delete":{riskLevel:"destructive",description:"Delete a comment from a Figma file [DESTRUCTIVE]"},"comments.list":{riskLevel:"read",description:"List comments on a Figma file"},"comments.getReactions":{riskLevel:"read",description:"Get reactions on a comment"},"comments.addReaction":{riskLevel:"write",description:"Add a reaction to a comment"},"comments.deleteReaction":{riskLevel:"write",description:"Delete a reaction from a comment"},"webhooks.create":{riskLevel:"write",description:"Create a Figma webhook"},"webhooks.delete":{riskLevel:"destructive",description:"Delete a Figma webhook [DESTRUCTIVE]"},"webhooks.get":{riskLevel:"read",description:"Get a Figma webhook by ID"},"webhooks.list":{riskLevel:"read",description:"List Figma webhooks"},"webhooks.getRequests":{riskLevel:"read",description:"Get webhook request history"},"webhooks.update":{riskLevel:"write",description:"Update a Figma webhook"},"devResources.create":{riskLevel:"write",description:"Create dev resources on a Figma file"},"devResources.delete":{riskLevel:"destructive",description:"Delete a dev resource from a Figma file [DESTRUCTIVE]"},"devResources.get":{riskLevel:"read",description:"Get dev resources for a Figma file"},"devResources.update":{riskLevel:"write",description:"Update dev resources on a Figma file"},"variables.createModifyDelete":{riskLevel:"write",description:"Create, modify, or delete variables in a Figma file"},"variables.getLocal":{riskLevel:"read",description:"Get local variables from a Figma file"},"variables.getPublished":{riskLevel:"read",description:"Get published variables from a Figma file"},"components.get":{riskLevel:"read",description:"Get a Figma component by key"},"components.getComponentSet":{riskLevel:"read",description:"Get a Figma component set by key"},"components.getForFile":{riskLevel:"read",description:"Get all components in a Figma file"},"components.getComponentSetsForFile":{riskLevel:"read",description:"Get all component sets in a Figma file"},"components.getForTeam":{riskLevel:"read",description:"Get all components for a Figma team"},"components.getComponentSetsForTeam":{riskLevel:"read",description:"Get all component sets for a Figma team"},"files.getJSON":{riskLevel:"read",description:"Get full Figma file JSON"},"files.getMetadata":{riskLevel:"read",description:"Get Figma file metadata"},"files.getNodes":{riskLevel:"read",description:"Get specific nodes from a Figma file"},"files.getStyles":{riskLevel:"read",description:"Get styles from a Figma file"},"files.getImageFills":{riskLevel:"read",description:"Get image fills from a Figma file"},"files.getVersions":{riskLevel:"read",description:"Get version history of a Figma file"},"files.renderImages":{riskLevel:"read",description:"Render Figma nodes as images"},"files.getProjectFiles":{riskLevel:"read",description:"Get all files in a Figma project"},"styles.get":{riskLevel:"read",description:"Get a Figma style by key"},"styles.getForTeam":{riskLevel:"read",description:"Get all styles for a Figma team"},"projects.getTeamProjects":{riskLevel:"read",description:"Get all projects for a Figma team"},"users.getCurrent":{riskLevel:"read",description:"Get the currently authenticated Figma user"},"libraryAnalytics.componentActions":{riskLevel:"read",description:"Get library component action analytics"},"libraryAnalytics.componentUsages":{riskLevel:"read",description:"Get library component usage analytics"},"libraryAnalytics.styleActions":{riskLevel:"read",description:"Get library style action analytics"},"libraryAnalytics.styleUsages":{riskLevel:"read",description:"Get library style usage analytics"},"libraryAnalytics.variableActions":{riskLevel:"read",description:"Get library variable action analytics"},"libraryAnalytics.variableUsages":{riskLevel:"read",description:"Get library variable usage analytics"},"activityLogs.list":{riskLevel:"read",description:"List Figma organization activity logs"},"payments.get":{riskLevel:"read",description:"Get payment information for a Figma plugin or widget"},"designTools.discoverResources":{riskLevel:"read",description:"Discover Figma files, projects, and teams"},"designTools.extractDesignTokens":{riskLevel:"read",description:"Extract design tokens (variables and styles) from a Figma file"},"designTools.extractPrototypeInteractions":{riskLevel:"read",description:"Extract prototype interactions and flows from a Figma file"},"designTools.downloadImages":{riskLevel:"read",description:"Download rendered images for Figma nodes"},"designTools.designTokensToTailwind":{riskLevel:"read",description:"Convert Figma design tokens to a Tailwind CSS configuration"}};var _i={api_key:{account:["one"]}};function wi(t={}){let o={...t,authType:t.authType??Ks};return{id:"figma",schema:ot,options:o,hooks:o.hooks,webhookHooks:o.webhookHooks,endpoints:Bs,webhooks:Js,endpointMeta:Ys,endpointSchemas:Hs,pluginWebhookMatcher:s=>"x-figma-signature"in s.headers,errorHandlers:{...ft,...o.errorHandlers},keyBuilder:async(s,i)=>{if(i==="webhook"&&o.webhookSecret)return o.webhookSecret;if(i==="webhook"){let n=await s.keys.get_webhook_signature();return n||""}if(i==="endpoint"&&o.key)return o.key;if(i==="endpoint"&&s.authType==="api_key"){let n=await s.keys.get_api_key();return n||""}return""}}}export{g as createFigmaEventMatch,wi as figma,_i as figmaAuthConfig,Hs as figmaEndpointSchemas};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FigmaComment: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
uuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
message: z.ZodOptional<z.ZodString>;
|
|
6
|
+
file_key: z.ZodOptional<z.ZodString>;
|
|
7
|
+
order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
resolved_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
12
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
13
|
+
user_handle: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
id: string;
|
|
16
|
+
created_at?: string | null | undefined;
|
|
17
|
+
message?: string | undefined;
|
|
18
|
+
uuid?: string | null | undefined;
|
|
19
|
+
file_key?: string | undefined;
|
|
20
|
+
order_id?: string | null | undefined;
|
|
21
|
+
parent_id?: string | null | undefined;
|
|
22
|
+
resolved_at?: string | null | undefined;
|
|
23
|
+
user_id?: string | undefined;
|
|
24
|
+
createdAt?: Date | null | undefined;
|
|
25
|
+
user_handle?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
id: string;
|
|
28
|
+
created_at?: string | null | undefined;
|
|
29
|
+
message?: string | undefined;
|
|
30
|
+
uuid?: string | null | undefined;
|
|
31
|
+
file_key?: string | undefined;
|
|
32
|
+
order_id?: string | null | undefined;
|
|
33
|
+
parent_id?: string | null | undefined;
|
|
34
|
+
resolved_at?: string | null | undefined;
|
|
35
|
+
user_id?: string | undefined;
|
|
36
|
+
createdAt?: Date | null | undefined;
|
|
37
|
+
user_handle?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const FigmaWebhookConfig: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
status: z.ZodOptional<z.ZodEnum<["ACTIVE", "PAUSED"]>>;
|
|
42
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodEnum<["team", "project", "file"]>>>;
|
|
43
|
+
team_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
45
|
+
passcode: z.ZodOptional<z.ZodString>;
|
|
46
|
+
client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
context_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
49
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
id: string;
|
|
53
|
+
status?: "ACTIVE" | "PAUSED" | undefined;
|
|
54
|
+
event_type?: string | undefined;
|
|
55
|
+
endpoint?: string | undefined;
|
|
56
|
+
client_id?: string | null | undefined;
|
|
57
|
+
description?: string | null | undefined;
|
|
58
|
+
context?: "team" | "project" | "file" | null | undefined;
|
|
59
|
+
team_id?: string | null | undefined;
|
|
60
|
+
passcode?: string | undefined;
|
|
61
|
+
context_id?: string | null | undefined;
|
|
62
|
+
createdAt?: Date | null | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
id: string;
|
|
65
|
+
status?: "ACTIVE" | "PAUSED" | undefined;
|
|
66
|
+
event_type?: string | undefined;
|
|
67
|
+
endpoint?: string | undefined;
|
|
68
|
+
client_id?: string | null | undefined;
|
|
69
|
+
description?: string | null | undefined;
|
|
70
|
+
context?: "team" | "project" | "file" | null | undefined;
|
|
71
|
+
team_id?: string | null | undefined;
|
|
72
|
+
passcode?: string | undefined;
|
|
73
|
+
context_id?: string | null | undefined;
|
|
74
|
+
createdAt?: Date | null | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const FigmaComponent: z.ZodObject<{
|
|
77
|
+
key: z.ZodString;
|
|
78
|
+
file_key: z.ZodOptional<z.ZodString>;
|
|
79
|
+
node_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
name: z.ZodOptional<z.ZodString>;
|
|
81
|
+
description: z.ZodOptional<z.ZodString>;
|
|
82
|
+
thumbnail_url: z.ZodOptional<z.ZodString>;
|
|
83
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
key: string;
|
|
88
|
+
created_at?: string | null | undefined;
|
|
89
|
+
updated_at?: string | null | undefined;
|
|
90
|
+
name?: string | undefined;
|
|
91
|
+
description?: string | undefined;
|
|
92
|
+
file_key?: string | undefined;
|
|
93
|
+
node_id?: string | undefined;
|
|
94
|
+
thumbnail_url?: string | undefined;
|
|
95
|
+
createdAt?: Date | null | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
key: string;
|
|
98
|
+
created_at?: string | null | undefined;
|
|
99
|
+
updated_at?: string | null | undefined;
|
|
100
|
+
name?: string | undefined;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
file_key?: string | undefined;
|
|
103
|
+
node_id?: string | undefined;
|
|
104
|
+
thumbnail_url?: string | undefined;
|
|
105
|
+
createdAt?: Date | null | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const FigmaFileMetadata: z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
name: z.ZodOptional<z.ZodString>;
|
|
110
|
+
role: z.ZodOptional<z.ZodString>;
|
|
111
|
+
last_modified: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
editorType: z.ZodOptional<z.ZodString>;
|
|
113
|
+
thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
version: z.ZodOptional<z.ZodString>;
|
|
115
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
id: string;
|
|
118
|
+
name?: string | undefined;
|
|
119
|
+
version?: string | undefined;
|
|
120
|
+
thumbnail_url?: string | null | undefined;
|
|
121
|
+
role?: string | undefined;
|
|
122
|
+
editorType?: string | undefined;
|
|
123
|
+
last_modified?: string | null | undefined;
|
|
124
|
+
createdAt?: Date | null | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
id: string;
|
|
127
|
+
name?: string | undefined;
|
|
128
|
+
version?: string | undefined;
|
|
129
|
+
thumbnail_url?: string | null | undefined;
|
|
130
|
+
role?: string | undefined;
|
|
131
|
+
editorType?: string | undefined;
|
|
132
|
+
last_modified?: string | null | undefined;
|
|
133
|
+
createdAt?: Date | null | undefined;
|
|
134
|
+
}>;
|
|
135
|
+
export declare const FigmaVersion: z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
file_key: z.ZodOptional<z.ZodString>;
|
|
138
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
142
|
+
user_handle: z.ZodOptional<z.ZodString>;
|
|
143
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
id: string;
|
|
146
|
+
created_at?: string | null | undefined;
|
|
147
|
+
description?: string | null | undefined;
|
|
148
|
+
file_key?: string | undefined;
|
|
149
|
+
label?: string | null | undefined;
|
|
150
|
+
user_id?: string | undefined;
|
|
151
|
+
createdAt?: Date | null | undefined;
|
|
152
|
+
user_handle?: string | undefined;
|
|
153
|
+
}, {
|
|
154
|
+
id: string;
|
|
155
|
+
created_at?: string | null | undefined;
|
|
156
|
+
description?: string | null | undefined;
|
|
157
|
+
file_key?: string | undefined;
|
|
158
|
+
label?: string | null | undefined;
|
|
159
|
+
user_id?: string | undefined;
|
|
160
|
+
createdAt?: Date | null | undefined;
|
|
161
|
+
user_handle?: string | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
export type FigmaComment = z.infer<typeof FigmaComment>;
|
|
164
|
+
export type FigmaWebhookConfig = z.infer<typeof FigmaWebhookConfig>;
|
|
165
|
+
export type FigmaComponent = z.infer<typeof FigmaComponent>;
|
|
166
|
+
export type FigmaFileMetadata = z.infer<typeof FigmaFileMetadata>;
|
|
167
|
+
export type FigmaVersion = z.infer<typeof FigmaVersion>;
|
|
168
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYvB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
export declare const FigmaSchema: {
|
|
2
|
+
readonly version: "1.0.0";
|
|
3
|
+
readonly entities: {
|
|
4
|
+
readonly comments: import("zod").ZodObject<{
|
|
5
|
+
id: import("zod").ZodString;
|
|
6
|
+
uuid: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
7
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
file_key: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
order_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
10
|
+
parent_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
11
|
+
created_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
12
|
+
resolved_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
13
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
14
|
+
user_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
user_handle: import("zod").ZodOptional<import("zod").ZodString>;
|
|
16
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
17
|
+
id: string;
|
|
18
|
+
created_at?: string | null | undefined;
|
|
19
|
+
message?: string | undefined;
|
|
20
|
+
uuid?: string | null | undefined;
|
|
21
|
+
file_key?: string | undefined;
|
|
22
|
+
order_id?: string | null | undefined;
|
|
23
|
+
parent_id?: string | null | undefined;
|
|
24
|
+
resolved_at?: string | null | undefined;
|
|
25
|
+
user_id?: string | undefined;
|
|
26
|
+
createdAt?: Date | null | undefined;
|
|
27
|
+
user_handle?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
id: string;
|
|
30
|
+
created_at?: string | null | undefined;
|
|
31
|
+
message?: string | undefined;
|
|
32
|
+
uuid?: string | null | undefined;
|
|
33
|
+
file_key?: string | undefined;
|
|
34
|
+
order_id?: string | null | undefined;
|
|
35
|
+
parent_id?: string | null | undefined;
|
|
36
|
+
resolved_at?: string | null | undefined;
|
|
37
|
+
user_id?: string | undefined;
|
|
38
|
+
createdAt?: Date | null | undefined;
|
|
39
|
+
user_handle?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
readonly webhookConfigs: import("zod").ZodObject<{
|
|
42
|
+
id: import("zod").ZodString;
|
|
43
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<["ACTIVE", "PAUSED"]>>;
|
|
44
|
+
context: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodEnum<["team", "project", "file"]>>>;
|
|
45
|
+
team_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
46
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
passcode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
client_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
49
|
+
context_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
50
|
+
event_type: import("zod").ZodOptional<import("zod").ZodString>;
|
|
51
|
+
description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
52
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
53
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
54
|
+
id: string;
|
|
55
|
+
status?: "ACTIVE" | "PAUSED" | undefined;
|
|
56
|
+
event_type?: string | undefined;
|
|
57
|
+
endpoint?: string | undefined;
|
|
58
|
+
client_id?: string | null | undefined;
|
|
59
|
+
description?: string | null | undefined;
|
|
60
|
+
context?: "team" | "project" | "file" | null | undefined;
|
|
61
|
+
team_id?: string | null | undefined;
|
|
62
|
+
passcode?: string | undefined;
|
|
63
|
+
context_id?: string | null | undefined;
|
|
64
|
+
createdAt?: Date | null | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
id: string;
|
|
67
|
+
status?: "ACTIVE" | "PAUSED" | undefined;
|
|
68
|
+
event_type?: string | undefined;
|
|
69
|
+
endpoint?: string | undefined;
|
|
70
|
+
client_id?: string | null | undefined;
|
|
71
|
+
description?: string | null | undefined;
|
|
72
|
+
context?: "team" | "project" | "file" | null | undefined;
|
|
73
|
+
team_id?: string | null | undefined;
|
|
74
|
+
passcode?: string | undefined;
|
|
75
|
+
context_id?: string | null | undefined;
|
|
76
|
+
createdAt?: Date | null | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
readonly components: import("zod").ZodObject<{
|
|
79
|
+
key: import("zod").ZodString;
|
|
80
|
+
file_key: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
node_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
82
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
83
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
thumbnail_url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
85
|
+
created_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
86
|
+
updated_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
87
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
88
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
89
|
+
key: string;
|
|
90
|
+
created_at?: string | null | undefined;
|
|
91
|
+
updated_at?: string | null | undefined;
|
|
92
|
+
name?: string | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
file_key?: string | undefined;
|
|
95
|
+
node_id?: string | undefined;
|
|
96
|
+
thumbnail_url?: string | undefined;
|
|
97
|
+
createdAt?: Date | null | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
key: string;
|
|
100
|
+
created_at?: string | null | undefined;
|
|
101
|
+
updated_at?: string | null | undefined;
|
|
102
|
+
name?: string | undefined;
|
|
103
|
+
description?: string | undefined;
|
|
104
|
+
file_key?: string | undefined;
|
|
105
|
+
node_id?: string | undefined;
|
|
106
|
+
thumbnail_url?: string | undefined;
|
|
107
|
+
createdAt?: Date | null | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
readonly fileMetadata: import("zod").ZodObject<{
|
|
110
|
+
id: import("zod").ZodString;
|
|
111
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
role: import("zod").ZodOptional<import("zod").ZodString>;
|
|
113
|
+
last_modified: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
114
|
+
editorType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
115
|
+
thumbnail_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
116
|
+
version: import("zod").ZodOptional<import("zod").ZodString>;
|
|
117
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
118
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
119
|
+
id: string;
|
|
120
|
+
name?: string | undefined;
|
|
121
|
+
version?: string | undefined;
|
|
122
|
+
thumbnail_url?: string | null | undefined;
|
|
123
|
+
role?: string | undefined;
|
|
124
|
+
editorType?: string | undefined;
|
|
125
|
+
last_modified?: string | null | undefined;
|
|
126
|
+
createdAt?: Date | null | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
id: string;
|
|
129
|
+
name?: string | undefined;
|
|
130
|
+
version?: string | undefined;
|
|
131
|
+
thumbnail_url?: string | null | undefined;
|
|
132
|
+
role?: string | undefined;
|
|
133
|
+
editorType?: string | undefined;
|
|
134
|
+
last_modified?: string | null | undefined;
|
|
135
|
+
createdAt?: Date | null | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
readonly versions: import("zod").ZodObject<{
|
|
138
|
+
id: import("zod").ZodString;
|
|
139
|
+
file_key: import("zod").ZodOptional<import("zod").ZodString>;
|
|
140
|
+
label: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
141
|
+
description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
142
|
+
created_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
143
|
+
user_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
144
|
+
user_handle: import("zod").ZodOptional<import("zod").ZodString>;
|
|
145
|
+
createdAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
146
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
147
|
+
id: string;
|
|
148
|
+
created_at?: string | null | undefined;
|
|
149
|
+
description?: string | null | undefined;
|
|
150
|
+
file_key?: string | undefined;
|
|
151
|
+
label?: string | null | undefined;
|
|
152
|
+
user_id?: string | undefined;
|
|
153
|
+
createdAt?: Date | null | undefined;
|
|
154
|
+
user_handle?: string | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
id: string;
|
|
157
|
+
created_at?: string | null | undefined;
|
|
158
|
+
description?: string | null | undefined;
|
|
159
|
+
file_key?: string | undefined;
|
|
160
|
+
label?: string | null | undefined;
|
|
161
|
+
user_id?: string | undefined;
|
|
162
|
+
createdAt?: Date | null | undefined;
|
|
163
|
+
user_handle?: string | undefined;
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASd,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=tsup.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBAYG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../webhooks/example.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAOxC,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,MAAM,CA4BzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileComment.d.ts","sourceRoot":"","sources":["../../webhooks/fileComment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGxC,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,aAAa,CAqDpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileDelete.d.ts","sourceRoot":"","sources":["../../webhooks/fileDelete.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGxC,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAgDlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileUpdate.d.ts","sourceRoot":"","sources":["../../webhooks/fileUpdate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGxC,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CA+ClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileVersionUpdate.d.ts","sourceRoot":"","sources":["../../webhooks/fileVersionUpdate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGxC,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,mBAAmB,CAkEhE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const FileCommentWebhooks: {
|
|
2
|
+
fileComment: {
|
|
3
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
4
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaFileCommentEvent, import("./types").FigmaFileCommentEvent>;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const FileUpdateWebhooks: {
|
|
8
|
+
fileUpdate: {
|
|
9
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
10
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaFileUpdateEvent, import("./types").FigmaFileUpdateEvent>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const FileDeleteWebhooks: {
|
|
14
|
+
fileDelete: {
|
|
15
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
16
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaFileDeleteEvent, import("./types").FigmaFileDeleteEvent>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const FileVersionUpdateWebhooks: {
|
|
20
|
+
fileVersionUpdate: {
|
|
21
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
22
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaFileVersionUpdateEvent, import("./types").FigmaFileVersionUpdateEvent>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const LibraryPublishWebhooks: {
|
|
26
|
+
libraryPublish: {
|
|
27
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
28
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaLibraryPublishEvent, import("./types").FigmaLibraryPublishEvent>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const PingWebhooks: {
|
|
32
|
+
ping: {
|
|
33
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
34
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").FigmaContext, import("./types").FigmaPingEvent, import("./types").FigmaPingEvent>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export * from './types';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../webhooks/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;CAE/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;CAE9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;CAE9B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;CAErC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;CAElC,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;CAExB,CAAC;AAEF,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libraryPublish.d.ts","sourceRoot":"","sources":["../../webhooks/libraryPublish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGxC,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,gBAAgB,CA+C1D,CAAC"}
|