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,22 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { SQLiteColumn, SQLiteColumnBuilder } from "./common.js";
export type SQLiteRealBuilderInitial<TName extends string> = SQLiteRealBuilder<{
name: TName;
dataType: 'number';
columnType: 'SQLiteReal';
data: number;
driverParam: number;
enumValues: undefined;
}>;
export declare class SQLiteRealBuilder<T extends ColumnBuilderBaseConfig<'number', 'SQLiteReal'>> extends SQLiteColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SQLiteReal<T extends ColumnBaseConfig<'number', 'SQLiteReal'>> extends SQLiteColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function real(): SQLiteRealBuilderInitial<''>;
export declare function real<TName extends string>(name: TName): SQLiteRealBuilderInitial<TName>;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"fields.cjs","names":[],"sources":["../../../../src/rest/commands/update/fields.ts"],"sourcesContent":["import type { DirectusField } from '../../../schema/field.js';\nimport type { ApplyQueryFields, FieldQuery, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdateFieldOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusField<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Updates the given field in the given collection.\n * @param collection\n * @param field\n * @param item\n * @param query\n * @returns\n * @throws Will throw if collection is empty\n * @throws Will throw if field is empty\n */\nexport const updateField =\n\t<Schema, const TQuery extends FieldQuery<Schema, DirectusField<Schema>>>(\n\t\tcollection: DirectusField<Schema>['collection'],\n\t\tfield: DirectusField<Schema>['field'],\n\t\titem: NestedPartial<DirectusField<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateFieldOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Keys cannot be empty');\n\t\tthrowIfEmpty(field, 'Field cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}/${field}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Updates the multiple field in the given collection.\n * Update multiple existing fields.\n * @param collection\n * @param items\n * @param query\n * @returns\n * @throws Will throw if collection is empty\n */\nexport const updateFields =\n\t<Schema, const TQuery extends FieldQuery<Schema, DirectusField<Schema>>>(\n\t\tcollection: DirectusField<Schema>['collection'],\n\t\titems: NestedPartial<DirectusField<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateFieldOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(items),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"kDAqBa,GAEX,EACA,EACA,EACA,SAGA,EAAA,aAAa,EAAY,uBAAuB,CAChD,EAAA,aAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,WAAW,EAAW,GAAG,IAC/B,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR,EAYU,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,WAAW,IACjB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/BulkUpload/FileSidebar/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAiBzB,OAAO,cAAc,CAAA;AAQrB,wBAAgB,WAAW,sBA6M1B"}

View File

@@ -0,0 +1,2 @@
import { conformsTo } from "./index";
export = conformsTo;

View File

@@ -0,0 +1,33 @@
import { status as httpStatus } from 'http-status';
import { getRequestGlobal } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { isNumber } from '../../utilities/isNumber.js';
import { sanitizePopulateParam } from '../../utilities/sanitizePopulateParam.js';
import { sanitizeSelectParam } from '../../utilities/sanitizeSelectParam.js';
import { findOneOperation } from '../operations/findOne.js';
export const findOneHandler = async (req)=>{
const globalConfig = getRequestGlobal(req);
const { data, searchParams } = req;
const depth = data ? data.depth : searchParams.get('depth');
const flattenLocales = data ? data.flattenLocales : searchParams.has('flattenLocales') ? searchParams.get('flattenLocales') === 'true' : undefined;
const result = await findOneOperation({
slug: globalConfig.slug,
data: data ? data?.data : searchParams.get('data') ? JSON.parse(searchParams.get('data')) : undefined,
depth: isNumber(depth) ? Number(depth) : undefined,
draft: data ? data.draft : searchParams.get('draft') === 'true',
flattenLocales,
globalConfig,
populate: sanitizePopulateParam(req.query.populate),
req,
select: sanitizeSelectParam(req.query.select)
});
return Response.json(result, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=findOne.js.map

View File

@@ -0,0 +1,2 @@
export declare const ExceptionEventName = "exception";
//# sourceMappingURL=enums.d.ts.map

View File

@@ -0,0 +1,2 @@
export * from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1yZWFjdC5janMuZC5tdHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9

View File

@@ -0,0 +1,76 @@
export declare type int = number;
/** Shift size for getting the index-2 table offset. */
export declare const UTRIE2_SHIFT_2 = 5;
/** Shift size for getting the index-1 table offset. */
export declare const UTRIE2_SHIFT_1: number;
/**
* Shift size for shifting left the index array values.
* Increases possible data size with 16-bit index values at the cost
* of compactability.
* This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
*/
export declare const UTRIE2_INDEX_SHIFT = 2;
/**
* Difference between the two shift sizes,
* for getting an index-1 offset from an index-2 offset. 6=11-5
*/
export declare const UTRIE2_SHIFT_1_2: number;
/**
* The part of the index-2 table for U+D800..U+DBFF stores values for
* lead surrogate code _units_ not code _points_.
* Values for lead surrogate code _points_ are indexed with this portion of the table.
* Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
*/
export declare const UTRIE2_LSCP_INDEX_2_OFFSET: number;
/** Number of entries in a data block. 32=0x20 */
export declare const UTRIE2_DATA_BLOCK_LENGTH: number;
/** Mask for getting the lower bits for the in-data-block offset. */
export declare const UTRIE2_DATA_MASK: number;
export declare const UTRIE2_LSCP_INDEX_2_LENGTH: number;
/** Count the lengths of both BMP pieces. 2080=0x820 */
export declare const UTRIE2_INDEX_2_BMP_LENGTH: number;
/**
* The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
* Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
*/
export declare const UTRIE2_UTF8_2B_INDEX_2_OFFSET: number;
export declare const UTRIE2_UTF8_2B_INDEX_2_LENGTH: number;
/**
* The index-1 table, only used for supplementary code points, at offset 2112=0x840.
* Variable length, for code points up to highStart, where the last single-value range starts.
* Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
* (For 0x100000 supplementary code points U+10000..U+10ffff.)
*
* The part of the index-2 table for supplementary code points starts
* after this index-1 table.
*
* Both the index-1 table and the following part of the index-2 table
* are omitted completely if there is only BMP data.
*/
export declare const UTRIE2_INDEX_1_OFFSET: number;
/**
* Number of index-1 entries for the BMP. 32=0x20
* This part of the index-1 table is omitted from the serialized form.
*/
export declare const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH: number;
/** Number of entries in an index-2 block. 64=0x40 */
export declare const UTRIE2_INDEX_2_BLOCK_LENGTH: number;
/** Mask for getting the lower bits for the in-index-2-block offset. */
export declare const UTRIE2_INDEX_2_MASK: number;
export declare const createTrieFromBase64: (base64: string, _byteLength: number) => Trie;
export declare class Trie {
initialValue: int;
errorValue: int;
highStart: int;
highValueIndex: int;
index: Uint16Array | number[];
data: Uint32Array | Uint16Array | number[];
constructor(initialValue: int, errorValue: int, highStart: int, highValueIndex: int, index: Uint16Array | number[], data: Uint32Array | Uint16Array | number[]);
/**
* Get the value for a code point as stored in the Trie.
*
* @param codePoint the code point
* @return the value
*/
get(codePoint: number): number;
}

View File

@@ -0,0 +1,256 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/**
* Transforms a `Headers` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into a simple key-value dict.
* The header keys will be lower case: e.g. A "Content-Type" header will be stored as "content-type".
*/
function winterCGHeadersToDict(winterCGHeaders) {
const headers = {};
try {
winterCGHeaders.forEach((value, key) => {
if (typeof value === 'string') {
// We check that value is a string even though it might be redundant to make sure prototype pollution is not possible.
headers[key] = value;
}
});
} catch {
// just return the empty headers
}
return headers;
}
/**
* Convert common request headers to a simple dictionary.
*/
function headersToDict(reqHeaders) {
const headers = Object.create(null);
try {
Object.entries(reqHeaders).forEach(([key, value]) => {
if (typeof value === 'string') {
headers[key] = value;
}
});
} catch {
// just return the empty headers
}
return headers;
}
/**
* Converts a `Request` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into the format that the `RequestData` integration understands.
*/
function winterCGRequestToRequestData(req) {
const headers = winterCGHeadersToDict(req.headers);
return {
method: req.method,
url: req.url,
query_string: extractQueryParamsFromUrl(req.url),
headers,
// TODO: Can we extract body data from the request?
};
}
/**
* Convert a HTTP request object to RequestEventData to be passed as normalizedRequest.
* Instead of allowing `PolymorphicRequest` to be passed,
* we want to be more specific and generally require a http.IncomingMessage-like object.
*/
function httpRequestToRequestData(request
) {
const headers = request.headers || {};
// Check for x-forwarded-host first, then fall back to host header
const forwardedHost = typeof headers['x-forwarded-host'] === 'string' ? headers['x-forwarded-host'] : undefined;
const host = forwardedHost || (typeof headers.host === 'string' ? headers.host : undefined);
// Check for x-forwarded-proto first, then fall back to existing protocol detection
const forwardedProto = typeof headers['x-forwarded-proto'] === 'string' ? headers['x-forwarded-proto'] : undefined;
const protocol = forwardedProto || request.protocol || (request.socket?.encrypted ? 'https' : 'http');
const url = request.url || '';
const absoluteUrl = getAbsoluteUrl({
url,
host,
protocol,
});
// This is non-standard, but may be sometimes set
// It may be overwritten later by our own body handling
const data = (request ).body || undefined;
// This is non-standard, but may be set on e.g. Next.js or Express requests
const cookies = (request ).cookies;
return {
url: absoluteUrl,
method: request.method,
query_string: extractQueryParamsFromUrl(url),
headers: headersToDict(headers),
cookies,
data,
};
}
function getAbsoluteUrl({
url,
protocol,
host,
}
) {
if (url?.startsWith('http')) {
return url;
}
if (url && host) {
return `${protocol}://${host}${url}`;
}
return undefined;
}
const SENSITIVE_HEADER_SNIPPETS = [
'auth',
'token',
'secret',
'session', // for the user_session cookie
'password',
'passwd',
'pwd',
'key',
'jwt',
'bearer',
'sso',
'saml',
'csrf',
'xsrf',
'credentials',
// Always treat cookie headers as sensitive in case individual key-value cookie pairs cannot properly be extracted
'set-cookie',
'cookie',
];
const PII_HEADER_SNIPPETS = ['x-forwarded-', '-user'];
/**
* Converts incoming HTTP request headers to OpenTelemetry span attributes following semantic conventions.
* Header names are converted to the format: http.request.header.<key>
* where <key> is the header name in lowercase with dashes converted to underscores.
*
* @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/http/#http-request-header
*/
function httpHeadersToSpanAttributes(
headers,
sendDefaultPii = false,
) {
const spanAttributes = {};
try {
Object.entries(headers).forEach(([key, value]) => {
if (value == null) {
return;
}
const lowerCasedHeaderKey = key.toLowerCase();
const isCookieHeader = lowerCasedHeaderKey === 'cookie' || lowerCasedHeaderKey === 'set-cookie';
if (isCookieHeader && typeof value === 'string' && value !== '') {
// Set-Cookie: single cookie with attributes ("name=value; HttpOnly; Secure")
// Cookie: multiple cookies separated by "; " ("cookie1=value1; cookie2=value2")
const isSetCookie = lowerCasedHeaderKey === 'set-cookie';
const semicolonIndex = value.indexOf(';');
const cookieString = isSetCookie && semicolonIndex !== -1 ? value.substring(0, semicolonIndex) : value;
const cookies = isSetCookie ? [cookieString] : cookieString.split('; ');
for (const cookie of cookies) {
// Split only at the first '=' to preserve '=' characters in cookie values
const equalSignIndex = cookie.indexOf('=');
const cookieKey = equalSignIndex !== -1 ? cookie.substring(0, equalSignIndex) : cookie;
const cookieValue = equalSignIndex !== -1 ? cookie.substring(equalSignIndex + 1) : '';
const lowerCasedCookieKey = cookieKey.toLowerCase();
addSpanAttribute(spanAttributes, lowerCasedHeaderKey, lowerCasedCookieKey, cookieValue, sendDefaultPii);
}
} else {
addSpanAttribute(spanAttributes, lowerCasedHeaderKey, '', value, sendDefaultPii);
}
});
} catch {
// Return empty object if there's an error
}
return spanAttributes;
}
function normalizeAttributeKey(key) {
return key.replace(/-/g, '_');
}
function addSpanAttribute(
spanAttributes,
headerKey,
cookieKey,
value,
sendPii,
) {
const normalizedKey = cookieKey
? `http.request.header.${normalizeAttributeKey(headerKey)}.${normalizeAttributeKey(cookieKey)}`
: `http.request.header.${normalizeAttributeKey(headerKey)}`;
const headerValue = handleHttpHeader(cookieKey || headerKey, value, sendPii);
if (headerValue !== undefined) {
spanAttributes[normalizedKey] = headerValue;
}
}
function handleHttpHeader(
lowerCasedKey,
value,
sendPii,
) {
const isSensitive = sendPii
? SENSITIVE_HEADER_SNIPPETS.some(snippet => lowerCasedKey.includes(snippet))
: [...PII_HEADER_SNIPPETS, ...SENSITIVE_HEADER_SNIPPETS].some(snippet => lowerCasedKey.includes(snippet));
if (isSensitive) {
return '[Filtered]';
} else if (Array.isArray(value)) {
return value.map(v => (v != null ? String(v) : v)).join(';');
} else if (typeof value === 'string') {
return value;
}
return undefined;
}
/** Extract the query params from an URL. */
function extractQueryParamsFromUrl(url) {
// url is path and query string
if (!url) {
return;
}
try {
// The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and
// hostname as the base. Since the point here is just to grab the query string, it doesn't matter what we use.
const queryParams = new URL(url, 'http://s.io').search.slice(1);
return queryParams.length ? queryParams : undefined;
} catch {
return undefined;
}
}
exports.extractQueryParamsFromUrl = extractQueryParamsFromUrl;
exports.headersToDict = headersToDict;
exports.httpHeadersToSpanAttributes = httpHeadersToSpanAttributes;
exports.httpRequestToRequestData = httpRequestToRequestData;
exports.winterCGHeadersToDict = winterCGHeadersToDict;
exports.winterCGRequestToRequestData = winterCGRequestToRequestData;
//# sourceMappingURL=request.js.map

View File

@@ -0,0 +1,20 @@
import { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious';
export declare const instrumentTedious: ((options?: unknown) => TediousInstrumentation) & {
id: string;
};
/**
* Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.
*
* For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.tediousIntegration()],
* });
* ```
*/
export declare const tediousIntegration: () => import("@sentry/core").Integration;
//# sourceMappingURL=tedious.d.ts.map

View File

@@ -0,0 +1,19 @@
/**
* @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 TableCellsMerge = createLucideIcon("TableCellsMerge", [
["path", { d: "M12 21v-6", key: "lihzve" }],
["path", { d: "M12 9V3", key: "da5inc" }],
["path", { d: "M3 15h18", key: "5xshup" }],
["path", { d: "M3 9h18", key: "1pudct" }],
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
]);
export { TableCellsMerge as default };
//# sourceMappingURL=table-cells-merge.js.map

View File

@@ -0,0 +1,245 @@
import { ElementType } from "domelementtype";
interface SourceCodeLocation {
/** One-based line index of the first character. */
startLine: number;
/** One-based column index of the first character. */
startCol: number;
/** Zero-based first character index. */
startOffset: number;
/** One-based line index of the last character. */
endLine: number;
/** One-based column index of the last character. Points directly *after* the last character. */
endCol: number;
/** Zero-based last character index. Points directly *after* the last character. */
endOffset: number;
}
interface TagSourceCodeLocation extends SourceCodeLocation {
startTag?: SourceCodeLocation;
endTag?: SourceCodeLocation;
}
export declare type ParentNode = Document | Element | CDATA;
export declare type ChildNode = Text | Comment | ProcessingInstruction | Element | CDATA | Document;
export declare type AnyNode = ParentNode | ChildNode;
/**
* This object will be used as the prototype for Nodes when creating a
* DOM-Level-1-compliant structure.
*/
export declare abstract class Node {
/** The type of the node. */
abstract readonly type: ElementType;
/** Parent of the node */
parent: ParentNode | null;
/** Previous sibling */
prev: ChildNode | null;
/** Next sibling */
next: ChildNode | null;
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
startIndex: number | null;
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
endIndex: number | null;
/**
* `parse5` source code location info.
*
* Available if parsing with parse5 and location info is enabled.
*/
sourceCodeLocation?: SourceCodeLocation | null;
/**
* [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
* node {@link type}.
*/
abstract readonly nodeType: number;
/**
* Same as {@link parent}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get parentNode(): ParentNode | null;
set parentNode(parent: ParentNode | null);
/**
* Same as {@link prev}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get previousSibling(): ChildNode | null;
set previousSibling(prev: ChildNode | null);
/**
* Same as {@link next}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get nextSibling(): ChildNode | null;
set nextSibling(next: ChildNode | null);
/**
* Clone this node, and optionally its children.
*
* @param recursive Clone child nodes as well.
* @returns A clone of the node.
*/
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
}
/**
* A node that contains some data.
*/
export declare abstract class DataNode extends Node {
data: string;
/**
* @param data The content of the data node
*/
constructor(data: string);
/**
* Same as {@link data}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get nodeValue(): string;
set nodeValue(data: string);
}
/**
* Text within the document.
*/
export declare class Text extends DataNode {
type: ElementType.Text;
get nodeType(): 3;
}
/**
* Comments within the document.
*/
export declare class Comment extends DataNode {
type: ElementType.Comment;
get nodeType(): 8;
}
/**
* Processing instructions, including doc types.
*/
export declare class ProcessingInstruction extends DataNode {
name: string;
type: ElementType.Directive;
constructor(name: string, data: string);
get nodeType(): 1;
/** If this is a doctype, the document type name (parse5 only). */
"x-name"?: string;
/** If this is a doctype, the document type public identifier (parse5 only). */
"x-publicId"?: string;
/** If this is a doctype, the document type system identifier (parse5 only). */
"x-systemId"?: string;
}
/**
* A `Node` that can have children.
*/
export declare abstract class NodeWithChildren extends Node {
children: ChildNode[];
/**
* @param children Children of the node. Only certain node types can have children.
*/
constructor(children: ChildNode[]);
/** First child of the node. */
get firstChild(): ChildNode | null;
/** Last child of the node. */
get lastChild(): ChildNode | null;
/**
* Same as {@link children}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get childNodes(): ChildNode[];
set childNodes(children: ChildNode[]);
}
export declare class CDATA extends NodeWithChildren {
type: ElementType.CDATA;
get nodeType(): 4;
}
/**
* The root node of the document.
*/
export declare class Document extends NodeWithChildren {
type: ElementType.Root;
get nodeType(): 9;
/** [Document mode](https://dom.spec.whatwg.org/#concept-document-limited-quirks) (parse5 only). */
"x-mode"?: "no-quirks" | "quirks" | "limited-quirks";
}
/**
* The description of an individual attribute.
*/
interface Attribute {
name: string;
value: string;
namespace?: string;
prefix?: string;
}
/**
* An element within the DOM.
*/
export declare class Element extends NodeWithChildren {
name: string;
attribs: {
[name: string]: string;
};
type: ElementType.Tag | ElementType.Script | ElementType.Style;
/**
* @param name Name of the tag, eg. `div`, `span`.
* @param attribs Object mapping attribute names to attribute values.
* @param children Children of the node.
*/
constructor(name: string, attribs: {
[name: string]: string;
}, children?: ChildNode[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
get nodeType(): 1;
/**
* `parse5` source code location info, with start & end tags.
*
* Available if parsing with parse5 and location info is enabled.
*/
sourceCodeLocation?: TagSourceCodeLocation | null;
/**
* Same as {@link name}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get tagName(): string;
set tagName(name: string);
get attributes(): Attribute[];
/** Element namespace (parse5 only). */
namespace?: string;
/** Element attribute namespaces (parse5 only). */
"x-attribsNamespace"?: Record<string, string>;
/** Element attribute namespace-related prefixes (parse5 only). */
"x-attribsPrefix"?: Record<string, string>;
}
/**
* @param node Node to check.
* @returns `true` if the node is a `Element`, `false` otherwise.
*/
export declare function isTag(node: Node): node is Element;
/**
* @param node Node to check.
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
*/
export declare function isCDATA(node: Node): node is CDATA;
/**
* @param node Node to check.
* @returns `true` if the node has the type `Text`, `false` otherwise.
*/
export declare function isText(node: Node): node is Text;
/**
* @param node Node to check.
* @returns `true` if the node has the type `Comment`, `false` otherwise.
*/
export declare function isComment(node: Node): node is Comment;
/**
* @param node Node to check.
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
*/
export declare function isDirective(node: Node): node is ProcessingInstruction;
/**
* @param node Node to check.
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
*/
export declare function isDocument(node: Node): node is Document;
/**
* @param node Node to check.
* @returns `true` if the node has children, `false` otherwise.
*/
export declare function hasChildren(node: Node): node is ParentNode;
/**
* Clone a node, and optionally its children.
*
* @param recursive Clone child nodes as well.
* @returns A clone of the node.
*/
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
export {};
//# sourceMappingURL=node.d.ts.map

View File

@@ -0,0 +1,7 @@
export declare const subISOWeekYearsWithOptions: import("./types.js").FPFn3<
Date,
| import("../subISOWeekYears.js").SubISOWeekYearsOptions<Date>
| undefined,
number,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1 @@
Prism.languages.cilkc=Prism.languages.insertBefore("c","function",{"parallel-keyword":{pattern:/\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,alias:"keyword"}}),Prism.languages["cilk-c"]=Prism.languages.cilkc;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 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","2":"C L M G N O P"},C:{"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 4C 5C","132":"0 1 2 3 4 5 6 7 8 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","1090":"CC","1412":"GC","1668":"DC EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 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","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","2114":"EC"},E:{"1":"M G 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","2":"J bB K D E F 6C bC 7C 8C 9C AD","4100":"A B C L cC PC QC"},F:{"1":"0 1 2 3 4 5 6 7 8 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","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 JD KD LD MD PC xC ND QC","8196":"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"},G:{"1":"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","2":"E bC OD yC PD QD RD SD","4100":"TD UD VD WD XD YD ZD aD bD cD dD eD"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"16388":"I"},M:{"16388":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"2":"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:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:5,C:"Picture-in-Picture",D:true};

View File

@@ -0,0 +1,223 @@
import { isParameterizedString, isError, isPlainObject, isErrorEvent } from './is.js';
import { addExceptionMechanism, addExceptionTypeValue } from './misc.js';
import { normalizeToSize } from './normalize.js';
import { extractExceptionKeysForMessage } from './object.js';
/**
* Extracts stack frames from the error.stack string
*/
function parseStackFrames(stackParser, error) {
return stackParser(error.stack || '', 1);
}
function hasSentryFetchUrlHost(error) {
return isError(error) && '__sentry_fetch_url_host__' in error && typeof error.__sentry_fetch_url_host__ === 'string';
}
/**
* Enhances the error message with the hostname for better Sentry error reporting.
* This allows third-party packages to still match on the original error message,
* while Sentry gets the enhanced version with context.
*
* Only used internally
* @hidden
*/
function _enhanceErrorWithSentryInfo(error) {
// If the error has a __sentry_fetch_url_host__ property (added by fetch instrumentation),
// enhance the error message with the hostname.
if (hasSentryFetchUrlHost(error)) {
return `${error.message} (${error.__sentry_fetch_url_host__})`;
}
return error.message;
}
/**
* Extracts stack frames from the error and builds a Sentry Exception
*/
function exceptionFromError(stackParser, error) {
const exception = {
type: error.name || error.constructor.name,
value: _enhanceErrorWithSentryInfo(error),
};
const frames = parseStackFrames(stackParser, error);
if (frames.length) {
exception.stacktrace = { frames };
}
return exception;
}
/** If a plain object has a property that is an `Error`, return this error. */
function getErrorPropertyFromObject(obj) {
for (const prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
const value = obj[prop];
if (value instanceof Error) {
return value;
}
}
}
return undefined;
}
function getMessageForObject(exception) {
if ('name' in exception && typeof exception.name === 'string') {
let message = `'${exception.name}' captured as exception`;
if ('message' in exception && typeof exception.message === 'string') {
message += ` with message '${exception.message}'`;
}
return message;
} else if ('message' in exception && typeof exception.message === 'string') {
return exception.message;
}
const keys = extractExceptionKeysForMessage(exception);
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
// We still want to try to get a decent message for these cases
if (isErrorEvent(exception)) {
return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``;
}
const className = getObjectClassName(exception);
return `${
className && className !== 'Object' ? `'${className}'` : 'Object'
} captured as exception with keys: ${keys}`;
}
function getObjectClassName(obj) {
try {
const prototype = Object.getPrototypeOf(obj);
return prototype ? prototype.constructor.name : undefined;
} catch {
// ignore errors here
}
}
function getException(
client,
mechanism,
exception,
hint,
) {
if (isError(exception)) {
return [exception, undefined];
}
// Mutate this!
mechanism.synthetic = true;
if (isPlainObject(exception)) {
const normalizeDepth = client?.getOptions().normalizeDepth;
const extras = { ['__serialized__']: normalizeToSize(exception, normalizeDepth) };
const errorFromProp = getErrorPropertyFromObject(exception);
if (errorFromProp) {
return [errorFromProp, extras];
}
const message = getMessageForObject(exception);
const ex = hint?.syntheticException || new Error(message);
ex.message = message;
return [ex, extras];
}
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
const ex = hint?.syntheticException || new Error(exception );
ex.message = `${exception}`;
return [ex, undefined];
}
/**
* Builds and Event from a Exception
* @hidden
*/
function eventFromUnknownInput(
client,
stackParser,
exception,
hint,
) {
const providedMechanism = hint?.data && (hint.data ).mechanism;
const mechanism = providedMechanism || {
handled: true,
type: 'generic',
};
const [ex, extras] = getException(client, mechanism, exception, hint);
const event = {
exception: {
values: [exceptionFromError(stackParser, ex)],
},
};
if (extras) {
event.extra = extras;
}
addExceptionTypeValue(event, undefined, undefined);
addExceptionMechanism(event, mechanism);
return {
...event,
event_id: hint?.event_id,
};
}
/**
* Builds and Event from a Message
* @hidden
*/
function eventFromMessage(
stackParser,
message,
level = 'info',
hint,
attachStacktrace,
) {
const event = {
event_id: hint?.event_id,
level,
};
if (attachStacktrace && hint?.syntheticException) {
const frames = parseStackFrames(stackParser, hint.syntheticException);
if (frames.length) {
event.exception = {
values: [
{
value: message,
stacktrace: { frames },
},
],
};
addExceptionMechanism(event, { synthetic: true });
}
}
if (isParameterizedString(message)) {
const { __sentry_template_string__, __sentry_template_values__ } = message;
event.logentry = {
message: __sentry_template_string__,
params: __sentry_template_values__,
};
return event;
}
event.message = message;
return event;
}
export { _enhanceErrorWithSentryInfo, eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames };
//# sourceMappingURL=eventbuilder.js.map

View File

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

View File

@@ -0,0 +1,20 @@
/**
* @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 Bird = createLucideIcon("Bird", [
["path", { d: "M16 7h.01", key: "1kdx03" }],
["path", { d: "M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20", key: "oj1oa8" }],
["path", { d: "m20 7 2 .5-2 .5", key: "12nv4d" }],
["path", { d: "M10 18v3", key: "1yea0a" }],
["path", { d: "M14 17.75V21", key: "1pymcb" }],
["path", { d: "M7 18a6 6 0 0 0 3.84-10.61", key: "1npnn0" }]
]);
export { Bird as default };
//# sourceMappingURL=bird.js.map

View File

@@ -0,0 +1,6 @@
import { Event } from '../types-hoist/event';
/**
* Get a list of possible event messages from a Sentry event.
*/
export declare function getPossibleEventMessages(event: Event): string[];
//# sourceMappingURL=eventUtils.d.ts.map

View File

@@ -0,0 +1,122 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = require("../ModuleTypeConstants");
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const AsyncWasmLoadingRuntimeModule = require("../wasm-async/AsyncWasmLoadingRuntimeModule");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compiler")} Compiler */
/**
* @typedef {object} ReadFileCompileAsyncWasmPluginOptions
* @property {boolean=} import use import?
*/
const PLUGIN_NAME = "ReadFileCompileAsyncWasmPlugin";
class ReadFileCompileAsyncWasmPlugin {
/**
* @param {ReadFileCompileAsyncWasmPluginOptions=} options options object
*/
constructor({ import: useImport = false } = {}) {
this._import = useImport;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
const globalWasmLoading = compilation.outputOptions.wasmLoading;
/**
* @param {Chunk} chunk chunk
* @returns {boolean} true, if wasm loading is enabled for the chunk
*/
const isEnabledForChunk = (chunk) => {
const options = chunk.getEntryOptions();
const wasmLoading =
options && options.wasmLoading !== undefined
? options.wasmLoading
: globalWasmLoading;
return wasmLoading === "async-node";
};
/**
* @type {(path: string) => string} callback to generate code to load the wasm file
*/
const generateLoadBinaryCode = this._import
? (path) =>
Template.asString([
"Promise.all([import('fs'), import('url')]).then(([{ readFile }, { URL }]) => new Promise((resolve, reject) => {",
Template.indent([
`readFile(new URL(${path}, ${compilation.outputOptions.importMetaName}.url), (err, buffer) => {`,
Template.indent([
"if (err) return reject(err);",
"",
"// Fake fetch response",
"resolve({",
Template.indent(["arrayBuffer() { return buffer; }"]),
"});"
]),
"});"
]),
"}))"
])
: (path) =>
Template.asString([
"new Promise(function (resolve, reject) {",
Template.indent([
"try {",
Template.indent([
`var { readFile } = require(${compilation.runtimeTemplate.renderNodePrefixForCoreModule("fs")});`,
`var { join } = require(${compilation.runtimeTemplate.renderNodePrefixForCoreModule("path")});`,
"",
`readFile(join(__dirname, ${path}), function(err, buffer){`,
Template.indent([
"if (err) return reject(err);",
"",
"// Fake fetch response",
"resolve({",
Template.indent(["arrayBuffer() { return buffer; }"]),
"});"
]),
"});"
]),
"} catch (err) { reject(err); }"
]),
"})"
]);
compilation.hooks.runtimeRequirementInTree
.for(RuntimeGlobals.instantiateWasm)
.tap(PLUGIN_NAME, (chunk, set, { chunkGraph }) => {
if (!isEnabledForChunk(chunk)) return;
if (
!chunkGraph.hasModuleInGraph(
chunk,
(m) => m.type === WEBASSEMBLY_MODULE_TYPE_ASYNC
)
) {
return;
}
compilation.addRuntimeModule(
chunk,
new AsyncWasmLoadingRuntimeModule({
generateLoadBinaryCode,
supportsStreaming: false
})
);
});
});
}
}
module.exports = ReadFileCompileAsyncWasmPlugin;

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.05629,"111":0.00512,"117":0.00512,"134":0.02047,"135":0.00512,"137":0.01023,"140":0.08699,"142":0.00512,"143":0.32237,"144":0.02559,"145":0.25585,"146":0.77267,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 112 113 114 115 116 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 136 138 139 141 147 148 149 3.5 3.6"},D:{"56":0.00512,"67":0.01023,"69":0.06652,"93":0.00512,"102":0.01023,"103":0.01535,"104":0.00512,"107":0.00512,"109":0.10234,"110":0.00512,"111":0.07164,"112":0.07164,"116":0.28144,"119":0.00512,"120":0.09722,"122":0.01535,"123":0.00512,"125":0.57822,"126":0.03582,"128":0.02047,"129":0.02047,"130":0.02047,"131":0.01535,"132":0.08187,"133":0.00512,"134":0.04094,"137":0.02047,"138":0.90059,"139":0.2712,"140":0.26608,"141":0.27632,"142":6.67769,"143":14.68579,"144":0.01023,"145":0.02047,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 68 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 105 106 108 113 114 115 117 118 121 124 127 135 136 146"},F:{"93":0.00512,"120":0.00512,"122":0.00512,"123":0.03582,"124":0.32749,"125":0.08699,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00512,"109":0.00512,"133":0.02047,"136":0.2405,"138":0.01535,"139":0.01535,"140":0.09722,"141":0.54752,"142":2.88599,"143":6.10458,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 134 135 137"},E:{"14":0.03582,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 17.0","13.1":0.00512,"14.1":0.07676,"15.6":0.04605,"16.1":0.00512,"16.3":0.0307,"16.4":0.01023,"16.5":0.00512,"16.6":0.19956,"17.1":0.05117,"17.2":0.02559,"17.3":0.02047,"17.4":0.02047,"17.5":0.01535,"17.6":0.11769,"18.0":0.01535,"18.1":0.05117,"18.2":0.00512,"18.3":0.03582,"18.4":0.01023,"18.5-18.6":0.23027,"26.0":0.37866,"26.1":2.01098,"26.2":0.31725,"26.3":0.01023},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00493,"5.0-5.1":0,"6.0-6.1":0.00987,"7.0-7.1":0.0074,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01973,"10.0-10.2":0.00247,"10.3":0.03453,"11.0-11.2":0.42422,"11.3-11.4":0.01233,"12.0-12.1":0.00987,"12.2-12.5":0.11099,"13.0-13.1":0.00247,"13.2":0.01726,"13.3":0.00493,"13.4-13.7":0.01726,"14.0-14.4":0.03453,"14.5-14.8":0.037,"15.0-15.1":0.03946,"15.2-15.3":0.0296,"15.4":0.03206,"15.5":0.03453,"15.6-15.8":0.53521,"16.0":0.06166,"16.1":0.11839,"16.2":0.06166,"16.3":0.11099,"16.4":0.02713,"16.5":0.04686,"16.6-16.7":0.69553,"17.0":0.03946,"17.1":0.06413,"17.2":0.04686,"17.3":0.07153,"17.4":0.12085,"17.5":0.23677,"17.6-17.7":0.54754,"18.0":0.12332,"18.1":0.25651,"18.2":0.13565,"18.3":0.44149,"18.4":0.22691,"18.5-18.7":16.29306,"26.0":0.31817,"26.1":2.64645,"26.2":0.50315,"26.3":0.0222},P:{"4":0.01053,"24":0.02106,"26":0.01053,"27":0.01053,"28":0.17903,"29":3.93869,_:"20 21 22 23 25 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","5.0-5.4":0.02106,"7.2-7.4":0.02106,"8.2":0.02106},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.09278,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":20.37022},R:{_:"0"},M:{"0":1.05473}};

View File

@@ -0,0 +1,261 @@
'use strict'
const { test } = require('tap')
const fs = require('fs')
const proxyquire = require('proxyquire')
const SonicBoom = require('../')
const { file } = require('./helper')
test('write buffers that are not totally written with sync mode', (t) => {
t.plan(9)
const fakeFs = Object.create(fs)
fakeFs.writeSync = function (fd, buf, enc) {
t.pass('fake fs.write called')
fakeFs.writeSync = (fd, buf, enc) => {
t.pass('calling real fs.writeSync, ' + buf)
return fs.writeSync(fd, buf, enc)
}
return 0
}
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 0, sync: true })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.end()
stream.on('finish', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})
test('write buffers that are not totally written with flush sync', (t) => {
t.plan(7)
const fakeFs = Object.create(fs)
fakeFs.writeSync = function (fd, buf, enc) {
t.pass('fake fs.write called')
fakeFs.writeSync = fs.writeSync
return 0
}
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 100, sync: false })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.flushSync()
stream.on('write', (n) => {
if (n === 0) {
t.fail('throwing to avoid infinite loop')
throw Error('shouldn\'t call write handler after flushing with n === 0')
}
})
stream.end()
stream.on('finish', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})
test('sync writing is fully sync', (t) => {
t.plan(6)
const fakeFs = Object.create(fs)
fakeFs.writeSync = function (fd, buf, enc, cb) {
t.pass('fake fs.write called')
return fs.writeSync(fd, buf, enc)
}
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 0, sync: true })
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
// 'drain' will be only emitted once,
// the number of assertions at the top check this.
stream.on('drain', () => {
t.pass('drain emitted')
})
const data = fs.readFileSync(dest, 'utf8')
t.equal(data, 'hello world\nsomething else\n')
})
test('write enormously large buffers sync', (t) => {
t.plan(3)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 0, sync: true })
const buf = Buffer.alloc(1024).fill('x').toString() // 1 MB
let length = 0
for (let i = 0; i < 1024 * 512; i++) {
length += buf.length
stream.write(buf)
}
stream.end()
stream.on('finish', () => {
fs.stat(dest, (err, stat) => {
t.error(err)
t.equal(stat.size, length)
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})
test('write enormously large buffers sync with utf8 multi-byte split', (t) => {
t.plan(4)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 0, sync: true })
let buf = Buffer.alloc((1024 * 16) - 2).fill('x') // 16MB - 3B
const length = buf.length + 4
buf = buf.toString() + '🌲' // 16 MB + 1B
stream.write(buf)
stream.end()
stream.on('finish', () => {
fs.stat(dest, (err, stat) => {
t.error(err)
t.equal(stat.size, length)
const char = Buffer.alloc(4)
const fd = fs.openSync(dest, 'r')
fs.readSync(fd, char, 0, 4, length - 4)
t.equal(char.toString(), '🌲')
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})
// for context see this issue https://github.com/pinojs/pino/issues/871
test('file specified by dest path available immediately when options.sync is true', (t) => {
t.plan(3)
const dest = file()
const stream = new SonicBoom({ dest, sync: true })
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.flushSync()
t.pass('file opened and written to without error')
})
test('sync error handling', (t) => {
t.plan(1)
try {
/* eslint no-new: off */
new SonicBoom({ dest: '/path/to/nowwhere', sync: true })
t.fail('must throw synchronously')
} catch (err) {
t.pass('an error happened')
}
})
for (const fd of [1, 2]) {
test(`fd ${fd}`, (t) => {
t.plan(1)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const stream = new SonicBoom({ fd })
fakeFs.close = function (fd, cb) {
t.fail(`should not close fd ${fd}`)
}
stream.end()
stream.on('close', () => {
t.pass('close emitted')
})
})
}
test('._len must always be equal or greater than 0', (t) => {
t.plan(3)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, sync: true })
t.ok(stream.write('hello world 👀\n'))
t.ok(stream.write('another line 👀\n'))
t.equal(stream._len, 0)
stream.end()
})
test('._len must always be equal or greater than 0', (t) => {
const n = 20
t.plan(n + 3)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, sync: true, minLength: 20 })
let str = ''
for (let i = 0; i < 20; i++) {
t.ok(stream.write('👀'))
str += '👀'
}
t.equal(stream._len, 0)
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, str)
})
})

