fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"3 4 5 6 7 8 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r","194":"s t u","516":"0 1 2 v w x y z"},C:{"1":"0 1 2 3 4 5 6 7 8 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x 4C 5C","322":"y z"},D:{"1":"3 4 5 6 7 8 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r","194":"s t u","516":"0 1 2 v w x y z"},E:{"1":"lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC","516":"jC FD TC kC"},F:{"1":"0 1 2 3 4 5 6 7 8 p q r s t u v w x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d JD KD LD MD PC xC ND QC","194":"e f g","516":"h i j k l m n o"},G:{"1":"lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC","516":"jC jD TC kC"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"1":"EB FB GB HB IB","2":"9 J AB BB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","516":"CB DB"},Q:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:5,C:"CSS Nesting",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"parsePayloadComponent.d.ts","sourceRoot":"","sources":["../../../../src/bin/generateImportMap/utilities/parsePayloadComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG;IACzE,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAuBA"}

View File

@@ -0,0 +1,253 @@
'use strict'
const { test } = require('tap')
const { sink, once } = require('./helper')
const stdSerializers = require('pino-std-serializers')
const pino = require('../')
const parentSerializers = {
test: () => 'parent'
}
const childSerializers = {
test: () => 'child'
}
test('default err namespace error serializer', async ({ equal }) => {
const stream = sink()
const parent = pino(stream)
parent.info({ err: ReferenceError('test') })
const o = await once(stream, 'data')
equal(typeof o.err, 'object')
equal(o.err.type, 'ReferenceError')
equal(o.err.message, 'test')
equal(typeof o.err.stack, 'string')
})
test('custom serializer overrides default err namespace error serializer', async ({ equal }) => {
const stream = sink()
const parent = pino({
serializers: {
err: (e) => ({
t: e.constructor.name,
m: e.message,
s: e.stack
})
}
}, stream)
parent.info({ err: ReferenceError('test') })
const o = await once(stream, 'data')
equal(typeof o.err, 'object')
equal(o.err.t, 'ReferenceError')
equal(o.err.m, 'test')
equal(typeof o.err.s, 'string')
})
test('custom serializer overrides default err namespace error serializer when nestedKey is on', async ({ equal }) => {
const stream = sink()
const parent = pino({
nestedKey: 'obj',
serializers: {
err: (e) => {
return {
t: e.constructor.name,
m: e.message,
s: e.stack
}
}
}
}, stream)
parent.info({ err: ReferenceError('test') })
const o = await once(stream, 'data')
equal(typeof o.obj.err, 'object')
equal(o.obj.err.t, 'ReferenceError')
equal(o.obj.err.m, 'test')
equal(typeof o.obj.err.s, 'string')
})
test('null overrides default err namespace error serializer', async ({ equal }) => {
const stream = sink()
const parent = pino({ serializers: { err: null } }, stream)
parent.info({ err: ReferenceError('test') })
const o = await once(stream, 'data')
equal(typeof o.err, 'object')
equal(typeof o.err.type, 'undefined')
equal(typeof o.err.message, 'undefined')
equal(typeof o.err.stack, 'undefined')
})
test('undefined overrides default err namespace error serializer', async ({ equal }) => {
const stream = sink()
const parent = pino({ serializers: { err: undefined } }, stream)
parent.info({ err: ReferenceError('test') })
const o = await once(stream, 'data')
equal(typeof o.err, 'object')
equal(typeof o.err.type, 'undefined')
equal(typeof o.err.message, 'undefined')
equal(typeof o.err.stack, 'undefined')
})
test('serializers override values', async ({ equal }) => {
const stream = sink()
const parent = pino({ serializers: parentSerializers }, stream)
parent.child({}, { serializers: childSerializers })
parent.fatal({ test: 'test' })
const o = await once(stream, 'data')
equal(o.test, 'parent')
})
test('child does not overwrite parent serializers', async ({ equal }) => {
const stream = sink()
const parent = pino({ serializers: parentSerializers }, stream)
const child = parent.child({}, { serializers: childSerializers })
parent.fatal({ test: 'test' })
const o = once(stream, 'data')
equal((await o).test, 'parent')
const o2 = once(stream, 'data')
child.fatal({ test: 'test' })
equal((await o2).test, 'child')
})
test('Symbol.for(\'pino.serializers\')', async ({ equal, same, not }) => {
const stream = sink()
const expected = Object.assign({
err: stdSerializers.err
}, parentSerializers)
const parent = pino({ serializers: parentSerializers }, stream)
const child = parent.child({ a: 'property' })
same(parent[Symbol.for('pino.serializers')], expected)
same(child[Symbol.for('pino.serializers')], expected)
equal(parent[Symbol.for('pino.serializers')], child[Symbol.for('pino.serializers')])
const child2 = parent.child({}, {
serializers: {
a
}
})
function a () {
return 'hello'
}
not(child2[Symbol.for('pino.serializers')], parentSerializers)
equal(child2[Symbol.for('pino.serializers')].a, a)
equal(child2[Symbol.for('pino.serializers')].test, parentSerializers.test)
})
test('children inherit parent serializers', async ({ equal }) => {
const stream = sink()
const parent = pino({ serializers: parentSerializers }, stream)
const child = parent.child({ a: 'property' })
child.fatal({ test: 'test' })
const o = await once(stream, 'data')
equal(o.test, 'parent')
})
test('children inherit parent Symbol serializers', async ({ equal, same, not }) => {
const stream = sink()
const symbolSerializers = {
[Symbol.for('b')]: b
}
const expected = Object.assign({
err: stdSerializers.err
}, symbolSerializers)
const parent = pino({ serializers: symbolSerializers }, stream)
same(parent[Symbol.for('pino.serializers')], expected)
const child = parent.child({}, {
serializers: {
[Symbol.for('a')]: a,
a
}
})
function a () {
return 'hello'
}
function b () {
return 'world'
}
same(child[Symbol.for('pino.serializers')].a, a)
same(child[Symbol.for('pino.serializers')][Symbol.for('b')], b)
same(child[Symbol.for('pino.serializers')][Symbol.for('a')], a)
})
test('children serializers get called', async ({ equal }) => {
const stream = sink()
const parent = pino({
test: 'this'
}, stream)
const child = parent.child({ a: 'property' }, { serializers: childSerializers })
child.fatal({ test: 'test' })
const o = await once(stream, 'data')
equal(o.test, 'child')
})
test('children serializers get called when inherited from parent', async ({ equal }) => {
const stream = sink()
const parent = pino({
test: 'this',
serializers: parentSerializers
}, stream)
const child = parent.child({}, { serializers: { test: function () { return 'pass' } } })
child.fatal({ test: 'fail' })
const o = await once(stream, 'data')
equal(o.test, 'pass')
})
test('non-overridden serializers are available in the children', async ({ equal }) => {
const stream = sink()
const pSerializers = {
onlyParent: function () { return 'parent' },
shared: function () { return 'parent' }
}
const cSerializers = {
shared: function () { return 'child' },
onlyChild: function () { return 'child' }
}
const parent = pino({ serializers: pSerializers }, stream)
const child = parent.child({}, { serializers: cSerializers })
const o = once(stream, 'data')
child.fatal({ shared: 'test' })
equal((await o).shared, 'child')
const o2 = once(stream, 'data')
child.fatal({ onlyParent: 'test' })
equal((await o2).onlyParent, 'parent')
const o3 = once(stream, 'data')
child.fatal({ onlyChild: 'test' })
equal((await o3).onlyChild, 'child')
const o4 = once(stream, 'data')
parent.fatal({ onlyChild: 'test' })
equal((await o4).onlyChild, 'test')
})
test('custom serializer for messageKey', async (t) => {
const stream = sink()
const instance = pino({ serializers: { msg: () => '422' } }, stream)
const o = { num: NaN }
instance.info(o, 42)
const { msg } = await once(stream, 'data')
t.equal(msg, '422')
})

View File

@@ -0,0 +1,7 @@
export * from "./delete.cjs";
export * from "./insert.cjs";
export * from "./query-builder.cjs";
export * from "./refresh-materialized-view.cjs";
export * from "./select.cjs";
export * from "./select.types.cjs";
export * from "./update.cjs";

View File

