@stacksjs/orm 0.75.89 → 0.75.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/models/CardAttachment.ts +103 -0
- package/dist/models/FeedbackToken.ts +129 -0
- package/package.json +23 -23
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export declare const Board: ReturnType<typeof lazyModel<typeof import('./models/
|
|
|
66
66
|
export declare const BoardColumn: ReturnType<typeof lazyModel<typeof import('./models/BoardColumn').default>>;
|
|
67
67
|
export declare const Campaign: ReturnType<typeof lazyModel<typeof import('./models/Campaign').default>>;
|
|
68
68
|
export declare const Card: ReturnType<typeof lazyModel<typeof import('./models/Card').default>>;
|
|
69
|
+
export declare const CardAttachment: ReturnType<typeof lazyModel<typeof import('./models/CardAttachment').default>>;
|
|
69
70
|
export declare const CardComment: ReturnType<typeof lazyModel<typeof import('./models/CardComment').default>>;
|
|
70
71
|
export declare const Cart: ReturnType<typeof lazyModel<typeof import('./models/commerce/Cart').default>>;
|
|
71
72
|
export declare const CartItem: ReturnType<typeof lazyModel<typeof import('./models/commerce/CartItem').default>>;
|
|
@@ -76,6 +77,7 @@ export declare const Customer: ReturnType<typeof lazyModel<typeof import('./mode
|
|
|
76
77
|
export declare const DeliveryRoute: ReturnType<typeof lazyModel<typeof import('./models/commerce/DeliveryRoute').default>>;
|
|
77
78
|
export declare const DeliveryStop: ReturnType<typeof lazyModel<typeof import('./models/commerce/DeliveryStop').default>>;
|
|
78
79
|
export declare const Deployment: ReturnType<typeof lazyModel<typeof import('./models/Deployment').default>>;
|
|
80
|
+
export declare const FeedbackToken: ReturnType<typeof lazyModel<typeof import('./models/FeedbackToken').default>>;
|
|
79
81
|
export declare const DigitalDelivery: ReturnType<typeof lazyModel<typeof import('./models/commerce/DigitalDelivery').default>>;
|
|
80
82
|
export declare const Courier: ReturnType<typeof lazyModel<typeof import('./models/commerce/Courier').default>>;
|
|
81
83
|
export declare const CourierPing: ReturnType<typeof lazyModel<typeof import('./models/commerce/CourierPing').default>>;
|
package/dist/index.js
CHANGED
|
@@ -24,4 +24,4 @@ export {}
|
|
|
24
24
|
`),p=`${qn(l)}${d}
|
|
25
25
|
${Gn(l)}`;if(!e.dryRun){let m=A.dirname(o);if(!ne.existsSync(m))ne.mkdirSync(m,{recursive:!0});ne.writeFileSync(o,p,"utf-8"),_a.success(`[generate:db-types] wrote ${u.length} table(s) to ${o}`)}return{outFile:o,tables:u,errors:a,content:p}}function Ga(e,n="app"){let t=[...e].sort((r,o)=>r.table.localeCompare(o.table)).map((r)=>Ln(r.table,r.columns,n==="framework"?1:2)).join(`
|
|
26
26
|
`);return`${qn(n)}${t}
|
|
27
|
-
${Gn(n)}`}import{isCursorPaginator as _l,isPaginator as Al,isSimplePaginator as Pl,toCursorPaginator as xl,toPaginator as Cl,toSimplePaginator as Ml}from"@stacksjs/pagination";import{configureOrm as Ua}from"@stacksjs/query-builder";function Ka(){try{let e=process.env.DB_DATABASE_PATH||"database/stacks.sqlite";if((process.env.DB_CONNECTION||"sqlite")==="sqlite")Ua({database:e})}catch{}}Ka();async function Kn(e){for(let n=0;;n++){let t=await import(e);try{return t.default}catch(r){if(n<5&&r instanceof ReferenceError&&/before initialization/.test(r.message)){await new Promise((o)=>setTimeout(o,0));continue}throw r}}}async function Ae(e,n=[""]){let{path:t}=await import("@stacksjs/path"),r=t.userModelsPath(`${e}.ts`);try{if(await Bun.file(r).exists())return await Kn(r)}catch(o){console.error(`[orm] Failed to import userland model ${e} from ${r} - falling back to framework default. Reason:`,o)}for(let o of n){let a=o?`${o}/`:"",i=t.frameworkPath(`defaults/app/Models/${a}${e}.ts`);try{if(await Bun.file(i).exists())return await Kn(i)}catch(s){console.error(`[orm] Failed to import framework default model ${e} from ${i} - trying next subdir. Reason:`,s)}}return null}var j={},Wn=()=>{},zc=new Promise((e)=>{Wn=e});function y(e){return new Proxy(function(){},{get(n,t){if(t==="then")return;let r=j[e];if(r==null)return;let o=r[t];return typeof o==="function"?o.bind(r):o},set(n,t,r){let o=j[e];if(o==null)return!1;return o[t]=r,!0},has(n,t){let r=j[e];return r==null?!1:(t in r)},apply(n,t,r){let o=j[e];if(o==null||typeof o!=="function")return;return o.apply(t,r)}})}var Wa=y("User"),Va=y("Job"),Qa=y("FailedJob"),za=[["Referral",[""],"auth"],["ReferralCode",[""],"auth"],["Team",[""],"auth"],["TeamInvitation",[""],"auth"],["TeamMember",[""],"auth"],["SocialAccount",[""],"auth"],["Subscriber",[""],"auth"],["SubscriberEmail",[""],"auth"],["Subscription",[""],"auth"],["Categorizable",["Content"],"cms"],["Post",["Content"],"cms"],["Page",["Content"],"cms"],["PageRevision",["Content"],"cms"],["Redirect",["Content"],"cms"],["Menu",["Content"],"cms"],["MenuItem",["Content"],"cms"],["Author",["Content"],"cms"],["Comment",[""],"cms"],["Tag",[""],"cms"],["Site",[""],"auth"],["SiteDomain",[""],"auth"],["MagicLinkToken",[""],"auth"],["SmsOptOut",[""],"auth"],["GdprRequest",[""],"auth"],["Form",["Forms"],"forms"],["FormField",["Forms"],"forms"],["FormSubmission",["Forms"],"forms"],["Activity",[""],"dashboard"],["Board",[""],"dashboard"],["BoardColumn",[""],"dashboard"],["Card",[""],"dashboard"],["CardComment",[""],"dashboard"],["Deployment",[""],"dashboard"],["Label",[""],"dashboard"],["Release",[""],"dashboard"],["Notification",[""],"dashboard"],["NotificationDelivery",[""],"dashboard"],["PersonalAccessToken",[""],"dashboard"],["MailPreference",[""],"dashboard"],["Log",[""],"dashboard"],["Request",[""],"dashboard"],["AnalyticsEvent",[""],"dashboard"],["QueryLog",[""],"dashboard"],["StorageItem",[""],"dashboard"],["StorageItemTask",[""],"dashboard"],["Error",[""],"monitoring"],["Websocket",["realtime"],"realtime"],["Campaign",[""],"marketing"],["CampaignSend",[""],"marketing"],["EmailList",[""],"marketing"],["EmailListSubscriber",[""],"marketing"],["EmailIdempotency",[""],"marketing"],["EmailSuppression",[""],"marketing"],["EmailWebhookEvent",[""],"marketing"],["SocialPost",[""],"marketing"],["Automation",[""],"marketing"],["AutomationRun",[""],"marketing"],["CampaignVariant",[""],"marketing"],["CommunicationSuppression",[""],"marketing"],["ConsentEvent",[""],"marketing"],["SenderDomain",[""],"marketing"],["UsageEvent",[""],"marketing"],["PaymentMethod",[""],"commerce"],["PaymentProduct",[""],"commerce"],["PaymentTransaction",[""],"commerce"],["Order",["commerce"],"commerce"],["OrderIdempotency",["commerce"],"commerce"],["OrderItem",["commerce"],"commerce"],["Cart",["commerce"],"commerce"],["CartItem",["commerce"],"commerce"],["Customer",["commerce"],"commerce"],["Product",["commerce"],"commerce"],["ProductVariant",["commerce"],"commerce"],["ProductUnit",["commerce"],"commerce"],["Manufacturer",["commerce"],"commerce"],["Category",["commerce"],"commerce"],["Coupon",["commerce"],"commerce"],["GiftCard",["commerce"],"commerce"],["LicenseKey",["commerce"],"commerce"],["Review",["commerce"],"commerce"],["Receipt",["commerce"],"commerce"],["PrintDevice",["commerce"],"commerce"],["ShippingMethod",["commerce"],"commerce"],["ShippingRate",["commerce"],"commerce"],["ShippingZone",["commerce"],"commerce"],["DeliveryRoute",["commerce"],"commerce"],["DeliveryStop",["commerce"],"commerce"],["DigitalDelivery",["commerce"],"commerce"],["Courier",["commerce"],"commerce"],["CourierPing",["commerce"],"commerce"],["TaxRate",["commerce"],"commerce"],["WaitlistProduct",["commerce"],"commerce"],["WaitlistRestaurant",["commerce"],"commerce"],["Auction",["commerce"],"commerce"],["AuctionItem",["commerce"],"commerce"],["Bid",["commerce"],"commerce"],["Pledge",["commerce"],"commerce"],["LoyaltyPoint",["commerce"],"commerce"],["LoyaltyReward",["commerce"],"commerce"],["Payment",["commerce"],"commerce"],["PaymentWebhookEvent",["commerce"],"commerce"],["Transaction",["commerce"],"commerce"]];queueMicrotask(async()=>{try{let{feature:e}=await import("@stacksjs/config"),n=await Ae("User");if(n)j.User=n;if(e("queue")){let t=await Ae("Job");if(t)j.Job=t;let r=await Ae("FailedJob");if(r)j.FailedJob=r}for(let[t,r,o]of za){if(!e(o))continue;let a=await Ae(t,r);if(a)j[t]=a}}catch(e){console.error("[orm] deferred model load failed:",e)}finally{Wn()}});var Ha=y("Activity"),Ja=y("AnalyticsEvent"),Ya=y("Automation"),Xa=y("AutomationRun"),Za=y("Auction"),ei=y("CampaignVariant"),ti=y("CommunicationSuppression"),ni=y("ConsentEvent"),ri=y("SenderDomain"),oi=y("UsageEvent"),ai=y("AuctionItem"),ii=y("Author"),si=y("Bid"),ui=y("Board"),ci=y("BoardColumn"),li=y("Campaign"),di=y("Card"),fi=y("CardComment"),pi=y("Cart"),mi=y("CartItem"),gi=y("Category"),yi=y("Comment"),wi=y("Coupon"),bi=y("Customer"),hi=y("DeliveryRoute"),ki=y("DeliveryStop"),Ti=y("Deployment"),Ri=y("DigitalDelivery"),Si=y("Courier"),_i=y("CourierPing"),Ai=y("CampaignSend"),Pi=y("EmailList"),xi=y("EmailListSubscriber"),Ci=y("Form"),Mi=y("FormField"),vi=y("FormSubmission"),Oi=y("MagicLinkToken"),Di=y("Menu"),Ei=y("MenuItem"),ji=y("PageRevision"),Fi=y("Pledge"),$i=y("Redirect"),Ii=y("Site"),Bi=y("SiteDomain"),Ni=y("SmsOptOut"),Li=y("GdprRequest"),Hc=y("StorageItem"),Jc=y("StorageItemTask"),qi=y("EmailIdempotency"),Gi=y("EmailSuppression"),Ui=y("EmailWebhookEvent"),Ki=y("Error"),Wi=y("GiftCard"),Vi=y("Label"),Qi=y("LicenseKey"),zi=y("Log"),Hi=y("LoyaltyPoint"),Ji=y("LoyaltyReward"),Yi=y("MailPreference"),Xi=y("Manufacturer"),Zi=y("Notification"),es=y("NotificationDelivery"),ts=y("Order"),ns=y("OrderIdempotency"),Yc=y("PersonalAccessToken"),rs=y("OrderItem"),os=y("Page"),as=y("Payment"),is=y("PaymentWebhookEvent"),ss=y("PaymentMethod"),us=y("PaymentProduct"),cs=y("PaymentTransaction"),ls=y("Post"),ds=y("Categorizable"),fs=y("PrintDevice"),ps=y("Product"),ms=y("ProductUnit"),gs=y("ProductVariant"),ys=y("QueryLog"),ws=y("Receipt"),Xc=y("Referral"),Zc=y("ReferralCode"),bs=y("Release"),hs=y("Request"),ks=y("Review"),Ts=y("ShippingMethod"),Rs=y("ShippingRate"),Ss=y("ShippingZone"),_s=y("SocialPost"),As=y("SocialAccount"),Ps=y("Subscriber"),xs=y("SubscriberEmail"),Cs=y("Subscription"),Ms=y("Tag"),vs=y("TaxRate"),Os=y("Team"),Ds=y("TeamInvitation"),Es=y("TeamMember"),js=y("Transaction"),Fs=y("WaitlistProduct"),$s=y("WaitlistRestaurant"),Is=y("Websocket"),Vn={User:Wa,Job:Va,FailedJob:Qa,Activity:Ha,AnalyticsEvent:Ja,Automation:Ya,AutomationRun:Xa,Auction:Za,AuctionItem:ai,Author:ii,Bid:si,Board:ui,BoardColumn:ci,Campaign:li,CampaignSend:Ai,CampaignVariant:ei,Card:di,CardComment:fi,Cart:pi,CartItem:mi,Categorizable:ds,Category:gi,Comment:yi,Coupon:wi,Customer:bi,CommunicationSuppression:ti,ConsentEvent:ni,DeliveryRoute:hi,DeliveryStop:ki,Deployment:Ti,DigitalDelivery:Ri,Courier:Si,CourierPing:_i,EmailList:Pi,EmailListSubscriber:xi,EmailIdempotency:qi,EmailSuppression:Gi,EmailWebhookEvent:Ui,ErrorModel:Ki,Form:Ci,FormField:Mi,FormSubmission:vi,GdprRequest:Li,GiftCard:Wi,Label:Vi,LicenseKey:Qi,Log:zi,LoyaltyPoint:Hi,LoyaltyReward:Ji,MailPreference:Yi,Manufacturer:Xi,Notification:Zi,MagicLinkToken:Oi,Menu:Di,MenuItem:Ei,NotificationDelivery:es,Order:ts,OrderIdempotency:ns,OrderItem:rs,Page:os,PageRevision:ji,Payment:as,PaymentMethod:ss,PaymentProduct:us,PaymentTransaction:cs,PaymentWebhookEvent:is,Pledge:Fi,Post:ls,PrintDevice:fs,Product:ps,ProductUnit:ms,ProductVariant:gs,QueryLog:ys,Receipt:ws,Release:bs,Request:hs,Review:ks,ShippingMethod:Ts,Redirect:$i,SenderDomain:ri,ShippingRate:Rs,ShippingZone:Ss,Site:Ii,SiteDomain:Bi,SmsOptOut:Ni,SocialAccount:As,SocialPost:_s,Subscriber:Ps,SubscriberEmail:xs,Subscription:Cs,Tag:Ms,TaxRate:vs,Team:Os,TeamInvitation:Ds,TeamMember:Es,Transaction:js,UsageEvent:oi,WaitlistProduct:Fs,WaitlistRestaurant:$s,Websocket:Is},K=globalThis;for(let[e,n]of Object.entries(Vn))if(n&&K[e]===void 0)K[e]=n;var el=Object.keys(Vn);async function Bs(e){if(!e)return[];try{if(typeof e.all==="function"){let n=await e.all();return Array.isArray(n)?n:[]}if(typeof e.get==="function"){let n=await e.get();return Array.isArray(n)?n:[]}}catch{}return[]}function Ns(e,n,t=""){if(!e)return t;try{if(typeof e.get==="function"){let o=e.get(n);if(o!==void 0&&o!==null)return o}}catch{}let r=e?.[n];return r!==void 0&&r!==null?r:t}if(K.safeAll===void 0)K.safeAll=Bs;if(K.safeGet===void 0)K.safeGet=Ns;export{Ha as Activity,Ja as AnalyticsEvent,Za as Auction,ai as AuctionItem,ii as Author,Ya as Automation,Xa as AutomationRun,le as BILLABLE_INSTANCE_METHODS,si as Bid,ui as Board,ci as BoardColumn,li as Campaign,Ai as CampaignSend,ei as CampaignVariant,di as Card,fi as CardComment,pi as Cart,mi as CartItem,ds as Categorizable,gi as Category,yi as Comment,ti as CommunicationSuppression,ni as ConsentEvent,wi as Coupon,Si as Courier,_i as CourierPing,bi as Customer,hi as DeliveryRoute,ki as DeliveryStop,Ti as Deployment,Ri as DigitalDelivery,qi as EmailIdempotency,Pi as EmailList,xi as EmailListSubscriber,Gi as EmailSuppression,Ui as EmailWebhookEvent,Ki as ErrorModel,Qa as FailedJob,Ci as Form,Mi as FormField,vi as FormSubmission,me as GDPR_AUDIT_TABLE,D as GDPR_SUBJECT_MODEL,Ke as GdprDeclarationError,Li as GdprRequest,ge as GdprSubjectNotFoundError,Wi as GiftCard,Va as Job,Vi as Label,Qi as LicenseKey,zi as Log,Hi as LoyaltyPoint,Ji as LoyaltyReward,ft as MODEL_DEFINITION,Oi as MagicLinkToken,Yi as MailPreference,Xi as Manufacturer,lt as MassAssignmentException,Di as Menu,Ei as MenuItem,En as ModelNotFoundError,Mn as ModelValidationError,Zi as Notification,es as NotificationDelivery,ts as Order,ns as OrderIdempotency,rs as OrderItem,os as Page,ji as PageRevision,as as Payment,ss as PaymentMethod,us as PaymentProduct,cs as PaymentTransaction,is as PaymentWebhookEvent,Yc as PersonalAccessToken,Fi as Pledge,ls as Post,fs as PrintDevice,ps as Product,ms as ProductUnit,gs as ProductVariant,ys as QueryLog,ws as Receipt,$i as Redirect,Xc as Referral,Zc as ReferralCode,bs as Release,hs as Request,ks as Review,ri as SenderDomain,Ts as ShippingMethod,Rs as ShippingRate,Ss as ShippingZone,Ii as Site,Bi as SiteDomain,Ni as SmsOptOut,As as SocialAccount,_s as SocialPost,Hc as StorageItem,Jc as StorageItemTask,Kr as SubqueryBuilder,Ps as Subscriber,xs as SubscriberEmail,Cs as Subscription,Be as SubscriptionNotOwnedError,Ms as Tag,vs as TaxRate,Os as Team,Ds as TeamInvitation,Es as TeamMember,js as Transaction,oi as UsageEvent,Wa as User,Fs as WaitlistProduct,$s as WaitlistRestaurant,Is as Websocket,pe as assertGdprPlan,Mu as batchLoad,qa as buildDatabaseSchema,bo as buildProcessingRegister,ve as collectEncryptedAttributes,Tt as createAuditMethods,$e as createCategorizableMethods,Ee as createCommentableMethods,Ie as createLikeableMethods,Fe as createTaggableMethods,$r as customerOwnership,Eu as db,Me as decryptValue,$n as defineModel,Ce as encryptValue,ot as enrichPaginatorUrls,mo as eraseSubject,fo as exportSubjectData,Fc as extendModel,Tr as filterFillable,we as gdprTableExists,qt as gdprTableName,Ks as getPrunableConfig,kr as getWritableFields,yr as isBillable,_l as isCursorPaginator,V as isEncrypted,Al as isPaginator,Pl as isSimplePaginator,jr as isUniqueViolation,We as loadGdprModels,br as mapWriteError,Us as massPrunable,ga as mergeModelDefinition,el as modelGlobalNames,zc as ormReady,Lr as parentOwnership,en as parseCursor,dt as projectDocumentsFromTrait,zn as prunable,yo as pruneRetainedData,Ga as renderDatabaseTypeFile,ho as renderProcessingRegister,rt as resolveCursorArgs,fe as resolveGdprPlan,so as resolveGdprSubject,nt as resolvePageArgs,$u as savepoint,Ir as selfOwnership,nr as setAuditUser,Br as siteOwnership,Nr as teamMembershipOwnership,ca as toAttrs,xl as toCursorPaginator,Cl as toPaginator,Ml as toSimplePaginator,hr as toSnakeCaseKeys,Ue as transaction,Iu as transactional,I as withoutEvents,Bo as withoutValidation};
|
|
27
|
+
${Gn(n)}`}import{isCursorPaginator as Pl,isPaginator as xl,isSimplePaginator as Cl,toCursorPaginator as Ml,toPaginator as vl,toSimplePaginator as Ol}from"@stacksjs/pagination";import{configureOrm as Ua}from"@stacksjs/query-builder";function Ka(){try{let e=process.env.DB_DATABASE_PATH||"database/stacks.sqlite";if((process.env.DB_CONNECTION||"sqlite")==="sqlite")Ua({database:e})}catch{}}Ka();async function Kn(e){for(let n=0;;n++){let t=await import(e);try{return t.default}catch(r){if(n<5&&r instanceof ReferenceError&&/before initialization/.test(r.message)){await new Promise((o)=>setTimeout(o,0));continue}throw r}}}async function Ae(e,n=[""]){let{path:t}=await import("@stacksjs/path"),r=t.userModelsPath(`${e}.ts`);try{if(await Bun.file(r).exists())return await Kn(r)}catch(o){console.error(`[orm] Failed to import userland model ${e} from ${r} - falling back to framework default. Reason:`,o)}for(let o of n){let a=o?`${o}/`:"",i=t.frameworkPath(`defaults/app/Models/${a}${e}.ts`);try{if(await Bun.file(i).exists())return await Kn(i)}catch(s){console.error(`[orm] Failed to import framework default model ${e} from ${i} - trying next subdir. Reason:`,s)}}return null}var j={},Wn=()=>{},zc=new Promise((e)=>{Wn=e});function y(e){return new Proxy(function(){},{get(n,t){if(t==="then")return;let r=j[e];if(r==null)return;let o=r[t];return typeof o==="function"?o.bind(r):o},set(n,t,r){let o=j[e];if(o==null)return!1;return o[t]=r,!0},has(n,t){let r=j[e];return r==null?!1:(t in r)},apply(n,t,r){let o=j[e];if(o==null||typeof o!=="function")return;return o.apply(t,r)}})}var Wa=y("User"),Va=y("Job"),Qa=y("FailedJob"),za=[["Referral",[""],"auth"],["ReferralCode",[""],"auth"],["Team",[""],"auth"],["TeamInvitation",[""],"auth"],["TeamMember",[""],"auth"],["SocialAccount",[""],"auth"],["Subscriber",[""],"auth"],["SubscriberEmail",[""],"auth"],["Subscription",[""],"auth"],["Categorizable",["Content"],"cms"],["Post",["Content"],"cms"],["Page",["Content"],"cms"],["PageRevision",["Content"],"cms"],["Redirect",["Content"],"cms"],["Menu",["Content"],"cms"],["MenuItem",["Content"],"cms"],["Author",["Content"],"cms"],["Comment",[""],"cms"],["Tag",[""],"cms"],["Site",[""],"auth"],["SiteDomain",[""],"auth"],["MagicLinkToken",[""],"auth"],["SmsOptOut",[""],"auth"],["GdprRequest",[""],"auth"],["Form",["Forms"],"forms"],["FormField",["Forms"],"forms"],["FormSubmission",["Forms"],"forms"],["Activity",[""],"dashboard"],["Board",[""],"dashboard"],["BoardColumn",[""],"dashboard"],["Card",[""],"dashboard"],["CardAttachment",[""],"dashboard"],["CardComment",[""],"dashboard"],["Deployment",[""],"dashboard"],["FeedbackToken",[""],"dashboard"],["Label",[""],"dashboard"],["Release",[""],"dashboard"],["Notification",[""],"dashboard"],["NotificationDelivery",[""],"dashboard"],["PersonalAccessToken",[""],"dashboard"],["MailPreference",[""],"dashboard"],["Log",[""],"dashboard"],["Request",[""],"dashboard"],["AnalyticsEvent",[""],"dashboard"],["QueryLog",[""],"dashboard"],["StorageItem",[""],"dashboard"],["StorageItemTask",[""],"dashboard"],["Error",[""],"monitoring"],["Websocket",["realtime"],"realtime"],["Campaign",[""],"marketing"],["CampaignSend",[""],"marketing"],["EmailList",[""],"marketing"],["EmailListSubscriber",[""],"marketing"],["EmailIdempotency",[""],"marketing"],["EmailSuppression",[""],"marketing"],["EmailWebhookEvent",[""],"marketing"],["SocialPost",[""],"marketing"],["Automation",[""],"marketing"],["AutomationRun",[""],"marketing"],["CampaignVariant",[""],"marketing"],["CommunicationSuppression",[""],"marketing"],["ConsentEvent",[""],"marketing"],["SenderDomain",[""],"marketing"],["UsageEvent",[""],"marketing"],["PaymentMethod",[""],"commerce"],["PaymentProduct",[""],"commerce"],["PaymentTransaction",[""],"commerce"],["Order",["commerce"],"commerce"],["OrderIdempotency",["commerce"],"commerce"],["OrderItem",["commerce"],"commerce"],["Cart",["commerce"],"commerce"],["CartItem",["commerce"],"commerce"],["Customer",["commerce"],"commerce"],["Product",["commerce"],"commerce"],["ProductVariant",["commerce"],"commerce"],["ProductUnit",["commerce"],"commerce"],["Manufacturer",["commerce"],"commerce"],["Category",["commerce"],"commerce"],["Coupon",["commerce"],"commerce"],["GiftCard",["commerce"],"commerce"],["LicenseKey",["commerce"],"commerce"],["Review",["commerce"],"commerce"],["Receipt",["commerce"],"commerce"],["PrintDevice",["commerce"],"commerce"],["ShippingMethod",["commerce"],"commerce"],["ShippingRate",["commerce"],"commerce"],["ShippingZone",["commerce"],"commerce"],["DeliveryRoute",["commerce"],"commerce"],["DeliveryStop",["commerce"],"commerce"],["DigitalDelivery",["commerce"],"commerce"],["Courier",["commerce"],"commerce"],["CourierPing",["commerce"],"commerce"],["TaxRate",["commerce"],"commerce"],["WaitlistProduct",["commerce"],"commerce"],["WaitlistRestaurant",["commerce"],"commerce"],["Auction",["commerce"],"commerce"],["AuctionItem",["commerce"],"commerce"],["Bid",["commerce"],"commerce"],["Pledge",["commerce"],"commerce"],["LoyaltyPoint",["commerce"],"commerce"],["LoyaltyReward",["commerce"],"commerce"],["Payment",["commerce"],"commerce"],["PaymentWebhookEvent",["commerce"],"commerce"],["Transaction",["commerce"],"commerce"]];queueMicrotask(async()=>{try{let{feature:e}=await import("@stacksjs/config"),n=await Ae("User");if(n)j.User=n;if(e("queue")){let t=await Ae("Job");if(t)j.Job=t;let r=await Ae("FailedJob");if(r)j.FailedJob=r}for(let[t,r,o]of za){if(!e(o))continue;let a=await Ae(t,r);if(a)j[t]=a}}catch(e){console.error("[orm] deferred model load failed:",e)}finally{Wn()}});var Ha=y("Activity"),Ja=y("AnalyticsEvent"),Ya=y("Automation"),Xa=y("AutomationRun"),Za=y("Auction"),ei=y("CampaignVariant"),ti=y("CommunicationSuppression"),ni=y("ConsentEvent"),ri=y("SenderDomain"),oi=y("UsageEvent"),ai=y("AuctionItem"),ii=y("Author"),si=y("Bid"),ui=y("Board"),ci=y("BoardColumn"),li=y("Campaign"),di=y("Card"),Hc=y("CardAttachment"),fi=y("CardComment"),pi=y("Cart"),mi=y("CartItem"),gi=y("Category"),yi=y("Comment"),wi=y("Coupon"),bi=y("Customer"),hi=y("DeliveryRoute"),ki=y("DeliveryStop"),Ti=y("Deployment"),Jc=y("FeedbackToken"),Ri=y("DigitalDelivery"),Si=y("Courier"),_i=y("CourierPing"),Ai=y("CampaignSend"),Pi=y("EmailList"),xi=y("EmailListSubscriber"),Ci=y("Form"),Mi=y("FormField"),vi=y("FormSubmission"),Oi=y("MagicLinkToken"),Di=y("Menu"),Ei=y("MenuItem"),ji=y("PageRevision"),Fi=y("Pledge"),$i=y("Redirect"),Ii=y("Site"),Bi=y("SiteDomain"),Ni=y("SmsOptOut"),Li=y("GdprRequest"),Yc=y("StorageItem"),Xc=y("StorageItemTask"),qi=y("EmailIdempotency"),Gi=y("EmailSuppression"),Ui=y("EmailWebhookEvent"),Ki=y("Error"),Wi=y("GiftCard"),Vi=y("Label"),Qi=y("LicenseKey"),zi=y("Log"),Hi=y("LoyaltyPoint"),Ji=y("LoyaltyReward"),Yi=y("MailPreference"),Xi=y("Manufacturer"),Zi=y("Notification"),es=y("NotificationDelivery"),ts=y("Order"),ns=y("OrderIdempotency"),Zc=y("PersonalAccessToken"),rs=y("OrderItem"),os=y("Page"),as=y("Payment"),is=y("PaymentWebhookEvent"),ss=y("PaymentMethod"),us=y("PaymentProduct"),cs=y("PaymentTransaction"),ls=y("Post"),ds=y("Categorizable"),fs=y("PrintDevice"),ps=y("Product"),ms=y("ProductUnit"),gs=y("ProductVariant"),ys=y("QueryLog"),ws=y("Receipt"),el=y("Referral"),tl=y("ReferralCode"),bs=y("Release"),hs=y("Request"),ks=y("Review"),Ts=y("ShippingMethod"),Rs=y("ShippingRate"),Ss=y("ShippingZone"),_s=y("SocialPost"),As=y("SocialAccount"),Ps=y("Subscriber"),xs=y("SubscriberEmail"),Cs=y("Subscription"),Ms=y("Tag"),vs=y("TaxRate"),Os=y("Team"),Ds=y("TeamInvitation"),Es=y("TeamMember"),js=y("Transaction"),Fs=y("WaitlistProduct"),$s=y("WaitlistRestaurant"),Is=y("Websocket"),Vn={User:Wa,Job:Va,FailedJob:Qa,Activity:Ha,AnalyticsEvent:Ja,Automation:Ya,AutomationRun:Xa,Auction:Za,AuctionItem:ai,Author:ii,Bid:si,Board:ui,BoardColumn:ci,Campaign:li,CampaignSend:Ai,CampaignVariant:ei,Card:di,CardComment:fi,Cart:pi,CartItem:mi,Categorizable:ds,Category:gi,Comment:yi,Coupon:wi,Customer:bi,CommunicationSuppression:ti,ConsentEvent:ni,DeliveryRoute:hi,DeliveryStop:ki,Deployment:Ti,DigitalDelivery:Ri,Courier:Si,CourierPing:_i,EmailList:Pi,EmailListSubscriber:xi,EmailIdempotency:qi,EmailSuppression:Gi,EmailWebhookEvent:Ui,ErrorModel:Ki,Form:Ci,FormField:Mi,FormSubmission:vi,GdprRequest:Li,GiftCard:Wi,Label:Vi,LicenseKey:Qi,Log:zi,LoyaltyPoint:Hi,LoyaltyReward:Ji,MailPreference:Yi,Manufacturer:Xi,Notification:Zi,MagicLinkToken:Oi,Menu:Di,MenuItem:Ei,NotificationDelivery:es,Order:ts,OrderIdempotency:ns,OrderItem:rs,Page:os,PageRevision:ji,Payment:as,PaymentMethod:ss,PaymentProduct:us,PaymentTransaction:cs,PaymentWebhookEvent:is,Pledge:Fi,Post:ls,PrintDevice:fs,Product:ps,ProductUnit:ms,ProductVariant:gs,QueryLog:ys,Receipt:ws,Release:bs,Request:hs,Review:ks,ShippingMethod:Ts,Redirect:$i,SenderDomain:ri,ShippingRate:Rs,ShippingZone:Ss,Site:Ii,SiteDomain:Bi,SmsOptOut:Ni,SocialAccount:As,SocialPost:_s,Subscriber:Ps,SubscriberEmail:xs,Subscription:Cs,Tag:Ms,TaxRate:vs,Team:Os,TeamInvitation:Ds,TeamMember:Es,Transaction:js,UsageEvent:oi,WaitlistProduct:Fs,WaitlistRestaurant:$s,Websocket:Is},K=globalThis;for(let[e,n]of Object.entries(Vn))if(n&&K[e]===void 0)K[e]=n;var nl=Object.keys(Vn);async function Bs(e){if(!e)return[];try{if(typeof e.all==="function"){let n=await e.all();return Array.isArray(n)?n:[]}if(typeof e.get==="function"){let n=await e.get();return Array.isArray(n)?n:[]}}catch{}return[]}function Ns(e,n,t=""){if(!e)return t;try{if(typeof e.get==="function"){let o=e.get(n);if(o!==void 0&&o!==null)return o}}catch{}let r=e?.[n];return r!==void 0&&r!==null?r:t}if(K.safeAll===void 0)K.safeAll=Bs;if(K.safeGet===void 0)K.safeGet=Ns;export{Ha as Activity,Ja as AnalyticsEvent,Za as Auction,ai as AuctionItem,ii as Author,Ya as Automation,Xa as AutomationRun,le as BILLABLE_INSTANCE_METHODS,si as Bid,ui as Board,ci as BoardColumn,li as Campaign,Ai as CampaignSend,ei as CampaignVariant,di as Card,Hc as CardAttachment,fi as CardComment,pi as Cart,mi as CartItem,ds as Categorizable,gi as Category,yi as Comment,ti as CommunicationSuppression,ni as ConsentEvent,wi as Coupon,Si as Courier,_i as CourierPing,bi as Customer,hi as DeliveryRoute,ki as DeliveryStop,Ti as Deployment,Ri as DigitalDelivery,qi as EmailIdempotency,Pi as EmailList,xi as EmailListSubscriber,Gi as EmailSuppression,Ui as EmailWebhookEvent,Ki as ErrorModel,Qa as FailedJob,Jc as FeedbackToken,Ci as Form,Mi as FormField,vi as FormSubmission,me as GDPR_AUDIT_TABLE,D as GDPR_SUBJECT_MODEL,Ke as GdprDeclarationError,Li as GdprRequest,ge as GdprSubjectNotFoundError,Wi as GiftCard,Va as Job,Vi as Label,Qi as LicenseKey,zi as Log,Hi as LoyaltyPoint,Ji as LoyaltyReward,ft as MODEL_DEFINITION,Oi as MagicLinkToken,Yi as MailPreference,Xi as Manufacturer,lt as MassAssignmentException,Di as Menu,Ei as MenuItem,En as ModelNotFoundError,Mn as ModelValidationError,Zi as Notification,es as NotificationDelivery,ts as Order,ns as OrderIdempotency,rs as OrderItem,os as Page,ji as PageRevision,as as Payment,ss as PaymentMethod,us as PaymentProduct,cs as PaymentTransaction,is as PaymentWebhookEvent,Zc as PersonalAccessToken,Fi as Pledge,ls as Post,fs as PrintDevice,ps as Product,ms as ProductUnit,gs as ProductVariant,ys as QueryLog,ws as Receipt,$i as Redirect,el as Referral,tl as ReferralCode,bs as Release,hs as Request,ks as Review,ri as SenderDomain,Ts as ShippingMethod,Rs as ShippingRate,Ss as ShippingZone,Ii as Site,Bi as SiteDomain,Ni as SmsOptOut,As as SocialAccount,_s as SocialPost,Yc as StorageItem,Xc as StorageItemTask,Kr as SubqueryBuilder,Ps as Subscriber,xs as SubscriberEmail,Cs as Subscription,Be as SubscriptionNotOwnedError,Ms as Tag,vs as TaxRate,Os as Team,Ds as TeamInvitation,Es as TeamMember,js as Transaction,oi as UsageEvent,Wa as User,Fs as WaitlistProduct,$s as WaitlistRestaurant,Is as Websocket,pe as assertGdprPlan,Mu as batchLoad,qa as buildDatabaseSchema,bo as buildProcessingRegister,ve as collectEncryptedAttributes,Tt as createAuditMethods,$e as createCategorizableMethods,Ee as createCommentableMethods,Ie as createLikeableMethods,Fe as createTaggableMethods,$r as customerOwnership,Eu as db,Me as decryptValue,$n as defineModel,Ce as encryptValue,ot as enrichPaginatorUrls,mo as eraseSubject,fo as exportSubjectData,Fc as extendModel,Tr as filterFillable,we as gdprTableExists,qt as gdprTableName,Ks as getPrunableConfig,kr as getWritableFields,yr as isBillable,Pl as isCursorPaginator,V as isEncrypted,xl as isPaginator,Cl as isSimplePaginator,jr as isUniqueViolation,We as loadGdprModels,br as mapWriteError,Us as massPrunable,ga as mergeModelDefinition,nl as modelGlobalNames,zc as ormReady,Lr as parentOwnership,en as parseCursor,dt as projectDocumentsFromTrait,zn as prunable,yo as pruneRetainedData,Ga as renderDatabaseTypeFile,ho as renderProcessingRegister,rt as resolveCursorArgs,fe as resolveGdprPlan,so as resolveGdprSubject,nt as resolvePageArgs,$u as savepoint,Ir as selfOwnership,nr as setAuditUser,Br as siteOwnership,Nr as teamMembershipOwnership,ca as toAttrs,Ml as toCursorPaginator,vl as toPaginator,Ol as toSimplePaginator,hr as toSnakeCaseKeys,Ue as transaction,Iu as transactional,I as withoutEvents,Bo as withoutValidation};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineModel } from '@stacksjs/orm'
|
|
2
|
+
import { schema } from '@stacksjs/validation/runtime'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A file attached to a card. Today that means one screenshot on a card filed
|
|
6
|
+
* through a feedback link (stacksjs/stacks#2872).
|
|
7
|
+
*
|
|
8
|
+
* The bytes live on a disk and this row is the only thing that knows they
|
|
9
|
+
* belong to a card: a disk knows a path and some bytes, not which card a
|
|
10
|
+
* screenshot illustrates. Same division as `StorageItem`, for the same
|
|
11
|
+
* reason, and deliberately a separate table from it - `storage_items` is
|
|
12
|
+
* advisory metadata keyed by `(disk, path)` for the file manager, while this
|
|
13
|
+
* is a card's own content and is authoritative about what is attached to
|
|
14
|
+
* what.
|
|
15
|
+
*
|
|
16
|
+
* ## The disk is chosen here, not by the uploader
|
|
17
|
+
*
|
|
18
|
+
* `disk` is recorded rather than assumed so a row written while an app used
|
|
19
|
+
* local storage still resolves after it moves to S3. It is written by the
|
|
20
|
+
* action from configuration; nothing a submitter sends reaches it, and
|
|
21
|
+
* neither does any part of `path`, which is generated. See
|
|
22
|
+
* `feedback-attachment.ts`, which holds the rules.
|
|
23
|
+
*
|
|
24
|
+
* A feedback attachment is written to a PRIVATE disk. An unauthenticated
|
|
25
|
+
* stranger's upload landing under `public/` would be world-readable at a
|
|
26
|
+
* path the dashboard also prints.
|
|
27
|
+
*
|
|
28
|
+
* ## Erasure removes the row, not yet the bytes
|
|
29
|
+
*
|
|
30
|
+
* The `gdpr` trait deletes this row, and a screenshot is likely to contain
|
|
31
|
+
* personal data - it is a picture of somebody's screen. Deleting the row
|
|
32
|
+
* leaves the file behind, because nothing here sweeps a disk. Stated rather
|
|
33
|
+
* than implied, and tracked separately: a half-done erasure that looks done
|
|
34
|
+
* is worse than one that says what it did.
|
|
35
|
+
*
|
|
36
|
+
* No `useApi`. These rows are written by the feedback intake action and read
|
|
37
|
+
* by the dashboard's own board actions; a REST surface over them would
|
|
38
|
+
* publish a list of every uploaded file.
|
|
39
|
+
*/
|
|
40
|
+
export default defineModel({
|
|
41
|
+
name: 'CardAttachment',
|
|
42
|
+
table: 'card_attachments',
|
|
43
|
+
primaryKey: 'id',
|
|
44
|
+
autoIncrement: true,
|
|
45
|
+
|
|
46
|
+
traits: {
|
|
47
|
+
gdpr: { erasure: 'delete', basis: 'legitimate_interests', purpose: 'A screenshot attached to a card, usually illustrating a bug report' },
|
|
48
|
+
useTimestamps: true,
|
|
49
|
+
useUuid: true,
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
// Cascade: an attachment to a card that no longer exists is a file nothing
|
|
53
|
+
// can reach and a row nothing can render. Declared, and not relied on -
|
|
54
|
+
// SQLite enforces it only with `foreign_keys = ON`, which the framework
|
|
55
|
+
// sets while renaming and not otherwise.
|
|
56
|
+
belongsTo: [{ model: 'Card', onDelete: 'cascade' }],
|
|
57
|
+
|
|
58
|
+
attributes: {
|
|
59
|
+
/** Which configured disk holds the bytes, e.g. `local`. */
|
|
60
|
+
disk: {
|
|
61
|
+
required: true,
|
|
62
|
+
order: 1,
|
|
63
|
+
fillable: true,
|
|
64
|
+
validation: { rule: schema.string().max(40) },
|
|
65
|
+
factory: () => 'local',
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The path on that disk. Unique, so the same bytes cannot be claimed by
|
|
70
|
+
* two cards, and generated in full by `feedbackAttachmentPath`.
|
|
71
|
+
*/
|
|
72
|
+
path: {
|
|
73
|
+
required: true,
|
|
74
|
+
order: 2,
|
|
75
|
+
fillable: true,
|
|
76
|
+
unique: true,
|
|
77
|
+
validation: { rule: schema.string().max(400) },
|
|
78
|
+
factory: faker => `feedback/1/${faker.string.uuid()}.png`,
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* What the bytes actually are, read from the file's own leading bytes
|
|
83
|
+
* rather than from the declared content type, which an uploader writes.
|
|
84
|
+
* The dashboard serves the file as this.
|
|
85
|
+
*/
|
|
86
|
+
mimeType: {
|
|
87
|
+
required: true,
|
|
88
|
+
order: 3,
|
|
89
|
+
fillable: true,
|
|
90
|
+
validation: { rule: schema.string().max(80) },
|
|
91
|
+
factory: () => 'image/png',
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
/** Size as stored, so a listing does not have to stat every file. */
|
|
95
|
+
sizeBytes: {
|
|
96
|
+
required: true,
|
|
97
|
+
order: 4,
|
|
98
|
+
fillable: true,
|
|
99
|
+
validation: { rule: schema.number().min(0) },
|
|
100
|
+
factory: faker => faker.number.int({ min: 1000, max: 500_000 }),
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
} as const)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineModel } from '@stacksjs/orm'
|
|
2
|
+
import { schema } from '@stacksjs/validation/runtime'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A revocable capability to add one card to one board, and nothing else.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately NOT a personal access token. `tokenCan()` and the `abilities`
|
|
8
|
+
* middleware are opt-in per route, and the dashboard's own actions authorize
|
|
9
|
+
* by calling `request.user()` rather than by checking scopes, so a
|
|
10
|
+
* user-owned bearer token authenticates as its owner across the whole
|
|
11
|
+
* dashboard API. Handing an external reviewer one of those to file feedback
|
|
12
|
+
* with would hand them an account (stacksjs/stacks#2872).
|
|
13
|
+
*
|
|
14
|
+
* This is a capability instead: the auth stack does not know it, so it can
|
|
15
|
+
* authenticate nothing. It names a board, it is checked only by the feedback
|
|
16
|
+
* intake action, and it never resolves to a user.
|
|
17
|
+
*
|
|
18
|
+
* `token` stores the SHA-256 of the raw value - deterministic, so a submit is
|
|
19
|
+
* one indexed lookup, and with 256 bits of entropy in the raw token an
|
|
20
|
+
* offline attack on a fast hash is irrelevant. Same reasoning as
|
|
21
|
+
* `MagicLinkToken`, and deliberately not the bcrypt-and-scan of password
|
|
22
|
+
* resets.
|
|
23
|
+
*
|
|
24
|
+
* No `useApi`: these rows are minted by a command and read by the intake
|
|
25
|
+
* action. Exposing them over REST would publish the thing they protect.
|
|
26
|
+
*/
|
|
27
|
+
export default defineModel({
|
|
28
|
+
name: 'FeedbackToken',
|
|
29
|
+
table: 'feedback_tokens',
|
|
30
|
+
primaryKey: 'id',
|
|
31
|
+
autoIncrement: true,
|
|
32
|
+
|
|
33
|
+
traits: {
|
|
34
|
+
gdpr: { erasure: 'delete', basis: 'legitimate_interests', purpose: 'Invites an external reviewer to file feedback on one board' },
|
|
35
|
+
useTimestamps: true,
|
|
36
|
+
useUuid: true,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// Cascade, so deleting a board takes its links with it: a token that
|
|
40
|
+
// outlives the board it names would be admitted carrying a board id that no
|
|
41
|
+
// longer resolves.
|
|
42
|
+
//
|
|
43
|
+
// Declared, not relied on. SQLite enforces this only with
|
|
44
|
+
// `foreign_keys = ON`, which the framework sets while renaming and not
|
|
45
|
+
// otherwise - `fk-audit.ts` exists because of exactly that. Verified with
|
|
46
|
+
// the pragma on (the row goes) and off (it stays), so the intake action
|
|
47
|
+
// checks the board resolves rather than trusting the constraint to have
|
|
48
|
+
// removed the token.
|
|
49
|
+
belongsTo: [{ model: 'Board', onDelete: 'cascade' }],
|
|
50
|
+
|
|
51
|
+
attributes: {
|
|
52
|
+
/** SHA-256 hex of the raw token. Never the raw value. */
|
|
53
|
+
token: {
|
|
54
|
+
required: true,
|
|
55
|
+
order: 1,
|
|
56
|
+
fillable: true,
|
|
57
|
+
unique: true,
|
|
58
|
+
validation: {
|
|
59
|
+
rule: schema.string().min(64).max(64),
|
|
60
|
+
},
|
|
61
|
+
factory: faker => faker.string.hexadecimal({ length: 64, prefix: '' }).toLowerCase(),
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Who it was issued to, so an operator can tell two links apart and
|
|
66
|
+
* revoke the right one. Shown in `buddy feedback:tokens`, never sent to
|
|
67
|
+
* the submitter and never used to authenticate.
|
|
68
|
+
*/
|
|
69
|
+
label: {
|
|
70
|
+
personal: true,
|
|
71
|
+
required: true,
|
|
72
|
+
order: 2,
|
|
73
|
+
fillable: true,
|
|
74
|
+
validation: {
|
|
75
|
+
rule: schema.string().max(120),
|
|
76
|
+
},
|
|
77
|
+
factory: faker => faker.person.firstName(),
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Revocation, which is the whole point of the design: flipping this stops
|
|
82
|
+
* the link without a deploy. Nullable rather than a boolean so the
|
|
83
|
+
* operator can also see *when* it was pulled.
|
|
84
|
+
*/
|
|
85
|
+
revokedAt: {
|
|
86
|
+
required: false,
|
|
87
|
+
order: 3,
|
|
88
|
+
fillable: true,
|
|
89
|
+
validation: {
|
|
90
|
+
rule: schema.timestamp(),
|
|
91
|
+
},
|
|
92
|
+
factory: () => null,
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/** Unset means it does not expire on its own; revocation still applies. */
|
|
96
|
+
expiresAt: {
|
|
97
|
+
required: false,
|
|
98
|
+
order: 4,
|
|
99
|
+
fillable: true,
|
|
100
|
+
validation: {
|
|
101
|
+
rule: schema.timestamp(),
|
|
102
|
+
},
|
|
103
|
+
factory: () => null,
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Last accepted submission. Lets an operator retire a link nobody uses,
|
|
108
|
+
* and tells them whether a leaked token has been exercised.
|
|
109
|
+
*/
|
|
110
|
+
lastUsedAt: {
|
|
111
|
+
required: false,
|
|
112
|
+
order: 5,
|
|
113
|
+
fillable: true,
|
|
114
|
+
validation: {
|
|
115
|
+
rule: schema.timestamp(),
|
|
116
|
+
},
|
|
117
|
+
factory: () => null,
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
/** The user who minted it. Set server-side, surfaced in the listing. */
|
|
121
|
+
createdByUserId: {
|
|
122
|
+
required: false,
|
|
123
|
+
order: 6,
|
|
124
|
+
fillable: true,
|
|
125
|
+
validation: { rule: schema.number() },
|
|
126
|
+
factory: () => null,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
} as const)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/orm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.91",
|
|
6
6
|
"description": "The Stacks ORM integration",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -63,31 +63,31 @@
|
|
|
63
63
|
"prepublishOnly": "bun run build"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@stacksjs/cache": "0.75.
|
|
67
|
-
"@stacksjs/cli": "0.75.
|
|
68
|
-
"@stacksjs/config": "0.75.
|
|
69
|
-
"@stacksjs/database": "0.75.
|
|
70
|
-
"@stacksjs/env": "0.75.
|
|
71
|
-
"@stacksjs/error-handling": "0.75.
|
|
72
|
-
"@stacksjs/events": "0.75.
|
|
73
|
-
"@stacksjs/logging": "0.75.
|
|
74
|
-
"@stacksjs/model-meta": "0.75.
|
|
75
|
-
"@stacksjs/pagination": "0.75.
|
|
76
|
-
"@stacksjs/path": "0.75.
|
|
77
|
-
"@stacksjs/query-builder": "0.75.
|
|
78
|
-
"@stacksjs/realtime": "0.75.
|
|
79
|
-
"@stacksjs/router": "0.75.
|
|
80
|
-
"@stacksjs/storage": "0.75.
|
|
81
|
-
"@stacksjs/strings": "0.75.
|
|
66
|
+
"@stacksjs/cache": "0.75.91",
|
|
67
|
+
"@stacksjs/cli": "0.75.91",
|
|
68
|
+
"@stacksjs/config": "0.75.91",
|
|
69
|
+
"@stacksjs/database": "0.75.91",
|
|
70
|
+
"@stacksjs/env": "0.75.91",
|
|
71
|
+
"@stacksjs/error-handling": "0.75.91",
|
|
72
|
+
"@stacksjs/events": "0.75.91",
|
|
73
|
+
"@stacksjs/logging": "0.75.91",
|
|
74
|
+
"@stacksjs/model-meta": "0.75.91",
|
|
75
|
+
"@stacksjs/pagination": "0.75.91",
|
|
76
|
+
"@stacksjs/path": "0.75.91",
|
|
77
|
+
"@stacksjs/query-builder": "0.75.91",
|
|
78
|
+
"@stacksjs/realtime": "0.75.91",
|
|
79
|
+
"@stacksjs/router": "0.75.91",
|
|
80
|
+
"@stacksjs/storage": "0.75.91",
|
|
81
|
+
"@stacksjs/strings": "0.75.91",
|
|
82
82
|
"@stacksjs/ts-validation": "^0.5.6",
|
|
83
|
-
"@stacksjs/validation": "0.75.
|
|
83
|
+
"@stacksjs/validation": "0.75.91",
|
|
84
84
|
"bun-query-builder": "^0.3.5"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@stacksjs/auth": "0.75.
|
|
88
|
-
"@stacksjs/payments": "0.75.
|
|
89
|
-
"@stacksjs/queue": "0.75.
|
|
90
|
-
"@stacksjs/search-engine": "0.75.
|
|
87
|
+
"@stacksjs/auth": "0.75.91",
|
|
88
|
+
"@stacksjs/payments": "0.75.91",
|
|
89
|
+
"@stacksjs/queue": "0.75.91",
|
|
90
|
+
"@stacksjs/search-engine": "0.75.91",
|
|
91
91
|
"stripe": "23.0.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@stacksjs/types": "0.75.
|
|
111
|
+
"@stacksjs/types": "0.75.91",
|
|
112
112
|
"better-dx": "^0.2.24",
|
|
113
113
|
"stripe": "23.0.0"
|
|
114
114
|
}
|