View File

@@ -0,0 +1 @@
{"version":3,"file":"snapshot.cjs","names":[],"sources":["../../../../src/rest/commands/schema/snapshot.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n// TODO improve typing\nexport type SchemaSnapshotOutput = {\n\tversion: number;\n\tdirectus: string;\n\tvendor: string;\n\tcollections: Record<string, any>[];\n\tfields: Record<string, any>[];\n\trelations: Record<string, any>[];\n};\n\n/**\n * Retrieve the current schema. This endpoint is only available to admin users.\n * @returns Returns the JSON object containing schema details.\n */\nexport const schemaSnapshot =\n\t<Schema>(): RestCommand<SchemaSnapshotOutput, Schema> =>\n\t() => ({\n\t\tmethod: 'GET',\n\t\tpath: '/schema/snapshot',\n\t});\n"],"mappings":"AAgBA,MAAa,WAEL,CACN,OAAQ,MACR,KAAM,mBACN"}

View File

@@ -0,0 +1,776 @@
import { getDayOfYear } from "../../getDayOfYear.mjs";
import { getISOWeek } from "../../getISOWeek.mjs";
import { getISOWeekYear } from "../../getISOWeekYear.mjs";
import { getWeek } from "../../getWeek.mjs";
import { getWeekYear } from "../../getWeekYear.mjs";
import { addLeadingZeros } from "../addLeadingZeros.mjs";
import { lightFormatters } from "./lightFormatters.mjs";
const dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
export const formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear(date);
// Padding
return addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = getWeek(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = getISOWeek(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = getDayOfYear(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(date.getTime() / 1000);
return addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
const timestamp = date.getTime();
return addLeadingZeros(timestamp, token.length);
},
};
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}