@@ -0,0 +1 @@
{"version":3,"file":"merge.js","sources":["../../../src/utils/merge.ts"],"sourcesContent":["/**\n * Shallow merge two objects.\n * Does not mutate the passed in objects.\n * Undefined/empty values in the merge object will overwrite existing values.\n *\n * By default, this merges 2 levels deep.\n */\nexport function merge<T>(initialObj: T, mergeObj: T, levels = 2): T {\n // If the merge value is not an object, or we have no merge levels left,\n // we just set the value to the merge value\n if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) {\n return mergeObj;\n }\n\n // If the merge object is an empty object, and the initial object is not undefined, we return the initial object\n if (initialObj && Object.keys(mergeObj).length === 0) {\n return initialObj;\n }\n\n // Clone object\n const output = { ...initialObj };\n\n // Merge values into output, resursively\n for (const key in mergeObj) {\n if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {\n output[key] = merge(output[key], mergeObj[key], levels - 1);\n }\n }\n\n return output;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAI,UAAU,EAAK,QAAQ,EAAK,MAAA,GAAS,CAAC,EAAK;AACpE;AACA;AACA,EAAE,IAAI,CAAC,QAAA,IAAY,OAAO,QAAA,KAAa,QAAA,IAAY,MAAA,IAAU,CAAC,EAAE;AAChE,IAAI,OAAO,QAAQ;AACnB,EAAE;;AAEF;AACA,EAAE,IAAI,UAAA,IAAc,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAA,KAAW,CAAC,EAAE;AACxD,IAAI,OAAO,UAAU;AACrB,EAAE;;AAEF;AACA,EAAE,MAAM,MAAA,GAAS,EAAE,GAAG,YAAY;;AAElC;AACA,EAAE,KAAK,MAAM,GAAA,IAAO,QAAQ,EAAE;AAC9B,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE;AAC7D,MAAM,MAAM,CAAC,GAAG,CAAA,GAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAA,GAAS,CAAC,CAAC;AACjE,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,MAAM;AACf;;;;"}

View File

@@ -0,0 +1,13 @@
import { entityKind } from "../entity.cjs";
import { MySqlDatabase } from "../mysql-core/db.cjs";
import type { DrizzleConfig } from "../utils.cjs";
import { type MySqlRemotePreparedQueryHKT, type MySqlRemoteQueryResultHKT } from "./session.cjs";
export declare class MySqlRemoteDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends MySqlDatabase<MySqlRemoteQueryResultHKT, MySqlRemotePreparedQueryHKT, TSchema> {
static readonly [entityKind]: string;
}
export type RemoteCallback = (sql: string, params: any[], method: 'all' | 'execute') => Promise<{
rows: any[];
insertId?: number;
affectedRows?: number;
}>;
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>>(callback: RemoteCallback, config?: DrizzleConfig<TSchema>): MySqlRemoteDatabase<TSchema>;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/pg-core/foreign-keys.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { TableName } from '~/table.utils.ts';\nimport type { AnyPgColumn, PgColumn } from './columns/index.ts';\nimport type { PgTable } from './table.ts';\n\nexport type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';\n\nexport type Reference = () => {\n\treadonly name?: string;\n\treadonly columns: PgColumn[];\n\treadonly foreignTable: PgTable;\n\treadonly foreignColumns: PgColumn[];\n};\n\nexport class ForeignKeyBuilder {\n\tstatic readonly [entityKind]: string = 'PgForeignKeyBuilder';\n\n\t/** @internal */\n\treference: Reference;\n\n\t/** @internal */\n\t_onUpdate: UpdateDeleteAction | undefined = 'no action';\n\n\t/** @internal */\n\t_onDelete: UpdateDeleteAction | undefined = 'no action';\n\n\tconstructor(\n\t\tconfig: () => {\n\t\t\tname?: string;\n\t\t\tcolumns: PgColumn[];\n\t\t\tforeignColumns: PgColumn[];\n\t\t},\n\t\tactions?: {\n\t\t\tonUpdate?: UpdateDeleteAction;\n\t\t\tonDelete?: UpdateDeleteAction;\n\t\t} | undefined,\n\t) {\n\t\tthis.reference = () => {\n\t\t\tconst { name, columns, foreignColumns } = config();\n\t\t\treturn { name, columns, foreignTable: foreignColumns[0]!.table as PgTable, foreignColumns };\n\t\t};\n\t\tif (actions) {\n\t\t\tthis._onUpdate = actions.onUpdate;\n\t\t\tthis._onDelete = actions.onDelete;\n\t\t}\n\t}\n\n\tonUpdate(action: UpdateDeleteAction): this {\n\t\tthis._onUpdate = action === undefined ? 'no action' : action;\n\t\treturn this;\n\t}\n\n\tonDelete(action: UpdateDeleteAction): this {\n\t\tthis._onDelete = action === undefined ? 'no action' : action;\n\t\treturn this;\n\t}\n\n\t/** @internal */\n\tbuild(table: PgTable): ForeignKey {\n\t\treturn new ForeignKey(table, this);\n\t}\n}\n\nexport type AnyForeignKeyBuilder = ForeignKeyBuilder;\n\nexport class ForeignKey {\n\tstatic readonly [entityKind]: string = 'PgForeignKey';\n\n\treadonly reference: Reference;\n\treadonly onUpdate: UpdateDeleteAction | undefined;\n\treadonly onDelete: UpdateDeleteAction | undefined;\n\n\tconstructor(readonly table: PgTable, builder: ForeignKeyBuilder) {\n\t\tthis.reference = builder.reference;\n\t\tthis.onUpdate = builder._onUpdate;\n\t\tthis.onDelete = builder._onDelete;\n\t}\n\n\tgetName(): string {\n\t\tconst { name, columns, foreignColumns } = this.reference();\n\t\tconst columnNames = columns.map((column) => column.name);\n\t\tconst foreignColumnNames = foreignColumns.map((column) => column.name);\n\t\tconst chunks = [\n\t\t\tthis.table[TableName],\n\t\t\t...columnNames,\n\t\t\tforeignColumns[0]!.table[TableName],\n\t\t\t...foreignColumnNames,\n\t\t];\n\t\treturn name ?? `${chunks.join('_')}_fk`;\n\t}\n}\n\ntype ColumnsWithTable<\n\tTTableName extends string,\n\tTColumns extends PgColumn[],\n> = { [Key in keyof TColumns]: AnyPgColumn<{ tableName: TTableName }> };\n\nexport function foreignKey<\n\tTTableName extends string,\n\tTForeignTableName extends string,\n\tTColumns extends [AnyPgColumn<{ tableName: TTableName }>, ...AnyPgColumn<{ tableName: TTableName }>[]],\n>(\n\tconfig: {\n\t\tname?: string;\n\t\tcolumns: TColumns;\n\t\tforeignColumns: ColumnsWithTable<TForeignTableName, TColumns>;\n\t},\n): ForeignKeyBuilder {\n\tfunction mappedConfig() {\n\t\tconst { name, columns, foreignColumns } = config;\n\t\treturn {\n\t\t\tname,\n\t\t\tcolumns,\n\t\t\tforeignColumns,\n\t\t};\n\t}\n\n\treturn new ForeignKeyBuilder(mappedConfig);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,yBAA0B;AAanB,MAAM,kBAAkB;AAAA,EAC9B,QAAiB,wBAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAGA,YAA4C;AAAA;AAAA,EAG5C,YAA4C;AAAA,EAE5C,YACC,QAKA,SAIC;AACD,SAAK,YAAY,MAAM;AACtB,YAAM,EAAE,MAAM,SAAS,eAAe,IAAI,OAAO;AACjD,aAAO,EAAE,MAAM,SAAS,cAAc,eAAe,CAAC,EAAG,OAAkB,eAAe;AAAA,IAC3F;AACA,QAAI,SAAS;AACZ,WAAK,YAAY,QAAQ;AACzB,WAAK,YAAY,QAAQ;AAAA,IAC1B;AAAA,EACD;AAAA,EAEA,SAAS,QAAkC;AAC1C,SAAK,YAAY,WAAW,SAAY,cAAc;AACtD,WAAO;AAAA,EACR;AAAA,EAEA,SAAS,QAAkC;AAC1C,SAAK,YAAY,WAAW,SAAY,cAAc;AACtD,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,MAAM,OAA4B;AACjC,WAAO,IAAI,WAAW,OAAO,IAAI;AAAA,EAClC;AACD;AAIO,MAAM,WAAW;AAAA,EAOvB,YAAqB,OAAgB,SAA4B;AAA5C;AACpB,SAAK,YAAY,QAAQ;AACzB,SAAK,WAAW,QAAQ;AACxB,SAAK,WAAW,QAAQ;AAAA,EACzB;AAAA,EAVA,QAAiB,wBAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EACA;AAAA,EAQT,UAAkB;AACjB,UAAM,EAAE,MAAM,SAAS,eAAe,IAAI,KAAK,UAAU;AACzD,UAAM,cAAc,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI;AACvD,UAAM,qBAAqB,eAAe,IAAI,CAAC,WAAW,OAAO,IAAI;AACrE,UAAM,SAAS;AAAA,MACd,KAAK,MAAM,4BAAS;AAAA,MACpB,GAAG;AAAA,MACH,eAAe,CAAC,EAAG,MAAM,4BAAS;AAAA,MAClC,GAAG;AAAA,IACJ;AACA,WAAO,QAAQ,GAAG,OAAO,KAAK,GAAG,CAAC;AAAA,EACnC;AACD;AAOO,SAAS,WAKf,QAKoB;AACpB,WAAS,eAAe;AACvB,UAAM,EAAE,MAAM,SAAS,eAAe,IAAI;AAC1C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,SAAO,IAAI,kBAAkB,YAAY;AAC1C;","names":[]}

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/ids/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-volume.js","sources":["../../../src/icons/file-volume.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileVolume\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTFhNSA1IDAgMCAxIDAgNiIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNNCA2Ljc2NVY0YTIgMiAwIDAgMSAyLTJoOWw1IDV2MTNhMiAyIDAgMCAxLTIgMkg2YTIgMiAwIDAgMS0uOTMtLjIzIiAvPgogIDxwYXRoIGQ9Ik03IDEwLjUxYS41LjUgMCAwIDAtLjgyNi0uMzhsLTEuODkzIDEuNjI4QTEgMSAwIDAgMSAzLjYzIDEySDIuNWEuNS41IDAgMCAwLS41LjV2M2EuNS41IDAgMCAwIC41LjVoMS4xMjlhMSAxIDAgMCAxIC42NTIuMjQybDEuODkzIDEuNjNhLjUuNSAwIDAgMCAuODI2LS4zOHoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-volume\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileVolume = createLucideIcon('FileVolume', [\n ['path', { d: 'M11 11a5 5 0 0 1 0 6', key: '193qb2' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n [\n 'path',\n { d: 'M4 6.765V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-.93-.23', key: 'ifyjnl' },\n ],\n [\n 'path',\n {\n d: 'M7 10.51a.5.5 0 0 0-.826-.38l-1.893 1.628A1 1 0 0 1 3.63 12H2.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h1.129a1 1 0 0 1 .652.242l1.893 1.63a.5.5 0 0 0 .826-.38z',\n key: 'mk8rxu',\n },\n ],\n]);\n\nexport default FileVolume;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC5F,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,8 @@
"use strict";
exports.formatRFC3339WithOptions = void 0;
var _index = require("../formatRFC3339.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const formatRFC3339WithOptions = (exports.formatRFC3339WithOptions = (0,
_index2.convertToFP)(_index.formatRFC3339, 2));

View File

@@ -0,0 +1,302 @@
import { context, trace, SpanStatusCode } from '@opentelemetry/api';
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
import { InstrumentationBase, InstrumentationNodeModuleDefinition, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
import { SEMATTRS_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';
import { getIsolationScope, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getClient } from '@sentry/core';
import { FastifyNames, AttributeNames, FastifyTypes } from './enums/AttributeNames.js';
import { startSpan, endSpan, safeExecuteInTheMiddleMaybePromise } from './utils.js';
// Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable jsdoc/require-jsdoc */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/** @knipignore */
const PACKAGE_VERSION = '0.1.0';
const PACKAGE_NAME = '@sentry/instrumentation-fastify-v3';
const ANONYMOUS_NAME = 'anonymous';
// The instrumentation creates a span for invocations of lifecycle hook handlers
// that take `(request, reply, ...[, done])` arguments. Currently this is all
// lifecycle hooks except `onRequestAbort`.
// https://fastify.dev/docs/latest/Reference/Hooks
const hooksNamesToWrap = new Set([
'onTimeout',
'onRequest',
'preParsing',
'preValidation',
'preSerialization',
'preHandler',
'onSend',
'onResponse',
'onError',
]);
/**
* Fastify instrumentation for OpenTelemetry
*/
class FastifyInstrumentationV3 extends InstrumentationBase {
constructor(config = {}) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
}
init() {
return [
new InstrumentationNodeModuleDefinition('fastify', ['>=3.0.0 <4'], moduleExports => {
return this._patchConstructor(moduleExports);
}),
];
}
_hookOnRequest() {
const instrumentation = this;
return function onRequest(request, reply, done) {
if (!instrumentation.isEnabled()) {
return done();
}
instrumentation._wrap(reply, 'send', instrumentation._patchSend());
const anyRequest = request ;
const rpcMetadata = getRPCMetadata(context.active());
const routeName = anyRequest.routeOptions
? anyRequest.routeOptions.url // since fastify@4.10.0
: request.routerPath;
if (routeName && rpcMetadata?.type === RPCType.HTTP) {
rpcMetadata.route = routeName;
}
const method = request.method || 'GET';
getIsolationScope().setTransactionName(`${method} ${routeName}`);
done();
};
}
_wrapHandler(
pluginName,
hookName,
original,
syncFunctionWithDone,
) {
const instrumentation = this;
this._diag.debug('Patching fastify route.handler function');
return function ( ...args) {
if (!instrumentation.isEnabled()) {
return original.apply(this, args);
}
const name = original.name || pluginName || ANONYMOUS_NAME;
const spanName = `${FastifyNames.MIDDLEWARE} - ${name}`;
const reply = args[1] ;
const span = startSpan(reply, instrumentation.tracer, spanName, {
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.MIDDLEWARE,
[AttributeNames.PLUGIN_NAME]: pluginName,
[AttributeNames.HOOK_NAME]: hookName,
});
const origDone = syncFunctionWithDone && (args[args.length - 1] );
if (origDone) {
args[args.length - 1] = function (...doneArgs) {
endSpan(reply);
origDone.apply(this, doneArgs);
};
}
return context.with(trace.setSpan(context.active(), span), () => {
return safeExecuteInTheMiddleMaybePromise(
() => {
return original.apply(this, args);
},
err => {
if (err instanceof Error) {
span.setStatus({
code: SpanStatusCode.ERROR,
message: err.message,
});
span.recordException(err);
}
// async hooks should end the span as soon as the promise is resolved
if (!syncFunctionWithDone) {
endSpan(reply);
}
},
);
});
};
}
_wrapAddHook() {
const instrumentation = this;
this._diag.debug('Patching fastify server.addHook function');
// biome-ignore lint/complexity/useArrowFunction: <explanation>
return function (original) {
return function wrappedAddHook( ...args) {
const name = args[0] ;
const handler = args[1] ;
const pluginName = this.pluginName;
if (!hooksNamesToWrap.has(name)) {
return original.apply(this, args);
}
const syncFunctionWithDone =
typeof args[args.length - 1] === 'function' && handler.constructor.name !== 'AsyncFunction';
return original.apply(this, [
name,
instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone),
] );
};
};
}
_patchConstructor(moduleExports
) {
const instrumentation = this;
function fastify( ...args) {
const app = moduleExports.fastify.apply(this, args);
app.addHook('onRequest', instrumentation._hookOnRequest());
app.addHook('preHandler', instrumentation._hookPreHandler());
instrumentClient();
instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook());
return app;
}
if (moduleExports.errorCodes !== undefined) {
fastify.errorCodes = moduleExports.errorCodes;
}
fastify.fastify = fastify;
fastify.default = fastify;
return fastify;
}
_patchSend() {
const instrumentation = this;
this._diag.debug('Patching fastify reply.send function');
return function patchSend(original) {
return function send( ...args) {
const maybeError = args[0];
if (!instrumentation.isEnabled()) {
return original.apply(this, args);
}
return safeExecuteInTheMiddle(
() => {
return original.apply(this, args);
},
err => {
if (!err && maybeError instanceof Error) {
// eslint-disable-next-line no-param-reassign
err = maybeError;
}
endSpan(this, err);
},
);
};
};
}
_hookPreHandler() {
const instrumentation = this;
this._diag.debug('Patching fastify preHandler function');
return function preHandler( request, reply, done) {
if (!instrumentation.isEnabled()) {
return done();
}
const anyRequest = request ;
const handler = anyRequest.routeOptions?.handler || anyRequest.context?.handler;
const handlerName = handler?.name.startsWith('bound ') ? handler.name.substring(6) : handler?.name;
const spanName = `${FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || ANONYMOUS_NAME}`;
const spanAttributes = {
[AttributeNames.PLUGIN_NAME]: this.pluginName,
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER,
// eslint-disable-next-line deprecation/deprecation
[SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions
? anyRequest.routeOptions.url // since fastify@4.10.0
: request.routerPath,
};
if (handlerName) {
spanAttributes[AttributeNames.FASTIFY_NAME] = handlerName;
}
const span = startSpan(reply, instrumentation.tracer, spanName, spanAttributes);
addFastifyV3SpanAttributes(span);
const { requestHook } = instrumentation.getConfig();
if (requestHook) {
safeExecuteInTheMiddle(
() => requestHook(span, { request }),
e => {
if (e) {
instrumentation._diag.error('request hook failed', e);
}
},
true,
);
}
return context.with(trace.setSpan(context.active(), span), () => {
done();
});
};
}
}
function instrumentClient() {
const client = getClient();
if (client) {
client.on('spanStart', (span) => {
addFastifyV3SpanAttributes(span);
});
}
}
function addFastifyV3SpanAttributes(span) {
const attributes = spanToJSON(span).data;
// this is one of: middleware, request_handler
const type = attributes['fastify.type'];
// If this is already set, or we have no fastify span, no need to process again...
if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
return;
}
span.setAttributes({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,
});
// Also update the name, we don't need to "middleware - " prefix
const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];
if (typeof name === 'string') {
// Try removing `fastify -> ` and `@fastify/otel -> ` prefixes
// This is a bit of a hack, and not always working for all spans
// But it's the best we can do without a proper API
const updatedName = name.replace(/^fastify -> /, '').replace(/^@fastify\/otel -> /, '');
span.updateName(updatedName);
}
}
export { FastifyInstrumentationV3 };
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { eachQuarterOfInterval as fn } from "../eachQuarterOfInterval.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const eachQuarterOfIntervalWithOptions = convertToFP(fn, 2);
// Fallback for modularized imports:
export default eachQuarterOfIntervalWithOptions;

View File

@@ -0,0 +1,24 @@
import { Bench } from 'tinybench'
import { stringArrayToHexStripped } from '../lib/utils.js'
const benchStringArrayToHexStripped = new Bench({ name: 'stringArrayToHexStripped' })
const case1 = ['0', '0', '0', '0']
const case2 = ['0', '0', '0', '1']
const case3 = ['0', '0', '1', '0']
const case4 = ['0', '1', '0', '0']
const case5 = ['1', '0', '0', '0']
const case6 = ['1', '0', '0', '1']
benchStringArrayToHexStripped.add('stringArrayToHexStripped', function () {
stringArrayToHexStripped(case1)
stringArrayToHexStripped(case2)
stringArrayToHexStripped(case3)
stringArrayToHexStripped(case4)
stringArrayToHexStripped(case5)
stringArrayToHexStripped(case6)
})
await benchStringArrayToHexStripped.run()
console.log(benchStringArrayToHexStripped.name)
console.table(benchStringArrayToHexStripped.table())

View File

@@ -0,0 +1,76 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const utils = require('./utils.js');
function getAbsoluteTime(time) {
// falsy values should be preserved so that we can later on drop undefined values and
// preserve 0 vals for cross-origin resources without proper `Timing-Allow-Origin` header.
return time ? ((core.browserPerformanceTimeOrigin() || performance.timeOrigin) + time) / 1000 : time;
}
/**
* Converts a PerformanceResourceTiming entry to span data for the resource span. Most importantly,
* it converts the timing values from timestamps relative to the `performance.timeOrigin` to absolute timestamps
* in seconds.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming#timestamps
*
* @param resourceTiming
* @returns An array where the first element is the attribute name and the second element is the attribute value.
*/
function resourceTimingToSpanAttributes(resourceTiming) {
const timingSpanData = {};
// Checking for only `undefined` and `null` is intentional because it's
// valid for `nextHopProtocol` to be an empty string.
if (resourceTiming.nextHopProtocol != undefined) {
const { name, version } = utils.extractNetworkProtocol(resourceTiming.nextHopProtocol);
timingSpanData['network.protocol.version'] = version;
timingSpanData['network.protocol.name'] = name;
}
if (!(core.browserPerformanceTimeOrigin() || utils.getBrowserPerformanceAPI()?.timeOrigin)) {
return timingSpanData;
}
return dropUndefinedKeysFromObject({
...timingSpanData,
'http.request.redirect_start': getAbsoluteTime(resourceTiming.redirectStart),
'http.request.redirect_end': getAbsoluteTime(resourceTiming.redirectEnd),
'http.request.worker_start': getAbsoluteTime(resourceTiming.workerStart),
'http.request.fetch_start': getAbsoluteTime(resourceTiming.fetchStart),
'http.request.domain_lookup_start': getAbsoluteTime(resourceTiming.domainLookupStart),
'http.request.domain_lookup_end': getAbsoluteTime(resourceTiming.domainLookupEnd),
'http.request.connect_start': getAbsoluteTime(resourceTiming.connectStart),
'http.request.secure_connection_start': getAbsoluteTime(resourceTiming.secureConnectionStart),
'http.request.connection_end': getAbsoluteTime(resourceTiming.connectEnd),
'http.request.request_start': getAbsoluteTime(resourceTiming.requestStart),
'http.request.response_start': getAbsoluteTime(resourceTiming.responseStart),
'http.request.response_end': getAbsoluteTime(resourceTiming.responseEnd),
// For TTFB we actually want the relative time from timeOrigin to responseStart
// This way, TTFB always measures the "first page load" experience.
// see: https://web.dev/articles/ttfb#measure-resource-requests
'http.request.time_to_first_byte':
resourceTiming.responseStart != null ? resourceTiming.responseStart / 1000 : undefined,
});
}
/**
* Remove properties with `undefined` as value from an object.
* In contrast to `dropUndefinedKeys` in core this funciton only works on first-level
* key-value objects and does not recursively go into object properties or arrays.
*/
function dropUndefinedKeysFromObject(attrs) {
return Object.fromEntries(Object.entries(attrs).filter(([, value]) => value != null)) ;
}
exports.resourceTimingToSpanAttributes = resourceTimingToSpanAttributes;
//# sourceMappingURL=resourceTiming.js.map

