@rizom/brain 0.2.0-alpha.234 → 0.2.0-alpha.236
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/brain.js +1276 -1273
- package/dist/chunks/blog-post-adapter-vt71whj1.js +5 -0
- package/dist/chunks/{index-23zvavvg.js → index-51pqwxdb.js} +3 -3
- package/dist/chunks/{index-23zvavvg.js.map → index-51pqwxdb.js.map} +1 -1
- package/dist/chunks/{index-k1dcptsq.js → index-72d2a6vf.js} +3 -3
- package/dist/chunks/{index-k1dcptsq.js.map → index-72d2a6vf.js.map} +1 -1
- package/dist/chunks/{index-5ecgasa8.js → index-8ej1r6tb.js} +3 -3
- package/dist/chunks/{index-5ecgasa8.js.map → index-8ej1r6tb.js.map} +1 -1
- package/dist/chunks/{index-twtkr2fy.js → index-8hmmeype.js} +4 -4
- package/dist/chunks/{index-twtkr2fy.js.map → index-8hmmeype.js.map} +1 -1
- package/dist/chunks/{index-nqjbkf5n.js → index-a3n899ev.js} +3 -3
- package/dist/chunks/{index-nqjbkf5n.js.map → index-a3n899ev.js.map} +1 -1
- package/dist/chunks/{index-6tjqzkys.js → index-aatpaped.js} +4 -4
- package/dist/chunks/{index-6tjqzkys.js.map → index-aatpaped.js.map} +1 -1
- package/dist/chunks/index-atsf9t9d.js +6 -0
- package/dist/chunks/{index-q0dkt6nc.js.map → index-atsf9t9d.js.map} +5 -4
- package/dist/chunks/{index-zx3c2cws.js → index-b6k44k1d.js} +3 -3
- package/dist/chunks/{index-zx3c2cws.js.map → index-b6k44k1d.js.map} +3 -3
- package/dist/chunks/{index-vtwspye3.js → index-fxc39qy2.js} +3 -3
- package/dist/chunks/{index-vtwspye3.js.map → index-fxc39qy2.js.map} +1 -1
- package/dist/chunks/{index-srk70x0g.js → index-kga4gmhq.js} +3 -3
- package/dist/chunks/{index-srk70x0g.js.map → index-kga4gmhq.js.map} +1 -1
- package/dist/chunks/{index-57d1xga4.js → index-q5r12b3s.js} +4 -4
- package/dist/chunks/{index-57d1xga4.js.map → index-q5r12b3s.js.map} +1 -1
- package/dist/chunks/index-zc6br876.js +10 -0
- package/dist/chunks/{index-9djq51zg.js.map → index-zc6br876.js.map} +8 -8
- package/dist/chunks/{rss-datasource-gj506d71.js → rss-datasource-9j87n822.js} +3 -3
- package/dist/chunks/{rss-datasource-gj506d71.js.map → rss-datasource-9j87n822.js.map} +1 -1
- package/dist/deploy.js +1 -1
- package/dist/entities.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.js +2 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/migrations/auth-service/0009_wild_namor.sql +44 -0
- package/dist/migrations/auth-service/0010_mixed_red_skull.sql +23 -0
- package/dist/migrations/auth-service/meta/0009_snapshot.json +1824 -0
- package/dist/migrations/auth-service/meta/0010_snapshot.json +1820 -0
- package/dist/migrations/auth-service/meta/_journal.json +14 -0
- package/dist/plugins.d.ts +48 -3
- package/dist/plugins.js +3 -3
- package/dist/plugins.js.map +4 -4
- package/dist/services.js +1 -1
- package/dist/site.js +224 -224
- package/dist/site.js.map +7 -5
- package/dist/templates.js +2 -2
- package/dist/templates.js.map +1 -1
- package/dist/themes.js +1 -1
- package/dist/ui/admin-app.js +102 -102
- package/dist/ui/admin-app.js.map +10 -10
- package/package.json +1 -1
- package/dist/chunks/blog-post-adapter-bgre78xn.js +0 -5
- package/dist/chunks/index-9djq51zg.js +0 -10
- package/dist/chunks/index-q0dkt6nc.js +0 -6
- /package/dist/chunks/{blog-post-adapter-bgre78xn.js.map → blog-post-adapter-vt71whj1.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{c as K}from"./index-d5r8p459.js";import{h as J}from"./index-
|
|
2
|
+
import{c as K}from"./index-d5r8p459.js";import{h as J}from"./index-atsf9t9d.js";import"./index-zc6br876.js";import"./index-kga4gmhq.js";import{W as I}from"./index-72d2a6vf.js";import"./index-8hmmeype.js";import"./index-aatpaped.js";import"./index-8ej1r6tb.js";import"./index-b6k44k1d.js";import{_a as j}from"./index-q5r12b3s.js";import"./index-fxc39qy2.js";var V=j.object({siteUrl:j.url(),title:j.string(),description:j.string(),language:j.string().optional(),copyright:j.string().optional()});class Y{logger;id="blog:rss";name="Blog RSS Feed DataSource";description="Generates RSS 2.0 feed XML from published blog posts";constructor(D){this.logger=D,this.logger.debug("RSSDataSource initialized")}async fetch(D,N,O){let v=V.parse(D),E=(await O.entityService.listEntities({entityType:"post",options:{limit:1000}})).filter((A)=>A.metadata.status==="published"&&A.metadata.publishedAt).map((A)=>{let H=I(A.content,J);return{...A,frontmatter:H.metadata,body:H.content}});this.logger.debug(`Generating RSS feed with ${E.length} posts`);let T={title:v.title,description:v.description,link:v.siteUrl,language:v.language??"en-us",...v.copyright&&{copyright:v.copyright}},U={xml:K(E,T)};return N.parse(U)}}export{Y as RSSDataSource};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=rss-datasource-
|
|
4
|
+
//# debugId=8940998F1D361B1264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=rss-datasource-9j87n822.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type {\n BaseDataSourceContext,\n DataSource,\n DataSourceSchema,\n} from \"@brains/plugins\";\nimport type { Logger } from \"@brains/utils/logger\";\nimport { z } from \"@brains/utils/zod\";\nimport type { BlogPost } from \"../schemas/blog-post\";\nimport { parseMarkdownWithFrontmatter } from \"@brains/plugins\";\nimport { blogPostFrontmatterSchema } from \"../schemas/blog-post\";\nimport type { BlogPostWithData } from \"./blog-datasource\";\nimport { generateRSSFeed, type RSSFeedConfig } from \"../rss/feed-generator\";\n\n/**\n * RSS feed query schema\n */\nconst rssFeedQuerySchema = z.object({\n siteUrl: z.url(),\n title: z.string(),\n description: z.string(),\n language: z.string().optional(),\n copyright: z.string().optional(),\n});\n\ntype RSSFeedQuery = z.output<typeof rssFeedQuerySchema>;\n\n/**\n * DataSource for generating RSS feed from blog posts\n */\nexport class RSSDataSource implements DataSource {\n private readonly logger: Logger;\n public readonly id = \"blog:rss\";\n public readonly name = \"Blog RSS Feed DataSource\";\n public readonly description =\n \"Generates RSS 2.0 feed XML from published blog posts\";\n\n constructor(logger: Logger) {\n this.logger = logger;\n this.logger.debug(\"RSSDataSource initialized\");\n }\n\n /**\n * Fetch and generate RSS feed XML\n * @param context - Optional context (environment, etc.)\n */\n async fetch<T>(\n query: unknown,\n outputSchema: DataSourceSchema<T>,\n context: BaseDataSourceContext,\n ): Promise<T> {\n // Parse query parameters\n const params: RSSFeedQuery = rssFeedQuerySchema.parse(query);\n // Use context.entityService for automatic publishedOnly filtering\n const entityService = context.entityService;\n\n // Fetch all published posts\n const allPosts: BlogPost[] = await entityService.listEntities({\n entityType: \"post\",\n options: {\n limit: 1000,\n },\n });\n\n // Filter only published posts and parse frontmatter\n const publishedPosts: BlogPostWithData[] = allPosts\n .filter(\n (p) => p.metadata.status === \"published\" && p.metadata.publishedAt,\n )\n .map((entity) => {\n const parsed = parseMarkdownWithFrontmatter(\n entity.content,\n blogPostFrontmatterSchema,\n );\n return {\n ...entity,\n frontmatter: parsed.metadata,\n body: parsed.content,\n };\n });\n\n this.logger.debug(\n `Generating RSS feed with ${publishedPosts.length} posts`,\n );\n\n // Build RSS config\n const rssConfig: RSSFeedConfig = {\n title: params.title,\n description: params.description,\n link: params.siteUrl,\n language: params.language ?? \"en-us\",\n ...(params.copyright && { copyright: params.copyright }),\n };\n\n // Generate RSS XML\n const xml = generateRSSFeed(publishedPosts, rssConfig);\n\n const result = {\n xml,\n };\n\n return outputSchema.parse(result);\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";iaAgBA,FAAM,JAAqB,JAAE,CAAO,LAClC,EAAS,JAAE,FAAI,JACf,AAAO,EAAE,OAAO,EAChB,YAAa,EAAE,OAAO,EACtB,SAAU,EAAE,OAAO,EAAE,SAAS,EAC9B,UAAW,EAAE,OAAO,EAAE,SAAS,CACjC,CAAC,EAOM,MAAM,CAAoC,CAC9B,OACD,GAAK,WACL,KAAO,2BACP,YACd,uDAEF,WAAW,CAAC,EAAgB,CAC1B,KAAK,OAAS,EACd,KAAK,OAAO,MAAM,2BAA2B,OAOzC,MAAQ,CACZ,EACA,EACA,EACY,CAEZ,IAAM,EAAuB,EAAmB,MAAM,CAAK,EAarD,GARuB,MAHP,EAAQ,cAGmB,aAAa,CAC5D,WAAY,OACZ,QAAS,CACP,MAAO,IACT,CACF,CAAC,GAIE,OACC,CAAC,IAAM,EAAE,SAAS,SAAW,aAAe,EAAE,SAAS,WACzD,EACC,IAAI,CAAC,IAAW,CACf,IAAM,EAAS,EACb,EAAO,QACP,CACF,EACA,MAAO,IACF,EACH,YAAa,EAAO,SACpB,KAAM,EAAO,OACf,EACD,EAEH,KAAK,OAAO,MACV,4BAA4B,EAAe,cAC7C,EAGA,IAAM,EAA2B,CAC/B,MAAO,EAAO,MACd,YAAa,EAAO,YACpB,KAAM,EAAO,QACb,SAAU,EAAO,UAAY,WACzB,EAAO,WAAa,CAAE,UAAW,EAAO,SAAU,CACxD,EAKM,EAAS,CACb,IAHU,EAAgB,EAAgB,CAAS,CAIrD,EAEA,OAAO,EAAa,MAAM,CAAM,EAEpC",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "8940998F1D361B1264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/deploy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunks/index-
|
|
2
|
+
import"./chunks/index-fxc39qy2.js";import{appendFileSync as l,readFileSync as m}from"fs";var y=/^# ---- .+ ----$/;function p(e,t){let n=[],i=new Set,S=t?.skipSections??new Set,c=!1,s=!1,o=!1;for(let v of e.split(/\r?\n/)){let r=v.trim();if(y.test(r)){c=S.has(r),s=!1,o=!1;continue}if(c)continue;if(r.startsWith("#")){if(r.includes("@required"))s=!0;if(r.includes("@sensitive"))o=!0;continue}let u=r.match(/^([A-Z][A-Z0-9_]*)=/);if(!u?.[1]){s=!1,o=!1;continue}let a=u[1];if(!i.has(a))i.add(a),n.push({key:a,required:s,sensitive:o});s=!1,o=!1}return n}function d(e,t){return p(m(e,"utf8"),t)}async function f(e,t){let n=await e.text();if(!n)throw Error(`${t} returned an empty response (${e.status})`);try{return JSON.parse(n)}catch{throw Error(`${t} returned invalid JSON (${e.status}): ${n}`)}}function E(e){let t=m(e,"utf8");return Object.fromEntries(t.split(/\r?\n/).filter(Boolean).map((n)=>{let i=n.indexOf("=");return[n.slice(0,i),n.slice(i+1)]}))}function _(e){let t=process.env[e];if(!t)throw Error(`Missing ${e}`);return t}function h(e,t){let n=process.env.GITHUB_OUTPUT;if(n)l(n,`${e}=${t}
|
|
3
3
|
`)}function g(e,t){let n=process.env.GITHUB_ENV;if(!n)return;if(t.includes(`
|
|
4
4
|
`)){let i=`EOF_${e}_${Date.now().toString(36)}`;l(n,`${e}<<${i}
|
|
5
5
|
${t}
|
package/dist/entities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$ as r,R as t,S as e,V as a,W as n,X as i,ba as o,ca as s,da as p}from"./chunks/index-
|
|
2
|
+
import{$ as r,R as t,S as e,V as a,W as n,X as i,ba as o,ca as s,da as p}from"./chunks/index-72d2a6vf.js";import"./chunks/index-aatpaped.js";import"./chunks/index-b6k44k1d.js";import"./chunks/index-q5r12b3s.js";import"./chunks/index-fxc39qy2.js";export{n as parseMarkdownWithFrontmatter,o as paginationInfoSchema,p as paginateItems,a as generateMarkdownWithFrontmatter,i as generateFrontmatter,s as buildPaginationInfo,e as baseEntitySchema,t as NOTE_ENTITY_TYPE,r as BaseEntityAdapter};
|
|
3
3
|
|
|
4
4
|
//# debugId=467E3A7AFE9EA41964756E2164756E21
|
|
5
5
|
//# sourceMappingURL=entities.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Za as r,_a as o}from"./chunks/index-q5r12b3s.js";import"./chunks/index-fxc39qy2.js";function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.236",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"],license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{brain:"./dist/brain.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@clack/prompts":"^1.5.1","@modelcontextprotocol/sdk":"^1.29.0","@tailwindcss/postcss":"^4.3.1","@tailwindcss/typography":"^0.5.20",postcss:"^8.5.15",preact:"^10.27.2","preact-render-to-string":"^6.7.0",tailwindcss:"^4.3.1",zod:"^4.1.8"},devDependencies:{"@brains/app":"workspace:*","@brains/auth-service":"workspace:*","@brains/build-tools":"workspace:*","@brains/content-formatters":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/mcp-service":"workspace:*","@brains/plugins":"workspace:*","@brains/ranger":"workspace:*","@brains/relay":"workspace:*","@brains/rover":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-default":"workspace:*","@brains/site-personal":"workspace:*","@brains/site-professional":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@rizom/theme-default":"workspace:*","@types/bun":"^1.3.14",rolldown:"^1.0.0","rolldown-plugin-dts":"^0.27.4",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cli":"./dist/brain.js","./plugins":{types:"./dist/plugins.d.ts",import:"./dist/plugins.js"},"./entities":{types:"./dist/entities.d.ts",import:"./dist/entities.js"},"./services":{types:"./dist/services.d.ts",import:"./dist/services.js"},"./interfaces":{types:"./dist/interfaces.d.ts",import:"./dist/interfaces.js"},"./templates":{types:"./dist/templates.d.ts",import:"./dist/templates.js"},"./site":{types:"./dist/site.d.ts",import:"./dist/site.js"},"./themes":{types:"./dist/themes.d.ts",import:"./dist/themes.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js"},"./tsconfig.instance.json":"./tsconfig.instance.json"},files:["dist","templates","tsconfig.instance.json"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.17.4","@tailwindcss/oxide":"^4.1.4",lightningcss:"^1.29.2","playwright-core":"^1.61.0","react-devtools-core":"^7.0.1",sharp:"^0.35.1"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},scripts:{build:"bun scripts/build.ts","dev:start":"bun scripts/build.ts && bun dist/brain.js start",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var n=e.version;export{o as z,t as defineBrain,r as ZodError,n as PLUGIN_API_VERSION};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=00BEEA9C3E9100A164756E2164756E21
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import packageJson from \"../package.json\" with { type: \"json\" };\n\n/**\n * Pre-v1 external plugin API marker.\n *\n * During alpha, the external plugin API compatibility marker tracks the\n * published @rizom/brain package version. Once the plugin API is declared\n * stable, this can move to an independent semver contract such as 1.0.0.\n */\nexport const PLUGIN_API_VERSION: string = packageJson.version;\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";0FA0EO,UAAS,CAAW,CAAC,EAA8C,CACxE,OAAO,k1FClEF,IAAM,EAA6B,EAAY",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "00BEEA9C3E9100A164756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/interfaces.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ea as d,fa as f,ga as h,ha as j,ia as k,ja as q,
|
|
2
|
+
import{ea as d,fa as f,ga as h,ha as j,ia as k,ja as q,qa as w,ra as x}from"./chunks/index-8hmmeype.js";import"./chunks/index-aatpaped.js";import{za as v}from"./chunks/index-8ej1r6tb.js";import"./chunks/index-b6k44k1d.js";import"./chunks/index-q5r12b3s.js";import"./chunks/index-fxc39qy2.js";export{v as UserPermissionLevelSchema,j as UnregisterRoutesPayloadSchema,f as RouteDefinitionSchema,h as RegisterRoutesPayloadSchema,d as NavigationSlots,w as MessageResponseSchema,k as ListRoutesPayloadSchema,q as GetRoutePayloadSchema,x as BaseMessageSchema};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=CDA2A81C6F23892864756E2164756E21
|
|
5
5
|
//# sourceMappingURL=interfaces.js.map
|
package/dist/interfaces.js.map
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
CREATE TABLE `auth_invitation_delivery_attempts` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`invitation_id` text NOT NULL,
|
|
4
|
+
`setup_token_hash` text NOT NULL,
|
|
5
|
+
`provider_id` text NOT NULL,
|
|
6
|
+
`provider_delivery_id` text,
|
|
7
|
+
`state` text NOT NULL,
|
|
8
|
+
`failure_code` text,
|
|
9
|
+
`queued_at` integer NOT NULL,
|
|
10
|
+
`started_at` integer,
|
|
11
|
+
`completed_at` integer,
|
|
12
|
+
FOREIGN KEY (`invitation_id`) REFERENCES `auth_invitations`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
13
|
+
FOREIGN KEY (`setup_token_hash`) REFERENCES `setup_tokens`(`token_hash`) ON UPDATE no action ON DELETE no action,
|
|
14
|
+
CONSTRAINT "auth_invitation_delivery_attempts_state_check" CHECK("auth_invitation_delivery_attempts"."state" IN ('queued', 'sending', 'sent', 'failed'))
|
|
15
|
+
);
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
CREATE INDEX `idx_auth_invitation_delivery_attempts_invitation_id` ON `auth_invitation_delivery_attempts` (`invitation_id`);--> statement-breakpoint
|
|
18
|
+
CREATE INDEX `idx_auth_invitation_delivery_attempts_state` ON `auth_invitation_delivery_attempts` (`state`);--> statement-breakpoint
|
|
19
|
+
CREATE TABLE `auth_invitations` (
|
|
20
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
21
|
+
`user_id` text NOT NULL,
|
|
22
|
+
`delivery_claim_id` text NOT NULL,
|
|
23
|
+
`current_setup_token_hash` text NOT NULL,
|
|
24
|
+
`created_by_user_id` text,
|
|
25
|
+
`idempotency_key_hash` text NOT NULL,
|
|
26
|
+
`state` text NOT NULL,
|
|
27
|
+
`failure_code` text,
|
|
28
|
+
`created_at` integer NOT NULL,
|
|
29
|
+
`updated_at` integer NOT NULL,
|
|
30
|
+
`sent_at` integer,
|
|
31
|
+
`claimed_at` integer,
|
|
32
|
+
`expired_at` integer,
|
|
33
|
+
`cancelled_at` integer,
|
|
34
|
+
FOREIGN KEY (`user_id`) REFERENCES `auth_users`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
35
|
+
FOREIGN KEY (`delivery_claim_id`) REFERENCES `person_identity_claims`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
36
|
+
FOREIGN KEY (`current_setup_token_hash`) REFERENCES `setup_tokens`(`token_hash`) ON UPDATE no action ON DELETE no action,
|
|
37
|
+
FOREIGN KEY (`created_by_user_id`) REFERENCES `auth_users`(`id`) ON UPDATE no action ON DELETE set null,
|
|
38
|
+
CONSTRAINT "auth_invitations_state_check" CHECK("auth_invitations"."state" IN ('pending', 'sending', 'sent', 'claimed', 'expired', 'cancelled', 'failed'))
|
|
39
|
+
);
|
|
40
|
+
--> statement-breakpoint
|
|
41
|
+
CREATE UNIQUE INDEX `idx_auth_invitations_idempotency_key` ON `auth_invitations` (`idempotency_key_hash`);--> statement-breakpoint
|
|
42
|
+
CREATE UNIQUE INDEX `idx_auth_invitations_current_setup_token` ON `auth_invitations` (`current_setup_token_hash`);--> statement-breakpoint
|
|
43
|
+
CREATE INDEX `idx_auth_invitations_user_id` ON `auth_invitations` (`user_id`);--> statement-breakpoint
|
|
44
|
+
CREATE INDEX `idx_auth_invitations_state` ON `auth_invitations` (`state`);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
+
CREATE TABLE `__new_person_identity_claims` (
|
|
3
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
+
`person_id` text NOT NULL,
|
|
5
|
+
`type` text NOT NULL,
|
|
6
|
+
`issuer` text,
|
|
7
|
+
`identity_key_hash` text NOT NULL,
|
|
8
|
+
`delivery_subject` text,
|
|
9
|
+
`label` text,
|
|
10
|
+
`visibility` text NOT NULL,
|
|
11
|
+
`revoked_at` integer,
|
|
12
|
+
`created_at` integer NOT NULL,
|
|
13
|
+
FOREIGN KEY (`person_id`) REFERENCES `auth_people`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
14
|
+
CONSTRAINT "person_identity_claims_visibility_check" CHECK("__new_person_identity_claims"."visibility" IN ('private', 'trusted', 'public'))
|
|
15
|
+
);
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
INSERT INTO `__new_person_identity_claims`("id", "person_id", "type", "issuer", "identity_key_hash", "delivery_subject", "label", "visibility", "revoked_at", "created_at") SELECT "id", "person_id", "type", "issuer", "identity_key_hash", "delivery_subject", "label", "visibility", "revoked_at", "created_at" FROM `person_identity_claims`;--> statement-breakpoint
|
|
18
|
+
DROP TABLE `person_identity_claims`;--> statement-breakpoint
|
|
19
|
+
ALTER TABLE `__new_person_identity_claims` RENAME TO `person_identity_claims`;--> statement-breakpoint
|
|
20
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
21
|
+
CREATE UNIQUE INDEX `idx_person_identity_claims_active_key` ON `person_identity_claims` (`identity_key_hash`) WHERE revoked_at IS NULL;--> statement-breakpoint
|
|
22
|
+
CREATE INDEX `idx_person_identity_claims_key` ON `person_identity_claims` (`identity_key_hash`);--> statement-breakpoint
|
|
23
|
+
CREATE INDEX `idx_person_identity_claims_person_id` ON `person_identity_claims` (`person_id`);
|