View File

@@ -0,0 +1,156 @@
import React from 'react';
type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' | 'error' | 'loading' | 'default';
type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
type PromiseTResult<Data = any> = string | React.ReactNode | ((data: Data) => React.ReactNode | string | Promise<React.ReactNode | string>);
type PromiseExternalToast = Omit<ExternalToast, 'description'>;
type PromiseData<ToastData = any> = PromiseExternalToast & {
loading?: string | React.ReactNode;
success?: PromiseTResult<ToastData>;
error?: PromiseTResult;
description?: PromiseTResult;
finally?: () => void | Promise<void>;
};
interface ToastClassnames {
toast?: string;
title?: string;
description?: string;
loader?: string;
closeButton?: string;
cancelButton?: string;
actionButton?: string;
success?: string;
error?: string;
info?: string;
warning?: string;
loading?: string;
default?: string;
content?: string;
icon?: string;
}
interface ToastIcons {
success?: React.ReactNode;
info?: React.ReactNode;
warning?: React.ReactNode;
error?: React.ReactNode;
loading?: React.ReactNode;
close?: React.ReactNode;
}
interface Action {
label: React.ReactNode;
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
actionButtonStyle?: React.CSSProperties;
}
interface ToastT {
id: number | string;
title?: (() => React.ReactNode) | React.ReactNode;
type?: ToastTypes;
icon?: React.ReactNode;
jsx?: React.ReactNode;
richColors?: boolean;
invert?: boolean;
closeButton?: boolean;
dismissible?: boolean;
description?: (() => React.ReactNode) | React.ReactNode;
duration?: number;
delete?: boolean;
action?: Action | React.ReactNode;
cancel?: Action | React.ReactNode;
onDismiss?: (toast: ToastT) => void;
onAutoClose?: (toast: ToastT) => void;
promise?: PromiseT;
cancelButtonStyle?: React.CSSProperties;
actionButtonStyle?: React.CSSProperties;
style?: React.CSSProperties;
unstyled?: boolean;
className?: string;
classNames?: ToastClassnames;
descriptionClassName?: string;
position?: Position;
}
type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
interface ToastOptions {
className?: string;
closeButton?: boolean;
descriptionClassName?: string;
style?: React.CSSProperties;
cancelButtonStyle?: React.CSSProperties;
actionButtonStyle?: React.CSSProperties;
duration?: number;
unstyled?: boolean;
classNames?: ToastClassnames;
}
type Offset = {
top?: string | number;
right?: string | number;
bottom?: string | number;
left?: string | number;
} | string | number;
interface ToasterProps {
invert?: boolean;
theme?: 'light' | 'dark' | 'system';
position?: Position;
hotkey?: string[];
richColors?: boolean;
expand?: boolean;
duration?: number;
gap?: number;
visibleToasts?: number;
closeButton?: boolean;
toastOptions?: ToastOptions;
className?: string;
style?: React.CSSProperties;
offset?: Offset;
mobileOffset?: Offset;
dir?: 'rtl' | 'ltr' | 'auto';
swipeDirections?: SwipeDirection[];
/**
* @deprecated Please use the `icons` prop instead:
* ```jsx
* <Toaster
* icons={{ loading: <LoadingIcon /> }}
* />
* ```
*/
loadingIcon?: React.ReactNode;
icons?: ToastIcons;
containerAriaLabel?: string;
pauseWhenPageIsHidden?: boolean;
}
type SwipeDirection = 'top' | 'right' | 'bottom' | 'left';
interface ToastToDismiss {
id: number | string;
dismiss: boolean;
}
type ExternalToast = Omit<ToastT, 'id' | 'type' | 'title' | 'jsx' | 'delete' | 'promise'> & {
id?: number | string;
};
type titleT = (() => React.ReactNode) | React.ReactNode;
declare const toast: ((message: titleT, data?: ExternalToast) => string | number) & {
success: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
info: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
warning: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
error: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
custom: (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => string | number;
message: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
promise: <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData>) => (string & {
unwrap: () => Promise<ToastData>;
}) | (number & {
unwrap: () => Promise<ToastData>;
}) | {
unwrap: () => Promise<ToastData>;
};
dismiss: (id?: number | string) => string | number;
loading: (message: titleT | React.ReactNode, data?: ExternalToast) => string | number;
} & {
getHistory: () => (ToastT | ToastToDismiss)[];
getToasts: () => (ToastT | ToastToDismiss)[];
};
declare function useSonner(): {
toasts: ToastT[];
};
declare const Toaster: React.ForwardRefExoticComponent<ToasterProps & React.RefAttributes<HTMLElement>>;
export { Action, ExternalToast, ToastClassnames, ToastT, ToastToDismiss, Toaster, ToasterProps, toast, useSonner };