View File

@@ -0,0 +1,425 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pathToRegexp = exports.tokensToRegexp = exports.regexpToFunction = exports.match = exports.tokensToFunction = exports.compile = exports.parse = void 0;
/**
* Tokenize input string.
*/
function lexer(str) {
var tokens = [];
var i = 0;
while (i < str.length) {
var char = str[i];
if (char === "*" || char === "+" || char === "?") {
tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
continue;
}
if (char === "\\") {
tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
continue;
}
if (char === "{") {
tokens.push({ type: "OPEN", index: i, value: str[i++] });
continue;
}
if (char === "}") {
tokens.push({ type: "CLOSE", index: i, value: str[i++] });
continue;
}
if (char === ":") {
var name = "";
var j = i + 1;
while (j < str.length) {
var code = str.charCodeAt(j);
if (
// `0-9`
(code >= 48 && code <= 57) ||
// `A-Z`
(code >= 65 && code <= 90) ||
// `a-z`
(code >= 97 && code <= 122) ||
// `_`
code === 95) {
name += str[j++];
continue;
}
break;
}
if (!name)
throw new TypeError("Missing parameter name at ".concat(i));
tokens.push({ type: "NAME", index: i, value: name });
i = j;
continue;
}
if (char === "(") {
var count = 1;
var pattern = "";
var j = i + 1;
if (str[j] === "?") {
throw new TypeError("Pattern cannot start with \"?\" at ".concat(j));
}
while (j < str.length) {
if (str[j] === "\\") {
pattern += str[j++] + str[j++];
continue;
}
if (str[j] === ")") {
count--;
if (count === 0) {
j++;
break;
}
}
else if (str[j] === "(") {
count++;
if (str[j + 1] !== "?") {
throw new TypeError("Capturing groups are not allowed at ".concat(j));
}
}
pattern += str[j++];
}
if (count)
throw new TypeError("Unbalanced pattern at ".concat(i));
if (!pattern)
throw new TypeError("Missing pattern at ".concat(i));
tokens.push({ type: "PATTERN", index: i, value: pattern });
i = j;
continue;
}
tokens.push({ type: "CHAR", index: i, value: str[i++] });
}
tokens.push({ type: "END", index: i, value: "" });
return tokens;
}
/**
* Parse a string for the raw tokens.
*/
function parse(str, options) {
if (options === void 0) { options = {}; }
var tokens = lexer(str);
var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a, _b = options.delimiter, delimiter = _b === void 0 ? "/#?" : _b;
var result = [];
var key = 0;
var i = 0;
var path = "";
var tryConsume = function (type) {
if (i < tokens.length && tokens[i].type === type)
return tokens[i++].value;
};
var mustConsume = function (type) {
var value = tryConsume(type);
if (value !== undefined)
return value;
var _a = tokens[i], nextType = _a.type, index = _a.index;
throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
};
var consumeText = function () {
var result = "";
var value;
while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) {
result += value;
}
return result;
};
var isSafe = function (value) {
for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
var char = delimiter_1[_i];
if (value.indexOf(char) > -1)
return true;
}
return false;
};
var safePattern = function (prefix) {
var prev = result[result.length - 1];
var prevText = prefix || (prev && typeof prev === "string" ? prev : "");
if (prev && !prevText) {
throw new TypeError("Must have text between two parameters, missing text after \"".concat(prev.name, "\""));
}
if (!prevText || isSafe(prevText))
return "[^".concat(escapeString(delimiter), "]+?");
return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
};
while (i < tokens.length) {
var char = tryConsume("CHAR");
var name = tryConsume("NAME");
var pattern = tryConsume("PATTERN");
if (name || pattern) {
var prefix = char || "";
if (prefixes.indexOf(prefix) === -1) {
path += prefix;
prefix = "";
}
if (path) {
result.push(path);
path = "";
}
result.push({
name: name || key++,
prefix: prefix,
suffix: "",
pattern: pattern || safePattern(prefix),
modifier: tryConsume("MODIFIER") || "",
});
continue;
}
var value = char || tryConsume("ESCAPED_CHAR");
if (value) {
path += value;
continue;
}
if (path) {
result.push(path);
path = "";
}
var open = tryConsume("OPEN");
if (open) {
var prefix = consumeText();
var name_1 = tryConsume("NAME") || "";
var pattern_1 = tryConsume("PATTERN") || "";
var suffix = consumeText();
mustConsume("CLOSE");
result.push({
name: name_1 || (pattern_1 ? key++ : ""),
pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
prefix: prefix,
suffix: suffix,
modifier: tryConsume("MODIFIER") || "",
});
continue;
}
mustConsume("END");
}
return result;
}
exports.parse = parse;
/**
* Compile a string to a template function for the path.
*/
function compile(str, options) {
return tokensToFunction(parse(str, options), options);
}
exports.compile = compile;
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction(tokens, options) {
if (options === void 0) { options = {}; }
var reFlags = flags(options);
var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;
// Compile all the tokens into regexps.
var matches = tokens.map(function (token) {
if (typeof token === "object") {
return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
}
});
return function (data) {
var path = "";
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === "string") {
path += token;
continue;
}
var value = data ? data[token.name] : undefined;
var optional = token.modifier === "?" || token.modifier === "*";
var repeat = token.modifier === "*" || token.modifier === "+";
if (Array.isArray(value)) {
if (!repeat) {
throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array"));
}
if (value.length === 0) {
if (optional)
continue;
throw new TypeError("Expected \"".concat(token.name, "\" to not be empty"));
}
for (var j = 0; j < value.length; j++) {
var segment = encode(value[j], token);
if (validate && !matches[i].test(segment)) {
throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
}
path += token.prefix + segment + token.suffix;
}
continue;
}
if (typeof value === "string" || typeof value === "number") {
var segment = encode(String(value), token);
if (validate && !matches[i].test(segment)) {
throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
}
path += token.prefix + segment + token.suffix;
continue;
}
if (optional)
continue;
var typeOfMessage = repeat ? "an array" : "a string";
throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
}
return path;
};
}
exports.tokensToFunction = tokensToFunction;
/**
* Create path match function from `path-to-regexp` spec.
*/
function match(str, options) {
var keys = [];
var re = pathToRegexp(str, keys, options);
return regexpToFunction(re, keys, options);
}
exports.match = match;
/**
* Create a path match function from `path-to-regexp` output.
*/
function regexpToFunction(re, keys, options) {
if (options === void 0) { options = {}; }
var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;
return function (pathname) {
var m = re.exec(pathname);
if (!m)
return false;
var path = m[0], index = m.index;
var params = Object.create(null);
var _loop_1 = function (i) {
if (m[i] === undefined)
return "continue";
var key = keys[i - 1];
if (key.modifier === "*" || key.modifier === "+") {
params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {
return decode(value, key);
});
}
else {
params[key.name] = decode(m[i], key);
}
};
for (var i = 1; i < m.length; i++) {
_loop_1(i);
}
return { path: path, index: index, params: params };
};
}
exports.regexpToFunction = regexpToFunction;
/**
* Escape a regular expression string.
*/
function escapeString(str) {
return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
}
/**
* Get the flags for a regexp from the options.
*/
function flags(options) {
return options && options.sensitive ? "" : "i";
}
/**
* Pull out keys from a regexp.
*/
function regexpToRegexp(path, keys) {
if (!keys)
return path;
var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
var index = 0;
var execResult = groupsRegex.exec(path.source);
while (execResult) {
keys.push({
// Use parenthesized substring match if available, index otherwise
name: execResult[1] || index++,
prefix: "",
suffix: "",
modifier: "",
pattern: "",
});
execResult = groupsRegex.exec(path.source);
}
return path;
}
/**
* Transform an array into a regexp.
*/
function arrayToRegexp(paths, keys, options) {
var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });
return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
}
/**
* Create a path regexp from string input.
*/
function stringToRegexp(path, keys, options) {
return tokensToRegexp(parse(path, options), keys, options);
}
/**
* Expose a function for taking tokens and returning a RegExp.
*/
function tokensToRegexp(tokens, keys, options) {
if (options === void 0) { options = {}; }
var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
var delimiterRe = "[".concat(escapeString(delimiter), "]");
var route = start ? "^" : "";
// Iterate over the tokens and create our regexp string.
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
var token = tokens_1[_i];
if (typeof token === "string") {
route += escapeString(encode(token));
}
else {
var prefix = escapeString(encode(token.prefix));
var suffix = escapeString(encode(token.suffix));
if (token.pattern) {
if (keys)
keys.push(token);
if (prefix || suffix) {
if (token.modifier === "+" || token.modifier === "*") {
var mod = token.modifier === "*" ? "?" : "";
route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod);
}
else {
route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier);
}
}
else {
if (token.modifier === "+" || token.modifier === "*") {
throw new TypeError("Can not repeat \"".concat(token.name, "\" without a prefix and suffix"));
}
route += "(".concat(token.pattern, ")").concat(token.modifier);
}
}
else {
route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
}
}
}
if (end) {
if (!strict)
route += "".concat(delimiterRe, "?");
route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")");
}
else {
var endToken = tokens[tokens.length - 1];
var isEndDelimited = typeof endToken === "string"
? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1
: endToken === undefined;
if (!strict) {
route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?");
}
if (!isEndDelimited) {
route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")");
}
}
return new RegExp(route, flags(options));
}
exports.tokensToRegexp = tokensToRegexp;
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*/
function pathToRegexp(path, keys, options) {
if (path instanceof RegExp)
return regexpToRegexp(path, keys);
if (Array.isArray(path))
return arrayToRegexp(path, keys, options);
return stringToRegexp(path, keys, options);
}
exports.pathToRegexp = pathToRegexp;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,41 @@
import { GraphQLBoolean, GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLObjectType } from 'graphql';
export const buildPaginatedListType = (name, docType)=>new GraphQLObjectType({
name,
fields: {
docs: {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(docType)))
},
hasNextPage: {
type: new GraphQLNonNull(GraphQLBoolean)
},
hasPrevPage: {
type: new GraphQLNonNull(GraphQLBoolean)
},
limit: {
type: new GraphQLNonNull(GraphQLInt)
},
nextPage: {
type: GraphQLInt
},
offset: {
type: GraphQLInt
},
page: {
type: new GraphQLNonNull(GraphQLInt)
},
pagingCounter: {
type: new GraphQLNonNull(GraphQLInt)
},
prevPage: {
type: GraphQLInt
},
totalDocs: {
type: new GraphQLNonNull(GraphQLInt)
},
totalPages: {
type: new GraphQLNonNull(GraphQLInt)
}
}
});
//# sourceMappingURL=buildPaginatedListType.js.map

View File

@@ -0,0 +1,42 @@
declare namespace pLimit {
interface Limit {
/**
The number of promises that are currently running.
*/
readonly activeCount: number;
/**
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
*/
readonly pendingCount: number;
/**
Discard pending promises that are waiting to run.
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
Note: This does not cancel promises that are already running.
*/
clearQueue: () => void;
/**
@param fn - Promise-returning/async function.
@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
@returns The promise returned by calling `fn(...arguments)`.
*/
<Arguments extends unknown[], ReturnType>(
fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
...arguments: Arguments
): Promise<ReturnType>;
}
}
/**
Run multiple promise-returning & async functions with limited concurrency.
@param concurrency - Concurrency limit. Minimum: `1`.
@returns A `limit` function.
*/
declare function pLimit(concurrency: number): pLimit.Limit;
export = pLimit;

View File

@@ -0,0 +1,29 @@
import type { ExpoSQLiteDatabase } from "./driver.js";
interface MigrationConfig {
journal: {
entries: {
idx: number;
when: number;
tag: string;
breakpoints: boolean;
}[];
};
migrations: Record<string, string>;
}
export declare function migrate<TSchema extends Record<string, unknown>>(db: ExpoSQLiteDatabase<TSchema>, config: MigrationConfig): Promise<void>;
interface State {
success: boolean;
error?: Error;
}
export declare const useMigrations: (db: ExpoSQLiteDatabase<any>, migrations: {
journal: {
entries: {
idx: number;
when: number;
tag: string;
breakpoints: boolean;
}[];
};
migrations: Record<string, string>;
}) => State;
export {};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"D E F A B","2":"zC","8":"K"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JD KD LD MD PC xC ND QC"},G:{"1":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"1":"mD"},I:{"1":"VC J I nD oD pD qD yC rD sD"},J:{"1":"D A"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"CSS 2.1 selectors",D:true};

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict'
const LexicalCheckListPlugin = process.env.NODE_ENV !== 'production' ? require('./LexicalCheckListPlugin.dev.js') : require('./LexicalCheckListPlugin.prod.js');
module.exports = LexicalCheckListPlugin;

View File

@@ -0,0 +1,43 @@
'use strict';
function isHighSurrogate(codePoint) {
return codePoint >= 0xd800 && codePoint <= 0xdbff;
}
function isLowSurrogate(codePoint) {
return codePoint >= 0xdc00 && codePoint <= 0xdfff;
}
// Truncate string by size in bytes
module.exports = function truncate(getLength, string, byteLength) {
if (typeof string !== "string") {
throw new Error("Input must be string");
}
var charLength = string.length;
var curByteLength = 0;
var codePoint;
var segment;
for (var i = 0; i < charLength; i += 1) {
codePoint = string.charCodeAt(i);
segment = string[i];
if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) {
i += 1;
segment += string[i];
}
curByteLength += getLength(segment);
if (curByteLength === byteLength) {
return string.slice(0, i + 1);
}
else if (curByteLength > byteLength) {
return string.slice(0, i - segment.length + 1);
}
}
return string;
};

View File