View File

@@ -0,0 +1,29 @@
import { formatDistance } from "./en-US/_lib/formatDistance.js";
import { formatRelative } from "./en-US/_lib/formatRelative.js";
import { localize } from "./en-US/_lib/localize.js";
import { match } from "./en-US/_lib/match.js";
import { formatLong } from "./en-ZA/_lib/formatLong.js";
/**
* @category Locales
* @summary English locale (South Africa).
* @language English
* @iso-639-2 eng
* @author Shaila Kavrakova [@shaykav](https://github.com/shaykav)
*/
export const enZA = {
code: "en-ZA",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0, // Sunday is the first day of the week.
firstWeekContainsDate: 1, // The week that contains Jan 1st is the first week of the year.
},
};
// Fallback for modularized imports:
export default enZA;

View File

@@ -0,0 +1,3 @@
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
export declare const LocalDateTimeConfig: GraphQLScalarTypeConfig<string, string>;
export declare const GraphQLLocalDateTime: GraphQLScalarType<string, string>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"polymorphics.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/polymorphics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,oGAAoG;AACpG,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAC1C,cAAc,GACd,WAAW,GACX,cAAc,GACd,UAAU,GACV,aAAa,CAAC;AAEhB,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,cAAc,GAAG,WAAW,CAAC;AAElC,KAAK,WAAW,GAAG,WAAW,GAAG;IAC/B,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;KAC9C,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,KAAK,UAAU,GAAG,WAAW,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,aAAa,GAAG,WAAW,GAAG;IACjC,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE;QAEN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,KAAK,cAAc,GAAG,WAAW,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,MAAM,CAAC;aACd;SACF,CAAC;KACH,CAAC;IACF,KAAK,CAAC,EAAE;QAEN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE;QAEL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC"}

View File

@@ -0,0 +1,308 @@
import { constructFromSymbol } from "../constants/index.ts";
/**
* Time zone date class. It overrides original Date functions making them
* to perform all the calculations in the given time zone.
*
* It also provides new functions useful when working with time zones.
*
* Combined with date-fns, it allows using the class the same way as
* the original date class.
*
* This complete version provides formatter functions, mirroring all original
* methods of the `Date` class. It's build-size-heavier than `TZDateMini` and
* should be used when you need to format a string or in an environment you
* don't fully control (a library).
*
* For the minimal version, see `TZDateMini`.
*/
export class TZDate extends Date {
/**
* Constructs a new `TZDate` instance in the system time zone.
*/
constructor();
/**
* Constructs a new `TZDate` instance from the date time string and time zone.
*
* @param dateStr - Date time string to create a new instance from
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(dateStr: string, timeZone?: string);
/**
* Constructs a new `TZDate` instance from the date object and time zone.
*
* @param date - Date object to create a new instance from
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(date: Date, timeZone?: string);
/**
* Constructs a new `TZDate` instance from the Unix timestamp in milliseconds
* and time zone.
*
* @param timestamp - Unix timestamp in milliseconds to create a new instance from
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(timestamp: number, timeZone?: string);
/**
* Constructs a new `TZDate` instance from the year, month, and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(year: number, month: number, timeZone?: string);
/**
* Constructs a new `TZDate` instance from the year, month, date and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(year: number, month: number, date: number, timeZone?: string);
/**
* Constructs a new `TZDate` instance from the year, month, date, hours
* and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(
year: number,
month: number,
date: number,
hours: number,
timeZone?: string
);
/**
* Constructs a new `TZDate` instance from the year, month, date, hours,
* minutes and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(
year: number,
month: number,
date: number,
hours: number,
minutes: number,
timeZone?: string
);
/**
* Constructs a new `TZDate` instance from the year, month, date, hours,
* minutes, seconds and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
* @param seconds - Seconds
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(
year: number,
month: number,
date: number,
hours: number,
minutes: number,
seconds: number,
timeZone?: string
);
/**
* Constructs a new `TZDate` instance from the year, month, date, hours,
* minutes, seconds, milliseconds and time zone.
*
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
* @param seconds - Seconds
* @param milliseconds - Milliseconds
* @param timeZone - Time zone name (IANA or UTC offset)
*/
constructor(
year: number,
month: number,
date: number,
hours: number,
minutes: number,
seconds: number,
milliseconds: number,
timeZone?: string
);
/**
* Creates a new `TZDate` instance in the given time zone.
*
* @param tz - Time zone name (IANA or UTC offset)
*/
static tz(tz: string): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the Unix
* timestamp in milliseconds.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param timestamp - Unix timestamp in milliseconds
*/
static tz(tz: string, timestamp: number): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the date time
* string.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param dateStr - Date time string
*/
static tz(tz: string, dateStr: string): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the date object.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param date - Date object
*/
static tz(tz: string, date: Date): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year
* and month.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
*/
static tz(tz: string, year: number, month: number): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year,
* month and date.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
*/
static tz(tz: string, year: number, month: number, date: number): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year,
* month, date and hours.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
*/
static tz(
tz: string,
year: number,
month: number,
date: number,
hours: number
): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year,
* month, date, hours and minutes.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
*/
static tz(
tz: string,
year: number,
month: number,
date: number,
hours: number,
minutes: number
): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year,
* month, date, hours, minutes and seconds.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
* @param seconds - Seconds
*/
static tz(
tz: string,
year: number,
month: number,
date: number,
hours: number,
minutes: number,
seconds: number
): TZDate;
/**
* Creates a new `TZDate` instance in the given time zone from the year,
* month, date, hours, minutes, seconds and milliseconds.
*
* @param tz - Time zone name (IANA or UTC offset)
* @param year - Year
* @param month - Month (0-11)
* @param date - Date
* @param hours - Hours
* @param minutes - Minutes
* @param seconds - Seconds
* @param milliseconds - Milliseconds
*/
static tz(
tz: string,
year: number,
month: number,
date: number,
hours: number,
minutes: number,
seconds: number,
milliseconds: number
): TZDate;
/**
* The current time zone of the date.
*/
readonly timeZone: string | undefined;
/**
* Creates a new `TZDate` instance in the given time zone.
*/
withTimeZone(timeZone: string): TZDate;
/**
* Creates a new `TZDate` instance in the current instance time zone and
* the specified date time value.
*
* @param date - Date value to create a new instance from
*/
[constructFromSymbol](date: Date | number | string): TZDate;
}

View File

@@ -0,0 +1,98 @@
'use strict';
const prompts = require('./prompts');
const passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];
const noop = () => {};
/**
* Prompt for a series of questions
* @param {Array|Object} questions Single question object or Array of question objects
* @param {Function} [onSubmit] Callback function called on prompt submit
* @param {Function} [onCancel] Callback function called on cancel/abort
* @returns {Object} Object with values from user input
*/
async function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {
const answers = {};
const override = prompt._override || {};
questions = [].concat(questions);
let answer, question, quit, name, type, lastPrompt;
const getFormattedAnswer = async (question, answer, skipValidation = false) => {
if (!skipValidation && question.validate && question.validate(answer) !== true) {
return;
}
return question.format ? await question.format(answer, answers) : answer
};
for (question of questions) {
({ name, type } = question);
// evaluate type first and skip if type is a falsy value
if (typeof type === 'function') {
type = await type(answer, { ...answers }, question)
question['type'] = type
}
if (!type) continue;
// if property is a function, invoke it unless it's a special function
for (let key in question) {
if (passOn.includes(key)) continue;
let value = question[key];
question[key] = typeof value === 'function' ? await value(answer, { ...answers }, lastPrompt) : value;
}
lastPrompt = question;
if (typeof question.message !== 'string') {
throw new Error('prompt message is required');
}
// update vars in case they changed
({ name, type } = question);
if (prompts[type] === void 0) {
throw new Error(`prompt type (${type}) is not defined`);
}
if (override[question.name] !== undefined) {
answer = await getFormattedAnswer(question, override[question.name]);
if (answer !== undefined) {
answers[name] = answer;
continue;
}
}
try {
// Get the injected answer if there is one or prompt the user
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);
answers[name] = answer = await getFormattedAnswer(question, answer, true);
quit = await onSubmit(question, answer, answers);
} catch (err) {
quit = !(await onCancel(question, answers));
}
if (quit) return answers;
}
return answers;
}
function getInjectedAnswer(injected, deafultValue) {
const answer = injected.shift();
if (answer instanceof Error) {
throw answer;
}
return (answer === undefined) ? deafultValue : answer;
}
function inject(answers) {
prompt._injected = (prompt._injected || []).concat(answers);
}
function override(answers) {
prompt._override = Object.assign({}, answers);
}
module.exports = Object.assign(prompt, { prompt, prompts, inject, override });

View File

@@ -0,0 +1,40 @@
var baseAssignValue = require('./_baseAssignValue'),
createAggregator = require('./_createAggregator');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the number of times the key was returned by `iteratee`. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.5.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* // The `_.property` iteratee shorthand.
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
++result[key];
} else {
baseAssignValue(result, key, 1);
}
});
module.exports = countBy;

View File

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

View File

@@ -0,0 +1,16 @@
/**
* @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 Ban = createLucideIcon("Ban", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "m4.9 4.9 14.2 14.2", key: "1m5liu" }]
]);
export { Ban as default };
//# sourceMappingURL=ban.js.map

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
export var ExportResultCode;
(function (ExportResultCode) {
ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS";
ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED";
})(ExportResultCode || (ExportResultCode = {}));
//# sourceMappingURL=ExportResult.js.map

View File

@@ -0,0 +1,86 @@
import { is } from "../entity.js";
import { SQL } from "../index.js";
import { Subquery } from "../subquery.js";
import { Table } from "../table.js";
import { ViewBaseConfig } from "../view-common.js";
import { CheckBuilder } from "./checks.js";
import { ForeignKeyBuilder } from "./foreign-keys.js";
import { IndexBuilder } from "./indexes.js";
import { PrimaryKeyBuilder } from "./primary-keys.js";
import { MySqlTable } from "./table.js";
import { UniqueConstraintBuilder } from "./unique-constraint.js";
import { MySqlViewConfig } from "./view-common.js";
function extractUsedTable(table) {
if (is(table, MySqlTable)) {
return [`${table[Table.Symbol.BaseName]}`];
}
if (is(table, Subquery)) {
return table._.usedTables ?? [];
}
if (is(table, SQL)) {
return table.usedTables ?? [];
}
return [];
}
function getTableConfig(table) {
const columns = Object.values(table[MySqlTable.Symbol.Columns]);
const indexes = [];
const checks = [];
const primaryKeys = [];
const uniqueConstraints = [];
const foreignKeys = Object.values(table[MySqlTable.Symbol.InlineForeignKeys]);
const name = table[Table.Symbol.Name];
const schema = table[Table.Symbol.Schema];
const baseName = table[Table.Symbol.BaseName];
const extraConfigBuilder = table[MySqlTable.Symbol.ExtraConfigBuilder];
if (extraConfigBuilder !== void 0) {
const extraConfig = extraConfigBuilder(table[MySqlTable.Symbol.Columns]);
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
for (const builder of Object.values(extraValues)) {
if (is(builder, IndexBuilder)) {
indexes.push(builder.build(table));
} else if (is(builder, CheckBuilder)) {
checks.push(builder.build(table));
} else if (is(builder, UniqueConstraintBuilder)) {
uniqueConstraints.push(builder.build(table));
} else if (is(builder, PrimaryKeyBuilder)) {
primaryKeys.push(builder.build(table));
} else if (is(builder, ForeignKeyBuilder)) {
foreignKeys.push(builder.build(table));
}
}
}
return {
columns,
indexes,
foreignKeys,
checks,
primaryKeys,
uniqueConstraints,
name,
schema,
baseName
};
}
function getViewConfig(view) {
return {
...view[ViewBaseConfig],
...view[MySqlViewConfig]
};
}
function convertIndexToString(indexes) {
return indexes.map((idx) => {
return typeof idx === "object" ? idx.config.name : idx;
});
}
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
export {
convertIndexToString,
extractUsedTable,
getTableConfig,
getViewConfig,
toArray
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,353 @@
'use strict'
const Agent = require('../dispatcher/agent')
const MockAgent = require('./mock-agent')
const { SnapshotRecorder } = require('./snapshot-recorder')
const WrapHandler = require('../handler/wrap-handler')
const { InvalidArgumentError, UndiciError } = require('../core/errors')
const { validateSnapshotMode } = require('./snapshot-utils')
const kSnapshotRecorder = Symbol('kSnapshotRecorder')
const kSnapshotMode = Symbol('kSnapshotMode')
const kSnapshotPath = Symbol('kSnapshotPath')
const kSnapshotLoaded = Symbol('kSnapshotLoaded')
const kRealAgent = Symbol('kRealAgent')
// Static flag to ensure warning is only emitted once per process
let warningEmitted = false
class SnapshotAgent extends MockAgent {
constructor (opts = {}) {
// Emit experimental warning only once
if (!warningEmitted) {
process.emitWarning(
'SnapshotAgent is experimental and subject to change',
'ExperimentalWarning'
)
warningEmitted = true
}
const {
mode = 'record',
snapshotPath = null,
...mockAgentOpts
} = opts
super(mockAgentOpts)
validateSnapshotMode(mode)
// Validate snapshotPath is provided when required
if ((mode === 'playback' || mode === 'update') && !snapshotPath) {
throw new InvalidArgumentError(`snapshotPath is required when mode is '${mode}'`)
}
this[kSnapshotMode] = mode
this[kSnapshotPath] = snapshotPath
this[kSnapshotRecorder] = new SnapshotRecorder({
snapshotPath: this[kSnapshotPath],
mode: this[kSnapshotMode],
maxSnapshots: opts.maxSnapshots,
autoFlush: opts.autoFlush,
flushInterval: opts.flushInterval,
matchHeaders: opts.matchHeaders,
ignoreHeaders: opts.ignoreHeaders,
excludeHeaders: opts.excludeHeaders,
matchBody: opts.matchBody,
matchQuery: opts.matchQuery,
caseSensitive: opts.caseSensitive,
shouldRecord: opts.shouldRecord,
shouldPlayback: opts.shouldPlayback,
excludeUrls: opts.excludeUrls
})
this[kSnapshotLoaded] = false
// For recording/update mode, we need a real agent to make actual requests
// For playback mode, we need a real agent if there are excluded URLs
if (this[kSnapshotMode] === 'record' || this[kSnapshotMode] === 'update' ||
(this[kSnapshotMode] === 'playback' && opts.excludeUrls && opts.excludeUrls.length > 0)) {
this[kRealAgent] = new Agent(opts)
}
// Auto-load snapshots in playback/update mode
if ((this[kSnapshotMode] === 'playback' || this[kSnapshotMode] === 'update') && this[kSnapshotPath]) {
this.loadSnapshots().catch(() => {
// Ignore load errors - file might not exist yet
})
}
}
dispatch (opts, handler) {
handler = WrapHandler.wrap(handler)
const mode = this[kSnapshotMode]
// Check if URL should be excluded (pass through without mocking/recording)
if (this[kSnapshotRecorder].isUrlExcluded(opts)) {
// Real agent is guaranteed by constructor when excludeUrls is configured
return this[kRealAgent].dispatch(opts, handler)
}
if (mode === 'playback' || mode === 'update') {
// Ensure snapshots are loaded
if (!this[kSnapshotLoaded]) {
// Need to load asynchronously, delegate to async version
return this.#asyncDispatch(opts, handler)
}
// Try to find existing snapshot (synchronous)
const snapshot = this[kSnapshotRecorder].findSnapshot(opts)
if (snapshot) {
// Use recorded response (synchronous)
return this.#replaySnapshot(snapshot, handler)
} else if (mode === 'update') {
// Make real request and record it (async required)
return this.#recordAndReplay(opts, handler)
} else {
// Playback mode but no snapshot found
const error = new UndiciError(`No snapshot found for ${opts.method || 'GET'} ${opts.path}`)
if (handler.onError) {
handler.onError(error)
return
}
throw error
}
} else if (mode === 'record') {
// Record mode - make real request and save response (async required)
return this.#recordAndReplay(opts, handler)
}
}
/**
* Async version of dispatch for when we need to load snapshots first
*/
async #asyncDispatch (opts, handler) {
await this.loadSnapshots()
return this.dispatch(opts, handler)
}
/**
* Records a real request and replays the response
*/
#recordAndReplay (opts, handler) {
const responseData = {
statusCode: null,
headers: {},
trailers: {},
body: []
}
const self = this // Capture 'this' context for use within nested handler callbacks
const recordingHandler = {
onRequestStart (controller, context) {
return handler.onRequestStart(controller, { ...context, history: this.history })
},
onRequestUpgrade (controller, statusCode, headers, socket) {
return handler.onRequestUpgrade(controller, statusCode, headers, socket)
},
onResponseStart (controller, statusCode, headers, statusMessage) {
responseData.statusCode = statusCode
responseData.headers = headers
return handler.onResponseStart(controller, statusCode, headers, statusMessage)
},
onResponseData (controller, chunk) {
responseData.body.push(chunk)
return handler.onResponseData(controller, chunk)
},
onResponseEnd (controller, trailers) {
responseData.trailers = trailers
// Record the interaction using captured 'self' context (fire and forget)
const responseBody = Buffer.concat(responseData.body)
self[kSnapshotRecorder].record(opts, {
statusCode: responseData.statusCode,
headers: responseData.headers,
body: responseBody,
trailers: responseData.trailers
})
.then(() => handler.onResponseEnd(controller, trailers))
.catch((error) => handler.onResponseError(controller, error))
}
}
// Use composed agent if available (includes interceptors), otherwise use real agent
const agent = this[kRealAgent]
return agent.dispatch(opts, recordingHandler)
}
/**
* Replays a recorded response
*
* @param {Object} snapshot - The recorded snapshot to replay.
* @param {Object} handler - The handler to call with the response data.
* @returns {void}
*/
#replaySnapshot (snapshot, handler) {
try {
const { response } = snapshot
const controller = {
pause () { },
resume () { },
abort (reason) {
this.aborted = true
this.reason = reason
},
aborted: false,
paused: false
}
handler.onRequestStart(controller)
handler.onResponseStart(controller, response.statusCode, response.headers)
// Body is always stored as base64 string
const body = Buffer.from(response.body, 'base64')
handler.onResponseData(controller, body)
handler.onResponseEnd(controller, response.trailers)
} catch (error) {
handler.onError?.(error)
}
}
/**
* Loads snapshots from file
*
* @param {string} [filePath] - Optional file path to load snapshots from.
* @returns {Promise<void>} - Resolves when snapshots are loaded.
*/
async loadSnapshots (filePath) {
await this[kSnapshotRecorder].loadSnapshots(filePath || this[kSnapshotPath])
this[kSnapshotLoaded] = true
// In playback mode, set up MockAgent interceptors for all snapshots
if (this[kSnapshotMode] === 'playback') {
this.#setupMockInterceptors()
}
}
/**
* Saves snapshots to file
*
* @param {string} [filePath] - Optional file path to save snapshots to.
* @returns {Promise<void>} - Resolves when snapshots are saved.
*/
async saveSnapshots (filePath) {
return this[kSnapshotRecorder].saveSnapshots(filePath || this[kSnapshotPath])
}
/**
* Sets up MockAgent interceptors based on recorded snapshots.
*
* This method creates MockAgent interceptors for each recorded snapshot,
* allowing the SnapshotAgent to fall back to MockAgent's standard intercept
* mechanism in playback mode. Each interceptor is configured to persist
* (remain active for multiple requests) and responds with the recorded
* response data.
*
* Called automatically when loading snapshots in playback mode.
*
* @returns {void}
*/
#setupMockInterceptors () {
for (const snapshot of this[kSnapshotRecorder].getSnapshots()) {
const { request, responses, response } = snapshot
const url = new URL(request.url)
const mockPool = this.get(url.origin)
// Handle both new format (responses array) and legacy format (response object)
const responseData = responses ? responses[0] : response
if (!responseData) continue
mockPool.intercept({
path: url.pathname + url.search,
method: request.method,
headers: request.headers,
body: request.body
}).reply(responseData.statusCode, responseData.body, {
headers: responseData.headers,
trailers: responseData.trailers
}).persist()
}
}
/**
* Gets the snapshot recorder
* @return {SnapshotRecorder} - The snapshot recorder instance
*/
getRecorder () {
return this[kSnapshotRecorder]
}
/**
* Gets the current mode
* @return {import('./snapshot-utils').SnapshotMode} - The current snapshot mode
*/
getMode () {
return this[kSnapshotMode]
}
/**
* Clears all snapshots
* @returns {void}
*/
clearSnapshots () {
this[kSnapshotRecorder].clear()
}
/**
* Resets call counts for all snapshots (useful for test cleanup)
* @returns {void}
*/
resetCallCounts () {
this[kSnapshotRecorder].resetCallCounts()
}
/**
* Deletes a specific snapshot by request options
* @param {import('./snapshot-recorder').SnapshotRequestOptions} requestOpts - Request options to identify the snapshot
* @return {Promise<boolean>} - Returns true if the snapshot was deleted, false if not found
*/
deleteSnapshot (requestOpts) {
return this[kSnapshotRecorder].deleteSnapshot(requestOpts)
}
/**
* Gets information about a specific snapshot
* @returns {import('./snapshot-recorder').SnapshotInfo|null} - Snapshot information or null if not found
*/
getSnapshotInfo (requestOpts) {
return this[kSnapshotRecorder].getSnapshotInfo(requestOpts)
}
/**
* Replaces all snapshots with new data (full replacement)
* @param {Array<{hash: string; snapshot: import('./snapshot-recorder').SnapshotEntryshotEntry}>|Record<string, import('./snapshot-recorder').SnapshotEntry>} snapshotData - New snapshot data to replace existing snapshots
* @returns {void}
*/
replaceSnapshots (snapshotData) {
this[kSnapshotRecorder].replaceSnapshots(snapshotData)
}
/**
* Closes the agent, saving snapshots and cleaning up resources.
*
* @returns {Promise<void>}
*/
async close () {
await this[kSnapshotRecorder].close()
await this[kRealAgent]?.close()
await super.close()
}
}
module.exports = SnapshotAgent

View File

@@ -0,0 +1,137 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var session_exports = {};
__export(session_exports, {
MySqlProxyTransaction: () => MySqlProxyTransaction,
MySqlRemoteSession: () => MySqlRemoteSession,
PreparedQuery: () => PreparedQuery
});
module.exports = __toCommonJS(session_exports);
var import_core = require("../cache/core/index.cjs");
var import_column = require("../column.cjs");
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_mysql_core = require("../mysql-core/index.cjs");
var import_session = require("../mysql-core/session.cjs");
var import_sql = require("../sql/sql.cjs");
var import_utils = require("../utils.cjs");
class MySqlRemoteSession extends import_session.MySqlSession {
constructor(client, dialect, schema, options) {
super(dialect);
this.client = client;
this.schema = schema;
this.logger = options.logger ?? new import_logger.NoopLogger();
this.cache = options.cache ?? new import_core.NoopCache();
}
static [import_entity.entityKind] = "MySqlRemoteSession";
logger;
cache;
prepareQuery(query, fields, customResultMapper, generatedIds, returningIds, queryMetadata, cacheConfig) {
return new PreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
customResultMapper,
generatedIds,
returningIds
);
}
all(query) {
const querySql = this.dialect.sqlToQuery(query);
this.logger.logQuery(querySql.sql, querySql.params);
return this.client(querySql.sql, querySql.params, "all").then(({ rows }) => rows);
}
async transaction(_transaction, _config) {
throw new Error("Transactions are not supported by the MySql Proxy driver");
}
}
class MySqlProxyTransaction extends import_mysql_core.MySqlTransaction {
static [import_entity.entityKind] = "MySqlProxyTransaction";
async transaction(_transaction) {
throw new Error("Transactions are not supported by the MySql Proxy driver");
}
}
class PreparedQuery extends import_session.MySqlPreparedQuery {
constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, customResultMapper, generatedIds, returningIds) {
super(cache, queryMetadata, cacheConfig);
this.client = client;
this.queryString = queryString;
this.params = params;
this.logger = logger;
this.fields = fields;
this.customResultMapper = customResultMapper;
this.generatedIds = generatedIds;
this.returningIds = returningIds;
}
static [import_entity.entityKind] = "MySqlProxyPreparedQuery";
async execute(placeholderValues = {}) {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
const { fields, client, queryString, logger, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;
logger.logQuery(queryString, params);
if (!fields && !customResultMapper) {
const { rows: data } = await this.queryWithCache(queryString, params, async () => {
return await client(queryString, params, "execute");
});
const insertId = data[0].insertId;
const affectedRows = data[0].affectedRows;
if (returningIds) {
const returningResponse = [];
let j = 0;
for (let i = insertId; i < insertId + affectedRows; i++) {
for (const column of returningIds) {
const key = returningIds[0].path[0];
if ((0, import_entity.is)(column.field, import_column.Column)) {
if (column.field.primary && column.field.autoIncrement) {
returningResponse.push({ [key]: i });
}
if (column.field.defaultFn && generatedIds) {
returningResponse.push({ [key]: generatedIds[j][key] });
}
}
}
j++;
}
return returningResponse;
}
return data;
}
const { rows } = await this.queryWithCache(queryString, params, async () => {
return await client(queryString, params, "all");
});
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap));
}
iterator(_placeholderValues = {}) {
throw new Error("Streaming is not supported by the MySql Proxy driver");
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MySqlProxyTransaction,
MySqlRemoteSession,
PreparedQuery
});
//# sourceMappingURL=session.cjs.map

View File

@@ -0,0 +1,6 @@
import type { CollectionConfig } from '../collections/config/types.js';
import { APIError } from './APIError.js';
export declare class TimestampsRequired extends APIError {
constructor(collection: CollectionConfig);
}
//# sourceMappingURL=TimestampsRequired.d.ts.map

View File