@@ -0,0 +1,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports._globalThis = void 0;
var node_1 = require("./node");
Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function () { return node_1._globalThis; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UploadEdits/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,kBAAkB,CAAC,EAAE,WAAW,CAAA;CACjC,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,MAAM,WAAW,CAAA;IACjC,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,iBAAiB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IAC/C,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AASD,eAAO,MAAM,mBAAmB,qCAAsC,wBAAwB,sBAqB7F,CAAA;AAED,eAAO,MAAM,cAAc,QAAO,kBAAwC,CAAA"}

View File

@@ -0,0 +1,171 @@
import { slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';
import state from 'state-local';
import config$1 from '../config/index.js';
import validators from '../validators/index.js';
import compose from '../utils/compose.js';
import merge from '../utils/deepMerge.js';
import makeCancelable from '../utils/makeCancelable.js';
var _excluded = ["monaco"];
/** the local state of the module */
var _state$create = state.create({
config: config$1,
isInitialized: false,
resolve: null,
reject: null,
monaco: null
}),
_state$create2 = _slicedToArray(_state$create, 2),
getState = _state$create2[0],
setState = _state$create2[1];
/**
* set the loader configuration
* @param {Object} config - the configuration object
*/
function config(globalConfig) {
var _validators$config = validators.config(globalConfig),
monaco = _validators$config.monaco,
config = _objectWithoutProperties(_validators$config, _excluded);
setState(function (state) {
return {
config: merge(state.config, config),
monaco: monaco
};
});
}
/**
* handles the initialization of the monaco-editor
* @return {Promise} - returns an instance of monaco (with a cancelable promise)
*/
function init() {
var state = getState(function (_ref) {
var monaco = _ref.monaco,
isInitialized = _ref.isInitialized,
resolve = _ref.resolve;
return {
monaco: monaco,
isInitialized: isInitialized,
resolve: resolve
};
});
if (!state.isInitialized) {
setState({
isInitialized: true
});
if (state.monaco) {
state.resolve(state.monaco);
return makeCancelable(wrapperPromise);
}
if (window.monaco && window.monaco.editor) {
storeMonacoInstance(window.monaco);
state.resolve(window.monaco);
return makeCancelable(wrapperPromise);
}
compose(injectScripts, getMonacoLoaderScript)(configureLoader);
}
return makeCancelable(wrapperPromise);
}
/**
* injects provided scripts into the document.body
* @param {Object} script - an HTML script element
* @return {Object} - the injected HTML script element
*/
function injectScripts(script) {
return document.body.appendChild(script);
}
/**
* creates an HTML script element with/without provided src
* @param {string} [src] - the source path of the script
* @return {Object} - the created HTML script element
*/
function createScript(src) {
var script = document.createElement('script');
return src && (script.src = src), script;
}
/**
* creates an HTML script element with the monaco loader src
* @return {Object} - the created HTML script element
*/
function getMonacoLoaderScript(configureLoader) {
var state = getState(function (_ref2) {
var config = _ref2.config,
reject = _ref2.reject;
return {
config: config,
reject: reject
};
});
var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
loaderScript.onload = function () {
return configureLoader();
};
loaderScript.onerror = state.reject;
return loaderScript;
}
/**
* configures the monaco loader
*/
function configureLoader() {
var state = getState(function (_ref3) {
var config = _ref3.config,
resolve = _ref3.resolve,
reject = _ref3.reject;
return {
config: config,
resolve: resolve,
reject: reject
};
});
var require = window.require;
require.config(state.config);
require(['vs/editor/editor.main'], function (loaded) {
var monaco = loaded.m /* for 0.53 & 0.54 */ || loaded /* for other versions */;
storeMonacoInstance(monaco);
state.resolve(monaco);
}, function (error) {
state.reject(error);
});
}
/**
* store monaco instance in local state
*/
function storeMonacoInstance(monaco) {
if (!getState().monaco) {
setState({
monaco: monaco
});
}
}
/**
* internal helper function
* extracts stored monaco instance
* @return {Object|null} - the monaco instance
*/
function __getMonacoInstance() {
return getState(function (_ref4) {
var monaco = _ref4.monaco;
return monaco;
});
}
var wrapperPromise = new Promise(function (resolve, reject) {
return setState({
resolve: resolve,
reject: reject
});
});
var loader = {
config: config,
init: init,
__getMonacoInstance: __getMonacoInstance
};
export { loader as default };

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FolderInput = createLucideIcon("FolderInput", [
[
"path",
{
d: "M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",
key: "fm4g5t"
}
],
["path", { d: "M2 13h10", key: "pgb2dq" }],
["path", { d: "m9 16 3-3-3-3", key: "6m91ic" }]
]);
export { FolderInput as default };
//# sourceMappingURL=folder-input.js.map

View File

@@ -0,0 +1,33 @@
import { nextDay } from "./nextDay.js";
/**
* The {@link nextFriday} function options.
*/
/**
* @name nextFriday
* @category Weekday Helpers
* @summary When is the next Friday?
*
* @description
* When is the next Friday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The next Friday
*
* @example
* // When is the next Friday after Mar, 22, 2020?
* const result = nextFriday(new Date(2020, 2, 22))
* //=> Fri Mar 27 2020 00:00:00
*/
export function nextFriday(date, options) {
return nextDay(date, 5, options);
}
// Fallback for modularized imports:
export default nextFriday;

View File

@@ -0,0 +1,17 @@
/**
* Create a new image name based on the output image name, the dimensions and
* the extension.
*
* Ignore the fact that duplicate names could happen if the there is one
* size with `width AND height` and one with only `height OR width`. Because
* space is expensive, we will reuse the same image for both sizes.
*
* @param outputImageName - the sanitized image name
* @param bufferInfo - the buffer info
* @param extension - the extension to use
* @returns the new image name that is not taken
*/ export const generateImageSizeFilename = ({ extension, height, outputImageName, width })=>{
return `${outputImageName}-${width}x${height}.${extension}`;
};
//# sourceMappingURL=generateImageSizeFilename.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeDuplicate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIzE,KAAK,IAAI,CAAC,CAAC,SAAS,UAAU,IAAI;IAChC,UAAU,EAAE,IAAI,GAAG,yBAAyB,CAAA;IAC5C,OAAO,EAAE,cAAc,CAAA;IACvB,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,SAAS,UAAU,0DAOvD,IAAI,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAiBrB,CAAA"}

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Github = createLucideIcon("Github", [
[
"path",
{
d: "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",
key: "tonef"
}
],
["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
]);
export { Github as default };
//# sourceMappingURL=github.js.map

View File

@@ -0,0 +1,11 @@
import { BatchSpanProcessorBase } from '../../../export/BatchSpanProcessorBase';
import { SpanExporter } from '../../../export/SpanExporter';
import { BatchSpanProcessorBrowserConfig } from '../../../types';
export declare class BatchSpanProcessor extends BatchSpanProcessorBase<BatchSpanProcessorBrowserConfig> {
private _visibilityChangeListener?;
private _pageHideListener?;
constructor(_exporter: SpanExporter, config?: BatchSpanProcessorBrowserConfig);
private onInit;
protected onShutdown(): void;
}
//# sourceMappingURL=BatchSpanProcessor.d.ts.map

View File

@@ -0,0 +1,56 @@
'use strict'
const { realImport, realRequire } = require('real-require')
module.exports = loadTransportStreamBuilder
/**
* Loads & returns a function to build transport streams
* @param {string} target
* @returns {Promise<function(object): Promise<import('node:stream').Writable>>}
* @throws {Error} In case the target module does not export a function
*/
async function loadTransportStreamBuilder (target) {
let fn
try {
const toLoad = target.startsWith('file://') ? target : 'file://' + target
if (toLoad.endsWith('.ts') || toLoad.endsWith('.cts')) {
// TODO: add support for the TSM modules loader ( https://github.com/lukeed/tsm ).
if (process[Symbol.for('ts-node.register.instance')]) {
realRequire('ts-node/register')
} else if (process.env && process.env.TS_NODE_DEV) {
realRequire('ts-node-dev')
}
// TODO: Support ES imports once tsc, tap & ts-node provide better compatibility guarantees.
fn = realRequire(decodeURIComponent(target))
} else {
fn = (await realImport(toLoad))
}
} catch (error) {
// See this PR for details: https://github.com/pinojs/thread-stream/pull/34
if ((error.code === 'ENOTDIR' || error.code === 'ERR_MODULE_NOT_FOUND')) {
fn = realRequire(target)
} else if (error.code === undefined || error.code === 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING') {
// When bundled with pkg, an undefined error is thrown when called with realImport
// When bundled with pkg and using node v20, an ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING error is thrown when called with realImport
// More info at: https://github.com/pinojs/thread-stream/issues/143
try {
fn = realRequire(decodeURIComponent(target))
} catch {
throw error
}
} else {
throw error
}
}
// Depending on how the default export is performed, and on how the code is
// transpiled, we may find cases of two nested "default" objects.
// See https://github.com/pinojs/pino/issues/1243#issuecomment-982774762
if (typeof fn === 'object') fn = fn.default
if (typeof fn === 'object') fn = fn.default
if (typeof fn !== 'function') throw Error('exported worker is not a function')
return fn
}

View File

@@ -0,0 +1,167 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["av. J.-C", "ap. J.-C"],
abbreviated: ["av. J.-C", "ap. J.-C"],
wide: ["avant Jésus-Christ", "après Jésus-Christ"],
};
const quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"janv.",
"févr.",
"mars",
"avr.",
"mai",
"juin",
"juil.",
"août",
"sept.",
"oct.",
"nov.",
"déc.",
],
wide: [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre",
],
};
const dayValues = {
narrow: ["D", "L", "M", "M", "J", "V", "S"],
short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
wide: [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi",
],
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "mat.",
afternoon: "ap.m.",
evening: "soir",
night: "mat.",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "matin",
afternoon: "après-midi",
evening: "soir",
night: "matin",
},
wide: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "du matin",
afternoon: "de laprès-midi",
evening: "du soir",
night: "du matin",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
if (number === 0) return "0";
const feminineUnits = ["year", "week", "hour", "minute", "second"];
let suffix;
if (number === 1) {
suffix = unit && feminineUnits.includes(unit) ? "ère" : "er";
} else {
suffix = "ème";
}
return number + suffix;
};
const LONG_MONTHS_TOKENS = ["MMM", "MMMM"];
const localize = (exports.localize = {
preprocessor: (date, parts) => {
// Replaces the `do` tokens with `d` when used with long month tokens and the day of the month is greater than one.
// Use case "do MMMM" => 1er août, 29 août
// see https://github.com/date-fns/date-fns/issues/1391
if (date.getDate() === 1) return parts;
const hasLongMonthToken = parts.some(
(part) => part.isToken && LONG_MONTHS_TOKENS.includes(part.value),
);
if (!hasLongMonthToken) return parts;
return parts.map((part) =>
part.isToken && part.value === "do"
? { isToken: true, value: "d" }
: part,
);
},
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
}),
});

View File

@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/versions`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/versions`,params:t??{},body:JSON.stringify(e),method:`POST`});export{t as createContentVersion,e as createContentVersions};
//# sourceMappingURL=versions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/queues/utilities/updateJob.ts"],"sourcesContent":["import type { ManyOptions } from '../../collections/operations/local/update.js'\nimport type { UpdateJobsArgs } from '../../database/types.js'\nimport type { Job } from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\n\nimport { jobAfterRead, jobsCollectionSlug } from '../config/collection.js'\n\ntype BaseArgs = {\n data: Partial<Job>\n depth?: number\n disableTransaction?: boolean\n limit?: number\n req: PayloadRequest\n returning?: boolean\n}\n\ntype ArgsByID = {\n id: number | string\n limit?: never\n sort?: never\n where?: never\n}\n\ntype ArgsWhere = {\n id?: never\n limit?: number\n sort?: Sort\n where: Where\n}\n\ntype RunJobsArgs = (ArgsByID | ArgsWhere) & BaseArgs\n\n/**\n * Convenience method for updateJobs by id\n */\nexport async function updateJob(args: ArgsByID & BaseArgs) {\n const result = await updateJobs(args)\n if (result) {\n return result[0]\n }\n}\n\n/**\n * Helper for updating jobs in the most performant way possible.\n * Handles deciding whether it can used direct db methods or not, and if so,\n * manually runs the afterRead hook that populates the `taskStatus` property.\n */\nexport async function updateJobs({\n id,\n data,\n depth,\n disableTransaction,\n limit: limitArg,\n req,\n returning,\n sort,\n where: whereArg,\n}: RunJobsArgs): Promise<Job[] | null> {\n const limit = id ? 1 : limitArg\n const where = id ? { id: { equals: id } } : whereArg\n\n if (depth || req.payload.config?.jobs?.runHooks) {\n const result = await req.payload.update({\n id,\n collection: jobsCollectionSlug,\n data,\n depth,\n disableTransaction,\n limit,\n req,\n where,\n } as ManyOptions<any, any>)\n if (returning === false || !result) {\n return null\n }\n return result.docs as Job[]\n }\n\n const jobReq = {\n transactionID:\n req.payload.db.name !== 'mongoose'\n ? ((await req.payload.db.beginTransaction()) as string)\n : undefined,\n }\n\n if (typeof data.updatedAt === 'undefined') {\n // Ensure updatedAt date is always updated\n data.updatedAt = new Date().toISOString()\n }\n\n const args: UpdateJobsArgs = id\n ? {\n id,\n data,\n req: jobReq,\n returning,\n }\n : {\n data,\n limit,\n req: jobReq,\n returning,\n sort,\n where: where as Where,\n }\n\n const updatedJobs: Job[] | null = await req.payload.db.updateJobs(args)\n\n if (req.payload.db.name !== 'mongoose' && jobReq.transactionID) {\n await req.payload.db.commitTransaction(jobReq.transactionID)\n }\n\n if (returning === false || !updatedJobs?.length) {\n return null\n }\n\n return updatedJobs.map((updatedJob) => {\n return jobAfterRead({\n config: req.payload.config,\n doc: updatedJob,\n })\n })\n}\n"],"names":["jobAfterRead","jobsCollectionSlug","updateJob","args","result","updateJobs","id","data","depth","disableTransaction","limit","limitArg","req","returning","sort","where","whereArg","equals","payload","config","jobs","runHooks","update","collection","docs","jobReq","transactionID","db","name","beginTransaction","undefined","updatedAt","Date","toISOString","updatedJobs","commitTransaction","length","map","updatedJob","doc"],"mappings":"AAKA,SAASA,YAAY,EAAEC,kBAAkB,QAAQ,0BAAyB;AA2B1E;;CAEC,GACD,OAAO,eAAeC,UAAUC,IAAyB;IACvD,MAAMC,SAAS,MAAMC,WAAWF;IAChC,IAAIC,QAAQ;QACV,OAAOA,MAAM,CAAC,EAAE;IAClB;AACF;AAEA;;;;CAIC,GACD,OAAO,eAAeC,WAAW,EAC/BC,EAAE,EACFC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,OAAOC,QAAQ,EACfC,GAAG,EACHC,SAAS,EACTC,IAAI,EACJC,OAAOC,QAAQ,EACH;IACZ,MAAMN,QAAQJ,KAAK,IAAIK;IACvB,MAAMI,QAAQT,KAAK;QAAEA,IAAI;YAAEW,QAAQX;QAAG;IAAE,IAAIU;IAE5C,IAAIR,SAASI,IAAIM,OAAO,CAACC,MAAM,EAAEC,MAAMC,UAAU;QAC/C,MAAMjB,SAAS,MAAMQ,IAAIM,OAAO,CAACI,MAAM,CAAC;YACtChB;YACAiB,YAAYtB;YACZM;YACAC;YACAC;YACAC;YACAE;YACAG;QACF;QACA,IAAIF,cAAc,SAAS,CAACT,QAAQ;YAClC,OAAO;QACT;QACA,OAAOA,OAAOoB,IAAI;IACpB;IAEA,MAAMC,SAAS;QACbC,eACEd,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,aAClB,MAAMhB,IAAIM,OAAO,CAACS,EAAE,CAACE,gBAAgB,KACvCC;IACR;IAEA,IAAI,OAAOvB,KAAKwB,SAAS,KAAK,aAAa;QACzC,0CAA0C;QAC1CxB,KAAKwB,SAAS,GAAG,IAAIC,OAAOC,WAAW;IACzC;IAEA,MAAM9B,OAAuBG,KACzB;QACEA;QACAC;QACAK,KAAKa;QACLZ;IACF,IACA;QACEN;QACAG;QACAE,KAAKa;QACLZ;QACAC;QACAC,OAAOA;IACT;IAEJ,MAAMmB,cAA4B,MAAMtB,IAAIM,OAAO,CAACS,EAAE,CAACtB,UAAU,CAACF;IAElE,IAAIS,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,cAAcH,OAAOC,aAAa,EAAE;QAC9D,MAAMd,IAAIM,OAAO,CAACS,EAAE,CAACQ,iBAAiB,CAACV,OAAOC,aAAa;IAC7D;IAEA,IAAIb,cAAc,SAAS,CAACqB,aAAaE,QAAQ;QAC/C,OAAO;IACT;IAEA,OAAOF,YAAYG,GAAG,CAAC,CAACC;QACtB,OAAOtC,aAAa;YAClBmB,QAAQP,IAAIM,OAAO,CAACC,MAAM;YAC1BoB,KAAKD;QACP;IACF;AACF"}

View File