@@ -0,0 +1,4 @@
export declare const startOfHour: import("./types.js").FPFn1<
Date,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,20 @@
/**
* @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 FlipHorizontal = createLucideIcon("FlipHorizontal", [
["path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3", key: "1i73f7" }],
["path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3", key: "saxlbk" }],
["path", { d: "M12 20v2", key: "1lh1kg" }],
["path", { d: "M12 14v2", key: "8jcxud" }],
["path", { d: "M12 8v2", key: "1woqiv" }],
["path", { d: "M12 2v2", key: "tus03m" }]
]);
export { FlipHorizontal as default };
//# sourceMappingURL=flip-horizontal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.spotlight.d.ts","sourceRoot":"","sources":["../../../../src/integrations-bundle/index.spotlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1,79 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const index = require('../asyncContext/index.js');
const carrier = require('../carrier.js');
const currentScopes = require('../currentScopes.js');
const _exports = require('../exports.js');
const debugLogger = require('./debug-logger.js');
const spanUtils = require('./spanUtils.js');
const dynamicSamplingContext = require('../tracing/dynamicSamplingContext.js');
const baggage = require('./baggage.js');
const tracing = require('./tracing.js');
/**
* Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation
* context) and serializes it to `sentry-trace` and `baggage` values. These values can be used to propagate
* a trace via our tracing Http headers or Html `<meta>` tags.
*
* This function also applies some validation to the generated sentry-trace and baggage values to ensure that
* only valid strings are returned.
*
* If (@param options.propagateTraceparent) is `true`, the function will also generate a `traceparent` value,
* following the W3C traceparent header format.
*
* @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header
* or meta tag name.
*/
function getTraceData(
options = {},
) {
const client = options.client || currentScopes.getClient();
if (!_exports.isEnabled() || !client) {
return {};
}
const carrier$1 = carrier.getMainCarrier();
const acs = index.getAsyncContextStrategy(carrier$1);
if (acs.getTraceData) {
return acs.getTraceData(options);
}
const scope = options.scope || currentScopes.getCurrentScope();
const span = options.span || spanUtils.getActiveSpan();
const sentryTrace = span ? spanUtils.spanToTraceHeader(span) : scopeToTraceHeader(scope);
const dsc = span ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) : dynamicSamplingContext.getDynamicSamplingContextFromScope(client, scope);
const baggage$1 = baggage.dynamicSamplingContextToSentryBaggageHeader(dsc);
const isValidSentryTraceHeader = tracing.TRACEPARENT_REGEXP.test(sentryTrace);
if (!isValidSentryTraceHeader) {
debugLogger.debug.warn('Invalid sentry-trace data. Cannot generate trace data');
return {};
}
const traceData = {
'sentry-trace': sentryTrace,
baggage: baggage$1,
};
if (options.propagateTraceparent) {
traceData.traceparent = span ? spanUtils.spanToTraceparentHeader(span) : scopeToTraceparentHeader(scope);
}
return traceData;
}
/**
* Get a sentry-trace header value for the given scope.
*/
function scopeToTraceHeader(scope) {
const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();
return tracing.generateSentryTraceHeader(traceId, propagationSpanId, sampled);
}
function scopeToTraceparentHeader(scope) {
const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();
return tracing.generateTraceparentHeader(traceId, propagationSpanId, sampled);
}
exports.getTraceData = getTraceData;
//# sourceMappingURL=traceData.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"zC","8":"K D E F A B"},B:{"1":"0 1 2 3 4 5 6 7 8 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","8":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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","2":"0C","8":"9 VC J bB K D E F A B C L M G N O P cB AB BB CB DB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"J bB K D E F A B C L","8":"M G N O P cB"},E:{"1":"K D E F A B C L M G 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","2":"6C bC","8":"J bB 7C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"F B JD KD LD MD","8":"C PC xC ND QC"},G:{"1":"E 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","2":"bC","8":"OD yC PD"},H:{"2":"mD"},I:{"1":"I rD sD","8":"VC J nD oD pD qD yC"},J:{"1":"A","8":"D"},K:{"1":"H","2":"A B","8":"C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"8":"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:1,C:"srcdoc attribute for iframes",D:true};

View File

@@ -0,0 +1,4 @@
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
export { _arrayWithHoles as default };

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"K D E F A B","2":"zC"},B:{"2":"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:{"2":"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:{"2":"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:{"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 jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"2":"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:{"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 jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C H PC xC QC"},L:{"2":"I"},M:{"2":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"2":"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:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:7,C:"EOT - Embedded OpenType fonts",D:true};

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./kk/_lib/formatDistance.mjs";
import { formatLong } from "./kk/_lib/formatLong.mjs";
import { formatRelative } from "./kk/_lib/formatRelative.mjs";
import { localize } from "./kk/_lib/localize.mjs";
import { match } from "./kk/_lib/match.mjs";
/**
* @category Locales
* @summary Kazakh locale.
* @language Kazakh
* @iso-639-2 kaz
* @author Nikita Bayev [@drugoi](https://github.com/drugoi)
*/
export const kk = {
code: "kk",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default kk;

View File

@@ -0,0 +1 @@
{"version":3,"file":"archive.js","sources":["../../../src/icons/archive.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Archive\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iNSIgeD0iMiIgeT0iMyIgcng9IjEiIC8+CiAgPHBhdGggZD0iTTQgOHYxMWEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJWOCIgLz4KICA8cGF0aCBkPSJNMTAgMTJoNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/archive\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 Archive = createLucideIcon('Archive', [\n ['rect', { width: '20', height: '5', x: '2', y: '3', rx: '1', key: '1wp1u1' }],\n ['path', { d: 'M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8', key: '1s80jp' }],\n ['path', { d: 'M10 12h4', key: 'a56b0p' }],\n]);\n\nexport default Archive;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,24 @@
export interface ProcessInterface {
execArgv: string[];
argv: string[];
cwd: () => string;
}
export interface ProcessArgs {
appPath: string;
importPaths: string[];
requirePaths: string[];
}
/**
* Parses the process arguments to determine the app path, import paths, and require paths.
*/
export declare function parseProcessPaths(proc: ProcessInterface): ProcessArgs;
/**
* Gets the current entry point type.
*
* `app` means this function was most likely called via the app entry point.
* `import` means this function was most likely called from an --import cli arg.
* `require` means this function was most likely called from a --require cli arg.
* `unknown` means we couldn't determine for sure.
*/
export declare function getEntryPointType(proc?: ProcessInterface): 'import' | 'require' | 'app' | 'unknown';
//# sourceMappingURL=entry-point.d.ts.map

View File

@@ -0,0 +1,42 @@
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, operators, Code} from "../../compile/codegen"
const ops = operators
type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"
type Comparison = "<=" | ">=" | "<" | ">"
const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {
maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT},
minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT},
exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE},
exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE},
}
export type LimitNumberError = ErrorObject<
Kwd,
{limit: number; comparison: Comparison},
number | {$data: string}
>
const error: KeywordErrorDefinition = {
message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,
params: ({keyword, schemaCode}) =>
_`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,
}
const def: CodeKeywordDefinition = {
keyword: Object.keys(KWDs),
type: "number",
schemaType: "number",
$data: true,
error,
code(cxt: KeywordCxt) {
const {keyword, data, schemaCode} = cxt
cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`)
},
}
export default def

View File

@@ -0,0 +1,102 @@
import { debug } from '@sentry/core';
function debugLog(...args) {
debug.log('[https-proxy-agent:parse-proxy-response]', ...args);
}
function parseProxyResponse(socket) {
return new Promise((resolve, reject) => {
// we need to buffer any HTTP traffic that happens with the proxy before we get
// the CONNECT response, so that if the response is anything other than an "200"
// response code, then we can re-play the "data" events on the socket once the
// HTTP parser is hooked up...
let buffersLength = 0;
const buffers = [];
function read() {
const b = socket.read();
if (b) ondata(b);
else socket.once('readable', read);
}
function cleanup() {
socket.removeListener('end', onend);
socket.removeListener('error', onerror);
socket.removeListener('readable', read);
}
function onend() {
cleanup();
debugLog('onend');
reject(new Error('Proxy connection ended before receiving CONNECT response'));
}
function onerror(err) {
cleanup();
debugLog('onerror %o', err);
reject(err);
}
function ondata(b) {
buffers.push(b);
buffersLength += b.length;
const buffered = Buffer.concat(buffers, buffersLength);
const endOfHeaders = buffered.indexOf('\r\n\r\n');
if (endOfHeaders === -1) {
// keep buffering
debugLog('have not received end of HTTP headers yet...');
read();
return;
}
const headerParts = buffered.subarray(0, endOfHeaders).toString('ascii').split('\r\n');
const firstLine = headerParts.shift();
if (!firstLine) {
socket.destroy();
return reject(new Error('No header received from proxy CONNECT response'));
}
const firstLineParts = firstLine.split(' ');
const statusCode = +(firstLineParts[1] || 0);
const statusText = firstLineParts.slice(2).join(' ');
const headers = {};
for (const header of headerParts) {
if (!header) continue;
const firstColon = header.indexOf(':');
if (firstColon === -1) {
socket.destroy();
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
}
const key = header.slice(0, firstColon).toLowerCase();
const value = header.slice(firstColon + 1).trimStart();
const current = headers[key];
if (typeof current === 'string') {
headers[key] = [current, value];
} else if (Array.isArray(current)) {
current.push(value);
} else {
headers[key] = value;
}
}
debugLog('got proxy server response: %o %o', firstLine, headers);
cleanup();
resolve({
connect: {
statusCode,
statusText,
headers,
},
buffered,
});
}
socket.on('error', onerror);
socket.on('end', onend);
read();
});
}
export { parseProxyResponse };
//# sourceMappingURL=parse-proxy-response.js.map

View File

@@ -0,0 +1,69 @@
import { is } from "../entity.js";
import { pgPolicy } from "../pg-core/index.js";
import { PgRole, pgRole } from "../pg-core/roles.js";
import { sql } from "../sql/sql.js";
const crudPolicy = (options) => {
if (options.read === void 0) {
throw new Error("crudPolicy requires a read policy");
}
if (options.modify === void 0) {
throw new Error("crudPolicy requires a modify policy");
}
let read;
if (options.read === true) {
read = sql`true`;
} else if (options.read === false) {
read = sql`false`;
} else if (options.read !== null) {
read = options.read;
}
let modify;
if (options.modify === true) {
modify = sql`true`;
} else if (options.modify === false) {
modify = sql`false`;
} else if (options.modify !== null) {
modify = options.modify;
}
let rolesName = "";
if (Array.isArray(options.role)) {
rolesName = options.role.map((it) => {
return is(it, PgRole) ? it.name : it;
}).join("-");
} else {
rolesName = is(options.role, PgRole) ? options.role.name : options.role;
}
return [
read && pgPolicy(`crud-${rolesName}-policy-select`, {
for: "select",
to: options.role,
using: read
}),
modify && pgPolicy(`crud-${rolesName}-policy-insert`, {
for: "insert",
to: options.role,
withCheck: modify
}),
modify && pgPolicy(`crud-${rolesName}-policy-update`, {
for: "update",
to: options.role,
using: modify,
withCheck: modify
}),
modify && pgPolicy(`crud-${rolesName}-policy-delete`, {
for: "delete",
to: options.role,
using: modify
})
].filter(Boolean);
};
const authenticatedRole = pgRole("authenticated").existing();
const anonymousRole = pgRole("anonymous").existing();
const authUid = (userIdColumn) => sql`(select auth.user_id() = ${userIdColumn})`;
export {
anonymousRole,
authUid,
authenticatedRole,
crudPolicy
};
//# sourceMappingURL=rls.js.map

View File

@@ -0,0 +1,59 @@
import type { KeyLike, GeneralJWE, JWEHeaderParameters, CritOption } from '../../types';
export interface Recipient {
/**
* Sets the JWE Per-Recipient Unprotected Header on the Recipient object.
*
* @param unprotectedHeader JWE Per-Recipient Unprotected Header.
*/
setUnprotectedHeader(unprotectedHeader: JWEHeaderParameters): Recipient;
/** A shorthand for calling addRecipient() on the enclosing GeneralEncrypt instance */
addRecipient(...args: Parameters<GeneralEncrypt['addRecipient']>): Recipient;
/** A shorthand for calling encrypt() on the enclosing GeneralEncrypt instance */
encrypt(...args: Parameters<GeneralEncrypt['encrypt']>): Promise<GeneralJWE>;
/** Returns the enclosing GeneralEncrypt */
done(): GeneralEncrypt;
}
/**
* The GeneralEncrypt class is used to build and encrypt General JWE objects.
*
* This class is exported (as a named export) from the main `'jose'` module entry point as well as
* from its subpath export `'jose/jwe/general/encrypt'`.
*
*/
export declare class GeneralEncrypt {
private _plaintext;
private _recipients;
private _protectedHeader;
private _unprotectedHeader;
private _aad;
/** @param plaintext Binary representation of the plaintext to encrypt. */
constructor(plaintext: Uint8Array);
/**
* Adds an additional recipient for the General JWE object.
*
* @param key Public Key or Secret to encrypt the Content Encryption Key for the recipient with.
* See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWE Encryption options.
*/
addRecipient(key: KeyLike | Uint8Array, options?: CritOption): Recipient;
/**
* Sets the JWE Protected Header on the GeneralEncrypt object.
*
* @param protectedHeader JWE Protected Header object.
*/
setProtectedHeader(protectedHeader: JWEHeaderParameters): this;
/**
* Sets the JWE Shared Unprotected Header on the GeneralEncrypt object.
*
* @param sharedUnprotectedHeader JWE Shared Unprotected Header object.
*/
setSharedUnprotectedHeader(sharedUnprotectedHeader: JWEHeaderParameters): this;
/**
* Sets the Additional Authenticated Data on the GeneralEncrypt object.
*
* @param aad Additional Authenticated Data.
*/
setAdditionalAuthenticatedData(aad: Uint8Array): this;
/** Encrypts and resolves the value of the General JWE object. */
encrypt(): Promise<GeneralJWE>;
}

View File

@@ -0,0 +1,22 @@
/** Supported Sentry transport protocols in a Dsn. */
export type DsnProtocol = 'http' | 'https';
/** Primitive components of a Dsn. */
export interface DsnComponents {
/** Protocol used to connect to Sentry. */
protocol: DsnProtocol;
/** Public authorization key. */
publicKey?: string;
/** Private authorization key (deprecated, optional). */
pass?: string;
/** Hostname of the Sentry instance. */
host: string;
/** Port of the Sentry instance. */
port?: string;
/** Sub path/ */
path?: string;
/** Project ID */
projectId: string;
}
/** Anything that can be parsed into a Dsn. */
export type DsnLike = string | DsnComponents;
//# sourceMappingURL=dsn.d.ts.map

View File

@@ -0,0 +1,8 @@
import './index.scss';
type Props = {
activeView: 'grid' | 'list';
setActiveView: (view: 'grid' | 'list') => void;
};
export declare function ToggleViewButtons({ activeView, setActiveView }: Props): import("react").JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('findLast', require('../findLast'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,12 @@
import getConfig from '../../server/react-server/getConfig.js';
/**
* This is only moved to a separate module for easier mocking in
* `../createNavigatoin.test.tsx` in order to avoid suspending.
*/
async function getServerLocale() {
const config = await getConfig();
return config.locale;
}
export { getServerLocale as default };

View File

@@ -0,0 +1,82 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const NullDependency = require("./NullDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
class UnsupportedDependency extends NullDependency {
/**
* @param {string} request the request string
* @param {Range} range location in source code
*/
constructor(request, range) {
super();
this.request = request;
this.range = range;
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.request);
write(this.range);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.request = read();
this.range = read();
super.deserialize(context);
}
}
makeSerializable(
UnsupportedDependency,
"webpack/lib/dependencies/UnsupportedDependency"
);
UnsupportedDependency.Template = class UnsupportedDependencyTemplate extends (
NullDependency.Template
) {
/**
* @param {Dependency} dependency the dependency for which the template should be applied
* @param {ReplaceSource} source the current replace source which can be modified
* @param {DependencyTemplateContext} templateContext the context object
* @returns {void}
*/
apply(dependency, source, { runtimeTemplate }) {
const dep = /** @type {UnsupportedDependency} */ (dependency);
source.replace(
dep.range[0],
dep.range[1],
runtimeTemplate.missingModule({
request: dep.request
})
);
}
};
module.exports = UnsupportedDependency;

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolvers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,EAAE,UAAU,CAAA;CACnB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"mouse.js","sources":["../../../src/icons/mouse.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mouse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB4PSI1IiB5PSIyIiB3aWR0aD0iMTQiIGhlaWdodD0iMjAiIHJ4PSI3IiAvPgogIDxwYXRoIGQ9Ik0xMiA2djQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/mouse\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 Mouse = createLucideIcon('Mouse', [\n ['rect', { x: '5', y: '2', width: '14', height: '20', rx: '7', key: '11ol66' }],\n ['path', { d: 'M12 6v4', key: '16clxf' }],\n]);\n\nexport default Mouse;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
Prism.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}});

View File

@@ -0,0 +1,34 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const UTC_OFFSET_REGEX = /^([+-]?)(\d{2}):(\d{2})$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!UTC_OFFSET_REGEX.test(value)) {
throw createGraphQLError(`Value is not a valid UTC Offset: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
export const GraphQLUtcOffset = /*#__PURE__*/ new GraphQLScalarType({
name: 'UtcOffset',
description: 'A field whose value is a UTC Offset: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones',
serialize: validate,
parseValue: validate,
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as UTC Offset but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'UtcOffset',
type: 'string',
pattern: UTC_OFFSET_REGEX.source,
},
},
});

View File

@@ -0,0 +1,53 @@
import { keyValMap } from '../jsutils/keyValMap.mjs';
import { Kind } from '../language/kinds.mjs';
/**
* Produces a JavaScript value given a GraphQL Value AST.
*
* Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value
* will reflect the provided GraphQL value AST.
*
* | GraphQL Value | JavaScript Value |
* | -------------------- | ---------------- |
* | Input Object | Object |
* | List | Array |
* | Boolean | Boolean |
* | String / Enum | String |
* | Int / Float | Number |
* | Null | null |
*
*/
export function valueFromASTUntyped(valueNode, variables) {
switch (valueNode.kind) {
case Kind.NULL:
return null;
case Kind.INT:
return parseInt(valueNode.value, 10);
case Kind.FLOAT:
return parseFloat(valueNode.value);
case Kind.STRING:
case Kind.ENUM:
case Kind.BOOLEAN:
return valueNode.value;
case Kind.LIST:
return valueNode.values.map((node) =>
valueFromASTUntyped(node, variables),
);
case Kind.OBJECT:
return keyValMap(
valueNode.fields,
(field) => field.name.value,
(field) => valueFromASTUntyped(field.value, variables),
);
case Kind.VARIABLE:
return variables === null || variables === void 0
? void 0
: variables[valueNode.name.value];
}
}

View File

@@ -0,0 +1,22 @@
import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
import { _JTDTypeError } from "./error";
declare enum PropError {
Additional = "additional",
Missing = "missing"
}
type PropKeyword = "properties" | "optionalProperties";
type PropSchema = {
[P in string]?: SchemaObject;
};
export type JTDPropertiesError = _JTDTypeError<PropKeyword, "object", PropSchema> | ErrorObject<PropKeyword, {
error: PropError.Additional;
additionalProperty: string;
}, PropSchema> | ErrorObject<PropKeyword, {
error: PropError.Missing;
missingProperty: string;
}, PropSchema>;
export declare const error: KeywordErrorDefinition;
declare const def: CodeKeywordDefinition;
export declare function validateProperties(cxt: KeywordCxt): void;
export default def;

View File

@@ -0,0 +1 @@
{"version":3,"file":"notebook-tabs.js","sources":["../../../src/icons/notebook-tabs.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NotebookTabs\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA2aDQiIC8+CiAgPHBhdGggZD0iTTIgMTBoNCIgLz4KICA8cGF0aCBkPSJNMiAxNGg0IiAvPgogIDxwYXRoIGQ9Ik0yIDE4aDQiIC8+CiAgPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjIwIiB4PSI0IiB5PSIyIiByeD0iMiIgLz4KICA8cGF0aCBkPSJNMTUgMnYyMCIgLz4KICA8cGF0aCBkPSJNMTUgN2g1IiAvPgogIDxwYXRoIGQ9Ik0xNSAxMmg1IiAvPgogIDxwYXRoIGQ9Ik0xNSAxN2g1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/notebook-tabs\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 NotebookTabs = createLucideIcon('NotebookTabs', [\n ['path', { d: 'M2 6h4', key: 'aawbzj' }],\n ['path', { d: 'M2 10h4', key: 'l0bgd4' }],\n ['path', { d: 'M2 14h4', key: '1gsvsf' }],\n ['path', { d: 'M2 18h4', key: '1bu2t1' }],\n ['rect', { width: '16', height: '20', x: '4', y: '2', rx: '2', key: '1nb95v' }],\n ['path', { d: 'M15 2v20', key: 'dcj49h' }],\n ['path', { d: 'M15 7h5', key: '1xj5lc' }],\n ['path', { d: 'M15 12h5', key: 'w5shd9' }],\n ['path', { d: 'M15 17h5', key: '1qaofu' }],\n]);\n\nexport default NotebookTabs;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,7 @@
import { DiagLogLevel } from '@opentelemetry/api';
/**
* Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined.
* @param value
*/
export declare function diagLogLevelFromString(value: string | undefined): DiagLogLevel | undefined;
//# sourceMappingURL=configuration.d.ts.map

View File

@@ -0,0 +1,316 @@
'use strict';
const shared = require('../shared');
const MimeNode = require('../mime-node');
const mimeFuncs = require('../mime-funcs');
class MailMessage {
constructor(mailer, data) {
this.mailer = mailer;
this.data = {};
this.message = null;
data = data || {};
let options = mailer.options || {};
let defaults = mailer._defaults || {};
Object.keys(data).forEach(key => {
this.data[key] = data[key];
});
this.data.headers = this.data.headers || {};
// apply defaults
Object.keys(defaults).forEach(key => {
if (!(key in this.data)) {
this.data[key] = defaults[key];
} else if (key === 'headers') {
// headers is a special case. Allow setting individual default headers
Object.keys(defaults.headers).forEach(key => {
if (!(key in this.data.headers)) {
this.data.headers[key] = defaults.headers[key];
}
});
}
});
// force specific keys from transporter options
['disableFileAccess', 'disableUrlAccess', 'normalizeHeaderKey'].forEach(key => {
if (key in options) {
this.data[key] = options[key];
}
});
}
resolveContent(...args) {
return shared.resolveContent(...args);
}
resolveAll(callback) {
let keys = [
[this.data, 'html'],
[this.data, 'text'],
[this.data, 'watchHtml'],
[this.data, 'amp'],
[this.data, 'icalEvent']
];
if (this.data.alternatives && this.data.alternatives.length) {
this.data.alternatives.forEach((alternative, i) => {
keys.push([this.data.alternatives, i]);
});
}
if (this.data.attachments && this.data.attachments.length) {
this.data.attachments.forEach((attachment, i) => {
if (!attachment.filename) {
attachment.filename =
(attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
if (attachment.filename.indexOf('.') < 0) {
attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);
}
}
if (!attachment.contentType) {
attachment.contentType = mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');
}
keys.push([this.data.attachments, i]);
});
}
let mimeNode = new MimeNode();
let addressKeys = ['from', 'to', 'cc', 'bcc', 'sender', 'replyTo'];
addressKeys.forEach(address => {
let value;
if (this.message) {
value = [].concat(mimeNode._parseAddresses(this.message.getHeader(address === 'replyTo' ? 'reply-to' : address)) || []);
} else if (this.data[address]) {
value = [].concat(mimeNode._parseAddresses(this.data[address]) || []);
}
if (value && value.length) {
this.data[address] = value;
} else if (address in this.data) {
this.data[address] = null;
}
});
let singleKeys = ['from', 'sender'];
singleKeys.forEach(address => {
if (this.data[address]) {
this.data[address] = this.data[address].shift();
}
});
let pos = 0;
let resolveNext = () => {
if (pos >= keys.length) {
return callback(null, this.data);
}
let args = keys[pos++];
if (!args[0] || !args[0][args[1]]) {
return resolveNext();
}
shared.resolveContent(...args, (err, value) => {
if (err) {
return callback(err);
}
let node = {
content: value
};
if (args[0][args[1]] && typeof args[0][args[1]] === 'object' && !Buffer.isBuffer(args[0][args[1]])) {
Object.keys(args[0][args[1]]).forEach(key => {
if (!(key in node) && !['content', 'path', 'href', 'raw'].includes(key)) {
node[key] = args[0][args[1]][key];
}
});
}
args[0][args[1]] = node;
resolveNext();
});
};
setImmediate(() => resolveNext());
}
normalize(callback) {
let envelope = this.data.envelope || this.message.getEnvelope();
let messageId = this.message.messageId();
this.resolveAll((err, data) => {
if (err) {
return callback(err);
}
data.envelope = envelope;
data.messageId = messageId;
['html', 'text', 'watchHtml', 'amp'].forEach(key => {
if (data[key] && data[key].content) {
if (typeof data[key].content === 'string') {
data[key] = data[key].content;
} else if (Buffer.isBuffer(data[key].content)) {
data[key] = data[key].content.toString();
}
}
});
if (data.icalEvent && Buffer.isBuffer(data.icalEvent.content)) {
data.icalEvent.content = data.icalEvent.content.toString('base64');
data.icalEvent.encoding = 'base64';
}
if (data.alternatives && data.alternatives.length) {
data.alternatives.forEach(alternative => {
if (alternative && alternative.content && Buffer.isBuffer(alternative.content)) {
alternative.content = alternative.content.toString('base64');
alternative.encoding = 'base64';
}
});
}
if (data.attachments && data.attachments.length) {
data.attachments.forEach(attachment => {
if (attachment && attachment.content && Buffer.isBuffer(attachment.content)) {
attachment.content = attachment.content.toString('base64');
attachment.encoding = 'base64';
}
});
}
data.normalizedHeaders = {};
Object.keys(data.headers || {}).forEach(key => {
let value = [].concat(data.headers[key] || []).shift();
value = (value && value.value) || value;
if (value) {
if (['references', 'in-reply-to', 'message-id', 'content-id'].includes(key)) {
value = this.message._encodeHeaderValue(key, value);
}
data.normalizedHeaders[key] = value;
}
});
if (data.list && typeof data.list === 'object') {
let listHeaders = this._getListHeaders(data.list);
listHeaders.forEach(entry => {
data.normalizedHeaders[entry.key] = entry.value.map(val => (val && val.value) || val).join(', ');
});
}
if (data.references) {
data.normalizedHeaders.references = this.message._encodeHeaderValue('references', data.references);
}
if (data.inReplyTo) {
data.normalizedHeaders['in-reply-to'] = this.message._encodeHeaderValue('in-reply-to', data.inReplyTo);
}
return callback(null, data);
});
}
setMailerHeader() {
if (!this.message || !this.data.xMailer) {
return;
}
this.message.setHeader('X-Mailer', this.data.xMailer);
}
setPriorityHeaders() {
if (!this.message || !this.data.priority) {
return;
}
switch ((this.data.priority || '').toString().toLowerCase()) {
case 'high':
this.message.setHeader('X-Priority', '1 (Highest)');
this.message.setHeader('X-MSMail-Priority', 'High');
this.message.setHeader('Importance', 'High');
break;
case 'low':
this.message.setHeader('X-Priority', '5 (Lowest)');
this.message.setHeader('X-MSMail-Priority', 'Low');
this.message.setHeader('Importance', 'Low');
break;
default:
// do not add anything, since all messages are 'Normal' by default
}
}
setListHeaders() {
if (!this.message || !this.data.list || typeof this.data.list !== 'object') {
return;
}
// add optional List-* headers
if (this.data.list && typeof this.data.list === 'object') {
this._getListHeaders(this.data.list).forEach(listHeader => {
listHeader.value.forEach(value => {
this.message.addHeader(listHeader.key, value);
});
});
}
}
_getListHeaders(listData) {
// make sure an url looks like <protocol:url>
return Object.keys(listData).map(key => ({
key: 'list-' + key.toLowerCase().trim(),
value: [].concat(listData[key] || []).map(value => ({
prepared: true,
foldLines: true,
value: []
.concat(value || [])
.map(value => {
if (typeof value === 'string') {
value = {
url: value
};
}
if (value && value.url) {
if (key.toLowerCase().trim() === 'id') {
// List-ID: "comment" <domain>
let comment = value.comment || '';
if (mimeFuncs.isPlainText(comment)) {
comment = '"' + comment + '"';
} else {
comment = mimeFuncs.encodeWord(comment);
}
return (value.comment ? comment + ' ' : '') + this._formatListUrl(value.url).replace(/^<[^:]+\/{,2}/, '');
}
// List-*: <http://domain> (comment)
let comment = value.comment || '';
if (!mimeFuncs.isPlainText(comment)) {
comment = mimeFuncs.encodeWord(comment);
}
return this._formatListUrl(value.url) + (value.comment ? ' (' + comment + ')' : '');
}
return '';
})
.filter(value => value)
.join(', ')
}))
}));
}
_formatListUrl(url) {
url = url.replace(/[\s<]+|[\s>]+/g, '');
if (/^(https?|mailto|ftp):/.test(url)) {
return '<' + url + '>';
}
if (/^[^@]+@[^@]+$/.test(url)) {
return '<mailto:' + url + '>';
}
return '<http://' + url + '>';
}
}
module.exports = MailMessage;

View File

@@ -0,0 +1,30 @@
import { constructNow } from "./constructNow.mjs";
import { isSameSecond } from "./isSameSecond.mjs";
/**
* @name isThisSecond
* @category Second Helpers
* @summary Is the given date in the same second as the current date?
* @pure false
*
* @description
* Is the given date in the same second as the current date?
*
* @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).
*
* @param date - The date to check
*
* @returns The date is in this second
*
* @example
* // If now is 25 September 2014 18:30:15.500,
* // is 25 September 2014 18:30:15.000 in this second?
* const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))
* //=> true
*/
export function isThisSecond(date) {
return isSameSecond(date, constructNow(date));
}
// Fallback for modularized imports:
export default isThisSecond;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F zC","132":"A B"},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 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 5C","2":"0C VC 4C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"J bB"},E:{"1":"K D E F A B C L M G 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","2":"J bB 6C bC 7C"},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 PC xC ND QC","2":"F B JD KD LD MD"},G:{"1":"E 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","2":"bC OD yC PD"},H:{"2":"mD"},I:{"1":"VC J I qD yC rD sD","2":"nD oD pD"},J:{"1":"A","2":"D"},K:{"1":"C H PC xC QC","2":"A B"},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:5,C:"FileReader API",D:true};

View File

@@ -0,0 +1,7 @@
import React from 'react';
import type { Props } from './types.js';
import './library.scss';
import './index.scss';
declare const DatePicker: React.FC<Props>;
export default DatePicker;
//# sourceMappingURL=DatePicker.d.ts.map

View File

@@ -0,0 +1,10 @@
export class Deferred {
constructor() {
this.resolve = () => null;
this.reject = () => null;
this.promise = new Promise((resolve, reject) => {
this.reject = reject;
this.resolve = resolve;
});
}
}

View File

@@ -0,0 +1,53 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { AnySingleStoreTable } from "../table.js";
import { type Equal } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
export type SingleStoreDateBuilderInitial<TName extends string> = SingleStoreDateBuilder<{
name: TName;
dataType: 'date';
columnType: 'SingleStoreDate';
data: Date;
driverParam: string | number;
enumValues: undefined;
generated: undefined;
}>;
export declare class SingleStoreDateBuilder<T extends ColumnBuilderBaseConfig<'date', 'SingleStoreDate'>> extends SingleStoreColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SingleStoreDate<T extends ColumnBaseConfig<'date', 'SingleStoreDate'>> extends SingleStoreColumn<T> {
static readonly [entityKind]: string;
constructor(table: AnySingleStoreTable<{
name: T['tableName'];
}>, config: SingleStoreDateBuilder<T>['config']);
getSQLType(): string;
mapFromDriverValue(value: string): Date;
}
export type SingleStoreDateStringBuilderInitial<TName extends string> = SingleStoreDateStringBuilder<{
name: TName;
dataType: 'string';
columnType: 'SingleStoreDateString';
data: string;
driverParam: string | number;
enumValues: undefined;
generated: undefined;
}>;
export declare class SingleStoreDateStringBuilder<T extends ColumnBuilderBaseConfig<'string', 'SingleStoreDateString'>> extends SingleStoreColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SingleStoreDateString<T extends ColumnBaseConfig<'string', 'SingleStoreDateString'>> extends SingleStoreColumn<T> {
static readonly [entityKind]: string;
constructor(table: AnySingleStoreTable<{
name: T['tableName'];
}>, config: SingleStoreDateStringBuilder<T>['config']);
getSQLType(): string;
}
export interface SingleStoreDateConfig<TMode extends 'date' | 'string' = 'date' | 'string'> {
mode?: TMode;
}
export declare function date(): SingleStoreDateBuilderInitial<''>;
export declare function date<TMode extends SingleStoreDateConfig['mode'] & {}>(config?: SingleStoreDateConfig<TMode>): Equal<TMode, 'string'> extends true ? SingleStoreDateStringBuilderInitial<''> : SingleStoreDateBuilderInitial<''>;
export declare function date<TName extends string, TMode extends SingleStoreDateConfig['mode'] & {}>(name: TName, config?: SingleStoreDateConfig<TMode>): Equal<TMode, 'string'> extends true ? SingleStoreDateStringBuilderInitial<TName> : SingleStoreDateBuilderInitial<TName>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tracing/vercel-ai/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,eAAO,MAAM,eAAe,mBAA0B,CAAC;AAGvD,eAAO,MAAM,gBAAgB,aAQ3B,CAAC;AAEH,eAAO,MAAM,oBAAoB,aAK/B,CAAC;AAEH,eAAO,MAAM,cAAc,aAAwD,CAAC;AAEpF,eAAO,MAAM,UAAU,aAAkC,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mysql-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './year.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,wBADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,wBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,sBANd;AAOA,4BAAc,0BAPd;AAQA,4BAAc,yBARd;AASA,4BAAc,wBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,uBAXd;AAYA,4BAAc,qBAZd;AAaA,4BAAc,sBAbd;AAcA,4BAAc,2BAdd;AAeA,4BAAc,sBAfd;AAgBA,4BAAc,wBAhBd;AAiBA,4BAAc,0BAjBd;AAkBA,4BAAc,sBAlBd;AAmBA,4BAAc,sBAnBd;AAoBA,4BAAc,2BApBd;AAqBA,4BAAc,yBArBd;AAsBA,4BAAc,2BAtBd;AAuBA,4BAAc,yBAvBd;AAwBA,4BAAc,sBAxBd;","names":[]}

View File

@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLRGB = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const RGB_REGEX = /^rgb\(\s*(-?\d+|-?\d*\.\d+(?=%))(%?)\s*,\s*(-?\d+|-?\d*\.\d+(?=%))(\2)\s*,\s*(-?\d+|-?\d*\.\d+(?=%))(\2)\s*\)$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!RGB_REGEX.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid RGB color: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
exports.GraphQLRGB = new graphql_1.GraphQLScalarType({
name: `RGB`,
description: `A field whose value is a CSS RGB color: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba().`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as RGB colors but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'RGB',
type: 'string',
pattern: RGB_REGEX.source,
},
},
});

View File

@@ -0,0 +1,43 @@
var root = require('./_root'),
toString = require('./toString');
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeParseInt = root.parseInt;
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a
* hexadecimal, in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
*
* @static
* @memberOf _
* @since 1.1.0
* @category String
* @param {string} string The string to convert.
* @param {number} [radix=10] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
}
module.exports = parseInt;

View File

@@ -0,0 +1,17 @@
/**
* @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 Diff = createLucideIcon("Diff", [
["path", { d: "M12 3v14", key: "7cf3v8" }],
["path", { d: "M5 10h14", key: "elsbfy" }],
["path", { d: "M5 21h14", key: "11awu3" }]
]);
export { Diff as default };
//# sourceMappingURL=diff.js.map

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const limitNumber_1 = require("./limitNumber");
const multipleOf_1 = require("./multipleOf");
const limitLength_1 = require("./limitLength");
const pattern_1 = require("./pattern");
const limitProperties_1 = require("./limitProperties");
const required_1 = require("./required");
const limitItems_1 = require("./limitItems");
const uniqueItems_1 = require("./uniqueItems");
const const_1 = require("./const");
const enum_1 = require("./enum");
const validation = [
// number
limitNumber_1.default,
multipleOf_1.default,
// string
limitLength_1.default,
pattern_1.default,
// object
limitProperties_1.default,
required_1.default,
// array
limitItems_1.default,
uniqueItems_1.default,
// any
{ keyword: "type", schemaType: ["string", "array"] },
{ keyword: "nullable", schemaType: "boolean" },
const_1.default,
enum_1.default,
];
exports.default = validation;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
!function(e){var s=/\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:s}},builtin:s,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}(Prism);

View File

@@ -0,0 +1 @@
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAI5D,eAAO,MAAM,0BAA0B,EAAE,oBAMrC,CAAA"}

View File

@@ -0,0 +1,175 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
var state = require('state-local');
var index = require('../config/index.js');
var index$1 = require('../validators/index.js');
var compose = require('../utils/compose.js');
var deepMerge = require('../utils/deepMerge.js');
var makeCancelable = require('../utils/makeCancelable.js');
var _excluded = ["monaco"];
/** the local state of the module */
var _state$create = state.create({
config: index.default,
isInitialized: false,
resolve: null,
reject: null,
monaco: null
}),
_state$create2 = _rollupPluginBabelHelpers.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 = index$1.default.config(globalConfig),
monaco = _validators$config.monaco,
config = _rollupPluginBabelHelpers.objectWithoutProperties(_validators$config, _excluded);
setState(function (state) {
return {
config: deepMerge.default(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.default(wrapperPromise);
}
if (window.monaco && window.monaco.editor) {
storeMonacoInstance(window.monaco);
state.resolve(window.monaco);
return makeCancelable.default(wrapperPromise);
}
compose.default(injectScripts, getMonacoLoaderScript)(configureLoader);
}
return makeCancelable.default(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
};
exports.default = loader;

View File

@@ -0,0 +1,58 @@
# fast-deep-equal
The fastest deep equal
[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal)
[![npm version](https://badge.fury.io/js/fast-deep-equal.svg)](http://badge.fury.io/js/fast-deep-equal)
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master)
## Install
```bash
npm install fast-deep-equal
```
## Features
- ES5 compatible
- works in node.js (0.10+) and browsers (IE9+)
- checks equality of Date and RegExp objects by value.
## Usage
```javascript
var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true
```
## Performance benchmark
Node.js v9.11.1:
```
fast-deep-equal x 226,960 ops/sec ±1.55% (86 runs sampled)
nano-equal x 218,210 ops/sec ±0.79% (89 runs sampled)
shallow-equal-fuzzy x 206,762 ops/sec ±0.84% (88 runs sampled)
underscore.isEqual x 128,668 ops/sec ±0.75% (91 runs sampled)
lodash.isEqual x 44,895 ops/sec ±0.67% (85 runs sampled)
deep-equal x 51,616 ops/sec ±0.96% (90 runs sampled)
deep-eql x 28,218 ops/sec ±0.42% (85 runs sampled)
assert.deepStrictEqual x 1,777 ops/sec ±1.05% (86 runs sampled)
ramda.equals x 13,466 ops/sec ±0.82% (86 runs sampled)
The fastest is fast-deep-equal
```
To run benchmark (requires node.js 6+):
```bash
npm install
node benchmark
```
## License
[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE)

View File

@@ -0,0 +1,5 @@
export declare const getISOWeekWithOptions: import("./types.js").FPFn2<
number,
import("../getISOWeek.js").GetISOWeekOptions | undefined,
string | number | Date
>;

View File

@@ -0,0 +1,3 @@
import type { MigrationConfig } from "../migrator.cjs";
import type { NeonDatabase } from "./driver.cjs";
export declare function migrate<TSchema extends Record<string, unknown>>(db: NeonDatabase<TSchema>, config: MigrationConfig): Promise<void>;

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 Compass = createLucideIcon("Compass", [
[
"path",
{
d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",
key: "9ktpf1"
}
],
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
]);
export { Compass as default };
//# sourceMappingURL=compass.js.map

View File

@@ -0,0 +1,58 @@
import { FetchHint, XhrHint } from '@sentry-internal/browser-utils';
interface GraphQLClientOptions {
endpoints: Array<string | RegExp>;
}
/** Standard graphql request shape: https://graphql.org/learn/serving-over-http/#post-request-and-body */
interface GraphQLStandardRequest {
query: string;
operationName?: string;
variables?: Record<string, unknown>;
extensions?: Record<string, unknown>;
}
/** Persisted operation request */
interface GraphQLPersistedRequest {
operationName: string;
variables?: Record<string, unknown>;
extensions: {
persistedQuery: {
version: number;
sha256Hash: string;
};
} & Record<string, unknown>;
}
type GraphQLRequestPayload = GraphQLStandardRequest | GraphQLPersistedRequest;
interface GraphQLOperation {
operationType?: string;
operationName?: string;
}
/**
* @param requestBody - GraphQL request
* @returns A formatted version of the request: 'TYPE NAME' or 'TYPE' or 'persisted NAME'
*/
export declare function _getGraphQLOperation(requestBody: GraphQLRequestPayload): string;
/**
* Get the request body/payload based on the shape of the hint.
*
* Exported for tests only.
*/
export declare function getRequestPayloadXhrOrFetch(hint: XhrHint | FetchHint): string | undefined;
/**
* Extract the name and type of the operation from the GraphQL query.
*
* Exported for tests only.
*/
export declare function parseGraphQLQuery(query: string): GraphQLOperation;
/**
* Extract the payload of a request if it's GraphQL.
* Exported for tests only.
* @param payload - A valid JSON string
* @returns A POJO or undefined
*/
export declare function getGraphQLRequestPayload(payload: string): GraphQLRequestPayload | undefined;
/**
* This integration ensures that GraphQL requests made in the browser
* have their GraphQL-specific data captured and attached to spans and breadcrumbs.
*/
export declare const graphqlClientIntegration: (options: GraphQLClientOptions) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=graphqlClient.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"forklift.js","sources":["../../../src/icons/forklift.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Forklift\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTJINWEyIDIgMCAwIDAtMiAydjUiIC8+CiAgPGNpcmNsZSBjeD0iMTMiIGN5PSIxOSIgcj0iMiIgLz4KICA8Y2lyY2xlIGN4PSI1IiBjeT0iMTkiIHI9IjIiIC8+CiAgPHBhdGggZD0iTTggMTloM201LTE3djE3aDZNNiAxMlY3YzAtMS4xLjktMiAyLTJoM2w1IDUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/forklift\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 Forklift = createLucideIcon('Forklift', [\n ['path', { d: 'M12 12H5a2 2 0 0 0-2 2v5', key: '7zsz91' }],\n ['circle', { cx: '13', cy: '19', r: '2', key: 'wjnkru' }],\n ['circle', { cx: '5', cy: '19', r: '2', key: 'v8kfzx' }],\n ['path', { d: 'M8 19h3m5-17v17h6M6 12V7c0-1.1.9-2 2-2h3l5 5', key: '13bk1p' }],\n]);\n\nexport default Forklift;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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/E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,60 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var bit_exports = {};
__export(bit_exports, {
PgBinaryVector: () => PgBinaryVector,
PgBinaryVectorBuilder: () => PgBinaryVectorBuilder,
bit: () => bit
});
module.exports = __toCommonJS(bit_exports);
var import_entity = require("../../../entity.cjs");
var import_utils = require("../../../utils.cjs");
var import_common = require("../common.cjs");
class PgBinaryVectorBuilder extends import_common.PgColumnBuilder {
static [import_entity.entityKind] = "PgBinaryVectorBuilder";
constructor(name, config) {
super(name, "string", "PgBinaryVector");
this.config.dimensions = config.dimensions;
}
/** @internal */
build(table) {
return new PgBinaryVector(
table,
this.config
);
}
}
class PgBinaryVector extends import_common.PgColumn {
static [import_entity.entityKind] = "PgBinaryVector";
dimensions = this.config.dimensions;
getSQLType() {
return `bit(${this.dimensions})`;
}
}
function bit(a, b) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
return new PgBinaryVectorBuilder(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgBinaryVector,
PgBinaryVectorBuilder,
bit
});
//# sourceMappingURL=bit.cjs.map

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _instanceof;
function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}
//# sourceMappingURL=instanceof.js.map

View File

@@ -0,0 +1,15 @@
/**
* 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.
*
* @flow strict
*/
type Props = $ReadOnly<{
hasCellMerge?: boolean,
hasCellBackgroundColor?: boolean,
hasTabHandler?: boolean,
}>;
declare export function TablePlugin(props: Props): null;

View File

@@ -0,0 +1,18 @@
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;

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