@@ -0,0 +1,15 @@
/// <reference types="node" />
export declare class BufferReader {
private offset;
private buffer;
private encoding;
constructor(offset?: number);
setBuffer(offset: number, buffer: Buffer): void;
int16(): number;
byte(): number;
int32(): number;
uint32(): number;
string(length: number): string;
cstring(): string;
bytes(length: number): Buffer;
}

View File

@@ -0,0 +1,7 @@
/**
* Adds a CSS class to a given element.
*
* @param element the element
* @param className the CSS class name
*/
export default function addClass(element: Element | SVGElement, className: string): void;

View File

@@ -0,0 +1,86 @@
# postgres-bytea [![Build Status](https://travis-ci.org/bendrucker/postgres-bytea.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-bytea) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/postgres-bytea.svg)](https://greenkeeper.io/)
> Decode/encode Postgres bytea strings to Buffers
## Install
```sh
npm install postgres-bytea
```
## Usage
### Decoding
To decode a bytea string into a buffer:
```js
const bytea = require('postgres-bytea')
// bytea hex format
bytea.decode('\\x1234') // <Buffer 12 34>
// bytea escape format
bytea.decode('\\000\\100\\200') // <Buffer 00 40 80>
```
The `decode` function supports both the hex format used in Postgres 9+ and the escape format used in Postgres 8 and earlier. It automatically detects the format from the incoming data.
For backward compatibility, `decode` is also the default export from the package.
### Decoding (Stream)
To decode a bytea hex stream into binary:
```js
const bytea = require('postgres-bytea')
readable.pipe(new bytea.Decoder())
```
`Decoder` expects a double-escaped `\\x` prefix to allow reading from a `COPY TO` statement.
### Encoding (Stream)
```js
const bytea = require('postgres-bytea')
readable.pipe(new bytea.Encoder())
```
`Encoder` adds a double-escaped `\\x` prefix to allow writing to a `COPY FROM` statement.
## API
#### `bytea.decode(input)` -> `buffer`
##### input
*Required*
Type: `string`
A Postgres bytea binary string.
#### `new bytea.Decoder()` -> `stream.Transform`
Creates a bytea decoder stream that emits buffer chunks.
#### `new bytea.Encoder()` -> `stream.Transform`
Creates a bytea encoder stream that receives buffer chunks and emits them as bytea strings.
## Prefix Escaping
> The “hex” format encodes binary data as 2 hexadecimal digits per byte, most significant nibble first. The entire string is preceded by the sequence \x (to distinguish it from the escape format). In some contexts, the initial backslash may need to be escaped by doubling it (see Section 4.1.2.1).
>
> https://www.postgresql.org/docs/12/datatype-binary.html#id-1.5.7.12.9
A `SELECT` statement returns bytea values using the single-escaped `\x` prefix. The `COPY TO` and `COPY FROM` commands expect and return bytea values with the double-escaped `\\x` prefix.
`bytea.decode` expects the single-escaped prefix. The `Decoder` and `Encoder` streams expect the double-escaped prefix, since they are most useful in `COPY FROM` and `COPY TO` statements.
## License
MIT © [Ben Drucker](http://bendrucker.me)

View File

@@ -0,0 +1,98 @@
Prism.languages.elixir = {
'doc': {
pattern: /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,
inside: {
'attribute': /^@\w+/,
'string': /['"][\s\S]+/
}
},
'comment': {
pattern: /#.*/,
greedy: true
},
// ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r<foo>
'regex': {
pattern: /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,
greedy: true
},
'string': [
{
// ~s"""foo""" (multi-line), ~s'''foo''' (multi-line), ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo} (with interpolation care), ~s<foo>
pattern: /~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,
greedy: true,
inside: {
// See interpolation below
}
},
{
pattern: /("""|''')[\s\S]*?\1/,
greedy: true,
inside: {
// See interpolation below
}
},
{
// Multi-line strings are allowed
pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true,
inside: {
// See interpolation below
}
}
],
'atom': {
// Look-behind prevents bad highlighting of the :: operator
pattern: /(^|[^:]):\w+/,
lookbehind: true,
alias: 'symbol'
},
'module': {
pattern: /\b[A-Z]\w*\b/,
alias: 'class-name'
},
// Look-ahead prevents bad highlighting of the :: operator
'attr-name': /\b\w+\??:(?!:)/,
'argument': {
// Look-behind prevents bad highlighting of the && operator
pattern: /(^|[^&])&\d+/,
lookbehind: true,
alias: 'variable'
},
'attribute': {
pattern: /@\w+/,
alias: 'variable'
},
'function': /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,
'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,
'keyword': /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,
'boolean': /\b(?:false|nil|true)\b/,
'operator': [
/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,
{
// We don't want to match <<
pattern: /([^<])<(?!<)/,
lookbehind: true
},
{
// We don't want to match >>
pattern: /([^>])>(?!>)/,
lookbehind: true
}
],
'punctuation': /<<|>>|[.,%\[\]{}()]/
};
Prism.languages.elixir.string.forEach(function (o) {
o.inside = {
'interpolation': {
pattern: /#\{[^}]+\}/,
inside: {
'delimiter': {
pattern: /^#\{|\}$/,
alias: 'punctuation'
},
rest: Prism.languages.elixir
}
}
};
});

View File

@@ -0,0 +1,72 @@
import * as http from 'node:http';
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
export declare const instrumentExpress: ((options?: unknown) => ExpressInstrumentation) & {
id: string;
};
/**
* Adds Sentry tracing instrumentation for [Express](https://expressjs.com/).
*
* If you also want to capture errors, you need to call `setupExpressErrorHandler(app)` after you set up your Express server.
*
* For more information, see the [express documentation](https://docs.sentry.io/platforms/javascript/guides/express/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.expressIntegration()],
* })
* ```
*/
export declare const expressIntegration: () => import("@sentry/core").Integration;
interface MiddlewareError extends Error {
status?: number | string;
statusCode?: number | string;
status_code?: number | string;
output?: {
statusCode?: number | string;
};
}
type ExpressMiddleware = (req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void;
type ExpressErrorMiddleware = (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
interface ExpressHandlerOptions {
/**
* Callback method deciding whether error should be captured and sent to Sentry
* @param error Captured middleware error
*/
shouldHandleError?(this: void, error: MiddlewareError): boolean;
}
/**
* An Express-compatible error handler.
*/
export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressErrorMiddleware;
/**
* Add an Express error handler to capture errors to Sentry.
*
* The error handler must be before any other middleware and after all controllers.
*
* @param app The Express instances
* @param options {ExpressHandlerOptions} Configuration options for the handler
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
* const express = require("express");
*
* const app = express();
*
* // Add your routes, etc.
*
* // Add this after all routes,
* // but before any and other error-handling middlewares are defined
* Sentry.setupExpressErrorHandler(app);
*
* app.listen(3000);
* ```
*/
export declare function setupExpressErrorHandler(app: {
use: (middleware: ExpressMiddleware | ExpressErrorMiddleware) => unknown;
}, options?: ExpressHandlerOptions): void;
export {};
//# sourceMappingURL=express.d.ts.map

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PhoneMissed = createLucideIcon("PhoneMissed", [
["line", { x1: "22", x2: "16", y1: "2", y2: "8", key: "1xzwqn" }],
["line", { x1: "16", x2: "22", y1: "2", y2: "8", key: "13zxdn" }],
[
"path",
{
d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",
key: "foiqr5"
}
]
]);
export { PhoneMissed as default };
//# sourceMappingURL=phone-missed.js.map

View File

@@ -0,0 +1,11 @@
import type { HandlerDataDom } from '@sentry/core';
/**
* Add an instrumentation handler for when a click or a keypress happens.
*
* Use at your own risk, this might break without changelog notice, only used internally.
* @hidden
*/
export declare function addClickKeypressInstrumentationHandler(handler: (data: HandlerDataDom) => void): void;
/** Exported for tests only. */
export declare function instrumentDOM(): void;
//# sourceMappingURL=dom.d.ts.map

View File

@@ -0,0 +1,8 @@
'use strict'
const parse = require('./parse')
const valid = (version, options) => {
const v = parse(version, options)
return v ? v.version : null
}
module.exports = valid

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/elements/DraggableSortable/useDraggableSortable/types.ts"],"sourcesContent":["import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities'\nimport type { HTMLAttributes } from 'react'\n\nexport type UseDraggableSortableReturn = {\n readonly attributes: HTMLAttributes<unknown>\n readonly isDragging?: boolean\n readonly listeners: SyntheticListenerMap\n readonly setNodeRef: (node: HTMLElement | null) => void\n readonly transform: string\n readonly transition: string\n}\n"],"mappings":"AAGA","ignoreList":[]}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRules = exports.isJSONType = void 0;
const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
const jsonTypes = new Set(_jsonTypes);
function isJSONType(x) {
return typeof x == "string" && jsonTypes.has(x);
}
exports.isJSONType = isJSONType;
function getRules() {
const groups = {
number: { type: "number", rules: [] },
string: { type: "string", rules: [] },
array: { type: "array", rules: [] },
object: { type: "object", rules: [] },
};
return {
types: { ...groups, integer: true, boolean: true, null: true },
rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
post: { rules: [] },
all: {},
keywords: {},
};
}
exports.getRules = getRules;
//# sourceMappingURL=rules.js.map

View File

@@ -0,0 +1,31 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
require('./common');
var assert = require('assert');
var events = require('../');
var e = new events.EventEmitter();
if (Object.create) assert.ok(!(e._events instanceof Object));
assert.strictEqual(Object.keys(e._events).length, 0);
e.setMaxListeners(5);
assert.strictEqual(Object.keys(e._events).length, 0);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// @ts-ignore - imported using Rollup json plugin\nexport { version as npmVersion } from '../package.json';\n// In version 7, we changed the PostgreSQL indexes API\nexport const compatibilityVersion = 10;\n"],"mappings":"AACA,SAAoB,eAAkB;AAE/B,MAAM,uBAAuB;","names":[]}

View File

@@ -0,0 +1,59 @@
{
"name": "strip-ansi",
"version": "7.1.2",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"funding": "https://github.com/chalk/strip-ansi?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"types": "./index.d.ts",
"sideEffects": false,
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-regex": "^6.0.1"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
}
}

View File

@@ -0,0 +1,28 @@
"use strict";
exports.bg = void 0;
var _index = require("./bg/_lib/formatDistance.cjs");
var _index2 = require("./bg/_lib/formatLong.cjs");
var _index3 = require("./bg/_lib/formatRelative.cjs");
var _index4 = require("./bg/_lib/localize.cjs");
var _index5 = require("./bg/_lib/match.cjs");
/**
* @category Locales
* @summary Bulgarian locale.
* @language Bulgarian
* @iso-639-2 bul
* @author Nikolay Stoynov [@arvigeus](https://github.com/arvigeus)
* @author Tsvetan Ovedenski [@fintara](https://github.com/fintara)
*/
const bg = (exports.bg = {
code: "bg",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"isRowCollapsed.d.ts","sourceRoot":"","sources":["../../../src/forms/fieldSchemasToFormState/isRowCollapsed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAEjF,wBAAgB,cAAc,CAAC,EAC7B,cAAc,EACd,KAAK,EACL,WAAW,EACX,GAAG,GACJ,EAAE;IACD,cAAc,EAAE,oBAAoB,CAAA;IACpC,KAAK,EAAE,UAAU,GAAG,WAAW,CAAA;IAC/B,WAAW,EAAE,GAAG,GAAG,SAAS,CAAA;IAC5B,GAAG,EAAE,GAAG,CAAA;CACT,GAAG,OAAO,CAYV"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../src/tracing/openai/constants.ts"],"sourcesContent":["export const OPENAI_INTEGRATION_NAME = 'OpenAI';\n\n// https://platform.openai.com/docs/quickstart?api-mode=responses\n// https://platform.openai.com/docs/quickstart?api-mode=chat\n// https://platform.openai.com/docs/api-reference/conversations\nexport const INSTRUMENTED_METHODS = [\n 'responses.create',\n 'chat.completions.create',\n 'embeddings.create',\n // Conversations API - for conversation state management\n // https://platform.openai.com/docs/guides/conversation-state\n 'conversations.create',\n] as const;\nexport const RESPONSES_TOOL_CALL_EVENT_TYPES = [\n 'response.output_item.added',\n 'response.function_call_arguments.delta',\n 'response.function_call_arguments.done',\n 'response.output_item.done',\n] as const;\nexport const RESPONSE_EVENT_TYPES = [\n 'response.created',\n 'response.in_progress',\n 'response.failed',\n 'response.completed',\n 'response.incomplete',\n 'response.queued',\n 'response.output_text.delta',\n ...RESPONSES_TOOL_CALL_EVENT_TYPES,\n] as const;\n"],"names":[],"mappings":"AAAO,MAAM,uBAAA,GAA0B;;AAEvC;AACA;AACA;AACO,MAAM,uBAAuB;AACpC,EAAE,kBAAkB;AACpB,EAAE,yBAAyB;AAC3B,EAAE,mBAAmB;AACrB;AACA;AACA,EAAE,sBAAsB;AACxB,CAAA;AACO,MAAM,kCAAkC;AAC/C,EAAE,4BAA4B;AAC9B,EAAE,wCAAwC;AAC1C,EAAE,uCAAuC;AACzC,EAAE,2BAA2B;AAC7B,CAAA;AACO,MAAM,uBAAuB;AACpC,EAAE,kBAAkB;AACpB,EAAE,sBAAsB;AACxB,EAAE,iBAAiB;AACnB,EAAE,oBAAoB;AACtB,EAAE,qBAAqB;AACvB,EAAE,iBAAiB;AACnB,EAAE,4BAA4B;AAC9B,EAAE,GAAG,+BAA+B;AACpC,CAAA;;;;"}

View File

@@ -0,0 +1,13 @@
import type { XataHttpDatabase } from "./driver.js";
export interface MigrationConfig {
migrationsFolder: string;
migrationsTable?: string;
}
/**
* This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
*
* NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails,
* no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.
* @param db - drizzle db instance
* @param config - path to migration folder generated by drizzle-kit
*/ export declare function migrate<TSchema extends Record<string, unknown>>(db: XataHttpDatabase<TSchema>, config: MigrationConfig): Promise<void>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"deepRequired.js","sourceRoot":"","sources":["../../src/definitions/deepRequired.ts"],"names":[],"mappings":";;AACA,sDAAsE;AAEtE,SAAwB,MAAM;IAC5B,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;QACnB,IAAI,CAAC,GAAe;YAClB,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,GAAG,CAAA;YAC1B,MAAM,KAAK,GAAI,MAAmB,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,IAAI,OAAO,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;YACzF,GAAG,CAAC,IAAI,CAAC,IAAA,YAAE,EAAC,GAAG,KAAK,CAAC,CAAC,CAAA;YAEtB,SAAS,OAAO,CAAC,WAAmB;gBAClC,IAAI,WAAW,KAAK,EAAE;oBAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;gBACzE,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBACvC,IAAI,CAAC,GAAS,IAAI,CAAA;gBAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC/B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAA,WAAC,EAAA,GAAG,CAAC,GAAG,IAAA,qBAAW,EAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAC1D,CAAA;gBACD,OAAO,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,CAAA;YACnB,CAAC;QACH,CAAC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAC;SAChD;KACF,CAAA;AACH,CAAC;AAzBD,yBAyBC;AAED,SAAS,iBAAiB,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"}

View File

@@ -0,0 +1,171 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
// Reference: https://www.unicode.org/cldr/charts/32/summary/kn.html
const eraValues = {
narrow: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"],
abbreviated: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"], // CLDR #1618, #1620
wide: ["ಕ್ರಿಸ್ತ ಪೂರ್ವ", "ಕ್ರಿಸ್ತ ಶಕ"], // CLDR #1614, #1616
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["ತ್ರೈ 1", "ತ್ರೈ 2", "ತ್ರೈ 3", "ತ್ರೈ 4"], // CLDR #1630 - #1638
wide: ["1ನೇ ತ್ರೈಮಾಸಿಕ", "2ನೇ ತ್ರೈಮಾಸಿಕ", "3ನೇ ತ್ರೈಮಾಸಿಕ", "4ನೇ ತ್ರೈಮಾಸಿಕ"],
// CLDR #1622 - #1629
};
// CLDR #1646 - #1717
const monthValues = {
narrow: ["ಜ", "ಫೆ", "ಮಾ", "ಏ", "ಮೇ", "ಜೂ", "ಜು", "ಆ", "ಸೆ", "ಅ", "ನ", "ಡಿ"],
abbreviated: [
"ಜನ",
"ಫೆಬ್ರ",
"ಮಾರ್ಚ್",
"ಏಪ್ರಿ",
"ಮೇ",
"ಜೂನ್",
"ಜುಲೈ",
"ಆಗ",
"ಸೆಪ್ಟೆಂ",
"ಅಕ್ಟೋ",
"ನವೆಂ",
"ಡಿಸೆಂ",
],
wide: [
"ಜನವರಿ",
"ಫೆಬ್ರವರಿ",
"ಮಾರ್ಚ್",
"ಏಪ್ರಿಲ್",
"ಮೇ",
"ಜೂನ್",
"ಜುಲೈ",
"ಆಗಸ್ಟ್",
"ಸೆಪ್ಟೆಂಬರ್",
"ಅಕ್ಟೋಬರ್",
"ನವೆಂಬರ್",
"ಡಿಸೆಂಬರ್",
],
};
// CLDR #1718 - #1773
const dayValues = {
narrow: ["ಭಾ", "ಸೋ", "ಮಂ", "ಬು", "ಗು", "ಶು", "ಶ"],
short: ["ಭಾನು", "ಸೋಮ", "ಮಂಗಳ", "ಬುಧ", "ಗುರು", "ಶುಕ್ರ", "ಶನಿ"],
abbreviated: ["ಭಾನು", "ಸೋಮ", "ಮಂಗಳ", "ಬುಧ", "ಗುರು", "ಶುಕ್ರ", "ಶನಿ"],
wide: [
"ಭಾನುವಾರ",
"ಸೋಮವಾರ",
"ಮಂಗಳವಾರ",
"ಬುಧವಾರ",
"ಗುರುವಾರ",
"ಶುಕ್ರವಾರ",
"ಶನಿವಾರ",
],
};
// CLDR #1774 - #1815
const dayPeriodValues = {
narrow: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾಹ್ನ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾಹ್ನ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
abbreviated: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
wide: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ಪೂ",
pm: "ಅ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
abbreviated: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
wide: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + "ನೇ";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,95 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import React, { useCallback } from 'react';
import { toast } from 'sonner';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { Button } from '../Button/index.js';
import { ConfirmationModal } from '../ConfirmationModal/index.js';
import { Translation } from '../Translation/index.js';
export function GenerateConfirmation(props) {
const $ = _c(12);
const {
highlightField,
setKey
} = props;
const {
id
} = useDocumentInfo();
const {
toggleModal
} = useModal();
const {
t
} = useTranslation();
const modalSlug = `generate-confirmation-${id}`;
let t0;
if ($[0] !== highlightField || $[1] !== setKey || $[2] !== t) {
t0 = () => {
setKey();
toast.success(t("authentication:newAPIKeyGenerated"));
highlightField(true);
};
$[0] = highlightField;
$[1] = setKey;
$[2] = t;
$[3] = t0;
} else {
t0 = $[3];
}
const handleGenerate = t0;
let t1;
if ($[4] !== modalSlug || $[5] !== toggleModal) {
t1 = () => {
toggleModal(modalSlug);
};
$[4] = modalSlug;
$[5] = toggleModal;
$[6] = t1;
} else {
t1 = $[6];
}
let t2;
if ($[7] !== handleGenerate || $[8] !== modalSlug || $[9] !== t || $[10] !== t1) {
t2 = _jsxs(React.Fragment, {
children: [_jsx(Button, {
buttonStyle: "secondary",
onClick: t1,
size: "small",
children: t("authentication:generateNewAPIKey")
}), _jsx(ConfirmationModal, {
body: _jsx(Translation, {
elements: {
1: _temp
},
i18nKey: "authentication:generatingNewAPIKeyWillInvalidate",
t
}),
confirmLabel: t("authentication:generate"),
heading: t("authentication:confirmGeneration"),
modalSlug,
onConfirm: handleGenerate
})]
});
$[7] = handleGenerate;
$[8] = modalSlug;
$[9] = t;
$[10] = t1;
$[11] = t2;
} else {
t2 = $[11];
}
return t2;
}
function _temp(t0) {
const {
children
} = t0;
return _jsx("strong", {
children
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,409 @@
'use strict'
const test = require('tape')
const split = require('./')
const callback = require('callback-stream')
const strcb = callback.bind(null, { decodeStrings: false })
const objcb = callback.bind(null, { objectMode: true })
test('split two lines on end', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\nworld')
})
test('split two lines on two writes', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.write('hello')
input.write('\nworld')
input.end()
})
test('split four lines on three writes', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world', 'bye', 'world'])
}))
input.write('hello\nwor')
input.write('ld\nbye\nwo')
input.write('rld')
input.end()
})
test('accumulate multiple writes', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['helloworld'])
}))
input.write('hello')
input.write('world')
input.end()
})
test('split using a custom string matcher', function (t) {
t.plan(2)
const input = split('~')
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('split using a custom regexp matcher', function (t) {
t.plan(2)
const input = split(/~/)
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('support an option argument', function (t) {
t.plan(2)
const input = split({ highWaterMark: 2 })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\nworld')
})
test('support a mapper function', function (t) {
t.plan(2)
const a = { a: '42' }
const b = { b: '24' }
const input = split(JSON.parse)
input.pipe(objcb(function (err, list) {
t.error(err)
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('\n')
input.end(JSON.stringify(b))
})
test('split lines windows-style', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\r\nworld')
})
test('splits a buffer', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end(Buffer.from('hello\nworld'))
})
test('do not end on undefined', function (t) {
t.plan(2)
const input = split(function (line) { })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, [])
}))
input.end(Buffer.from('hello\nworld'))
})
test('has destroy method', function (t) {
t.plan(1)
const input = split(function (line) { })
input.on('close', function () {
t.ok(true, 'close emitted')
t.end()
})
input.destroy()
})
test('support custom matcher and mapper', function (t) {
t.plan(4)
const a = { a: '42' }
const b = { b: '24' }
const input = split('~', JSON.parse)
t.equal(input.matcher, '~')
t.equal(typeof input.mapper, 'function')
input.pipe(objcb(function (err, list) {
t.notOk(err, 'no errors')
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('~')
input.end(JSON.stringify(b))
})
test('support custom matcher and options', function (t) {
t.plan(6)
const input = split('~', { highWaterMark: 1024 })
t.equal(input.matcher, '~')
t.equal(typeof input.mapper, 'function')
t.equal(input._readableState.highWaterMark, 1024)
t.equal(input._writableState.highWaterMark, 1024)
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('support mapper and options', function (t) {
t.plan(6)
const a = { a: '42' }
const b = { b: '24' }
const input = split(JSON.parse, { highWaterMark: 1024 })
t.ok(input.matcher instanceof RegExp, 'matcher is RegExp')
t.equal(typeof input.mapper, 'function')
t.equal(input._readableState.highWaterMark, 1024)
t.equal(input._writableState.highWaterMark, 1024)
input.pipe(objcb(function (err, list) {
t.error(err)
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('\n')
input.end(JSON.stringify(b))
})
test('split utf8 chars', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫烫烫', '锟斤拷'])
}))
const buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8')
for (let i = 0; i < buf.length; ++i) {
input.write(buf.slice(i, i + 1))
}
input.end()
})
test('split utf8 chars 2by2', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫烫烫', '烫烫烫'])
}))
const str = '烫烫烫\r\n烫烫烫'
const buf = Buffer.from(str, 'utf8')
for (let i = 0; i < buf.length; i += 2) {
input.write(buf.slice(i, i + 2))
}
input.end()
})
test('split lines when the \n comes at the end of a chunk', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.write('hello\n')
input.end('world')
})
test('truncated utf-8 char', function (t) {
t.plan(2)
const input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()])
}))
const str = '烫烫'
const buf = Buffer.from(str, 'utf8')
input.write(buf.slice(0, 3))
input.end(buf.slice(3, 4))
})
test('maximum buffer limit', function (t) {
t.plan(1)
const input = split({ maxLength: 2 })
input.on('error', function (err) {
t.ok(err)
})
input.resume()
input.write('hey')
})
test('readable highWaterMark', function (t) {
const input = split()
t.equal(input._readableState.highWaterMark, 16)
t.end()
})
test('maxLength < chunk size', function (t) {
t.plan(2)
const input = split({ maxLength: 2 })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['a', 'b'])
}))
input.end('a\nb')
})
test('maximum buffer limit w/skip', function (t) {
t.plan(2)
const input = split({ maxLength: 2, skipOverflow: true })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['a', 'b', 'c'])
}))
input.write('a\n123')
input.write('456')
input.write('789\nb\nc')
input.end()
})
test("don't modify the options object", function (t) {
t.plan(2)
const options = {}
const input = split(options)
input.pipe(strcb(function (err, list) {
t.error(err)
t.same(options, {})
}))
input.end()
})
test('mapper throws flush', function (t) {
t.plan(1)
const error = new Error()
const input = split(function () {
throw error
})
input.on('error', (err, list) => {
t.same(err, error)
})
input.end('hello')
})
test('mapper throws on transform', function (t) {
t.plan(1)
const error = new Error()
const input = split(function (l) {
throw error
})
input.on('error', (err) => {
t.same(err, error)
})
input.write('a')
input.write('\n')
input.end('b')
})
test('supports Symbol.split', function (t) {
t.plan(2)
const input = split({
[Symbol.split] (str) {
return str.split('~')
}
})
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})

View File

@@ -0,0 +1,9 @@
"use strict";
// Generated using scripts/write-decode-map.ts
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = new Uint16Array(
// prettier-ignore
"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022"
.split("")
.map(function (c) { return c.charCodeAt(0); }));
//# sourceMappingURL=decode-data-xml.js.map

View File

@@ -0,0 +1,106 @@
{
"name": "foreground-child",
"version": "3.3.1",
"description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"exports": {
"./watchdog": {
"import": {
"types": "./dist/esm/watchdog.d.ts",
"default": "./dist/esm/watchdog.js"
},
"require": {
"types": "./dist/commonjs/watchdog.d.ts",
"default": "./dist/commonjs/watchdog.js"
}
},
"./proxy-signals": {
"import": {
"types": "./dist/esm/proxy-signals.d.ts",
"default": "./dist/esm/proxy-signals.js"
},
"require": {
"types": "./dist/commonjs/proxy-signals.d.ts",
"default": "./dist/commonjs/proxy-signals.js"
}
},
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
},
"dependencies": {
"cross-spawn": "^7.0.6",
"signal-exit": "^4.0.1"
},
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write . --log-level warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"prettier": {
"experimentalTernaries": true,
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"tap": {
"typecheck": true
},
"repository": {
"type": "git",
"url": "git+https://github.com/tapjs/foreground-child.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/node": "^18.15.11",
"@types/tap": "^15.0.8",
"prettier": "^3.3.2",
"tap": "^21.1.0",
"tshy": "^3.0.2",
"typedoc": "^0.24.2",
"typescript": "^5.0.2"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"tshy": {
"exports": {
"./watchdog": "./src/watchdog.ts",
"./proxy-signals": "./src/proxy-signals.ts",
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"type": "module",
"module": "./dist/esm/index.js"
}

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
const dateFormats = {
full: "EEEE, d. MMMM yyyy.",
long: "d. MMMM yyyy.",
medium: "d. MMM yy.",
short: "dd. MM. yy.",
};
const timeFormats = {
full: "HH:mm:ss (zzzz)",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'у' {{time}}",
long: "{{date}} 'у' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,41 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { components as SelectComponents } from 'react-select';
import { useTranslation } from '../../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'multi-value-label';
export const MultiValueLabel = props => {
const {
data,
selectProps: t0
} = props;
const {
customProps: t1
} = t0 === undefined ? {} : t0;
const {
draggableProps,
editableProps
} = t1 === undefined ? {} : t1;
const {
i18n
} = useTranslation();
const className = `${baseClass}__text`;
const labelText = data.label ? getTranslation(data.label, i18n) : "";
const titleText = typeof labelText === "string" ? labelText : "";
return _jsx("div", {
className: baseClass,
title: titleText,
children: _jsx(SelectComponents.MultiValueLabel, {
...props,
innerProps: {
className,
...(editableProps && editableProps(data, className, props.selectProps) || {}),
...(draggableProps || {})
}
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D zC","260":"E","388":"F A B"},B:{"1":"0 1 2 3 4 5 6 7 8 G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","388":"C L M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ND","129":"QC","260":"F B JD KD LD MD PC xC"},G:{"1":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"1":"VC J I nD oD pD qD yC rD sD"},J:{"1":"D A"},K:{"1":"C H QC","260":"A B PC xC"},L:{"1":"I"},M:{"1":"OC"},N:{"388":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:4,C:"CSS outline properties",D:true};

View File

@@ -0,0 +1,103 @@
import { entityKind } from "../entity.js";
import { NoopLogger } from "../logger.js";
import { fillPlaceholders } from "../sql/sql.js";
import { SQLiteTransaction } from "../sqlite-core/index.js";
import {
SQLiteSession
} from "../sqlite-core/session.js";
import { SQLitePreparedQuery as PreparedQueryBase } from "../sqlite-core/session.js";
import { mapResultRow } from "../utils.js";
class SQLiteDOSession extends SQLiteSession {
constructor(client, dialect, schema, options = {}) {
super(dialect);
this.client = client;
this.schema = schema;
this.logger = options.logger ?? new NoopLogger();
}
static [entityKind] = "SQLiteDOSession";
logger;
prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper) {
return new SQLiteDOPreparedQuery(
this.client,
query,
this.logger,
fields,
executeMethod,
isResponseInArrayMode,
customResultMapper
);
}
transaction(transaction, _config) {
const tx = new SQLiteDOTransaction("sync", this.dialect, this, this.schema);
return this.client.transactionSync(() => transaction(tx));
}
}
class SQLiteDOTransaction extends SQLiteTransaction {
static [entityKind] = "SQLiteDOTransaction";
transaction(transaction) {
const tx = new SQLiteDOTransaction("sync", this.dialect, this.session, this.schema, this.nestedIndex + 1);
return this.session.transaction(() => transaction(tx));
}
}
class SQLiteDOPreparedQuery extends PreparedQueryBase {
constructor(client, query, logger, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
super("sync", executeMethod, query, void 0, void 0, void 0);
this.client = client;
this.logger = logger;
this.fields = fields;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
}
static [entityKind] = "SQLiteDOPreparedQuery";
run(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
params.length > 0 ? this.client.sql.exec(this.query.sql, ...params) : this.client.sql.exec(this.query.sql);
}
all(placeholderValues) {
const { fields, joinsNotNullableMap, query, logger, client, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = fillPlaceholders(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return params.length > 0 ? client.sql.exec(query.sql, ...params).toArray() : client.sql.exec(query.sql).toArray();
}
const rows = this.values(placeholderValues);
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap));
}
get(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
const { fields, client, joinsNotNullableMap, customResultMapper, query } = this;
if (!fields && !customResultMapper) {
return (params.length > 0 ? client.sql.exec(query.sql, ...params) : client.sql.exec(query.sql)).next().value;
}
const rows = this.values(placeholderValues);
const row = rows[0];
if (!row) {
return void 0;
}
if (customResultMapper) {
return customResultMapper(rows);
}
return mapResultRow(fields, row, joinsNotNullableMap);
}
values(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
const res = params.length > 0 ? this.client.sql.exec(this.query.sql, ...params) : this.client.sql.exec(this.query.sql);
return res.raw().toArray();
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
export {
SQLiteDOPreparedQuery,
SQLiteDOSession,
SQLiteDOTransaction
};
//# sourceMappingURL=session.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EACpC,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,gCAAgC,EAChC,sBAAsB,EACtB,gBAAgB,EAChB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,sCAAsC,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAElH,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEnH,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}

View File

@@ -0,0 +1,19 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const ANTHROPIC_AI_INTEGRATION_NAME = 'Anthropic_AI';
// https://docs.anthropic.com/en/api/messages
// https://docs.anthropic.com/en/api/models-list
const ANTHROPIC_AI_INSTRUMENTED_METHODS = [
'messages.create',
'messages.stream',
'messages.countTokens',
'models.get',
'completions.create',
'models.retrieve',
'beta.messages.create',
] ;
exports.ANTHROPIC_AI_INSTRUMENTED_METHODS = ANTHROPIC_AI_INSTRUMENTED_METHODS;
exports.ANTHROPIC_AI_INTEGRATION_NAME = ANTHROPIC_AI_INTEGRATION_NAME;
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "eeee 'گذشته در' p",
yesterday: "'دیروز در' p",
today: "'امروز در' p",
tomorrow: "'فردا در' p",
nextWeek: "eeee 'در' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneDeep;
var _cloneNode = require("./cloneNode.js");
function cloneDeep(node) {
return (0, _cloneNode.default)(node);
}
//# sourceMappingURL=cloneDeep.js.map

View File

@@ -0,0 +1,55 @@
import type { KeyLike, JWEKeyManagementHeaderParameters, CompactJWEHeaderParameters, EncryptOptions } from '../../types';
/**
* The CompactEncrypt class is used to build and encrypt Compact JWE strings.
*
* This class is exported (as a named export) from the main `'jose'` module entry point as well as
* from its subpath export `'jose/jwe/compact/encrypt'`.
*
*/
export declare class CompactEncrypt {
private _flattened;
/** @param plaintext Binary representation of the plaintext to encrypt. */
constructor(plaintext: Uint8Array);
/**
* Sets a content encryption key to use, by default a random suitable one is generated for the JWE
* enc" (Encryption Algorithm) Header Parameter.
*
* @deprecated You should not use this method. It is only really intended for test and vector
* validation purposes.
*
* @param cek JWE Content Encryption Key.
*/
setContentEncryptionKey(cek: Uint8Array): this;
/**
* Sets the JWE Initialization Vector to use for content encryption, by default a random suitable
* one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.
*
* @deprecated You should not use this method. It is only really intended for test and vector
* validation purposes.
*
* @param iv JWE Initialization Vector.
*/
setInitializationVector(iv: Uint8Array): this;
/**
* Sets the JWE Protected Header on the CompactEncrypt object.
*
* @param protectedHeader JWE Protected Header object.
*/
setProtectedHeader(protectedHeader: CompactJWEHeaderParameters): this;
/**
* Sets the JWE Key Management parameters to be used when encrypting the Content Encryption Key.
* You do not need to invoke this method, it is only really intended for test and vector
* validation purposes.
*
* @param parameters JWE Key Management parameters.
*/
setKeyManagementParameters(parameters: JWEKeyManagementHeaderParameters): this;
/**
* Encrypts and resolves the value of the Compact JWE string.
*
* @param key Public Key or Secret to encrypt the JWE with. See
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWE Encryption options.
*/
encrypt(key: KeyLike | Uint8Array, options?: EncryptOptions): Promise<string>;
}

View File

@@ -0,0 +1,33 @@
import { DirectusFolder } from "./folder.cjs";
import { DirectusUser } from "./user.cjs";
import { MergeCoreCollection } from "../types/schema.cjs";
//#region src/schema/file.d.ts
type DirectusFile<Schema = any> = MergeCoreCollection<Schema, 'directus_files', {
id: string;
storage: string;
filename_disk: string | null;
filename_download: string;
title: string | null;
type: string | null;
folder: DirectusFolder<Schema> | string | null;
uploaded_by: DirectusUser<Schema> | string | null;
uploaded_on: 'datetime';
modified_by: DirectusUser<Schema> | string | null;
modified_on: 'datetime';
charset: string | null;
filesize: string | null;
width: number | null;
height: number | null;
duration: number | null;
embed: unknown | null;
description: string | null;
location: string | null;
tags: string[] | null;
metadata: Record<string, any> | null;
focal_point_x: number | null;
focal_point_y: number | null;
}>;
//#endregion
export { DirectusFile };
//# sourceMappingURL=file.d.cts.map

View File

@@ -0,0 +1,48 @@
{
"name": "cjs-module-lexer",
"version": "2.2.0",
"description": "Lexes CommonJS modules, returning their named exports metadata",
"main": "lexer.js",
"exports": {
"import": {
"types": "./lexer.d.mts",
"default": "./dist/lexer.mjs"
},
"default": "./lexer.js"
},
"types": "lexer.d.ts",
"scripts": {
"test-js": "cross-env NODE_OPTIONS=--disallow-code-generation-from-strings mocha -b -u tdd test/*.js",
"test-wasm": "cross-env WASM=1 NODE_OPTIONS=--disallow-code-generation-from-strings mocha -b -u tdd test/*.js",
"test-wasm-sync": "cross-env WASM_SYNC=1 NODE_OPTIONS=--disallow-code-generation-from-strings mocha -b -u tdd test/*.js",
"test": "npm run test-wasm && npm run test-wasm-sync && npm run test-js",
"bench": "node --expose-gc bench/index.mjs",
"build": "node build.js ; babel dist/lexer.mjs -o dist/lexer.js ; terser dist/lexer.js -o dist/lexer.js",
"build-wasm": "make lib/lexer.wasm ; node build.js",
"prepublishOnly": "make && npm run build",
"footprint": "npm run build && cat dist/lexer.js | gzip -9f | wc -c"
},
"author": "Guy Bedford",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"cross-env": "^7.0.3",
"kleur": "^2.0.2",
"mocha": "^9.1.3",
"terser": "^4.1.4"
},
"files": [
"dist",
"lexer.d.ts"
],
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/cjs-module-lexer.git"
},
"bugs": {
"url": "https://github.com/nodejs/cjs-module-lexer/issues"
},
"homepage": "https://github.com/nodejs/cjs-module-lexer#readme"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"nb.d.ts","sourceRoot":"","sources":["../../../src/exports/i18n/nb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,uCAAuC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"rs.d.ts","sourceRoot":"","sources":["../../src/languages/rs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBAwnB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}

View File

@@ -0,0 +1,11 @@
/**
* An integration to add user feedback to your application,
* while loading most of the code lazily only when it's needed.
*/
export declare const feedbackAsyncIntegration: import("@sentry/core").IntegrationFn<import("@sentry/core").Integration & {
attachTo(el: Element | string, optionOverrides?: import("@sentry-internal/feedback/build/npm/types/core/types").OverrideFeedbackConfiguration): () => void;
createForm(optionOverrides?: import("@sentry-internal/feedback/build/npm/types/core/types").OverrideFeedbackConfiguration): Promise<ReturnType<import("@sentry/core").FeedbackModalIntegration["createDialog"]>>;
createWidget(optionOverrides?: import("@sentry-internal/feedback/build/npm/types/core/types").OverrideFeedbackConfiguration): import("@sentry-internal/feedback/build/npm/types/core/components/Actor").ActorComponent;
remove(): void;
}>;
//# sourceMappingURL=feedbackAsync.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link.js","sources":["../../../src/icons/link.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Link\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTNhNSA1IDAgMCAwIDcuNTQuNTRsMy0zYTUgNSAwIDAgMC03LjA3LTcuMDdsLTEuNzIgMS43MSIgLz4KICA8cGF0aCBkPSJNMTQgMTFhNSA1IDAgMCAwLTcuNTQtLjU0bC0zIDNhNSA1IDAgMCAwIDcuMDcgNy4wN2wxLjcxLTEuNzEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/link\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Link = createLucideIcon('Link', [\n ['path', { d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71', key: '1cjeqo' }],\n ['path', { d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71', key: '19qd67' }],\n]);\n\nexport default Link;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/F,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"envelope.js","sources":["../../../src/metrics/envelope.ts"],"sourcesContent":["import type { DsnComponents } from '../types-hoist/dsn';\nimport type { MetricContainerItem, MetricEnvelope } from '../types-hoist/envelope';\nimport type { SerializedMetric } from '../types-hoist/metric';\nimport type { SdkMetadata } from '../types-hoist/sdkmetadata';\nimport { dsnToString } from '../utils/dsn';\nimport { createEnvelope } from '../utils/envelope';\n\n/**\n * Creates a metric container envelope item for a list of metrics.\n *\n * @param items - The metrics to include in the envelope.\n * @returns The created metric container envelope item.\n */\nexport function createMetricContainerEnvelopeItem(items: Array<SerializedMetric>): MetricContainerItem {\n return [\n {\n type: 'trace_metric',\n item_count: items.length,\n content_type: 'application/vnd.sentry.items.trace-metric+json',\n } as MetricContainerItem[0],\n {\n items,\n },\n ];\n}\n\n/**\n * Creates an envelope for a list of metrics.\n *\n * Metrics from multiple traces can be included in the same envelope.\n *\n * @param metrics - The metrics to include in the envelope.\n * @param metadata - The metadata to include in the envelope.\n * @param tunnel - The tunnel to include in the envelope.\n * @param dsn - The DSN to include in the envelope.\n * @returns The created envelope.\n */\nexport function createMetricEnvelope(\n metrics: Array<SerializedMetric>,\n metadata?: SdkMetadata,\n tunnel?: string,\n dsn?: DsnComponents,\n): MetricEnvelope {\n const headers: MetricEnvelope[0] = {};\n\n if (metadata?.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && !!dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n return createEnvelope<MetricEnvelope>(headers, [createMetricContainerEnvelopeItem(metrics)]);\n}\n"],"names":["dsn","dsnToString","createEnvelope"],"mappings":";;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iCAAiC,CAAC,KAAK,EAAgD;AACvG,EAAE,OAAO;AACT,IAAI;AACJ,MAAM,IAAI,EAAE,cAAc;AAC1B,MAAM,UAAU,EAAE,KAAK,CAAC,MAAM;AAC9B,MAAM,YAAY,EAAE,gDAAgD;AACpE,KAAI;AACJ,IAAI;AACJ,MAAM,KAAK;AACX,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB;AACpC,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAEA,KAAG;AACL,EAAkB;AAClB,EAAE,MAAM,OAAO,GAAsB,EAAE;;AAEvC,EAAE,IAAI,QAAQ,EAAE,GAAG,EAAE;AACrB,IAAI,OAAO,CAAC,GAAA,GAAM;AAClB,MAAM,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC7B,MAAM,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACnC,KAAK;AACL,EAAE;;AAEF,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,CAACA,KAAG,EAAE;AACzB,IAAI,OAAO,CAAC,GAAA,GAAMC,eAAW,CAACD,KAAG,CAAC;AAClC,EAAE;;AAEF,EAAE,OAAOE,uBAAc,CAAiB,OAAO,EAAE,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9F;;;;;"}

View File

@@ -0,0 +1,52 @@
const isEmptyObject = (obj)=>Object.keys(obj).length === 0;
export const hoistQueryParamsToAnd = (currentWhere, incomingWhere)=>{
if (isEmptyObject(incomingWhere)) {
return currentWhere;
}
if (isEmptyObject(currentWhere)) {
return incomingWhere;
}
if ('and' in currentWhere && currentWhere.and) {
currentWhere.and.push(incomingWhere);
} else if ('or' in currentWhere) {
currentWhere = {
and: [
currentWhere,
incomingWhere
]
};
} else {
currentWhere = {
and: [
currentWhere,
incomingWhere
]
};
}
return currentWhere;
};
export const mergeListSearchAndWhere = ({ collectionConfig, search, where = {} })=>{
if (search) {
let copyOfWhere = {
...where || {}
};
const searchAsConditions = (collectionConfig.admin.listSearchableFields || [
collectionConfig.admin?.useAsTitle || 'id'
]).map((fieldName)=>({
[fieldName]: {
like: search
}
}));
if (searchAsConditions.length > 0) {
copyOfWhere = hoistQueryParamsToAnd(copyOfWhere, {
or: searchAsConditions
});
}
if (!isEmptyObject(copyOfWhere)) {
where = copyOfWhere;
}
}
return where;
};
//# sourceMappingURL=mergeListSearchAndWhere.js.map

View File

@@ -0,0 +1,5 @@
import { Builtin } from "../built-in";
import { IsUnknown } from "../is-unknown";
export type DeepWritable<Type> = Type extends Exclude<Builtin, Error> ? Type : Type extends Map<infer Key, infer Value> ? Map<DeepWritable<Key>, DeepWritable<Value>> : Type extends ReadonlyMap<infer Key, infer Value> ? Map<DeepWritable<Key>, DeepWritable<Value>> : Type extends WeakMap<infer Key, infer Value> ? WeakMap<DeepWritable<Key>, DeepWritable<Value>> : Type extends Set<infer Values> ? Set<DeepWritable<Values>> : Type extends ReadonlySet<infer Values> ? Set<DeepWritable<Values>> : Type extends WeakSet<infer Values> ? WeakSet<DeepWritable<Values>> : Type extends Promise<infer Value> ? Promise<DeepWritable<Value>> : Type extends {} ? {
-readonly [Key in keyof Type]: DeepWritable<Type[Key]>;
} : IsUnknown<Type> extends true ? unknown : Type;

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE, d. MMMM y.",
long: "d. MMMM y.",
medium: "d. MMM y.",
short: "dd. MM. y.",
};
const timeFormats = {
full: "HH:mm:ss (zzzz)",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'u' {{time}}",
long: "{{date}} 'u' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"custom-endpoint.cjs","names":[],"sources":["../../../src/rest/helpers/custom-endpoint.ts"],"sourcesContent":["import type { RequestOptions } from '../../index.js';\nimport type { RestCommand } from '../types.js';\n\nexport function customEndpoint<Output = unknown>(options: RequestOptions): RestCommand<Output, never> {\n\treturn () => options;\n}\n"],"mappings":"AAGA,SAAgB,EAAiC,EAAqD,CACrG,UAAa"}

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./fy/_lib/formatDistance.js";
import { formatLong } from "./fy/_lib/formatLong.js";
import { formatRelative } from "./fy/_lib/formatRelative.js";
import { localize } from "./fy/_lib/localize.js";
import { match } from "./fy/_lib/match.js";
/**
* @category Locales
* @summary Western Frisian locale (Netherlands).
* @language West Frisian
* @iso-639-2 fry
* @author Damon Asberg [@damon02](https://github.com/damon02)
*/
export const fy = {
code: "fy",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default fy;

View File

@@ -0,0 +1,29 @@
import { rectIntersection } from '@dnd-kit/core';
// If the toolbar exits the preview area, we need to reset its position
// This will prevent the toolbar from getting stuck outside the preview area
export const customCollisionDetection = ({
collisionRect,
droppableContainers,
...args
}) => {
const droppableContainer = droppableContainers.find(({
id
}) => id === 'live-preview-area');
const rectIntersectionCollisions = rectIntersection({
...args,
collisionRect,
droppableContainers: [droppableContainer]
});
// Collision detection algorithms return an array of collisions
if (rectIntersectionCollisions.length === 0) {
// The preview area is not intersecting, return early
return rectIntersectionCollisions;
}
// Compute whether the draggable element is completely contained within the preview area
const previewAreaRect = droppableContainer?.rect?.current;
const isContained = collisionRect.top >= previewAreaRect.top && collisionRect.left >= previewAreaRect.left && collisionRect.bottom <= previewAreaRect.bottom && collisionRect.right <= previewAreaRect.right;
if (isContained) {
return rectIntersectionCollisions;
}
};
//# sourceMappingURL=collisionDetection.js.map

View File

@@ -0,0 +1,40 @@
/**
* Information about a single route in the manifest
*/
export type RouteInfo = {
/**
* The parameterised route path, e.g. "/users/[id]"
*/
path: string;
/**
* (Optional) The regex pattern for dynamic routes
*/
regex?: string;
/**
* (Optional) The names of dynamic parameters in the route
*/
paramNames?: string[];
/**
* (Optional) Indicates if the first segment is an optional prefix (e.g., for i18n routing)
* When true, routes like '/foo' should match '/:locale/foo' patterns
*/
hasOptionalPrefix?: boolean;
};
/**
* The manifest containing all routes discovered in the app
*/
export type RouteManifest = {
/**
* List of all dynamic routes
*/
dynamicRoutes: RouteInfo[];
/**
* List of all static routes
*/
staticRoutes: RouteInfo[];
/**
* List of ISR/SSG routes (routes with generateStaticParams)
*/
isrRoutes: string[];
};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,104 @@
import type { WithCacheConfig } from "../../cache/core/types.js";
import type { GetColumnData } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { MySqlDialect } from "../dialect.js";
import type { AnyMySqlQueryResultHKT, MySqlPreparedQueryConfig, MySqlQueryResultHKT, MySqlQueryResultKind, MySqlSession, PreparedQueryHKTBase, PreparedQueryKind } from "../session.js";
import type { MySqlTable } from "../table.js";
import { QueryPromise } from "../../query-promise.js";
import type { Placeholder, Query, SQL, SQLWrapper } from "../../sql/sql.js";
import type { Subquery } from "../../subquery.js";
import { type UpdateSet, type ValueOrArray } from "../../utils.js";
import type { MySqlColumn } from "../columns/common.js";
import type { SelectedFieldsOrdered } from "./select.types.js";
export interface MySqlUpdateConfig {
where?: SQL | undefined;
limit?: number | Placeholder;
orderBy?: (MySqlColumn | SQL | SQL.Aliased)[];
set: UpdateSet;
table: MySqlTable;
returning?: SelectedFieldsOrdered;
withList?: Subquery[];
}
export type MySqlUpdateSetSource<TTable extends MySqlTable> = {
[Key in keyof TTable['$inferInsert']]?: GetColumnData<TTable['_']['columns'][Key], 'query'> | SQL | undefined;
} & {};
export declare class MySqlUpdateBuilder<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase> {
private table;
private session;
private dialect;
private withList?;
static readonly [entityKind]: string;
readonly _: {
readonly table: TTable;
};
constructor(table: TTable, session: MySqlSession, dialect: MySqlDialect, withList?: Subquery[] | undefined);
set(values: MySqlUpdateSetSource<TTable>): MySqlUpdateBase<TTable, TQueryResult, TPreparedQueryHKT>;
}
export type MySqlUpdateWithout<T extends AnyMySqlUpdateBase, TDynamic extends boolean, K extends keyof T & string> = TDynamic extends true ? T : Omit<MySqlUpdateBase<T['_']['table'], T['_']['queryResult'], T['_']['preparedQueryHKT'], TDynamic, T['_']['excludedMethods'] | K>, T['_']['excludedMethods'] | K>;
export type MySqlUpdatePrepare<T extends AnyMySqlUpdateBase> = PreparedQueryKind<T['_']['preparedQueryHKT'], MySqlPreparedQueryConfig & {
execute: MySqlQueryResultKind<T['_']['queryResult'], never>;
iterator: never;
}, true>;
export type MySqlUpdateDynamic<T extends AnyMySqlUpdateBase> = MySqlUpdate<T['_']['table'], T['_']['queryResult'], T['_']['preparedQueryHKT']>;
export type MySqlUpdate<TTable extends MySqlTable = MySqlTable, TQueryResult extends MySqlQueryResultHKT = AnyMySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase> = MySqlUpdateBase<TTable, TQueryResult, TPreparedQueryHKT, true, never>;
export type AnyMySqlUpdateBase = MySqlUpdateBase<any, any, any, any, any>;
export interface MySqlUpdateBase<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<MySqlQueryResultKind<TQueryResult, never>>, SQLWrapper {
readonly _: {
readonly table: TTable;
readonly queryResult: TQueryResult;
readonly preparedQueryHKT: TPreparedQueryHKT;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
};
}
export declare class MySqlUpdateBase<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<MySqlQueryResultKind<TQueryResult, never>> implements SQLWrapper {
private session;
private dialect;
static readonly [entityKind]: string;
private config;
protected cacheConfig?: WithCacheConfig;
constructor(table: TTable, set: UpdateSet, session: MySqlSession, dialect: MySqlDialect, withList?: Subquery[]);
/**
* Adds a 'where' clause to the query.
*
* Calling this method will update only those rows that fulfill a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param where the 'where' clause.
*
* @example
* You can use conditional operators and `sql function` to filter the rows to be updated.
*
* ```ts
* // Update all cars with green color
* db.update(cars).set({ color: 'red' })
* .where(eq(cars.color, 'green'));
* // or
* db.update(cars).set({ color: 'red' })
* .where(sql`${cars.color} = 'green'`)
* ```
*
* You can logically combine conditional operators with `and()` and `or()` operators:
*
* ```ts
* // Update all BMW cars with a green color
* db.update(cars).set({ color: 'red' })
* .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
*
* // Update all cars with the green or blue color
* db.update(cars).set({ color: 'red' })
* .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
* ```
*/
where(where: SQL | undefined): MySqlUpdateWithout<this, TDynamic, 'where'>;
orderBy(builder: (updateTable: TTable) => ValueOrArray<MySqlColumn | SQL | SQL.Aliased>): MySqlUpdateWithout<this, TDynamic, 'orderBy'>;
orderBy(...columns: (MySqlColumn | SQL | SQL.Aliased)[]): MySqlUpdateWithout<this, TDynamic, 'orderBy'>;
limit(limit: number | Placeholder): MySqlUpdateWithout<this, TDynamic, 'limit'>;
toSQL(): Query;
prepare(): MySqlUpdatePrepare<this>;
execute: ReturnType<this['prepare']>['execute'];
private createIterator;
iterator: ReturnType<this["prepare"]>["iterator"];
$dynamic(): MySqlUpdateDynamic<this>;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"offline.d.ts","sourceRoot":"","sources":["../../../../src/transports/offline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAA0B,uBAAuB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAyBrH,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAWxF,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAMpE;AAMD,uCAAuC;AACvC,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYlG;AAED,yCAAyC;AACzC,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrG;AAED,0CAA0C;AAC1C,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,CAc5E;AAED,MAAM,WAAW,8BAA+B,SAAQ,IAAI,CAAC,uBAAuB,EAAE,aAAa,CAAC;IAClG;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA4DD;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,oBAAoB,EACxE,eAAe,GAAE,CAAC,OAAO,EAAE,CAAC,KAAK,SAA8B,GAC9D,CAAC,OAAO,EAAE,CAAC,GAAG,8BAA8B,KAAK,SAAS,CAE5D"}

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM, yyyy",
medium: "d MMM, yyyy",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,10 @@
export const getRequestLanguage = ({
cookies,
defaultLanguage = 'en',
headers
}) => {
const acceptLanguage = headers.get('Accept-Language');
const cookieLanguage = cookies.get('lng');
return acceptLanguage || (typeof cookieLanguage === 'string' ? cookieLanguage : cookieLanguage.value) || defaultLanguage;
};
//# sourceMappingURL=getRequestLanguage.js.map

View File

@@ -0,0 +1,192 @@
import httpStatus from 'http-status';
import { executeAccess } from '../../auth/executeAccess.js';
import { combineQueries } from '../../database/combineQueries.js';
import { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js';
import { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js';
import { APIError } from '../../errors/APIError.js';
import { Forbidden } from '../../errors/Forbidden.js';
import { relationshipPopulationPromise } from '../../fields/hooks/afterRead/relationshipPopulationPromise.js';
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
import { getFieldByPath } from '../../utilities/getFieldByPath.js';
import { killTransaction } from '../../utilities/killTransaction.js';
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
export const findDistinctOperation = async (incomingArgs)=>{
let args = incomingArgs;
try {
// /////////////////////////////////////
// beforeOperation - Collection
// /////////////////////////////////////
args = await buildBeforeOperation({
args,
collection: args.collection.config,
operation: 'readDistinct',
overrideAccess: args.overrideAccess
});
const { collection: { config: collectionConfig }, disableErrors, overrideAccess, populate, showHiddenFields = false, trash = false, where } = args;
const req = args.req;
const { locale, payload } = req;
// /////////////////////////////////////
// Access
// /////////////////////////////////////
let accessResult;
if (!overrideAccess) {
accessResult = await executeAccess({
disableErrors,
req
}, collectionConfig.access.read);
// If errors are disabled, and access returns false, return empty results
if (accessResult === false) {
return {
hasNextPage: false,
hasPrevPage: false,
limit: args.limit || 0,
nextPage: null,
page: 1,
pagingCounter: 1,
prevPage: null,
totalDocs: 0,
totalPages: 0,
values: []
};
}
}
// /////////////////////////////////////
// Find Distinct
// /////////////////////////////////////
let fullWhere = combineQueries(where, accessResult);
sanitizeWhereQuery({
fields: collectionConfig.flattenedFields,
payload,
where: fullWhere
});
// Exclude trashed documents when trash: false
fullWhere = appendNonTrashedFilter({
enableTrash: collectionConfig.trash,
trash,
where: fullWhere
});
await validateQueryPaths({
collectionConfig,
overrideAccess: overrideAccess,
req,
where: where ?? {}
});
const fieldResult = getFieldByPath({
config: payload.config,
fields: collectionConfig.flattenedFields,
includeRelationships: true,
path: args.field
});
if (!fieldResult) {
throw new APIError(`Field ${args.field} was not found in the collection ${collectionConfig.slug}`, httpStatus.BAD_REQUEST);
}
if (fieldResult.field.hidden && !showHiddenFields) {
throw new Forbidden(req.t);
}
if (fieldResult.field.access?.read) {
const hasAccess = await fieldResult.field.access.read({
req
});
if (!hasAccess) {
throw new Forbidden(req.t);
}
}
if ('virtual' in fieldResult.field && fieldResult.field.virtual) {
if (typeof fieldResult.field.virtual !== 'string') {
throw new APIError(`Cannot findDistinct by a virtual field that isn't linked to a relationship field.`);
}
let relationPath = '';
let currentFields = collectionConfig.flattenedFields;
const fieldPathSegments = fieldResult.field.virtual.split('.');
for (const segment of fieldResult.field.virtual.split('.')){
relationPath = `${relationPath}${segment}`;
fieldPathSegments.shift();
const field = currentFields.find((e)=>e.name === segment);
if ((field.type === 'relationship' || field.type === 'upload') && typeof field.relationTo === 'string') {
break;
}
if ('flattenedFields' in field) {
currentFields = field.flattenedFields;
}
}
const path = `${relationPath}.${fieldPathSegments.join('.')}`;
const result = await payload.findDistinct({
collection: collectionConfig.slug,
depth: args.depth,
disableErrors,
field: path,
limit: args.limit,
locale,
overrideAccess,
page: args.page,
populate,
req,
showHiddenFields,
sort: args.sort,
trash,
where
});
for (const val of result.values){
val[args.field] = val[path];
delete val[path];
}
return result;
}
let result = await payload.db.findDistinct({
collection: collectionConfig.slug,
field: args.field,
limit: args.limit,
locale: locale,
page: args.page,
req,
sort: args.sort,
where: fullWhere
});
if ((fieldResult.field.type === 'relationship' || fieldResult.field.type === 'upload') && args.depth) {
const populationPromises = [];
const sanitizedField = {
...fieldResult.field
};
if (fieldResult.field.hasMany) {
sanitizedField.hasMany = false;
}
for (const doc of result.values){
populationPromises.push(relationshipPopulationPromise({
currentDepth: 0,
depth: args.depth,
draft: false,
fallbackLocale: req.fallbackLocale || null,
field: sanitizedField,
locale: req.locale || null,
overrideAccess: args.overrideAccess ?? true,
parentIsLocalized: false,
populate,
req,
showHiddenFields: false,
siblingDoc: doc
}));
}
await Promise.all(populationPromises);
}
// /////////////////////////////////////
// afterOperation - Collection
// /////////////////////////////////////
result = await buildAfterOperation({
args,
collection: collectionConfig,
operation: 'findDistinct',
overrideAccess,
result
});
// /////////////////////////////////////
// Return results
// /////////////////////////////////////
return result;
} catch (error) {
await killTransaction(args.req);
throw error;
}
};
//# sourceMappingURL=findDistinct.js.map

View File

@@ -0,0 +1,29 @@
import { numericPatterns } from "../constants.mjs";
import { Parser } from "../Parser.mjs";
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
export class SecondParser extends Parser {
priority = 50;
parse(dateString, token, match) {
switch (token) {
case "s":
return parseNumericPattern(numericPatterns.second, dateString);
case "so":
return match.ordinalNumber(dateString, { unit: "second" });
default:
return parseNDigits(token.length, dateString);
}
}
validate(_date, value) {
return value >= 0 && value <= 59;
}
set(date, _flags, value) {
date.setSeconds(value, 0);
return date;
}
incompatibleTokens = ["t", "T"];
}

View File

@@ -0,0 +1,44 @@
import { groupBy } from '../../jsutils/groupBy.mjs';
import { GraphQLError } from '../../error/GraphQLError.mjs';
/**
* Unique argument names
*
* A GraphQL field or directive is only valid if all supplied arguments are
* uniquely named.
*
* See https://spec.graphql.org/draft/#sec-Argument-Names
*/
export function UniqueArgumentNamesRule(context) {
return {
Field: checkArgUniqueness,
Directive: checkArgUniqueness,
};
function checkArgUniqueness(parentNode) {
var _parentNode$arguments;
// FIXME: https://github.com/graphql/graphql-js/issues/2203
/* c8 ignore next */
const argumentNodes =
(_parentNode$arguments = parentNode.arguments) !== null &&
_parentNode$arguments !== void 0
? _parentNode$arguments
: [];
const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);
for (const [argName, argNodes] of seenArgs) {
if (argNodes.length > 1) {
context.reportError(
new GraphQLError(
`There can be only one argument named "${argName}".`,
{
nodes: argNodes.map((node) => node.name),
},
),
);
}
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/core';\n\nexport const NODE_VERSION = parseSemver(process.versions.node) as { major: number; minor: number; patch: number };\nexport const NODE_MAJOR = NODE_VERSION.major;\nexport const NODE_MINOR = NODE_VERSION.minor;\n"],"names":[],"mappings":";;AAEO,MAAM,YAAA,GAAe,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA;AACtD,MAAM,UAAA,GAAa,YAAY,CAAC;AAChC,MAAM,UAAA,GAAa,YAAY,CAAC;;;;"}

Some files were not shown because too many files have changed in this diff Show More