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,76 @@
"use strict";
exports.roundToNearestHours = roundToNearestHours;
var _index = require("./_lib/getRoundingMethod.cjs");
var _index2 = require("./constructFrom.cjs");
var _index3 = require("./toDate.cjs");
/**
* The {@link roundToNearestHours} function options.
*/
/**
* @name roundToNearestHours
* @category Hour Helpers
* @summary Rounds the given date to the nearest hour
*
* @description
* Rounds the given date to the nearest hour (or number of hours).
* Rounds up when the given date is exactly between the nearest round hours.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to round
* @param options - An object with options.
*
* @returns The new date rounded to the closest hour
*
* @example
* // Round 10 July 2014 12:34:56 to nearest hour:
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56))
* //=> Thu Jul 10 2014 13:00:00
*
* @example
* // Round 10 July 2014 12:34:56 to nearest half hour:
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 })
* //=> Thu Jul 10 2014 12:00:00
*
* @example
* // Round 10 July 2014 12:34:56 to nearest half hour:
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 })
* //=> Thu Jul 10 2014 16:00:00
*
* @example
* // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour:
* const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' })
* //=> Thu Jul 10 2014 02:00:00
*
* @example
* // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour:
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 })
* //=> Thu Jul 10 2014 08:00:00
*/
function roundToNearestHours(date, options) {
const nearestTo = options?.nearestTo ?? 1;
if (nearestTo < 1 || nearestTo > 12)
return (0, _index2.constructFrom)(options?.in || date, NaN);
const date_ = (0, _index3.toDate)(date, options?.in);
const fractionalMinutes = date_.getMinutes() / 60;
const fractionalSeconds = date_.getSeconds() / 60 / 60;
const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60;
const hours =
date_.getHours() +
fractionalMinutes +
fractionalSeconds +
fractionalMilliseconds;
const method = options?.roundingMethod ?? "round";
const roundingMethod = (0, _index.getRoundingMethod)(method);
const roundedHours = roundingMethod(hours / nearestTo) * nearestTo;
date_.setHours(roundedHours, 0, 0, 0);
return date_;
}

View File

@@ -0,0 +1,39 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
// See https://github.com/auth0/node-jws/blob/master/lib/verify-stream.js#L8
const JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!JWS_REGEX.test(value)) {
throw createGraphQLError(`Value is not a valid JWT: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
export const GraphQLJWT = /*#__PURE__*/ new GraphQLScalarType({
name: `JWT`,
description: `A field whose value is a JSON Web Token (JWT): https://jwt.io/introduction.`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as JWT but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'JWT',
type: 'string',
pattern: JWS_REGEX.source,
},
},
});

View File

@@ -0,0 +1,32 @@
/**
* 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.
*
*/
import { Klass, LexicalEditor, TextNode } from 'lexical';
export type EntityMatch = {
end: number;
start: number;
};
/**
* Returns a tuple that can be rested (...) into mergeRegister to clean up
* node transforms listeners that transforms text into another node, eg. a HashtagNode.
* @example
* ```ts
* useEffect(() => {
return mergeRegister(
...registerLexicalTextEntity(editor, getMatch, targetNode, createNode),
);
}, [createNode, editor, getMatch, targetNode]);
* ```
* Where targetNode is the type of node containing the text you want to transform (like a text input),
* then getMatch uses a regex to find a matching text and creates the proper node to include the matching text.
* @param editor - The lexical editor.
* @param getMatch - Finds a matching string that satisfies a regex expression.
* @param targetNode - The node type that contains text to match with. eg. HashtagNode
* @param createNode - A function that creates a new node to contain the matched text. eg createHashtagNode
* @returns An array containing the plain text and reverse node transform listeners.
*/
export declare function registerLexicalTextEntity<T extends TextNode>(editor: LexicalEditor, getMatch: (text: string) => null | EntityMatch, targetNode: Klass<T>, createNode: (textNode: TextNode) => T): Array<() => void>;

View File

@@ -0,0 +1,42 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SingleStoreColumnBuilderWithAutoIncrement, SingleStoreColumnWithAutoIncrement } from "./common.js";
class SingleStoreRealBuilder extends SingleStoreColumnBuilderWithAutoIncrement {
static [entityKind] = "SingleStoreRealBuilder";
constructor(name, config) {
super(name, "number", "SingleStoreReal");
this.config.precision = config?.precision;
this.config.scale = config?.scale;
}
/** @internal */
build(table) {
return new SingleStoreReal(
table,
this.config
);
}
}
class SingleStoreReal extends SingleStoreColumnWithAutoIncrement {
static [entityKind] = "SingleStoreReal";
precision = this.config.precision;
scale = this.config.scale;
getSQLType() {
if (this.precision !== void 0 && this.scale !== void 0) {
return `real(${this.precision}, ${this.scale})`;
} else if (this.precision === void 0) {
return "real";
} else {
return `real(${this.precision})`;
}
}
}
function real(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new SingleStoreRealBuilder(name, config);
}
export {
SingleStoreReal,
SingleStoreRealBuilder,
real
};
//# sourceMappingURL=real.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/hono/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,WAAW,CAAC;IACjB,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B,CAAC;AAGF,MAAM,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAGvC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAG/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AAGrF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,QAAQ,EAAE,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,GAAG,YAAY,CAAC;IAC7D,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,GAAG,YAAY,CAAC;CAC5E,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,GAAG,YAAY,CAAC;CAClH,CAAC;AAGF,MAAM,MAAM,0BAA0B,GAAG;IACvC,CAAC,GAAG,QAAQ,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC;IACjD,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC;CAChE,CAAC;AAGF,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gBAAgB,CAAC;IACvB,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,gBAAgB,CAAC;IACtB,EAAE,EAAE,kBAAkB,CAAC;IACvB,GAAG,EAAE,0BAA0B,CAAC;CACjC;AAED,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,YAAY,CAAC"}

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 PanelsLeftBottom = createLucideIcon("PanelsLeftBottom", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M9 3v18", key: "fh3hqa" }],
["path", { d: "M9 15h12", key: "5ijen5" }]
]);
export { PanelsLeftBottom as default };
//# sourceMappingURL=panels-left-bottom.js.map

View File

@@ -0,0 +1,29 @@
import { entityKind } from "../../entity.js";
import { SQL, type SQLWrapper } from "../../sql/sql.js";
import type { NeonAuthToken } from "../../utils.js";
import type { PgSession } from "../session.js";
import type { PgTable } from "../table.js";
export declare class PgCountBuilder<TSession extends PgSession<any, any, any>> extends SQL<number> implements Promise<number>, SQLWrapper {
readonly params: {
source: PgTable | SQL | SQLWrapper;
filters?: SQL<unknown>;
session: TSession;
};
private sql;
private token?;
static readonly [entityKind] = "PgCountBuilder";
[Symbol.toStringTag]: string;
private session;
private static buildEmbeddedCount;
private static buildCount;
constructor(params: {
source: PgTable | SQL | SQLWrapper;
filters?: SQL<unknown>;
session: TSession;
});
/** @intrnal */
setToken(token?: NeonAuthToken): this;
then<TResult1 = number, TResult2 = never>(onfulfilled?: ((value: number) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
catch(onRejected?: ((reason: any) => any) | null | undefined): Promise<number>;
finally(onFinally?: (() => void) | null | undefined): Promise<number>;
}

View File

@@ -0,0 +1,16 @@
Copyright (c) 2011-2023 Andris Reinman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,14 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Copied from Node.js to ease compatibility in PR.
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single

View File

@@ -0,0 +1,42 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.value-container {
flex-grow: 1;
min-width: 0;
display: flex;
align-items: center;
flex-direction: row;
gap: calc(var(--base) / 2);
&__label {
color: var(--theme-elevation-550);
}
.rs__value-container {
overflow: visible;
padding: 2px;
gap: 2px;
> * {
margin: 0;
padding-top: 0;
padding-bottom: 0;
color: currentColor;
.field-label {
padding-bottom: 0;
}
}
&--is-multi {
width: calc(100% + base(0.25));
&.rs__value-container--has-value {
padding: 0;
margin-inline-start: -4px;
}
}
}
}
}

View File

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

View File

@@ -0,0 +1,5 @@
'use strict';
var implementation = require('./implementation');
module.exports = Function.prototype.bind || implementation;

View File

@@ -0,0 +1,479 @@
import type { Breadcrumb, ErrorEvent, ReplayRecordingData, ReplayRecordingMode, Span } from '@sentry/core';
import type { SKIPPED, THROTTLED } from '../util/throttle';
import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance';
import type { ReplayFrameEvent } from './replayFrame';
import type { ReplayNetworkRequestOrResponse } from './request';
import type { CanvasManagerInterface, CanvasManagerOptions, ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
export type RecordingOptions = RrwebRecordOptions;
export interface SendReplayData {
recordingData: ReplayRecordingData;
replayId: string;
segmentId: number;
eventContext: PopEventContext;
timestamp: number;
session: Session;
onError?: (err: unknown) => void;
}
export interface Timeouts {
sessionIdlePause: number;
sessionIdleExpire: number;
}
/**
* The request payload to worker
*/
export interface WorkerRequest {
id: number;
method: 'clear' | 'addEvent' | 'finish';
arg?: string;
}
/**
* The response from the worker
*/
export interface WorkerResponse {
id: number;
method: string;
success: boolean;
response: unknown;
}
export type AddEventResult = void;
export interface BeforeAddRecordingEvent {
(event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
}
export interface ReplayNetworkOptions {
/**
* Capture request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will match any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
*
* Only URLs matching these patterns will have bodies & additional headers captured.
*/
networkDetailAllowUrls: (string | RegExp)[];
/**
* Deny request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will deny any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
* URLs matching these patterns will not have bodies & additional headers captured.
*/
networkDetailDenyUrls: (string | RegExp)[];
/**
* If request & response bodies should be captured.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Defaults to true.
*/
networkCaptureBodies: boolean;
/**
* Capture the following request headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkRequestHeaders: string[];
/**
* Capture the following response headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkResponseHeaders: string[];
}
export type ReplayWorkerURL = string | URL;
export interface ReplayPluginOptions extends ReplayNetworkOptions {
/**
* The sample rate for session-long replays. 1.0 will record all sessions and
* 0 will record none.
*/
sessionSampleRate: number;
/**
* The sample rate for sessions that has had an error occur. This is
* independent of `sessionSampleRate`.
*/
errorSampleRate: number;
/**
* If false, will create a new session per pageload. Otherwise, saves session
* to Session Storage.
*/
stickySession: boolean;
/**
* The amount of time to wait before sending a replay
*/
flushMinDelay: number;
/**
* The max amount of time to wait before sending a replay
*/
flushMaxDelay: number;
/**
* Attempt to use compression when web workers are available
*
* (default is true)
*/
useCompression: boolean;
/**
* If defined, use this worker URL instead of the default included one for compression.
* This will only be used if `useCompression` is not false.
*/
workerUrl?: ReplayWorkerURL;
/**
* Block all media (e.g. images, svg, video) in recordings.
*/
blockAllMedia: boolean;
/**
* Mask all inputs in recordings
*/
maskAllInputs: boolean;
/**
* Mask all text in recordings
*/
maskAllText: boolean;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will create
* a breadcrumb in the recording when the limit has been reached.
*/
mutationBreadcrumbLimit: number;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will cause
* recording to stop when the limit has been reached.
*/
mutationLimit: number;
/**
* The max. time in ms to wait for a slow click to finish.
* After this amount of time we stop waiting for actions after a click happened.
* Set this to 0 to disable slow click capture.
*
* Default: 7000ms
*/
slowClickTimeout: number;
/**
* Ignore clicks on elements matching the given selectors for slow click detection.
*/
slowClickIgnoreSelectors: string[];
/**
* The min. duration (in ms) a replay has to have before it is sent to Sentry.
* Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
* Note that this is capped at max. 50s, so we don't unintentionally drop buffered replays that are longer than 60s
*
* Warning: Setting this to a higher value can result in unintended drops of onError-sampled replays.
*
*/
minReplayDuration: number;
/**
* The max. duration (in ms) a replay session may be.
* This is capped at max. 60min.
*/
maxReplayDuration: number;
/**
* Callback before adding a custom recording event
*
* Events added by the underlying DOM recording library can *not* be modified,
* only custom recording events from the Replay integration will trigger the
* callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
*
* Returning a `null` will drop the event completely. Note, dropping a recording
* event is not the same as dropping the replay, the replay will still exist and
* continue to function.
*/
beforeAddRecordingEvent?: BeforeAddRecordingEvent;
/**
* An optional callback to be called before we decide to sample based on an error.
* If specified, this callback will receive an error that was captured by Sentry.
* Return `true` to continue sampling for this error, or `false` to ignore this error for replay sampling.
* Note that returning `true` means that the `replaysOnErrorSampleRate` will be checked,
* not that it will definitely be sampled.
* Use this to filter out groups of errors that should def. not be sampled.
*/
beforeErrorSampling?: (event: ErrorEvent) => boolean;
/**
* Callback when an internal SDK error occurs. This can be used to debug SDK
* issues.
*/
onError?: (err: unknown) => void;
/**
* Patch the global Request() interface to store original request bodies.
* This allows Replay to capture the original body from Request objects passed to fetch().
*
* When enabled, creates a copy of the original body before it's converted to a ReadableStream.
* This is useful for capturing request bodies in network breadcrumbs.
*
* Note: This modifies the global Request constructor.
*
* @default false
*/
attachRawBodyFromRequest?: boolean;
/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
captureExceptions: boolean;
traceInternals: boolean;
continuousCheckout: number;
/**
* Before enabling, please read the security considerations:
* https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/cross-origin-iframes.md#considerations
*/
recordCrossOriginIframes: boolean;
/**
* Completely ignore mutations matching the given selectors.
* This can be used if a specific type of mutation is causing (e.g. performance) problems.
* NOTE: This can be dangerous to use, as mutations are applied as incremental patches.
* Make sure to verify that the captured replays still work when using this option.
*/
ignoreMutations: string[];
}>;
}
/**
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`.
*/
export type InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>;
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & {
/**
* Mask element attributes that are contained in list
*/
maskAttributes?: string[];
};
/**
* Session options that are configurable by the integration configuration
*/
export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
/**
* Should buffer recordings to be saved later either by error sampling, or by
* manually calling `flush()`. This is only a factor if not sampled for a
* session-based replay.
*/
allowBuffering: boolean;
}
export interface ReplayIntegrationPrivacyOptions {
/**
* Mask text content for elements that match the CSS selectors in the list.
*/
mask?: string[];
/**
* Unmask text content for elements that match the CSS selectors in the list.
*/
unmask?: string[];
/**
* Block elements that match the CSS selectors in the list. Blocking replaces
* the element with an empty placeholder with the same dimensions.
*/
block?: string[];
/**
* Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
*/
unblock?: string[];
/**
* Ignore input events for elements that match the CSS selectors in the list.
*/
ignore?: string[];
/**
* A callback function to customize how your text is masked.
*/
maskFn?: (s: string) => string;
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
/**
* The initial URL of the session
*/
initialUrl: string;
/**
* The initial starting timestamp in ms of the session.
*/
initialTimestamp: number;
/**
* Ordered list of URLs that have been visited during a replay segment
*/
urls: string[];
}
export interface PopEventContext extends CommonEventContext {
/**
* List of Sentry error ids that have occurred during a replay segment
*/
errorIds: Array<string>;
/**
* List of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Array<string>;
}
/**
* Additional context that will be sent w/ `replay_event`
*/
export interface InternalEventContext extends CommonEventContext {
/**
* Set of Sentry error ids that have occurred during a replay segment
*/
errorIds: Set<string>;
/**
* Set of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Set<string>;
}
export type Sampled = false | 'session' | 'buffer';
export interface Session {
id: string;
/**
* Start time of current session (in ms)
*/
started: number;
/**
* Last known activity of the session (in ms)
*/
lastActivity: number;
/**
* Segment ID for replay events
*/
segmentId: number;
/**
* The ID of the previous session.
* If this is empty, there was no previous session.
*/
previousSessionId?: string;
/**
* Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
*/
sampled: Sampled;
/**
* Session is dirty when its id has been linked to an event (e.g. error event).
* This is helpful when a session is mistakenly stuck in "buffer" mode (e.g. network issues preventing it from being converted to "session" mode).
* The dirty flag is used to prevent updating the session start time to the earliest event in the buffer so that it can be refreshed if it's been expired.
*/
dirty?: boolean;
}
export type EventBufferType = 'sync' | 'worker';
export interface EventBuffer {
/**
* If any events have been added to the buffer.
*/
readonly hasEvents: boolean;
/**
* The buffer type
*/
readonly type: EventBufferType;
/**
* If the event buffer contains a checkout event.
*/
hasCheckout: boolean;
/**
* If the event buffer needs to wait for a checkout event before it
* starts buffering events.
*/
waitForCheckout: boolean;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Clear the event buffer.
*/
clear(): void;
/**
* Add an event to the event buffer.
*
* Returns a promise that resolves if the event was successfully added, else rejects.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Clears and returns the contents of the buffer.
*/
finish(): Promise<ReplayRecordingData>;
/**
* Get the earliest timestamp in ms of any event currently in the buffer.
*/
getEarliestTimestamp(): number | null;
}
export type AddUpdateCallback = () => boolean | void;
export interface SendBufferedReplayOptions {
continueRecording?: boolean;
}
export interface ReplayClickDetector {
addListeners(): void;
removeListeners(): void;
/** Handle a click breadcrumb. */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** Register a mutation that happened at a given time. */
registerMutation(timestamp?: number): void;
/** Register a scroll that happened at a given time. */
registerScroll(timestamp?: number): void;
/** Register that a click on an element happened. */
registerClick(element: HTMLElement): void;
}
export interface ReplayContainer {
eventBuffer: EventBuffer | null;
clickDetector: ReplayClickDetector | undefined;
/**
* List of PerformanceEntry from PerformanceObservers.
*/
performanceEntries: AllPerformanceEntry[];
/**
* List of already processed performance data, ready to be added to replay.
*/
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
recordingMode: ReplayRecordingMode;
timeouts: Timeouts;
lastActiveSpan?: Span;
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
isEnabled(): boolean;
isPaused(): boolean;
isRecordingCanvas(): boolean;
getContext(): InternalEventContext;
initializeSampling(): void;
start(): void;
stop(options?: {
reason?: string;
forceflush?: boolean;
}): Promise<void>;
pause(): void;
resume(): void;
startRecording(): void;
stopRecording(): boolean;
sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
conditionalFlush(): Promise<void>;
flush(): Promise<void>;
flushImmediate(): Promise<void>;
cancelFlush(): void;
triggerUserActivity(): void;
updateUserActivity(): void;
addUpdate(cb: AddUpdateCallback): void;
getOptions(): ReplayPluginOptions;
getSessionId(): string | undefined;
checkAndHandleExpiredSession(): boolean | void;
setInitialState(): void;
getCurrentRoute(): string | undefined;
handleException(err: unknown): void;
}
export type ReplayNetworkRequestData = {
startTimestamp: number;
endTimestamp: number;
url: string;
method?: string;
statusCode: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
};
export interface SlowClickConfig {
threshold: number;
timeout: number;
scrollTimeout: number;
ignoreSelector: string;
}
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
getCanvasManager: (options: CanvasManagerOptions) => CanvasManagerInterface;
sampling: {
canvas: number;
};
dataURLOptions: {
type: string;
quality: number;
};
}
export {};
//# sourceMappingURL=replay.d.ts.map

View File

@@ -0,0 +1,83 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import React, { useCallback } from 'react';
import { useListQuery } from '../../providers/ListQuery/context.js';
import { PageControlsComponent } from './index.js';
/**
* If `groupBy` is set in the query, multiple tables will render, one for each group.
* In this case, each table needs its own `PageControls` to handle pagination.
* These page controls, however, should not modify the global `ListQuery` state.
* Instead, they should only handle the pagination for the current group.
* To do this, build a wrapper around `PageControlsComponent` that handles the pagination logic for the current group.
*/
export const GroupByPageControls = t0 => {
const $ = _c(12);
const {
AfterPageControls,
collectionConfig,
data,
groupByValue
} = t0;
const {
refineListData
} = useListQuery();
let t1;
if ($[0] !== groupByValue || $[1] !== refineListData) {
t1 = async page => {
await refineListData({
queryByGroup: {
[groupByValue]: {
page
}
}
});
};
$[0] = groupByValue;
$[1] = refineListData;
$[2] = t1;
} else {
t1 = $[2];
}
const handlePageChange = t1;
let t2;
if ($[3] !== groupByValue || $[4] !== refineListData) {
t2 = async limit => {
await refineListData({
queryByGroup: {
[groupByValue]: {
limit,
page: 1
}
}
});
};
$[3] = groupByValue;
$[4] = refineListData;
$[5] = t2;
} else {
t2 = $[5];
}
const handlePerPageChange = t2;
let t3;
if ($[6] !== AfterPageControls || $[7] !== collectionConfig || $[8] !== data || $[9] !== handlePageChange || $[10] !== handlePerPageChange) {
t3 = _jsx(PageControlsComponent, {
AfterPageControls,
collectionConfig,
data,
handlePageChange,
handlePerPageChange
});
$[6] = AfterPageControls;
$[7] = collectionConfig;
$[8] = data;
$[9] = handlePageChange;
$[10] = handlePerPageChange;
$[11] = t3;
} else {
t3 = $[11];
}
return t3;
};
//# sourceMappingURL=GroupByPageControls.js.map

View File

@@ -0,0 +1,601 @@
"use strict";
// parse a single path portion
Object.defineProperty(exports, "__esModule", { value: true });
exports.AST = void 0;
const brace_expressions_js_1 = require("./brace-expressions.js");
const unescape_js_1 = require("./unescape.js");
const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c);
// Patterns that get prepended to bind to the start of either the
// entire string, or just a single path portion, to prevent dots
// and/or traversal patterns, when needed.
// Exts don't need the ^ or / bit, because the root binds that already.
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
const startNoDot = '(?!\\.)';
// characters that indicate a start of pattern needs the "no dots" bit,
// because a dot *might* be matched. ( is not in the list, because in
// the case of a child extglob, it will handle the prevention itself.
const addPatternStart = new Set(['[', '.']);
// cases where traversal is A-OK, no dot prevention needed
const justDots = new Set(['..', '.']);
const reSpecials = new Set('().*{}+?[]^$\\!');
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
// any single thing other than /
const qmark = '[^/]';
// * => any number of characters
const star = qmark + '*?';
// use + when we need to ensure that *something* matches, because the * is
// the only thing in the path portion.
const starNoEmpty = qmark + '+?';
// remove the \ chars that we added if we end up doing a nonmagic compare
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
class AST {
type;
#root;
#hasMagic;
#uflag = false;
#parts = [];
#parent;
#parentIndex;
#negs;
#filledNegs = false;
#options;
#toString;
// set to true if it's an extglob with no children
// (which really means one child of '')
#emptyExt = false;
constructor(type, parent, options = {}) {
this.type = type;
// extglobs are inherently magical
if (type)
this.#hasMagic = true;
this.#parent = parent;
this.#root = this.#parent ? this.#parent.#root : this;
this.#options = this.#root === this ? options : this.#root.#options;
this.#negs = this.#root === this ? [] : this.#root.#negs;
if (type === '!' && !this.#root.#filledNegs)
this.#negs.push(this);
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
}
get hasMagic() {
/* c8 ignore start */
if (this.#hasMagic !== undefined)
return this.#hasMagic;
/* c8 ignore stop */
for (const p of this.#parts) {
if (typeof p === 'string')
continue;
if (p.type || p.hasMagic)
return (this.#hasMagic = true);
}
// note: will be undefined until we generate the regexp src and find out
return this.#hasMagic;
}
// reconstructs the pattern
toString() {
if (this.#toString !== undefined)
return this.#toString;
if (!this.type) {
return (this.#toString = this.#parts.map(p => String(p)).join(''));
}
else {
return (this.#toString =
this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
}
}
#fillNegs() {
/* c8 ignore start */
if (this !== this.#root)
throw new Error('should only call on root');
if (this.#filledNegs)
return this;
/* c8 ignore stop */
// call toString() once to fill this out
this.toString();
this.#filledNegs = true;
let n;
while ((n = this.#negs.pop())) {
if (n.type !== '!')
continue;
// walk up the tree, appending everthing that comes AFTER parentIndex
let p = n;
let pp = p.#parent;
while (pp) {
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
for (const part of n.#parts) {
/* c8 ignore start */
if (typeof part === 'string') {
throw new Error('string part in extglob AST??');
}
/* c8 ignore stop */
part.copyIn(pp.#parts[i]);
}
}
p = pp;
pp = p.#parent;
}
}
return this;
}
push(...parts) {
for (const p of parts) {
if (p === '')
continue;
/* c8 ignore start */
if (typeof p !== 'string' &&
!(p instanceof AST && p.#parent === this)) {
throw new Error('invalid part: ' + p);
}
/* c8 ignore stop */
this.#parts.push(p);
}
}
toJSON() {
const ret = this.type === null ?
this.#parts
.slice()
.map(p => (typeof p === 'string' ? p : p.toJSON()))
: [this.type, ...this.#parts.map(p => p.toJSON())];
if (this.isStart() && !this.type)
ret.unshift([]);
if (this.isEnd() &&
(this === this.#root ||
(this.#root.#filledNegs && this.#parent?.type === '!'))) {
ret.push({});
}
return ret;
}
isStart() {
if (this.#root === this)
return true;
// if (this.type) return !!this.#parent?.isStart()
if (!this.#parent?.isStart())
return false;
if (this.#parentIndex === 0)
return true;
// if everything AHEAD of this is a negation, then it's still the "start"
const p = this.#parent;
for (let i = 0; i < this.#parentIndex; i++) {
const pp = p.#parts[i];
if (!(pp instanceof AST && pp.type === '!')) {
return false;
}
}
return true;
}
isEnd() {
if (this.#root === this)
return true;
if (this.#parent?.type === '!')
return true;
if (!this.#parent?.isEnd())
return false;
if (!this.type)
return this.#parent?.isEnd();
// if not root, it'll always have a parent
/* c8 ignore start */
const pl = this.#parent ? this.#parent.#parts.length : 0;
/* c8 ignore stop */
return this.#parentIndex === pl - 1;
}
copyIn(part) {
if (typeof part === 'string')
this.push(part);
else
this.push(part.clone(this));
}
clone(parent) {
const c = new AST(this.type, parent);
for (const p of this.#parts) {
c.copyIn(p);
}
return c;
}
static #parseAST(str, ast, pos, opt) {
let escaping = false;
let inBrace = false;
let braceStart = -1;
let braceNeg = false;
if (ast.type === null) {
// outside of a extglob, append until we find a start
let i = pos;
let acc = '';
while (i < str.length) {
const c = str.charAt(i++);
// still accumulate escapes at this point, but we do ignore
// starts that are escaped
if (escaping || c === '\\') {
escaping = !escaping;
acc += c;
continue;
}
if (inBrace) {
if (i === braceStart + 1) {
if (c === '^' || c === '!') {
braceNeg = true;
}
}
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
inBrace = false;
}
acc += c;
continue;
}
else if (c === '[') {
inBrace = true;
braceStart = i;
braceNeg = false;
acc += c;
continue;
}
if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
ast.push(acc);
acc = '';
const ext = new AST(c, ast);
i = AST.#parseAST(str, ext, i, opt);
ast.push(ext);
continue;
}
acc += c;
}
ast.push(acc);
return i;
}
// some kind of extglob, pos is at the (
// find the next | or )
let i = pos + 1;
let part = new AST(null, ast);
const parts = [];
let acc = '';
while (i < str.length) {
const c = str.charAt(i++);
// still accumulate escapes at this point, but we do ignore
// starts that are escaped
if (escaping || c === '\\') {
escaping = !escaping;
acc += c;
continue;
}
if (inBrace) {
if (i === braceStart + 1) {
if (c === '^' || c === '!') {
braceNeg = true;
}
}
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
inBrace = false;
}
acc += c;
continue;
}
else if (c === '[') {
inBrace = true;
braceStart = i;
braceNeg = false;
acc += c;
continue;
}
if (isExtglobType(c) && str.charAt(i) === '(') {
part.push(acc);
acc = '';
const ext = new AST(c, part);
part.push(ext);
i = AST.#parseAST(str, ext, i, opt);
continue;
}
if (c === '|') {
part.push(acc);
acc = '';
parts.push(part);
part = new AST(null, ast);
continue;
}
if (c === ')') {
if (acc === '' && ast.#parts.length === 0) {
ast.#emptyExt = true;
}
part.push(acc);
acc = '';
ast.push(...parts, part);
return i;
}
acc += c;
}
// unfinished extglob
// if we got here, it was a malformed extglob! not an extglob, but
// maybe something else in there.
ast.type = null;
ast.#hasMagic = undefined;
ast.#parts = [str.substring(pos - 1)];
return i;
}
static fromGlob(pattern, options = {}) {
const ast = new AST(null, undefined, options);
AST.#parseAST(pattern, ast, 0, options);
return ast;
}
// returns the regular expression if there's magic, or the unescaped
// string if not.
toMMPattern() {
// should only be called on root
/* c8 ignore start */
if (this !== this.#root)
return this.#root.toMMPattern();
/* c8 ignore stop */
const glob = this.toString();
const [re, body, hasMagic, uflag] = this.toRegExpSource();
// if we're in nocase mode, and not nocaseMagicOnly, then we do
// still need a regular expression if we have to case-insensitively
// match capital/lowercase characters.
const anyMagic = hasMagic ||
this.#hasMagic ||
(this.#options.nocase &&
!this.#options.nocaseMagicOnly &&
glob.toUpperCase() !== glob.toLowerCase());
if (!anyMagic) {
return body;
}
const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
return Object.assign(new RegExp(`^${re}$`, flags), {
_src: re,
_glob: glob,
});
}
get options() {
return this.#options;
}
// returns the string match, the regexp source, whether there's magic
// in the regexp (so a regular expression is required) and whether or
// not the uflag is needed for the regular expression (for posix classes)
// TODO: instead of injecting the start/end at this point, just return
// the BODY of the regexp, along with the start/end portions suitable
// for binding the start/end in either a joined full-path makeRe context
// (where we bind to (^|/), or a standalone matchPart context (where
// we bind to ^, and not /). Otherwise slashes get duped!
//
// In part-matching mode, the start is:
// - if not isStart: nothing
// - if traversal possible, but not allowed: ^(?!\.\.?$)
// - if dots allowed or not possible: ^
// - if dots possible and not allowed: ^(?!\.)
// end is:
// - if not isEnd(): nothing
// - else: $
//
// In full-path matching mode, we put the slash at the START of the
// pattern, so start is:
// - if first pattern: same as part-matching mode
// - if not isStart(): nothing
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
// - if dots allowed or not possible: /
// - if dots possible and not allowed: /(?!\.)
// end is:
// - if last pattern, same as part-matching mode
// - else nothing
//
// Always put the (?:$|/) on negated tails, though, because that has to be
// there to bind the end of the negated pattern portion, and it's easier to
// just stick it in now rather than try to inject it later in the middle of
// the pattern.
//
// We can just always return the same end, and leave it up to the caller
// to know whether it's going to be used joined or in parts.
// And, if the start is adjusted slightly, can do the same there:
// - if not isStart: nothing
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
// - if dots allowed or not possible: (?:/|^)
// - if dots possible and not allowed: (?:/|^)(?!\.)
//
// But it's better to have a simpler binding without a conditional, for
// performance, so probably better to return both start options.
//
// Then the caller just ignores the end if it's not the first pattern,
// and the start always gets applied.
//
// But that's always going to be $ if it's the ending pattern, or nothing,
// so the caller can just attach $ at the end of the pattern when building.
//
// So the todo is:
// - better detect what kind of start is needed
// - return both flavors of starting pattern
// - attach $ at the end of the pattern when creating the actual RegExp
//
// Ah, but wait, no, that all only applies to the root when the first pattern
// is not an extglob. If the first pattern IS an extglob, then we need all
// that dot prevention biz to live in the extglob portions, because eg
// +(*|.x*) can match .xy but not .yx.
//
// So, return the two flavors if it's #root and the first child is not an
// AST, otherwise leave it to the child AST to handle it, and there,
// use the (?:^|/) style of start binding.
//
// Even simplified further:
// - Since the start for a join is eg /(?!\.) and the start for a part
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
// or start or whatever) and prepend ^ or / at the Regexp construction.
toRegExpSource(allowDot) {
const dot = allowDot ?? !!this.#options.dot;
if (this.#root === this)
this.#fillNegs();
if (!this.type) {
const noEmpty = this.isStart() &&
this.isEnd() &&
!this.#parts.some(s => typeof s !== 'string');
const src = this.#parts
.map(p => {
const [re, _, hasMagic, uflag] = typeof p === 'string' ?
AST.#parseGlob(p, this.#hasMagic, noEmpty)
: p.toRegExpSource(allowDot);
this.#hasMagic = this.#hasMagic || hasMagic;
this.#uflag = this.#uflag || uflag;
return re;
})
.join('');
let start = '';
if (this.isStart()) {
if (typeof this.#parts[0] === 'string') {
// this is the string that will match the start of the pattern,
// so we need to protect against dots and such.
// '.' and '..' cannot match unless the pattern is that exactly,
// even if it starts with . or dot:true is set.
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
if (!dotTravAllowed) {
const aps = addPatternStart;
// check if we have a possibility of matching . or ..,
// and prevent that.
const needNoTrav =
// dots are allowed, and the pattern starts with [ or .
(dot && aps.has(src.charAt(0))) ||
// the pattern starts with \., and then [ or .
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
// the pattern starts with \.\., and then [ or .
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
// no need to prevent dots if it can't match a dot, or if a
// sub-pattern will be preventing it anyway.
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
start =
needNoTrav ? startNoTraversal
: needNoDot ? startNoDot
: '';
}
}
}
// append the "end of path portion" pattern to negation tails
let end = '';
if (this.isEnd() &&
this.#root.#filledNegs &&
this.#parent?.type === '!') {
end = '(?:$|\\/)';
}
const final = start + src + end;
return [
final,
(0, unescape_js_1.unescape)(src),
(this.#hasMagic = !!this.#hasMagic),
this.#uflag,
];
}
// We need to calculate the body *twice* if it's a repeat pattern
// at the start, once in nodot mode, then again in dot mode, so a
// pattern like *(?) can match 'x.y'
const repeated = this.type === '*' || this.type === '+';
// some kind of extglob
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
let body = this.#partsToRegExp(dot);
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
// invalid extglob, has to at least be *something* present, if it's
// the entire path portion.
const s = this.toString();
this.#parts = [s];
this.type = null;
this.#hasMagic = undefined;
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
}
// XXX abstract out this map method
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
''
: this.#partsToRegExp(true);
if (bodyDotAllowed === body) {
bodyDotAllowed = '';
}
if (bodyDotAllowed) {
body = `(?:${body})(?:${bodyDotAllowed})*?`;
}
// an empty !() is exactly equivalent to a starNoEmpty
let final = '';
if (this.type === '!' && this.#emptyExt) {
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
}
else {
const close = this.type === '!' ?
// !() must match something,but !(x) can match ''
'))' +
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
star +
')'
: this.type === '@' ? ')'
: this.type === '?' ? ')?'
: this.type === '+' && bodyDotAllowed ? ')'
: this.type === '*' && bodyDotAllowed ? `)?`
: `)${this.type}`;
final = start + body + close;
}
return [
final,
(0, unescape_js_1.unescape)(body),
(this.#hasMagic = !!this.#hasMagic),
this.#uflag,
];
}
#partsToRegExp(dot) {
return this.#parts
.map(p => {
// extglob ASTs should only contain parent ASTs
/* c8 ignore start */
if (typeof p === 'string') {
throw new Error('string type in extglob ast??');
}
/* c8 ignore stop */
// can ignore hasMagic, because extglobs are already always magic
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
this.#uflag = this.#uflag || uflag;
return re;
})
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
.join('|');
}
static #parseGlob(glob, hasMagic, noEmpty = false) {
let escaping = false;
let re = '';
let uflag = false;
// multiple stars that aren't globstars coalesce into one *
let inStar = false;
for (let i = 0; i < glob.length; i++) {
const c = glob.charAt(i);
if (escaping) {
escaping = false;
re += (reSpecials.has(c) ? '\\' : '') + c;
continue;
}
if (c === '*') {
if (inStar)
continue;
inStar = true;
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
hasMagic = true;
continue;
}
else {
inStar = false;
}
if (c === '\\') {
if (i === glob.length - 1) {
re += '\\\\';
}
else {
escaping = true;
}
continue;
}
if (c === '[') {
const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
if (consumed) {
re += src;
uflag = uflag || needUflag;
i += consumed - 1;
hasMagic = hasMagic || magic;
continue;
}
}
if (c === '?') {
re += qmark;
hasMagic = true;
continue;
}
re += regExpEscape(c);
}
return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
}
}
exports.AST = AST;
//# sourceMappingURL=ast.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,eAAO,MAAM,MAAM,EAAiB,OAAO,UAAU,GAAG,MAAM,CAAC;AAE/D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAG7D,eAAO,MAAM,2BAA2B,SAAU,CAAC;AAGnD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,2BAA2B;AAC3B,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,eAAe,IAAI,CAAC;AAGjC,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAG7C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAG1C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,qHAAqH;AACrH,eAAO,MAAM,4BAA4B,WAAa,CAAC;AAEvD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AAMzC,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,UAAY,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,UAA2B,CAAC"}

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=e=>()=>({path:`/activity`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e(String(t),`Key cannot be empty`),{path:`/activity/${t}`,params:n??{},method:`GET`});export{t as readActivities,n as readActivity};
//# sourceMappingURL=activity.js.map

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ShieldQuestion = createLucideIcon("ShieldQuestion", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }],
["path", { d: "M12 17h.01", key: "p32p05" }]
]);
export { ShieldQuestion as default };
//# sourceMappingURL=shield-question.js.map

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 Target = createLucideIcon("Target", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["circle", { cx: "12", cy: "12", r: "6", key: "1vlfrh" }],
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }]
]);
export { Target as default };
//# sourceMappingURL=target.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/PageControls/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGpE,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAM3E,OAAO,cAAc,CAAA;AAIrB;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,gBAAgB,EAAE,sBAAsB,CAAA;IACxC,IAAI,EAAE,aAAa,CAAA;IACnB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;IACxD,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,qBAAqB,CAAC,CAAA;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CA2CA,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,gBAAgB,EAAE,sBAAsB,CAAA;CACzC,CAmBA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getAccessResults.d.ts","sourceRoot":"","sources":["../../src/auth/getAccessResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKnE,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,wBAAsB,gBAAgB,CAAC,EACrC,GAAG,GACJ,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqEtD"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/WhereBuilder/Condition/Date/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,YAAY,CAAA;AAO1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAetC,CAAA"}

View File

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

View File

@@ -0,0 +1,121 @@
import { inboundFiltersIntegration, functionToStringIntegration, conversationIdIntegration, dedupeIntegration, getIntegrationsToSetup, stackParserFromStackParserOptions, initAndBind } from '@sentry/core';
import { BrowserClient } from './client.js';
import { breadcrumbsIntegration } from './integrations/breadcrumbs.js';
import { browserApiErrorsIntegration } from './integrations/browserapierrors.js';
import { browserSessionIntegration } from './integrations/browsersession.js';
import { cultureContextIntegration } from './integrations/culturecontext.js';
import { globalHandlersIntegration } from './integrations/globalhandlers.js';
import { httpContextIntegration } from './integrations/httpcontext.js';
import { linkedErrorsIntegration } from './integrations/linkederrors.js';
import { spotlightBrowserIntegration } from './integrations/spotlight.js';
import { defaultStackParser } from './stack-parsers.js';
import { makeFetchTransport } from './transports/fetch.js';
import { checkAndWarnIfIsEmbeddedBrowserExtension } from './utils/detectBrowserExtension.js';
/** Get the default integrations for the browser SDK. */
function getDefaultIntegrations(_options) {
/**
* Note: Please make sure this stays in sync with Angular SDK, which re-exports
* `getDefaultIntegrations` but with an adjusted set of integrations.
*/
return [
// TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`
// eslint-disable-next-line deprecation/deprecation
inboundFiltersIntegration(),
functionToStringIntegration(),
conversationIdIntegration(),
browserApiErrorsIntegration(),
breadcrumbsIntegration(),
globalHandlersIntegration(),
linkedErrorsIntegration(),
dedupeIntegration(),
httpContextIntegration(),
cultureContextIntegration(),
browserSessionIntegration(),
];
}
/**
* The Sentry Browser SDK Client.
*
* To use this SDK, call the {@link init} function as early as possible when
* loading the web page. To set context information or send manual events, use
* the provided methods.
*
* @example
*
* ```
*
* import { init } from '@sentry/browser';
*
* init({
* dsn: '__DSN__',
* // ...
* });
* ```
*
* @example
* ```
*
* import { addBreadcrumb } from '@sentry/browser';
* addBreadcrumb({
* message: 'My Breadcrumb',
* // ...
* });
* ```
*
* @example
*
* ```
*
* import * as Sentry from '@sentry/browser';
* Sentry.captureMessage('Hello, world!');
* Sentry.captureException(new Error('Good bye'));
* Sentry.captureEvent({
* message: 'Manual',
* stacktrace: [
* // ...
* ],
* });
* ```
*
* @see {@link BrowserOptions} for documentation on configuration options.
*/
function init(options = {}) {
const shouldDisableBecauseIsBrowserExtenstion =
!options.skipBrowserExtensionCheck && checkAndWarnIfIsEmbeddedBrowserExtension();
let defaultIntegrations =
options.defaultIntegrations == null ? getDefaultIntegrations() : options.defaultIntegrations;
const clientOptions = {
...options,
enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,
stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
integrations: getIntegrationsToSetup({
integrations: options.integrations,
defaultIntegrations,
}),
transport: options.transport || makeFetchTransport,
};
return initAndBind(BrowserClient, clientOptions);
}
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
function forceLoad() {
// Noop
}
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
function onLoad(callback) {
callback();
}
export { forceLoad, getDefaultIntegrations, init, onLoad };
//# sourceMappingURL=sdk.js.map

View File

@@ -0,0 +1,3 @@
import type { UpdateJobs } from './types.js';
export declare const defaultUpdateJobs: UpdateJobs;
//# sourceMappingURL=defaultUpdateJobs.d.ts.map

View File

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

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 ChartBarBig = createLucideIcon("ChartBarBig", [
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["rect", { x: "7", y: "13", width: "9", height: "4", rx: "1", key: "1iip1u" }],
["rect", { x: "7", y: "5", width: "12", height: "4", rx: "1", key: "1anskk" }]
]);
export { ChartBarBig as default };
//# sourceMappingURL=chart-bar-big.js.map

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var assert_1 = require("assert");
var tokenizer_1 = require("../tokenizer");
var tokenize = function (value) {
var tokenizer = new tokenizer_1.Tokenizer();
tokenizer.write(value);
return tokenizer.read();
};
describe('tokenizer', function () {
describe('<ident>', function () {
it('auto', function () { return assert_1.deepEqual(tokenize('auto'), [{ type: 20 /* IDENT_TOKEN */, value: 'auto' }]); });
it('url', function () { return assert_1.deepEqual(tokenize('url'), [{ type: 20 /* IDENT_TOKEN */, value: 'url' }]); });
it('auto test', function () {
return assert_1.deepEqual(tokenize('auto test'), [
{ type: 20 /* IDENT_TOKEN */, value: 'auto' },
{ type: 31 /* WHITESPACE_TOKEN */ },
{ type: 20 /* IDENT_TOKEN */, value: 'test' }
]);
});
});
describe('<url-token>', function () {
it('url(test.jpg)', function () {
return assert_1.deepEqual(tokenize('url(test.jpg)'), [{ type: 22 /* URL_TOKEN */, value: 'test.jpg' }]);
});
it('url("test.jpg")', function () {
return assert_1.deepEqual(tokenize('url("test.jpg")'), [{ type: 22 /* URL_TOKEN */, value: 'test.jpg' }]);
});
it("url('test.jpg')", function () {
return assert_1.deepEqual(tokenize("url('test.jpg')"), [{ type: 22 /* URL_TOKEN */, value: 'test.jpg' }]);
});
});
});
//# sourceMappingURL=tokernizer-tests.js.map

View File

@@ -0,0 +1,9 @@
/**
* 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.
*
*/
import{$getSelection as e,$isRangeSelection as t,$isTextNode as n}from"lexical";function o(o){const i=window.location.origin,a=a=>{if(a.origin!==i)return;const r=o.getRootElement();if(document.activeElement!==r)return;const s=a.data;if("string"==typeof s){let i;try{i=JSON.parse(s)}catch(e){return}if(i&&"nuanria_messaging"===i.protocol&&"request"===i.type){const r=i.payload;if(r&&"makeChanges"===r.functionId){const i=r.args;if(i){const[r,s,c,g,d,f]=i;o.update((()=>{const o=e();if(t(o)){const e=o.anchor;let t=e.getNode(),i=0,f=0;if(n(t)&&r>=0&&s>=0&&(i=r,f=r+s,o.setTextNodeRange(t,i,t,f)),i===f&&""===c||(o.insertRawText(c),t=e.getNode()),n(t)){i=g,f=g+d;const e=t.getTextContentSize();i=i>e?e:i,f=f>e?e:f,o.setTextNodeRange(t,i,t,f)}a.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",a,!0),()=>{window.removeEventListener("message",a,!0)}}export{o as registerDragonSupport};

View File

@@ -0,0 +1,35 @@
/**
* Request-span correlation system for MCP server instrumentation
*
* Handles mapping requestId to span data for correlation with handler execution.
*
* Uses sessionId as the primary key for stateful transports. This handles the wrapper
* transport pattern (e.g., NodeStreamableHTTPServerTransport wrapping WebStandardStreamableHTTPServerTransport)
* where onmessage and send may receive different `this` values but share the same sessionId.
*
* Falls back to WeakMap by transport instance for stateless transports (no sessionId).
*/
import { Span } from '../../types-hoist/span';
import { MCPTransport, RequestId, ResolvedMcpOptions } from './types';
/**
* Stores span context for later correlation with handler execution
* @param transport - MCP transport instance
* @param requestId - Request identifier
* @param span - Active span to correlate
* @param method - MCP method name
*/
export declare function storeSpanForRequest(transport: MCPTransport, requestId: RequestId, span: Span, method: string): void;
/**
* Completes span with results and cleans up correlation
* @param transport - MCP transport instance
* @param requestId - Request identifier
* @param result - Execution result for attribute extraction
* @param options - Resolved MCP options
*/
export declare function completeSpanWithResults(transport: MCPTransport, requestId: RequestId, result: unknown, options: ResolvedMcpOptions): void;
/**
* Cleans up pending spans for a specific transport (when that transport closes)
* @param transport - MCP transport instance
*/
export declare function cleanupPendingSpansForTransport(transport: MCPTransport): void;
//# sourceMappingURL=correlation.d.ts.map

View File

@@ -0,0 +1,32 @@
"use strict";
exports.quartersToYears = quartersToYears;
var _index = require("./constants.js");
/**
* @name quartersToYears
* @category Conversion Helpers
* @summary Convert number of quarters to years.
*
* @description
* Convert a number of quarters to a full number of years.
*
* @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 quarters - The number of quarters to be converted
*
* @returns The number of quarters converted in years
*
* @example
* // Convert 8 quarters to years
* const result = quartersToYears(8)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = quartersToYears(11)
* //=> 2
*/
function quartersToYears(quarters) {
const years = quarters / _index.quartersInYear;
return Math.trunc(years);
}

View File

@@ -0,0 +1,2 @@
import type { CodeKeywordDefinition } from "ajv";
export default function getDef(): CodeKeywordDefinition;

View File

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

View File

@@ -0,0 +1,7 @@
import { JSONSchema, LinkedJSONSchema } from './types/JSONSchema';
import { JSONSchema4Type } from 'json-schema';
/**
* Traverses over the schema, giving each node a reference to its
* parent node. We need this for downstream operations.
*/
export declare function link(schema: JSONSchema4Type | JSONSchema, parent?: JSONSchema4Type | null): LinkedJSONSchema;

View File

@@ -0,0 +1,134 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(:a|:e)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
abbreviated: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
wide: /^(före Kristus|före vår tid|efter Kristus|vår tid)/i,
};
const parseEraPatterns = {
any: [/^f/i, /^[ev]/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](:a|:e)? kvartalet/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated:
/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,
wide: /^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[smtofl]/i,
short: /^(sö|må|ti|on|to|fr|lö)/i,
abbreviated: /^(sön|mån|tis|ons|tors|fre|lör)/i,
wide: /^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i,
};
const parseDayPatterns = {
any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i],
};
const matchDayPeriodPatterns = {
any: /^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^f/i,
pm: /^e/i,
midnight: /^midn/i,
noon: /^midd/i,
morning: /morgon/i,
afternoon: /eftermiddag/i,
evening: /kväll/i,
night: /natt/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

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

View File

@@ -0,0 +1,50 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { toast, useRouteTransition } from '@payloadcms/ui';
import { useRouter } from 'next/navigation.js';
import React, { useEffect } from 'react';
export function ToastAndRedirect(t0) {
const $ = _c(6);
const {
message,
redirectTo
} = t0;
const router = useRouter();
const {
startRouteTransition
} = useRouteTransition();
const hasToastedRef = React.useRef(false);
let t1;
let t2;
if ($[0] !== message || $[1] !== redirectTo || $[2] !== router || $[3] !== startRouteTransition) {
t1 = () => {
let timeoutID;
if (toast) {
timeoutID = setTimeout(() => {
toast.success(message);
hasToastedRef.current = true;
startRouteTransition(() => router.push(redirectTo));
}, 100);
}
return () => {
if (timeoutID) {
clearTimeout(timeoutID);
}
};
};
t2 = [router, redirectTo, message, startRouteTransition];
$[0] = message;
$[1] = redirectTo;
$[2] = router;
$[3] = startRouteTransition;
$[4] = t1;
$[5] = t2;
} else {
t1 = $[4];
t2 = $[5];
}
useEffect(t1, t2);
return null;
}
//# sourceMappingURL=index.client.js.map

View File

@@ -0,0 +1,18 @@
type SpotlightConnectionOptions = {
/**
* Set this if the Spotlight Sidecar is not running on localhost:8969
* By default, the Url is set to http://localhost:8969/stream
*/
sidecarUrl?: string;
};
export declare const INTEGRATION_NAME = "Spotlight";
/**
* Use this integration to send errors and transactions to Spotlight.
*
* Learn more about spotlight at https://spotlightjs.com
*
* Important: This integration only works with Node 18 or newer.
*/
export declare const spotlightIntegration: (options?: Partial<SpotlightConnectionOptions> | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=spotlight.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/CloseModalOnRouteChange/index.tsx"],"names":[],"mappings":"AAQA,wBAAgB,uBAAuB,QAoBtC"}

View File

@@ -0,0 +1,123 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const createMappingsSerializer = require("./createMappingsSerializer");
const streamChunks = require("./streamChunks");
/** @typedef {import("../Source").RawSourceMap} RawSourceMap */
/** @typedef {import("./streamChunks").GeneratedSourceInfo} GeneratedSourceInfo */
/** @typedef {import("./streamChunks").OnChunk} OnChunk */
/** @typedef {import("./streamChunks").OnName} OnName */
/** @typedef {import("./streamChunks").OnSource} OnSource */
/** @typedef {import("./streamChunks").Options} Options */
/** @typedef {import("./streamChunks").SourceMaybeWithStreamChunksFunction} SourceMaybeWithStreamChunksFunction */
/**
* @param {SourceMaybeWithStreamChunksFunction} inputSource input source
* @param {Options} options options
* @param {OnChunk} onChunk on chunk
* @param {OnSource} onSource on source
* @param {OnName} onName on name
* @returns {{ result: GeneratedSourceInfo, source: string, map: RawSourceMap | null }} result
*/
const streamAndGetSourceAndMap = (
inputSource,
options,
onChunk,
onSource,
onName,
) => {
let code = "";
let mappings = "";
/** @type {(string | null)[]} */
const potentialSources = [];
/** @type {(string | null)[]} */
const potentialSourcesContent = [];
/** @type {(string | null)[]} */
const potentialNames = [];
const addMapping = createMappingsSerializer({ ...options, columns: true });
const finalSource = Boolean(options && options.finalSource);
const { generatedLine, generatedColumn, source } = streamChunks(
inputSource,
options,
(
chunk,
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
) => {
if (chunk !== undefined) code += chunk;
mappings += addMapping(
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
);
return onChunk(
finalSource ? undefined : chunk,
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
);
},
(sourceIndex, source, sourceContent) => {
while (potentialSources.length < sourceIndex) {
potentialSources.push(null);
}
potentialSources[sourceIndex] = source;
if (sourceContent !== undefined) {
while (potentialSourcesContent.length < sourceIndex) {
potentialSourcesContent.push(null);
}
potentialSourcesContent[sourceIndex] = sourceContent;
}
return onSource(sourceIndex, source, sourceContent);
},
(nameIndex, name) => {
while (potentialNames.length < nameIndex) {
potentialNames.push(null);
}
potentialNames[nameIndex] = name;
return onName(nameIndex, name);
},
);
const resultSource = source !== undefined ? source : code;
return {
result: {
generatedLine,
generatedColumn,
source: finalSource ? resultSource : undefined,
},
source: resultSource,
map:
mappings.length > 0
? {
version: 3,
file: "x",
mappings,
// We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
sources: /** @type {string[]} */ (potentialSources),
sourcesContent:
potentialSourcesContent.length > 0
? /** @type {string[]} */ (potentialSourcesContent)
: undefined,
names: /** @type {string[]} */ (potentialNames),
}
: null,
};
};
module.exports = streamAndGetSourceAndMap;

View File

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

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["_getBindingIdentifiers","require","_default","exports","default","getOuterBindingIdentifiers","node","duplicates","getBindingIdentifiers"],"sources":["../../src/retrievers/getOuterBindingIdentifiers.ts"],"sourcesContent":["import getBindingIdentifiers from \"./getBindingIdentifiers.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default getOuterBindingIdentifiers as {\n (node: t.Node, duplicates: true): Record<string, t.Identifier[]>;\n (node: t.Node, duplicates?: false): Record<string, t.Identifier>;\n (\n node: t.Node,\n duplicates?: boolean,\n ): Record<string, t.Identifier> | Record<string, t.Identifier[]>;\n};\n\nfunction getOuterBindingIdentifiers(\n node: t.Node,\n duplicates: boolean,\n): Record<string, t.Identifier> | Record<string, t.Identifier[]> {\n return getBindingIdentifiers(node, duplicates, true);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAA+D,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGhDC,0BAA0B;AASzC,SAASA,0BAA0BA,CACjCC,IAAY,EACZC,UAAmB,EAC4C;EAC/D,OAAO,IAAAC,8BAAqB,EAACF,IAAI,EAAEC,UAAU,EAAE,IAAI,CAAC;AACtD","ignoreList":[]}

View File

@@ -0,0 +1,54 @@
import { v4 as uuid } from 'uuid';
export const beginTransaction = async function beginTransaction(options) {
let id;
try {
id = uuid();
let reject;
let resolve;
let transaction;
let transactionReady;
// Await initialization here
// Prevent race conditions where the adapter may be
// re-initializing, and `this.drizzle` is potentially undefined
await this.initializing;
// Drizzle only exposes a transactions API that is sufficient if you
// can directly pass around the `tx` argument. But our operations are spread
// over many files and we don't want to pass the `tx` around like that,
// so instead, we "lift" up the `resolve` and `reject` methods
// and will call them in our respective transaction methods
const done = this.drizzle.transaction(async (tx)=>{
transaction = tx;
await new Promise((res, rej)=>{
resolve = ()=>{
res();
return done;
};
reject = ()=>{
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
rej();
return done;
};
transactionReady();
});
}, options || this.transactionOptions).catch(()=>{
// swallow
});
// Need to wait until the transaction is ready
// before binding its `resolve` and `reject` methods below
await new Promise((resolve)=>transactionReady = resolve);
this.sessions[id] = {
db: transaction,
reject,
resolve
};
} catch (err) {
this.payload.logger.error({
err,
msg: `Error: cannot begin transaction: ${err.message}`
});
throw new Error(`Error: cannot begin transaction: ${err.message}`);
}
return id;
};
//# sourceMappingURL=beginTransaction.js.map

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","257":"O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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":"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 4C 5C","578":"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"},D:{"1":"0 1 2 3 4 5 6 7 8 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","194":"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"},E:{"1":"UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E 6C bC 7C 8C 9C","33":"F A B C L M G 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"},F:{"1":"0 1 2 3 4 5 6 7 8 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":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB JD KD LD MD PC xC ND QC","194":"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"},G:{"1":"UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD","33":"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"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB zD 0D 1D 2D SC TC UC 3D","2":"J","194":"tD uD vD wD xD cC yD"},Q:{"2":"4D"},R:{"1":"5D"},S:{"2":"6D 7D"}},B:7,C:"CSS Backdrop Filter",D:true};

View File

@@ -0,0 +1,22 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { SQLiteColumn, SQLiteColumnBuilder } from "./common.cjs";
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,35 @@
/**
* Mutates the incoming select object to append fields required for upload thumbnails
* @param collectionConfig
* @param select
*/ export const appendUploadSelectFields = ({ collectionConfig, select })=>{
if (!collectionConfig.upload || !select) {
return;
}
select.mimeType = true;
select.thumbnailURL = true;
if (collectionConfig.upload.imageSizes && collectionConfig.upload.imageSizes.length > 0) {
if (collectionConfig.upload.adminThumbnail && typeof collectionConfig.upload.adminThumbnail === 'string') {
/** Only return image size properties that are required to generate the adminThumbnailURL */ select.sizes = {
[collectionConfig.upload.adminThumbnail]: {
filename: true
}
};
} else {
/** Only return image size properties that are required for thumbnails */ select.sizes = collectionConfig.upload.imageSizes.reduce((acc, imageSizeConfig)=>{
return {
...acc,
[imageSizeConfig.name]: {
filename: true,
url: true,
width: true
}
};
}, {});
}
} else {
select.url = true;
}
};
//# sourceMappingURL=appendUploadSelectFields.js.map

View File

@@ -0,0 +1,83 @@
import { dequal } from 'dequal';
import prompts from 'prompts';
const previousSchema = {
localeCodes: null,
rawTables: null
};
/**
* Pushes the development schema to the database using Drizzle.
*
* @param {DrizzleAdapter} adapter - The PostgresAdapter instance connected to the database.
* @returns {Promise<void>} - A promise that resolves once the schema push is complete.
*/ export const pushDevSchema = async (adapter)=>{
if (process.env.PAYLOAD_FORCE_DRIZZLE_PUSH !== 'true') {
const localeCodes = adapter.payload.config.localization && adapter.payload.config.localization.localeCodes;
const equal = dequal(previousSchema, {
localeCodes,
rawTables: adapter.rawTables
});
if (equal) {
if (adapter.logger) {
adapter.payload.logger.info('No changes detected in schema, skipping schema push.');
}
return;
} else {
previousSchema.localeCodes = localeCodes;
previousSchema.rawTables = adapter.rawTables;
}
}
const { pushSchema } = adapter.requireDrizzleKit();
const { extensions = {}, tablesFilter } = adapter;
// This will prompt if clarifications are needed for Drizzle to push new schema
const { apply, hasDataLoss, warnings } = await pushSchema(adapter.schema, adapter.drizzle, adapter.schemaName ? [
adapter.schemaName
] : undefined, tablesFilter, // Drizzle extensionsFilter supports only postgis for now
// https://github.com/drizzle-team/drizzle-orm/blob/83daf2d5cf023112de878bc2249ee2c41a2a5b1b/drizzle-kit/src/cli/validations/cli.ts#L26
extensions.postgis ? [
'postgis'
] : undefined);
if (warnings.length) {
let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
if (hasDataLoss) {
message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`;
}
message += `Accept warnings and push schema to database?`;
const { confirm: acceptWarnings } = await prompts({
name: 'confirm',
type: 'confirm',
initial: false,
message
}, {
onCancel: ()=>{
process.exit(0);
}
});
// Exit if user does not accept warnings.
// Q: Is this the right type of exit for this interaction?
if (!acceptWarnings) {
process.exit(0);
}
}
await apply();
const migrationsTable = adapter.schemaName ? `"${adapter.schemaName}"."payload_migrations"` : '"payload_migrations"';
const drizzle = adapter.drizzle;
const result = await adapter.execute({
drizzle,
raw: `SELECT * FROM ${migrationsTable} WHERE batch = '-1'`
});
const devPush = result.rows;
if (!devPush.length) {
// Use drizzle for insert so $defaultFn's are called
await drizzle.insert(adapter.tables.payload_migrations).values({
name: 'dev',
batch: -1
});
} else {
await adapter.execute({
drizzle,
raw: `UPDATE ${migrationsTable} SET updated_at = CURRENT_TIMESTAMP WHERE batch = '-1'`
});
}
};
//# sourceMappingURL=pushDevSchema.js.map

View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/resolve
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -0,0 +1,42 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { PgColumn } from "./common.js";
import { PgDateColumnBaseBuilder } from "./date.common.js";
class PgTimeBuilder extends PgDateColumnBaseBuilder {
constructor(name, withTimezone, precision) {
super(name, "string", "PgTime");
this.withTimezone = withTimezone;
this.precision = precision;
this.config.withTimezone = withTimezone;
this.config.precision = precision;
}
static [entityKind] = "PgTimeBuilder";
/** @internal */
build(table) {
return new PgTime(table, this.config);
}
}
class PgTime extends PgColumn {
static [entityKind] = "PgTime";
withTimezone;
precision;
constructor(table, config) {
super(table, config);
this.withTimezone = config.withTimezone;
this.precision = config.precision;
}
getSQLType() {
const precision = this.precision === void 0 ? "" : `(${this.precision})`;
return `time${precision}${this.withTimezone ? " with time zone" : ""}`;
}
}
function time(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
}
export {
PgTime,
PgTimeBuilder,
time
};
//# sourceMappingURL=time.js.map

View File

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

View File

@@ -0,0 +1,563 @@
import { describe, it, expect } from 'vitest';
import { addSelectGenericsToGeneratedTypes } from './addSelectGenericsToGeneretedTypes.js';
const INPUT_AND_OUTPUT = [
{
input: `
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run \`payload generate:types\` to regenerate this file.
*/
export interface Config {
auth: {
users: UserAuthOperations;
};
collections: {
posts: Post;
users: User;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
collectionsSelect: {
posts: PostsSelect;
users: UsersSelect;
'payload-locked-documents': PayloadLockedDocumentsSelect;
'payload-preferences': PayloadPreferencesSelect;
'payload-migrations': PayloadMigrationsSelect;
};
db: {
defaultIDType: string;
};
globals: {};
globalsSelect: {};
locale: null;
user: User;
}
export interface UserAuthOperations {
forgotPassword: {
email: string;
password: string;
};
login: {
email: string;
password: string;
};
registerFirstUser: {
email: string;
password: string;
};
unlock: {
email: string;
password: string;
};
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "posts".
*/
export interface Post {
id: string;
text?: string | null;
number?: number | null;
group?: {
text?: string | null;
number?: number | null;
};
array?:
| {
text?: string | null;
number?: number | null;
id?: string | null;
}[]
| null;
blocks?:
| (
| {
text?: string | null;
introText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'intro';
}
| {
text?: string | null;
ctaText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'cta';
}
)[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "users".
*/
export interface User {
id: string;
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
password?: string | null;
collection: 'users';
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-locked-documents".
*/
export interface PayloadLockedDocument {
id: string;
document?:
| ({
relationTo: 'posts';
value: string | Post;
} | null)
| ({
relationTo: 'users';
value: string | User;
} | null);
globalSlug?: string | null;
user: {
relationTo: 'users';
value: string | User;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-preferences".
*/
export interface PayloadPreference {
id: string;
user: {
relationTo: 'users';
value: string | User;
};
key?: string | null;
value?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-migrations".
*/
export interface PayloadMigration {
id: string;
name?: string | null;
batch?: number | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "posts_select".
*/
export interface PostsSelect {
text?: boolean;
number?: boolean;
sharedGroup?: boolean | SharedGroup;
group?:
| boolean
| {
text?: boolean;
number?: boolean;
};
array?:
| boolean
| {
text?: boolean;
number?: boolean;
id?: boolean;
};
blocks?:
| boolean
| {
intro?:
| boolean
| {
text?: boolean;
introText?: boolean;
id?: boolean;
blockName?: boolean;
};
cta?:
| boolean
| {
text?: boolean;
ctaText?: boolean;
id?: boolean;
blockName?: boolean;
};
};
updatedAt?: boolean;
createdAt?: boolean;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "users_select".
*/
export interface UsersSelect {
updatedAt?: boolean;
createdAt?: boolean;
email?: boolean;
resetPasswordToken?: boolean;
resetPasswordExpiration?: boolean;
salt?: boolean;
hash?: boolean;
loginAttempts?: boolean;
lockUntil?: boolean;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-locked-documents_select".
*/
export interface PayloadLockedDocumentsSelect {
document?: boolean;
globalSlug?: boolean;
user?: boolean;
updatedAt?: boolean;
createdAt?: boolean;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-preferences_select".
*/
export interface PayloadPreferencesSelect {
user?: boolean;
key?: boolean;
value?: boolean;
updatedAt?: boolean;
createdAt?: boolean;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-migrations_select".
*/
export interface PayloadMigrationsSelect {
name?: boolean;
batch?: boolean;
updatedAt?: boolean;
createdAt?: boolean;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "auth".
*/
export interface Auth {
[k: string]: unknown;
}
declare module 'payload' {
// @ts-ignore
export interface GeneratedTypes extends Config {}
}
`,
output: `
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run \`payload generate:types\` to regenerate this file.
*/
export interface Config {
auth: {
users: UserAuthOperations;
};
collections: {
posts: Post;
users: User;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
collectionsSelect: {
posts: PostsSelect<false> | PostsSelect<true>;
users: UsersSelect<false> | UsersSelect<true>;
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
};
db: {
defaultIDType: string;
};
globals: {};
globalsSelect: {};
locale: null;
user: User;
}
export interface UserAuthOperations {
forgotPassword: {
email: string;
password: string;
};
login: {
email: string;
password: string;
};
registerFirstUser: {
email: string;
password: string;
};
unlock: {
email: string;
password: string;
};
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "posts".
*/
export interface Post {
id: string;
text?: string | null;
number?: number | null;
group?: {
text?: string | null;
number?: number | null;
};
array?:
| {
text?: string | null;
number?: number | null;
id?: string | null;
}[]
| null;
blocks?:
| (
| {
text?: string | null;
introText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'intro';
}
| {
text?: string | null;
ctaText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'cta';
}
)[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "users".
*/
export interface User {
id: string;
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
password?: string | null;
collection: 'users';
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-locked-documents".
*/
export interface PayloadLockedDocument {
id: string;
document?:
| ({
relationTo: 'posts';
value: string | Post;
} | null)
| ({
relationTo: 'users';
value: string | User;
} | null);
globalSlug?: string | null;
user: {
relationTo: 'users';
value: string | User;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-preferences".
*/
export interface PayloadPreference {
id: string;
user: {
relationTo: 'users';
value: string | User;
};
key?: string | null;
value?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-migrations".
*/
export interface PayloadMigration {
id: string;
name?: string | null;
batch?: number | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "posts_select".
*/
export interface PostsSelect<T extends boolean = true> {
text?: T;
number?: T;
sharedGroup?: T | SharedGroup<T>;
group?:
| T
| {
text?: T;
number?: T;
};
array?:
| T
| {
text?: T;
number?: T;
id?: T;
};
blocks?:
| T
| {
intro?:
| T
| {
text?: T;
introText?: T;
id?: T;
blockName?: T;
};
cta?:
| T
| {
text?: T;
ctaText?: T;
id?: T;
blockName?: T;
};
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "users_select".
*/
export interface UsersSelect<T extends boolean = true> {
updatedAt?: T;
createdAt?: T;
email?: T;
resetPasswordToken?: T;
resetPasswordExpiration?: T;
salt?: T;
hash?: T;
loginAttempts?: T;
lockUntil?: T;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-locked-documents_select".
*/
export interface PayloadLockedDocumentsSelect<T extends boolean = true> {
document?: T;
globalSlug?: T;
user?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-preferences_select".
*/
export interface PayloadPreferencesSelect<T extends boolean = true> {
user?: T;
key?: T;
value?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "payload-migrations_select".
*/
export interface PayloadMigrationsSelect<T extends boolean = true> {
name?: T;
batch?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by \`Config\`'s JSON-Schema
* via the \`definition\` "auth".
*/
export interface Auth {
[k: string]: unknown;
}
declare module 'payload' {
// @ts-ignore
export interface GeneratedTypes extends Config {}
}
`
}
];
describe('addSelectGenericsToGeneratedTypes', ()=>{
it('should match return of given input with output', ()=>{
for (const { input, output } of INPUT_AND_OUTPUT){
expect(addSelectGenericsToGeneratedTypes({
compiledGeneratedTypes: input
})).toStrictEqual(output);
}
});
});
//# sourceMappingURL=addSelectGenericsToGeneratedTypes.spec.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"52":0.01034,"78":0.01551,"115":0.1241,"125":0.01034,"128":0.01034,"132":0.00517,"133":0.00517,"134":0.00517,"136":0.01034,"137":0.01034,"139":0.00517,"140":0.06205,"141":0.02586,"142":0.01034,"143":0.02586,"144":0.0362,"145":0.94112,"146":1.21519,"147":0.00517,_:"2 3 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 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 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 111 112 113 114 116 117 118 119 120 121 122 123 124 126 127 129 130 131 135 138 148 149 3.5 3.6"},D:{"34":0.01551,"38":0.06205,"39":0.01551,"40":0.01551,"41":0.01551,"42":0.01551,"43":0.01551,"44":0.01551,"45":0.01551,"46":0.01551,"47":0.01551,"48":0.01551,"49":0.02068,"50":0.01551,"51":0.01551,"52":0.02586,"53":0.01551,"54":0.01551,"55":0.01551,"56":0.01551,"57":0.01551,"58":0.01551,"59":0.01551,"60":0.01551,"79":0.0362,"81":0.00517,"85":0.01551,"87":0.04137,"88":0.01034,"97":0.00517,"99":0.02586,"103":0.07239,"104":0.01034,"105":0.01551,"107":0.00517,"108":0.02586,"109":0.35163,"110":0.00517,"111":0.05171,"112":0.01034,"113":0.00517,"114":0.04137,"116":0.14479,"117":0.00517,"118":0.00517,"119":0.01551,"120":0.04654,"121":0.02586,"122":0.07239,"123":0.02068,"124":0.07239,"125":1.1583,"126":0.0362,"127":0.02068,"128":0.12928,"129":0.01551,"130":0.20167,"131":0.09308,"132":0.05688,"133":0.05688,"134":0.04654,"135":0.06205,"136":0.08274,"137":0.08274,"138":0.34129,"139":0.76014,"140":0.23787,"141":0.62569,"142":9.36985,"143":13.18088,"144":0.01034,"145":0.01551,_:"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 35 36 37 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 83 84 86 89 90 91 92 93 94 95 96 98 100 101 102 106 115 146"},F:{"46":0.01034,"93":0.01551,"95":0.01034,"122":0.01551,"123":0.01551,"124":0.81185,"125":0.25855,_:"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 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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"85":0.01034,"109":0.04654,"114":0.00517,"122":0.00517,"131":0.01034,"132":0.01034,"133":0.00517,"134":0.01034,"135":0.01551,"136":0.01034,"137":0.01034,"138":0.03103,"139":0.02068,"140":0.04137,"141":0.09308,"142":2.01152,"143":5.07275,_:"12 13 14 15 16 17 18 79 80 81 83 84 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 115 116 117 118 119 120 121 123 124 125 126 127 128 129 130"},E:{"14":0.02586,_:"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":0.01551,"13.1":0.05688,"14.1":0.08791,"15.1":0.00517,"15.2-15.3":0.01034,"15.4":0.01551,"15.5":0.04137,"15.6":0.33094,"16.0":0.01034,"16.1":0.05688,"16.2":0.02586,"16.3":0.06722,"16.4":0.02068,"16.5":0.02586,"16.6":0.44471,"17.0":0.00517,"17.1":0.44471,"17.2":0.02586,"17.3":0.04654,"17.4":0.06722,"17.5":0.10859,"17.6":0.40334,"18.0":0.02068,"18.1":0.05688,"18.2":0.04654,"18.3":0.14479,"18.4":0.07757,"18.5-18.6":0.30509,"26.0":0.13962,"26.1":0.92561,"26.2":0.22752,"26.3":0.00517},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00441,"6.0-6.1":0.00221,"7.0-7.1":0,"8.1-8.4":0.00441,"9.0-9.2":0,"9.3":0.0287,"10.0-10.2":0,"10.3":0.04635,"11.0-11.2":0.42381,"11.3-11.4":0.01987,"12.0-12.1":0.00441,"12.2-12.5":0.19866,"13.0-13.1":0.00221,"13.2":0.00662,"13.3":0.00441,"13.4-13.7":0.01987,"14.0-14.4":0.01987,"14.5-14.8":0.01987,"15.0-15.1":0.01766,"15.2-15.3":0.01545,"15.4":0.01545,"15.5":0.02428,"15.6-15.8":0.38187,"16.0":0.0287,"16.1":0.0905,"16.2":0.03973,"16.3":0.07726,"16.4":0.01545,"16.5":0.0309,"16.6-16.7":0.61144,"17.0":0.02207,"17.1":0.03532,"17.2":0.02428,"17.3":0.03311,"17.4":0.0596,"17.5":0.12582,"17.6-17.7":0.48341,"18.0":0.06181,"18.1":0.16334,"18.2":0.07505,"18.3":0.29799,"18.4":0.13906,"18.5-18.7":15.52879,"26.0":0.1192,"26.1":2.33097,"26.2":0.38629,"26.3":0.01766},P:{"4":0.0977,"21":0.02171,"22":0.02171,"23":0.02171,"24":0.03257,"25":0.03257,"26":0.04342,"27":0.06513,"28":0.17369,"29":2.89839,_:"20 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.01086,"7.2-7.4":0.02171,"8.2":0.01086},I:{"0":0.02413,"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.00001},A:{"9":0.13746,"11":0.0125,_:"6 7 8 10 5.5"},K:{"0":0.14484,_:"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":0.00966},O:{"0":0.0338},H:{"0":0},L:{"0":24.43962},R:{_:"0"},M:{"0":0.48763}};

View File

@@ -0,0 +1,4 @@
export declare const minutesToHours: import("./types.js").FPFn1<
number,
number
>;

View File

@@ -0,0 +1,59 @@
{
"name": "@opentelemetry/context-async-hooks",
"version": "2.5.1",
"description": "OpenTelemetry AsyncLocalStorage-based Context Manager",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"prepublishOnly": "npm run compile",
"compile": "tsc --build",
"clean": "tsc --build --clean",
"test": "nyc mocha 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"version": "node ../../scripts/version-update.js",
"prewatch": "npm run precompile",
"peer-api-check": "node ../../scripts/peer-api-check.js",
"align-api-deps": "node ../../scripts/align-api-deps.js"
},
"keywords": [
"opentelemetry",
"nodejs",
"tracing",
"profiling",
"metrics",
"stats"
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": "^18.19.0 || >=20.6.0"
},
"files": [
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
"doc",
"LICENSE",
"README.md"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.10.0",
"@types/mocha": "10.0.10",
"@types/node": "18.19.130",
"mocha": "11.7.5",
"nyc": "17.1.0",
"typescript": "5.0.4"
},
"peerDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.10.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-context-async-hooks",
"sideEffects": false,
"gitHead": "ad92be4c2c1094745a85b0b7eeff1444a11b1b4a"
}

View File

@@ -0,0 +1,178 @@
/**
* 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.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
import { $canShowPlaceholderCurry } from '@lexical/text';
import { mergeRegister } from '@lexical/utils';
import { useLayoutEffect, useEffect, useState, useMemo, Suspense } from 'react';
import { flushSync, createPortal } from 'react-dom';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import { registerDragonSupport } from '@lexical/dragon';
import { registerRichText } from '@lexical/rich-text';
/**
* 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.
*
*/
const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
/**
* 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.
*
*/
// This workaround is no longer necessary in React 19,
// but we currently support React >=17.x
// https://github.com/facebook/react/pull/26395
const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
/**
* 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.
*
*/
function canShowPlaceholderFromCurrentEditorState(editor) {
const currentCanShowPlaceholder = editor.getEditorState().read($canShowPlaceholderCurry(editor.isComposing()));
return currentCanShowPlaceholder;
}
function useCanShowPlaceholder(editor) {
const [canShowPlaceholder, setCanShowPlaceholder] = useState(() => canShowPlaceholderFromCurrentEditorState(editor));
useLayoutEffectImpl(() => {
function resetCanShowPlaceholder() {
const currentCanShowPlaceholder = canShowPlaceholderFromCurrentEditorState(editor);
setCanShowPlaceholder(currentCanShowPlaceholder);
}
resetCanShowPlaceholder();
return mergeRegister(editor.registerUpdateListener(() => {
resetCanShowPlaceholder();
}), editor.registerEditableListener(() => {
resetCanShowPlaceholder();
}));
}, [editor]);
return canShowPlaceholder;
}
/**
* 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.
*
*/
function useDecorators(editor, ErrorBoundary) {
const [decorators, setDecorators] = useState(() => editor.getDecorators());
// Subscribe to changes
useLayoutEffectImpl(() => {
return editor.registerDecoratorListener(nextDecorators => {
flushSync(() => {
setDecorators(nextDecorators);
});
});
}, [editor]);
useEffect(() => {
// If the content editable mounts before the subscription is added, then
// nothing will be rendered on initial pass. We can get around that by
// ensuring that we set the value.
setDecorators(editor.getDecorators());
}, [editor]);
// Return decorators defined as React Portals
return useMemo(() => {
const decoratedPortals = [];
const decoratorKeys = Object.keys(decorators);
for (let i = 0; i < decoratorKeys.length; i++) {
const nodeKey = decoratorKeys[i];
const reactDecorator = /*#__PURE__*/jsx(ErrorBoundary, {
onError: e => editor._onError(e),
children: /*#__PURE__*/jsx(Suspense, {
fallback: null,
children: decorators[nodeKey]
})
});
const element = editor.getElementByKey(nodeKey);
if (element !== null) {
decoratedPortals.push(/*#__PURE__*/createPortal(reactDecorator, element, nodeKey));
}
}
return decoratedPortals;
}, [ErrorBoundary, decorators, editor]);
}
/**
* 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.
*
*/
function useRichTextSetup(editor) {
useLayoutEffectImpl(() => {
return mergeRegister(registerRichText(editor), registerDragonSupport(editor));
// We only do this for init
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [editor]);
}
/**
* 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.
*
*/
function RichTextPlugin({
contentEditable,
// TODO Remove. This property is now part of ContentEditable
placeholder = null,
ErrorBoundary
}) {
const [editor] = useLexicalComposerContext();
const decorators = useDecorators(editor, ErrorBoundary);
useRichTextSetup(editor);
return /*#__PURE__*/jsxs(Fragment, {
children: [contentEditable, /*#__PURE__*/jsx(Placeholder, {
content: placeholder
}), decorators]
});
}
// TODO remove
function Placeholder({
content
}) {
const [editor] = useLexicalComposerContext();
const showPlaceholder = useCanShowPlaceholder(editor);
const editable = useLexicalEditable();
if (!showPlaceholder) {
return null;
}
if (typeof content === 'function') {
return content(editable);
} else {
return content;
}
}
export { RichTextPlugin };

View File

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

View File

@@ -0,0 +1,76 @@
var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or
// reference a signature, e.g.
//
// ;; inline signature
// (func (result i64)
// (i64.const 2)
// )
// ;; signature reference
// (type (func (result i64)))
// (func (type 0)
// (i64.const 2))
// )
//
// this AST transform denormalises the type references, making all signatures within the module
// inline.
export function transform(ast) {
var typeInstructions = [];
t.traverse(ast, {
TypeInstruction: function TypeInstruction(_ref) {
var node = _ref.node;
typeInstructions.push(node);
}
});
if (!typeInstructions.length) {
return;
}
function denormalizeSignature(signature) {
// signature referenced by identifier
if (signature.type === "Identifier") {
var identifier = signature;
var typeInstruction = typeInstructions.find(function (t) {
return t.id.type === identifier.type && t.id.value === identifier.value;
});
if (!typeInstruction) {
throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature)));
}
return typeInstruction.functype;
} // signature referenced by index
if (signature.type === "NumberLiteral") {
var signatureRef = signature;
var _typeInstruction = typeInstructions[signatureRef.value];
return _typeInstruction.functype;
}
return signature;
}
t.traverse(ast, {
Func: function (_Func) {
function Func(_x) {
return _Func.apply(this, arguments);
}
Func.toString = function () {
return _Func.toString();
};
return Func;
}(function (_ref2) {
var node = _ref2.node;
node.signature = denormalizeSignature(node.signature);
}),
CallIndirectInstruction: function CallIndirectInstruction(_ref3) {
var node = _ref3.node;
node.signature = denormalizeSignature(node.signature);
}
});
}

View File

@@ -0,0 +1,54 @@
import { toDate } from "./toDate.mjs";
/**
* @name compareAsc
* @category Common Helpers
* @summary Compare the two dates and return -1, 0 or 1.
*
* @description
* Compare the two dates and return 1 if the first date is after the second,
* -1 if the first date is before the second or 0 if dates are equal.
*
* @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 dateLeft - The first date to compare
* @param dateRight - The second date to compare
*
* @returns The result of the comparison
*
* @example
* // Compare 11 February 1987 and 10 July 1989:
* const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
* //=> -1
*
* @example
* // Sort the array of dates:
* const result = [
* new Date(1995, 6, 2),
* new Date(1987, 1, 11),
* new Date(1989, 6, 10)
* ].sort(compareAsc)
* //=> [
* // Wed Feb 11 1987 00:00:00,
* // Mon Jul 10 1989 00:00:00,
* // Sun Jul 02 1995 00:00:00
* // ]
*/
export function compareAsc(dateLeft, dateRight) {
const _dateLeft = toDate(dateLeft);
const _dateRight = toDate(dateRight);
const diff = _dateLeft.getTime() - _dateRight.getTime();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
// Return 0 if diff is 0; return NaN if diff is NaN
} else {
return diff;
}
}
// Fallback for modularized imports:
export default compareAsc;

View File

@@ -0,0 +1,465 @@
import {Syntax} from './options';
import {PromiseOr} from './util/promise_or';
/**
* Contextual information passed to {@link Importer.canonicalize} and {@link
* FileImporter.findFileUrl}. Not all importers will need this information to
* resolve loads, but some may find it useful.
*/
export interface CanonicalizeContext {
/**
* Whether this is being invoked because of a Sass
* `@import` rule, as opposed to a `@use` or `@forward` rule.
*
* This should *only* be used for determining whether or not to load
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files).
*/
fromImport: boolean;
/**
* The canonical URL of the file that contains the load, if that information
* is available.
*
* For an {@link Importer}, this is only passed when the `url` parameter is a
* relative URL _or_ when its [URL scheme] is included in {@link
* Importer.nonCanonicalScheme}. This ensures that canonical URLs are always
* resolved the same way regardless of context.
*
* [URL scheme]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme
*
* For a {@link FileImporter}, this is always available as long as Sass knows
* the canonical URL of the containing file.
*/
containingUrl: URL | null;
}
/**
* A special type of importer that redirects all loads to existing files on
* disk. Although this is less powerful than a full {@link Importer}, it
* automatically takes care of Sass features like resolving partials and file
* extensions and of loading the file from disk.
*
* Like all importers, this implements custom Sass loading logic for [`@use`
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
* to {@link Options.importers} or {@link StringOptions.importer}.
*
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
* synchronously, but in return it can be passed to {@link compile} and {@link
* compileString} in addition to {@link compileAsync} and {@link
* compileStringAsync}.
*
* A `FileImporter<'async'>`'s {@link findFileUrl} may either return
* synchronously or asynchronously, but it can only be used with {@link
* compileAsync} and {@link compileStringAsync}.
*
* @example
*
* ```js
* const {pathToFileURL} = require('url');
*
* sass.compile('style.scss', {
* importers: [{
* // An importer that redirects relative URLs starting with "~" to
* // `node_modules`.
* findFileUrl(url) {
* if (!url.startsWith('~')) return null;
* return new URL(url.substring(1), pathToFileURL('node_modules'));
* }
* }]
* });
* ```
*
* @category Importer
*/
export interface FileImporter<
sync extends 'sync' | 'async' = 'sync' | 'async'
> {
/**
* A callback that's called to partially resolve a load (such as
* [`@use`](https://sass-lang.com/documentation/at-rules/use) or
* [`@import`](https://sass-lang.com/documentation/at-rules/import)) to a file
* on disk.
*
* Unlike an {@link Importer}, the compiler will automatically handle relative
* loads for a {@link FileImporter}. See {@link Options.importers} for more
* details on the way loads are resolved.
*
* @param url - The loaded URL. Since this might be relative, it's represented
* as a string rather than a {@link URL} object.
*
* @returns An absolute `file:` URL if this importer recognizes the `url`.
* This may be only partially resolved: the compiler will automatically look
* for [partials](https://sass-lang.com/documentation/at-rules/use#partials),
* [index files](https://sass-lang.com/documentation/at-rules/use#index-files),
* and file extensions based on the returned URL. An importer may also return
* a fully resolved URL if it so chooses.
*
* If this importer doesn't recognize the URL, it should return `null` instead
* to allow other importers or {@link Options.loadPaths | load paths} to
* handle it.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer recognizes `url` but determines that it's
* invalid, it may throw an exception that will be wrapped by Sass. If the
* exception object has a `message` property, it will be used as the wrapped
* exception's message; otherwise, the exception object's `toString()` will be
* used. This means it's safe for importers to throw plain strings.
*/
findFileUrl(
url: string,
context: CanonicalizeContext
): PromiseOr<URL | null, sync>;
/** @hidden */
canonicalize?: never;
}
/**
* An object that implements custom Sass loading logic for [`@use`
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
* to {@link Options.importers} or {@link StringOptions.importer}.
*
* Importers that simply redirect to files on disk are encouraged to use the
* {@link FileImporter} interface instead.
*
* ### Resolving a Load
*
* This is the process of resolving a load using a custom importer:
*
* - The compiler encounters `@use "db:foo/bar/baz"`.
* - It calls {@link canonicalize} with `"db:foo/bar/baz"`.
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`.
* - If the compiler has already loaded a stylesheet with this canonical URL, it
* re-uses the existing module.
* - Otherwise, it calls {@link load} with `new
* URL("db:foo/bar/baz/_index.scss")`.
* - {@link load} returns an {@link ImporterResult} that the compiler uses as
* the contents of the module.
*
* See {@link Options.importers} for more details on the way loads are resolved
* using multiple importers and load paths.
*
* @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link
* load} must return synchronously, but in return it can be passed to {@link
* compile} and {@link compileString} in addition to {@link compileAsync} and
* {@link compileStringAsync}.
*
* An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either
* return synchronously or asynchronously, but it can only be used with {@link
* compileAsync} and {@link compileStringAsync}.
*
* @example
*
* ```js
* sass.compile('style.scss', {
* // An importer for URLs like `bgcolor:orange` that generates a
* // stylesheet with the given background color.
* importers: [{
* canonicalize(url) {
* if (!url.startsWith('bgcolor:')) return null;
* return new URL(url);
* },
* load(canonicalUrl) {
* return {
* contents: `body {background-color: ${canonicalUrl.pathname}}`,
* syntax: 'scss'
* };
* }
* }]
* });
* ```
*
* @category Importer
*/
export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
/**
* If `url` is recognized by this importer, returns its canonical format.
*
* If Sass has already loaded a stylesheet with the returned canonical URL, it
* re-uses the existing parse tree (and the loaded module for `@use`). This
* means that importers **must ensure** that the same canonical URL always
* refers to the same stylesheet, *even across different importers*. As such,
* importers are encouraged to use unique URL schemes to disambiguate between
* one another.
*
* As much as possible, custom importers should canonicalize URLs the same way
* as the built-in filesystem importer:
*
* - The importer should look for stylesheets by adding the prefix `_` to the
* URL's basename, and by adding the extensions `.sass` and `.scss` if the
* URL doesn't already have one of those extensions. For example, if the
* URL was `foo/bar/baz`, the importer would look for:
* - `foo/bar/baz.sass`
* - `foo/bar/baz.scss`
* - `foo/bar/_baz.sass`
* - `foo/bar/_baz.scss`
*
* If the URL was `foo/bar/baz.scss`, the importer would just look for:
* - `foo/bar/baz.scss`
* - `foo/bar/_baz.scss`
*
* If the importer finds a stylesheet at more than one of these URLs, it
* should throw an exception indicating that the URL is ambiguous. Note that
* if the extension is explicitly specified, a stylesheet with the opposite
* extension is allowed to exist.
*
* - If none of the possible paths is valid, the importer should perform the
* same resolution on the URL followed by `/index`. In the example above,
* it would look for:
* - `foo/bar/baz/index.sass`
* - `foo/bar/baz/index.scss`
* - `foo/bar/baz/_index.sass`
* - `foo/bar/baz/_index.scss`
*
* As above, if the importer finds a stylesheet at more than one of these
* URLs, it should throw an exception indicating that the import is
* ambiguous.
*
* If no stylesheets are found, the importer should return `null`.
*
* Calling {@link canonicalize} multiple times with the same URL must return
* the same result. Calling {@link canonicalize} with a URL returned by a
* previous call to {@link canonicalize} must return that URL.
*
* Relative loads in stylesheets loaded from an importer are handled by
* resolving the loaded URL relative to the canonical URL of the stylesheet
* that contains it, and passing that URL back to the importer's {@link
* canonicalize} method. For example, suppose the "Resolving a Load" example
* {@link Importer | above} returned a stylesheet that contained `@use
* "mixins"`:
*
* - The compiler resolves the URL `mixins` relative to the current
* stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get
* `db:foo/bar/baz/mixins`.
* - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`.
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`.
*
* Because of this, {@link canonicalize} must return a meaningful result when
* called with a URL relative to one returned by an earlier call to {@link
* canonicalize}.
*
* @param url - The loaded URL. Since this might be relative, it's represented
* as a string rather than a {@link URL} object.
*
* @returns An absolute URL if this importer recognizes the `url`, or `null`
* if it doesn't. If this returns `null`, other importers or {@link
* Options.loadPaths | load paths} may handle the load.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer recognizes `url` but determines that it's
* invalid, it may throw an exception that will be wrapped by Sass. If the
* exception object has a `message` property, it will be used as the wrapped
* exception's message; otherwise, the exception object's `toString()` will be
* used. This means it's safe for importers to throw plain strings.
*/
canonicalize(
url: string,
context: CanonicalizeContext
): PromiseOr<URL | null, sync>;
/**
* Loads the Sass text for the given `canonicalUrl`, or returns `null` if this
* importer can't find the stylesheet it refers to.
*
* @param canonicalUrl - The canonical URL of the stylesheet to load. This is
* guaranteed to come from a call to {@link canonicalize}, although not every
* call to {@link canonicalize} will result in a call to {@link load}.
*
* @returns The contents of the stylesheet at `canonicalUrl` if it can be
* loaded, or `null` if it can't.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer finds a stylesheet at `url` but it fails to
* load for some reason, or if `url` is uniquely associated with this importer
* but doesn't refer to a real stylesheet, the importer may throw an exception
* that will be wrapped by Sass. If the exception object has a `message`
* property, it will be used as the wrapped exception's message; otherwise,
* the exception object's `toString()` will be used. This means it's safe for
* importers to throw plain strings.
*/
load(canonicalUrl: URL): PromiseOr<ImporterResult | null, sync>;
/** @hidden */
findFileUrl?: never;
/**
* A URL scheme or set of schemes (without the `:`) that this importer
* promises never to use for URLs returned by {@link canonicalize}. If it does
* return a URL with one of these schemes, that's an error.
*
* If this is set, any call to canonicalize for a URL with a non-canonical
* scheme will be passed {@link CanonicalizeContext.containingUrl} if it's
* known.
*
* These schemes may only contain lowercase ASCII letters, ASCII numerals,
* `+`, `-`, and `.`. They may not be empty.
*/
nonCanonicalScheme?: string | string[];
}
declare const nodePackageImporterKey: unique symbol;
/**
* The built-in Node.js package importer. This loads pkg: URLs from node_modules
* according to the standard Node.js resolution algorithm.
*
* A Node.js package importer is exposed as a class that can be added to the
* `importers` option.
*
*```js
* const sass = require('sass');
* sass.compileString('@use "pkg:vuetify', {
* importers: [new sass.NodePackageImporter()]
* });
*```
*
* ## Writing Sass packages
*
* Package authors can control what is exposed to their users through their
* `package.json` manifest. The recommended method is to add a `sass`
* conditional export to `package.json`.
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "exports": {
* ".": {
* "sass": "./src/scss/index.scss",
* "import": "./dist/js/index.mjs",
* "default": "./dist/js/index.js"
* }
* }
* }
* ```
*
* This allows a package user to write `@use "pkg:uicomponents"` to load the
* file at `node_modules/uicomponents/src/scss/index.scss`.
*
* The Node.js package importer supports the variety of formats supported by
* Node.js [package entry points], allowing authors to expose multiple subpaths.
*
* [package entry points]:
* https://nodejs.org/api/packages.html#package-entry-points
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "exports": {
* ".": {
* "sass": "./src/scss/index.scss",
* },
* "./colors.scss": {
* "sass": "./src/scss/_colors.scss",
* },
* "./theme/*.scss": {
* "sass": "./src/scss/theme/*.scss",
* },
* }
* }
* ```
*
* This allows a package user to write:
*
* - `@use "pkg:uicomponents";` to import the root export.
* - `@use "pkg:uicomponents/colors";` to import the colors partial.
* - `@use "pkg:uicomponents/theme/purple";` to import a purple theme.
*
* Note that while library users can rely on the importer to resolve
* [partials](https://sass-lang.com/documentation/at-rules/use#partials), [index
* files](https://sass-lang.com/documentation/at-rules/use#index-files), and
* extensions, library authors must specify the entire file path in `exports`.
*
* In addition to the `sass` condition, the `style` condition is also
* acceptable. Sass will match the `default` condition if it's a relevant file
* type, but authors are discouraged from relying on this. Notably, the key
* order matters, and the importer will resolve to the first value with a key
* that is `sass`, `style`, or `default`, so you should always put `default`
* last.
*
* To help package authors who haven't transitioned to package entry points
* using the `exports` field, the Node.js package importer provides several
* fallback options. If the `pkg:` URL does not have a subpath, the Node.js
* package importer will look for a `sass` or `style` key at the root of
* `package.json`.
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "sass": "./src/scss/index.scss",
* }
* ```
*
* This allows a user to write `@use "pkg:uicomponents";` to import the
* `index.scss` file.
*
* Finally, the Node.js package importer will look for an `index` file at the
* package root, resolving partials and extensions. For example, if the file
* `_index.scss` exists in the package root of `uicomponents`, a user can import
* that with `@use "pkg:uicomponents";`.
*
* If a `pkg:` URL includes a subpath that doesn't have a match in package entry
* points, the Node.js importer will attempt to find that file relative to the
* package root, resolving for file extensions, partials and index files. For
* example, if the file `src/sass/_colors.scss` exists in the `uicomponents`
* package, a user can import that file using `@use
* "pkg:uicomponents/src/sass/colors";`.
*
* @compatibility dart: "1.71.0", node: false
* @category Importer
*/
export class NodePackageImporter {
/** Used to distinguish this type from any arbitrary object. */
private readonly [nodePackageImporterKey]: true;
/**
* The NodePackageImporter has an optional `entryPointDirectory` option, which
* is the directory where the Node Package Importer should start when
* resolving `pkg:` URLs in sources other than files on disk. This will be
* used as the `parentURL` in the [Node Module
* Resolution](https://nodejs.org/api/esm.html#resolution-algorithm-specification)
* algorithm.
*
* In order to be found by the Node Package Importer, a package will need to
* be inside a node_modules folder located in the `entryPointDirectory`, or
* one of its parent directories, up to the filesystem root.
*
* Relative paths will be resolved relative to the current working directory.
* If a path is not provided, this defaults to the parent directory of the
* Node.js entrypoint. If that's not available, this will throw an error.
*/
constructor(entryPointDirectory?: string);
}
/**
* The result of successfully loading a stylesheet with an {@link Importer}.
*
* @category Importer
*/
export interface ImporterResult {
/** The contents of the stylesheet. */
contents: string;
/** The syntax with which to parse {@link contents}. */
syntax: Syntax;
/**
* The URL to use to link to the loaded stylesheet's source code in source
* maps. A `file:` URL is ideal because it's accessible to both browsers and
* other build tools, but an `http:` URL is also acceptable.
*
* If this isn't set, it defaults to a `data:` URL that contains the contents
* of the loaded stylesheet.
*/
sourceMapUrl?: URL;
}

View File

@@ -0,0 +1,4 @@
import React from 'react';
import './index.scss';
export declare const TrashBanner: React.FC;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,8 @@
import React from 'react';
import type { UniqueIdentifier } from '../../../../types';
export declare type Animation = (key: UniqueIdentifier, node: HTMLElement) => Promise<void> | void;
export interface Props {
animation: Animation;
children: React.ReactElement | null;
}
export declare function AnimationManager({ animation, children }: Props): JSX.Element;

View File

@@ -0,0 +1,59 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.condition {
&__wrap {
display: flex;
align-items: center;
gap: var(--base);
}
&__inputs {
display: flex;
flex-grow: 1;
align-items: center;
gap: var(--base);
> div {
flex-basis: 100%;
}
}
&__field {
.field-label {
padding-bottom: 0;
}
}
&__actions {
flex-shrink: 0;
display: flex;
gap: calc(var(--base) / 2);
padding: calc(var(--base) / 2) 0;
}
.btn {
vertical-align: middle;
margin: 0;
}
@include mid-break {
&__wrap {
align-items: initial;
gap: calc(var(--base) / 2);
}
&__inputs {
flex-direction: column;
gap: calc(var(--base) / 2);
align-items: stretch;
}
&__actions {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
}
}

View File

@@ -0,0 +1,106 @@
var defaultIsMergeableObject = require('is-mergeable-object')
function emptyTarget(val) {
return Array.isArray(val) ? [] : {}
}
function cloneUnlessOtherwiseSpecified(value, options) {
return (options.clone !== false && options.isMergeableObject(value))
? deepmerge(emptyTarget(value), value, options)
: value
}
function defaultArrayMerge(target, source, options) {
return target.concat(source).map(function(element) {
return cloneUnlessOtherwiseSpecified(element, options)
})
}
function getMergeFunction(key, options) {
if (!options.customMerge) {
return deepmerge
}
var customMerge = options.customMerge(key)
return typeof customMerge === 'function' ? customMerge : deepmerge
}
function getEnumerableOwnPropertySymbols(target) {
return Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
return Object.propertyIsEnumerable.call(target, symbol)
})
: []
}
function getKeys(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}
function propertyIsOnObject(object, property) {
try {
return property in object
} catch(_) {
return false
}
}
// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}
function mergeObject(target, source, options) {
var destination = {}
if (options.isMergeableObject(target)) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
})
}
getKeys(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return
}
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options)
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options)
}
})
return destination
}
function deepmerge(target, source, options) {
options = options || {}
options.arrayMerge = options.arrayMerge || defaultArrayMerge
options.isMergeableObject = options.isMergeableObject || defaultIsMergeableObject
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
// implementations can use it. The caller may not replace it.
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified
var sourceIsArray = Array.isArray(source)
var targetIsArray = Array.isArray(target)
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray
if (!sourceAndTargetTypesMatch) {
return cloneUnlessOtherwiseSpecified(source, options)
} else if (sourceIsArray) {
return options.arrayMerge(target, source, options)
} else {
return mergeObject(target, source, options)
}
}
deepmerge.all = function deepmergeAll(array, options) {
if (!Array.isArray(array)) {
throw new Error('first argument should be an array')
}
return array.reduce(function(prev, next) {
return deepmerge(prev, next, options)
}, {})
}
module.exports = deepmerge

View File

@@ -0,0 +1,87 @@
import { formatAdminURL } from 'payload/shared';
import * as qs from 'qs-esm';
import React from 'react';
import { hasSavePermission as getHasSavePermission } from '../../utilities/hasSavePermission.js';
import { isEditing as getIsEditing } from '../../utilities/isEditing.js';
export const useGetDocPermissions = ({
id,
api,
collectionSlug,
globalSlug,
i18n,
locale,
permissions,
setDocPermissions,
setHasPublishPermission,
setHasSavePermission
}) => React.useCallback(async data => {
const params = {
locale: locale || undefined
};
const idToUse = data?.id || id;
const newIsEditing = getIsEditing({
id: idToUse,
collectionSlug,
globalSlug
});
if (newIsEditing) {
const docAccessPath = collectionSlug ? `/${collectionSlug}/access/${idToUse}` : globalSlug ? `/globals/${globalSlug}/access` : null;
if (docAccessPath) {
const res = await fetch(formatAdminURL({
apiRoute: api,
path: `${docAccessPath}${qs.stringify(params, {
addQueryPrefix: true
})}`
}), {
body: JSON.stringify({
...(data?.doc || data || {}),
_status: 'draft'
}),
credentials: 'include',
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/json'
},
method: 'post'
});
const json = await res.json();
const publishedAccessJSON = await fetch(formatAdminURL({
apiRoute: api,
path: `${docAccessPath}${qs.stringify(params, {
addQueryPrefix: true
})}`
}), {
body: JSON.stringify({
...(data?.doc || data || {}),
_status: 'published'
}),
credentials: 'include',
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/json'
},
method: 'POST'
}).then(res => res.json());
setDocPermissions(json);
setHasSavePermission(getHasSavePermission({
collectionSlug,
docPermissions: json,
globalSlug,
isEditing: newIsEditing
}));
setHasPublishPermission(publishedAccessJSON?.update);
}
} else {
// when creating new documents, there is no permissions saved for this document yet
// use the generic entity permissions instead
const newDocPermissions = collectionSlug ? permissions?.collections?.[collectionSlug] : permissions?.globals?.[globalSlug];
setDocPermissions(newDocPermissions);
setHasSavePermission(getHasSavePermission({
collectionSlug,
docPermissions: newDocPermissions,
globalSlug,
isEditing: newIsEditing
}));
}
}, [locale, id, collectionSlug, globalSlug, api, i18n.language, setDocPermissions, setHasSavePermission, setHasPublishPermission, permissions?.collections, permissions?.globals]);
//# sourceMappingURL=useGetDocPermissions.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"D E F A B","2":"zC","8":"K"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"J bB K D E F A B C L M G 6C bC 7C 8C 9C 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","1025":"AD"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JD KD LD MD PC xC ND QC"},G:{"1":"E 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","132":"PD QD RD"},H:{"2":"mD"},I:{"1":"VC I rD sD","260":"nD oD pD","513":"J qD yC"},J:{"1":"D A"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"CSS position:fixed",D:true};

View File

@@ -0,0 +1 @@
exports._default = require("./react-select.cjs.js").default;

View File

@@ -0,0 +1,18 @@
import { unflatten } from './unflatten.js';
export const getDataByPath = (fields, path)=>{
const pathPrefixToRemove = path.substring(0, path.lastIndexOf('.') + 1);
const name = path.split('.').pop();
const data = {};
Object.keys(fields).forEach((key)=>{
if (!fields[key]?.disableFormData && (key.indexOf(`${path}.`) === 0 || key === path)) {
data[key.replace(pathPrefixToRemove, '')] = fields[key]?.value;
if (fields[key]?.rows && fields[key].rows.length === 0) {
data[key.replace(pathPrefixToRemove, '')] = [];
}
}
});
const unflattenedData = unflatten(data);
return unflattenedData?.[name];
};
//# sourceMappingURL=getDataByPath.js.map

View File

@@ -0,0 +1,131 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "문자", verb: "to have" },
file: { unit: "바이트", verb: "to have" },
array: { unit: "개", verb: "to have" },
set: { unit: "개", verb: "to have" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "입력",
email: "이메일 주소",
url: "URL",
emoji: "이모지",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO 날짜시간",
date: "ISO 날짜",
time: "ISO 시간",
duration: "ISO 기간",
ipv4: "IPv4 주소",
ipv6: "IPv6 주소",
cidrv4: "IPv4 범위",
cidrv6: "IPv6 범위",
base64: "base64 인코딩 문자열",
base64url: "base64url 인코딩 문자열",
json_string: "JSON 문자열",
e164: "E.164 번호",
jwt: "JWT",
template_literal: "입력",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `잘못된 입력: 예상 타입은 ${issue.expected}, 받은 타입은 ${parsedType(issue.input)}입니다`;
case "invalid_value":
if (issue.values.length === 1)
return `잘못된 입력: 값은 ${util.stringifyPrimitive(issue.values[0])} 이어야 합니다`;
return `잘못된 옵션: ${util.joinValues(issue.values, "또는 ")} 중 하나여야 합니다`;
case "too_big": {
const adj = issue.inclusive ? "이하" : "미만";
const suffix = adj === "미만" ? "이어야 합니다" : "여야 합니다";
const sizing = getSizing(issue.origin);
const unit = sizing?.unit ?? "요소";
if (sizing) return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()}${unit} ${adj}${suffix}`;
return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()} ${adj}${suffix}`;
}
case "too_small": {
const adj = issue.inclusive ? "이상" : "초과";
const suffix = adj === "이상" ? "이어야 합니다" : "여야 합니다";
const sizing = getSizing(issue.origin);
const unit = sizing?.unit ?? "요소";
if (sizing) {
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()}${unit} ${adj}${suffix}`;
}
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()} ${adj}${suffix}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `잘못된 문자열: "${_issue.prefix}"(으)로 시작해야 합니다`;
}
if (_issue.format === "ends_with") return `잘못된 문자열: "${_issue.suffix}"(으)로 끝나야 합니다`;
if (_issue.format === "includes") return `잘못된 문자열: "${_issue.includes}"을(를) 포함해야 합니다`;
if (_issue.format === "regex") return `잘못된 문자열: 정규식 ${_issue.pattern} 패턴과 일치해야 합니다`;
return `잘못된 ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `잘못된 숫자: ${issue.divisor}의 배수여야 합니다`;
case "unrecognized_keys":
return `인식할 수 없는 키: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `잘못된 키: ${issue.origin}`;
case "invalid_union":
return `잘못된 입력`;
case "invalid_element":
return `잘못된 값: ${issue.origin}`;
default:
return `잘못된 입력`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,29 @@
var baseGt = require('./_baseGt'),
createRelationalOperation = require('./_createRelationalOperation');
/**
* Checks if `value` is greater than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
* @see _.lt
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
var gt = createRelationalOperation(baseGt);
module.exports = gt;

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 Briefcase = createLucideIcon("Briefcase", [
["path", { d: "M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16", key: "jecpp" }],
["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
]);
export { Briefcase as default };
//# sourceMappingURL=briefcase.js.map

View File

@@ -0,0 +1 @@
pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)}

View File

@@ -0,0 +1,12 @@
Prism.languages.objectivec = Prism.languages.extend('c', {
'string': {
pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
greedy: true
},
'keyword': /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,
'operator': /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/
});
delete Prism.languages.objectivec['class-name'];
Prism.languages.objc = Prism.languages.objectivec;

View File

@@ -0,0 +1,74 @@
{
"name": "escalade",
"version": "3.2.0",
"repository": "lukeed/escalade",
"description": "A tiny (183B to 210B) and fast utility to ascend parent directories",
"module": "dist/index.mjs",
"main": "dist/index.js",
"types": "index.d.ts",
"license": "MIT",
"author": {
"name": "Luke Edwards",
"email": "luke.edwards05@gmail.com",
"url": "https://lukeed.com"
},
"exports": {
".": [
{
"import": {
"types": "./index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./index.d.ts",
"default": "./dist/index.js"
}
},
"./dist/index.js"
],
"./sync": [
{
"import": {
"types": "./sync/index.d.mts",
"default": "./sync/index.mjs"
},
"require": {
"types": "./sync/index.d.ts",
"default": "./sync/index.js"
}
},
"./sync/index.js"
]
},
"files": [
"*.d.mts",
"*.d.ts",
"dist",
"sync"
],
"modes": {
"sync": "src/sync.js",
"default": "src/async.js"
},
"engines": {
"node": ">=6"
},
"scripts": {
"build": "bundt",
"pretest": "npm run build",
"test": "uvu -r esm test -i fixtures"
},
"keywords": [
"find",
"parent",
"parents",
"directory",
"search",
"walk"
],
"devDependencies": {
"bundt": "1.1.1",
"esm": "3.2.25",
"uvu": "0.3.3"
}
}

View File

@@ -0,0 +1,701 @@
import { DEBUG_BUILD } from './debug-build.js';
import { updateSession } from './session.js';
import { debug } from './utils/debug-logger.js';
import { isPlainObject } from './utils/is.js';
import { merge } from './utils/merge.js';
import { uuid4 } from './utils/misc.js';
import { generateTraceId } from './utils/propagationContext.js';
import { safeMathRandom } from './utils/randomSafeContext.js';
import { _setSpanForScope, _getSpanForScope } from './utils/spanOnScope.js';
import { truncate } from './utils/string.js';
import { dateTimestampInSeconds } from './utils/time.js';
/**
* Default value for maximum number of breadcrumbs added to an event.
*/
const DEFAULT_MAX_BREADCRUMBS = 100;
/**
* A context to be used for capturing an event.
* This can either be a Scope, or a partial ScopeContext,
* or a callback that receives the current scope and returns a new scope to use.
*/
/**
* Holds additional event information.
*/
class Scope {
/** Flag if notifying is happening. */
/** Callback for client to receive scope changes. */
/** Callback list that will be called during event processing. */
/** Array of breadcrumbs. */
/** User */
/** Tags */
/** Attributes */
/** Extra */
/** Contexts */
/** Attachments */
/** Propagation Context for distributed tracing */
/**
* A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
* sent to Sentry
*/
/** Fingerprint */
/** Severity */
/**
* Transaction Name
*
* IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects.
* It's purpose is to assign a transaction to the scope that's added to non-transaction events.
*/
/** Session */
/** The client on this scope */
/** Contains the last event id of a captured event. */
/** Conversation ID */
// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
constructor() {
this._notifyingListeners = false;
this._scopeListeners = [];
this._eventProcessors = [];
this._breadcrumbs = [];
this._attachments = [];
this._user = {};
this._tags = {};
this._attributes = {};
this._extra = {};
this._contexts = {};
this._sdkProcessingMetadata = {};
this._propagationContext = {
traceId: generateTraceId(),
sampleRand: safeMathRandom(),
};
}
/**
* Clone all data from this scope into a new scope.
*/
clone() {
const newScope = new Scope();
newScope._breadcrumbs = [...this._breadcrumbs];
newScope._tags = { ...this._tags };
newScope._attributes = { ...this._attributes };
newScope._extra = { ...this._extra };
newScope._contexts = { ...this._contexts };
if (this._contexts.flags) {
// We need to copy the `values` array so insertions on a cloned scope
// won't affect the original array.
newScope._contexts.flags = {
values: [...this._contexts.flags.values],
};
}
newScope._user = this._user;
newScope._level = this._level;
newScope._session = this._session;
newScope._transactionName = this._transactionName;
newScope._fingerprint = this._fingerprint;
newScope._eventProcessors = [...this._eventProcessors];
newScope._attachments = [...this._attachments];
newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };
newScope._propagationContext = { ...this._propagationContext };
newScope._client = this._client;
newScope._lastEventId = this._lastEventId;
newScope._conversationId = this._conversationId;
_setSpanForScope(newScope, _getSpanForScope(this));
return newScope;
}
/**
* Update the client assigned to this scope.
* Note that not every scope will have a client assigned - isolation scopes & the global scope will generally not have a client,
* as well as manually created scopes.
*/
setClient(client) {
this._client = client;
}
/**
* Set the ID of the last captured error event.
* This is generally only captured on the isolation scope.
*/
setLastEventId(lastEventId) {
this._lastEventId = lastEventId;
}
/**
* Get the client assigned to this scope.
*/
getClient() {
return this._client ;
}
/**
* Get the ID of the last captured error event.
* This is generally only available on the isolation scope.
*/
lastEventId() {
return this._lastEventId;
}
/**
* @inheritDoc
*/
addScopeListener(callback) {
this._scopeListeners.push(callback);
}
/**
* Add an event processor that will be called before an event is sent.
*/
addEventProcessor(callback) {
this._eventProcessors.push(callback);
return this;
}
/**
* Set the user for this scope.
* Set to `null` to unset the user.
*/
setUser(user) {
// If null is passed we want to unset everything, but still define keys,
// so that later down in the pipeline any existing values are cleared.
this._user = user || {
email: undefined,
id: undefined,
ip_address: undefined,
username: undefined,
};
if (this._session) {
updateSession(this._session, { user });
}
this._notifyScopeListeners();
return this;
}
/**
* Get the user from this scope.
*/
getUser() {
return this._user;
}
/**
* Set the conversation ID for this scope.
* Set to `null` to unset the conversation ID.
*/
setConversationId(conversationId) {
this._conversationId = conversationId || undefined;
this._notifyScopeListeners();
return this;
}
/**
* Set an object that will be merged into existing tags on the scope,
* and will be sent as tags data with the event.
*/
setTags(tags) {
this._tags = {
...this._tags,
...tags,
};
this._notifyScopeListeners();
return this;
}
/**
* Set a single tag that will be sent as tags data with the event.
*/
setTag(key, value) {
return this.setTags({ [key]: value });
}
/**
* Sets attributes onto the scope.
*
* These attributes are currently applied to logs and metrics.
* In the future, they will also be applied to spans.
*
* Important: For now, only strings, numbers and boolean attributes are supported, despite types allowing for
* more complex attribute types. We'll add this support in the future but already specify the wider type to
* avoid a breaking change in the future.
*
* @param newAttributes - The attributes to set on the scope. You can either pass in key-value pairs, or
* an object with a `value` and an optional `unit` (if applicable to your attribute).
*
* @example
* ```typescript
* scope.setAttributes({
* is_admin: true,
* payment_selection: 'credit_card',
* render_duration: { value: 'render_duration', unit: 'ms' },
* });
* ```
*/
setAttributes(newAttributes) {
this._attributes = {
...this._attributes,
...newAttributes,
};
this._notifyScopeListeners();
return this;
}
/**
* Sets an attribute onto the scope.
*
* These attributes are currently applied to logs and metrics.
* In the future, they will also be applied to spans.
*
* Important: For now, only strings, numbers and boolean attributes are supported, despite types allowing for
* more complex attribute types. We'll add this support in the future but already specify the wider type to
* avoid a breaking change in the future.
*
* @param key - The attribute key.
* @param value - the attribute value. You can either pass in a raw value, or an attribute
* object with a `value` and an optional `unit` (if applicable to your attribute).
*
* @example
* ```typescript
* scope.setAttribute('is_admin', true);
* scope.setAttribute('render_duration', { value: 'render_duration', unit: 'ms' });
* ```
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setAttribute(
key,
value,
) {
return this.setAttributes({ [key]: value });
}
/**
* Removes the attribute with the given key from the scope.
*
* @param key - The attribute key.
*
* @example
* ```typescript
* scope.removeAttribute('is_admin');
* ```
*/
removeAttribute(key) {
if (key in this._attributes) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete this._attributes[key];
this._notifyScopeListeners();
}
return this;
}
/**
* Set an object that will be merged into existing extra on the scope,
* and will be sent as extra data with the event.
*/
setExtras(extras) {
this._extra = {
...this._extra,
...extras,
};
this._notifyScopeListeners();
return this;
}
/**
* Set a single key:value extra entry that will be sent as extra data with the event.
*/
setExtra(key, extra) {
this._extra = { ...this._extra, [key]: extra };
this._notifyScopeListeners();
return this;
}
/**
* Sets the fingerprint on the scope to send with the events.
* @param {string[]} fingerprint Fingerprint to group events in Sentry.
*/
setFingerprint(fingerprint) {
this._fingerprint = fingerprint;
this._notifyScopeListeners();
return this;
}
/**
* Sets the level on the scope for future events.
*/
setLevel(level) {
this._level = level;
this._notifyScopeListeners();
return this;
}
/**
* Sets the transaction name on the scope so that the name of e.g. taken server route or
* the page location is attached to future events.
*
* IMPORTANT: Calling this function does NOT change the name of the currently active
* root span. If you want to change the name of the active root span, use
* `Sentry.updateSpanName(rootSpan, 'new name')` instead.
*
* By default, the SDK updates the scope's transaction name automatically on sensible
* occasions, such as a page navigation or when handling a new request on the server.
*/
setTransactionName(name) {
this._transactionName = name;
this._notifyScopeListeners();
return this;
}
/**
* Sets context data with the given name.
* Data passed as context will be normalized. You can also pass `null` to unset the context.
* Note that context data will not be merged - calling `setContext` will overwrite an existing context with the same key.
*/
setContext(key, context) {
if (context === null) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete this._contexts[key];
} else {
this._contexts[key] = context;
}
this._notifyScopeListeners();
return this;
}
/**
* Set the session for the scope.
*/
setSession(session) {
if (!session) {
delete this._session;
} else {
this._session = session;
}
this._notifyScopeListeners();
return this;
}
/**
* Get the session from the scope.
*/
getSession() {
return this._session;
}
/**
* Updates the scope with provided data. Can work in three variations:
* - plain object containing updatable attributes
* - Scope instance that'll extract the attributes from
* - callback function that'll receive the current scope as an argument and allow for modifications
*/
update(captureContext) {
if (!captureContext) {
return this;
}
const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;
const scopeInstance =
scopeToMerge instanceof Scope
? scopeToMerge.getScopeData()
: isPlainObject(scopeToMerge)
? (captureContext )
: undefined;
const {
tags,
attributes,
extra,
user,
contexts,
level,
fingerprint = [],
propagationContext,
conversationId,
} = scopeInstance || {};
this._tags = { ...this._tags, ...tags };
this._attributes = { ...this._attributes, ...attributes };
this._extra = { ...this._extra, ...extra };
this._contexts = { ...this._contexts, ...contexts };
if (user && Object.keys(user).length) {
this._user = user;
}
if (level) {
this._level = level;
}
if (fingerprint.length) {
this._fingerprint = fingerprint;
}
if (propagationContext) {
this._propagationContext = propagationContext;
}
if (conversationId) {
this._conversationId = conversationId;
}
return this;
}
/**
* Clears the current scope and resets its properties.
* Note: The client will not be cleared.
*/
clear() {
// client is not cleared here on purpose!
this._breadcrumbs = [];
this._tags = {};
this._attributes = {};
this._extra = {};
this._user = {};
this._contexts = {};
this._level = undefined;
this._transactionName = undefined;
this._fingerprint = undefined;
this._session = undefined;
this._conversationId = undefined;
_setSpanForScope(this, undefined);
this._attachments = [];
this.setPropagationContext({
traceId: generateTraceId(),
sampleRand: safeMathRandom(),
});
this._notifyScopeListeners();
return this;
}
/**
* Adds a breadcrumb to the scope.
* By default, the last 100 breadcrumbs are kept.
*/
addBreadcrumb(breadcrumb, maxBreadcrumbs) {
const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;
// No data has been changed, so don't notify scope listeners
if (maxCrumbs <= 0) {
return this;
}
const mergedBreadcrumb = {
timestamp: dateTimestampInSeconds(),
...breadcrumb,
// Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory
message: breadcrumb.message ? truncate(breadcrumb.message, 2048) : breadcrumb.message,
};
this._breadcrumbs.push(mergedBreadcrumb);
if (this._breadcrumbs.length > maxCrumbs) {
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);
this._client?.recordDroppedEvent('buffer_overflow', 'log_item');
}
this._notifyScopeListeners();
return this;
}
/**
* Get the last breadcrumb of the scope.
*/
getLastBreadcrumb() {
return this._breadcrumbs[this._breadcrumbs.length - 1];
}
/**
* Clear all breadcrumbs from the scope.
*/
clearBreadcrumbs() {
this._breadcrumbs = [];
this._notifyScopeListeners();
return this;
}
/**
* Add an attachment to the scope.
*/
addAttachment(attachment) {
this._attachments.push(attachment);
return this;
}
/**
* Clear all attachments from the scope.
*/
clearAttachments() {
this._attachments = [];
return this;
}
/**
* Get the data of this scope, which should be applied to an event during processing.
*/
getScopeData() {
return {
breadcrumbs: this._breadcrumbs,
attachments: this._attachments,
contexts: this._contexts,
tags: this._tags,
attributes: this._attributes,
extra: this._extra,
user: this._user,
level: this._level,
fingerprint: this._fingerprint || [],
eventProcessors: this._eventProcessors,
propagationContext: this._propagationContext,
sdkProcessingMetadata: this._sdkProcessingMetadata,
transactionName: this._transactionName,
span: _getSpanForScope(this),
conversationId: this._conversationId,
};
}
/**
* Add data which will be accessible during event processing but won't get sent to Sentry.
*/
setSDKProcessingMetadata(newData) {
this._sdkProcessingMetadata = merge(this._sdkProcessingMetadata, newData, 2);
return this;
}
/**
* Add propagation context to the scope, used for distributed tracing
*/
setPropagationContext(context) {
this._propagationContext = context;
return this;
}
/**
* Get propagation context from the scope, used for distributed tracing
*/
getPropagationContext() {
return this._propagationContext;
}
/**
* Capture an exception for this scope.
*
* @returns {string} The id of the captured Sentry event.
*/
captureException(exception, hint) {
const eventId = hint?.event_id || uuid4();
if (!this._client) {
DEBUG_BUILD && debug.warn('No client configured on scope - will not capture exception!');
return eventId;
}
const syntheticException = new Error('Sentry syntheticException');
this._client.captureException(
exception,
{
originalException: exception,
syntheticException,
...hint,
event_id: eventId,
},
this,
);
return eventId;
}
/**
* Capture a message for this scope.
*
* @returns {string} The id of the captured message.
*/
captureMessage(message, level, hint) {
const eventId = hint?.event_id || uuid4();
if (!this._client) {
DEBUG_BUILD && debug.warn('No client configured on scope - will not capture message!');
return eventId;
}
const syntheticException = hint?.syntheticException ?? new Error(message);
this._client.captureMessage(
message,
level,
{
originalException: message,
syntheticException,
...hint,
event_id: eventId,
},
this,
);
return eventId;
}
/**
* Capture a Sentry event for this scope.
*
* @returns {string} The id of the captured event.
*/
captureEvent(event, hint) {
const eventId = event.event_id || hint?.event_id || uuid4();
if (!this._client) {
DEBUG_BUILD && debug.warn('No client configured on scope - will not capture event!');
return eventId;
}
this._client.captureEvent(event, { ...hint, event_id: eventId }, this);
return eventId;
}
/**
* This will be called on every set call.
*/
_notifyScopeListeners() {
// We need this check for this._notifyingListeners to be able to work on scope during updates
// If this check is not here we'll produce endless recursion when something is done with the scope
// during the callback.
if (!this._notifyingListeners) {
this._notifyingListeners = true;
this._scopeListeners.forEach(callback => {
callback(this);
});
this._notifyingListeners = false;
}
}
}
export { Scope };
//# sourceMappingURL=scope.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getUniqueListBy.ts"],"sourcesContent":["export function getUniqueListBy<T>(arr: T[], key: string): T[] {\n return [...new Map(arr.map((item) => [item[key as keyof T], item])).values()]\n}\n"],"names":["getUniqueListBy","arr","key","Map","map","item","values"],"mappings":"AAAA,OAAO,SAASA,gBAAmBC,GAAQ,EAAEC,GAAW;IACtD,OAAO;WAAI,IAAIC,IAAIF,IAAIG,GAAG,CAAC,CAACC,OAAS;gBAACA,IAAI,CAACH,IAAe;gBAAEG;aAAK,GAAGC,MAAM;KAAG;AAC/E"}

View File

@@ -0,0 +1,115 @@
import "../types/number.js";
import { invariant } from "../utils.js";
import { ComputeExponent } from "./ComputeExponent.js";
import formatToParts from "./format_to_parts.js";
import { FormatNumericToString } from "./FormatNumericToString.js";
import { getPowerOf10 } from "./decimal-cache.js";
/**
* https://tc39.es/ecma402/#sec-partitionnumberpattern
*/
export function PartitionNumberPattern(internalSlots, _x) {
let x = _x;
// IMPL: We need to record the magnitude of the number
let magnitude = 0;
// 2. Let dataLocaleData be internalSlots.[[dataLocaleData]].
const { pl, dataLocaleData, numberingSystem } = internalSlots;
// 3. Let symbols be dataLocaleData.[[numbers]].[[symbols]][internalSlots.[[numberingSystem]]].
const symbols = dataLocaleData.numbers.symbols[numberingSystem] || dataLocaleData.numbers.symbols[dataLocaleData.numbers.nu[0]];
// 4. Let exponent be 0.
let exponent = 0;
// 5. Let n be ! ToString(x).
let n;
// 6. If x is NaN, then
if (x.isNaN()) {
// 6.a. Let n be symbols.[[nan]].
n = symbols.nan;
} else if (!x.isFinite()) {
// 7. Else if x is a non-finite Number, then
// 7.a. Let n be symbols.[[infinity]].
n = symbols.infinity;
} else {
// 8. Else,
if (!x.isZero()) {
// 8.a. If x < 0, let x be -x.
invariant(x.isFinite(), "Input must be a mathematical value");
// 8.b. If internalSlots.[[style]] is "percent", let x be 100 × x.
if (internalSlots.style == "percent") {
x = x.times(100);
}
// 8.c. Let exponent be ComputeExponent(numberFormat, x).
;
[exponent, magnitude] = ComputeExponent(internalSlots, x);
// 8.d. Let x be x × 10^(-exponent).
x = x.times(getPowerOf10(-exponent));
}
// 8.e. Let formatNumberResult be FormatNumericToString(internalSlots, x).
const formatNumberResult = FormatNumericToString(internalSlots, x);
// 8.f. Let n be formatNumberResult.[[formattedString]].
n = formatNumberResult.formattedString;
// 8.g. Let x be formatNumberResult.[[roundedNumber]].
x = formatNumberResult.roundedNumber;
}
// 9. Let sign be 0.
let sign;
// 10. If x is negative, then
const signDisplay = internalSlots.signDisplay;
switch (signDisplay) {
case "never":
// 10.a. If internalSlots.[[signDisplay]] is "never", then
// 10.a.i. Let sign be 0.
sign = 0;
break;
case "auto":
// 10.b. Else if internalSlots.[[signDisplay]] is "auto", then
if (x.isPositive() || x.isNaN()) {
// 10.b.i. If x is positive or x is NaN, let sign be 0.
sign = 0;
} else {
// 10.b.ii. Else, let sign be -1.
sign = -1;
}
break;
case "always":
// 10.c. Else if internalSlots.[[signDisplay]] is "always", then
if (x.isPositive() || x.isNaN()) {
// 10.c.i. If x is positive or x is NaN, let sign be 1.
sign = 1;
} else {
// 10.c.ii. Else, let sign be -1.
sign = -1;
}
break;
case "exceptZero":
// 10.d. Else if internalSlots.[[signDisplay]] is "exceptZero", then
if (x.isZero()) {
// 10.d.i. If x is 0, let sign be 0.
sign = 0;
} else if (x.isNegative()) {
// 10.d.ii. Else if x is negative, let sign be -1.
sign = -1;
} else {
// 10.d.iii. Else, let sign be 1.
sign = 1;
}
break;
default:
// 10.e. Else,
invariant(signDisplay === "negative", "signDisplay must be \"negative\"");
if (x.isNegative() && !x.isZero()) {
// 10.e.i. If x is negative and x is not 0, let sign be -1.
sign = -1;
} else {
// 10.e.ii. Else, let sign be 0.
sign = 0;
}
break;
}
// 11. Return ? FormatNumberToParts(numberFormat, x, n, exponent, sign).
return formatToParts({
roundedNumber: x,
formattedString: n,
exponent,
magnitude,
sign
}, internalSlots.dataLocaleData, pl, internalSlots);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.bundle.tracing.replay.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAIxH,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,6BAA6B,IAAI,yBAAyB,EAAE,UAAU,IAAI,MAAM,EAAE,CAAC;AAE5F,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,uBAAuB,IAAI,wBAAwB,EAAE,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;AAE/G,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}

View File

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

View File

@@ -0,0 +1,26 @@
/*
* 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.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { DiagAPI } from './api/diag';
/**
* Entrypoint for Diag API.
* Defines Diagnostic handler used for internal diagnostic logging operations.
* The default provides a Noop DiagLogger implementation which may be changed via the
* diag.setLogger(logger: DiagLogger) function.
*/
export const diag = DiagAPI.instance();
//# sourceMappingURL=diag-api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"traffic-cone.js","sources":["../../../src/icons/traffic-cone.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TrafficCone\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOS4zIDYuMmE0LjU1IDQuNTUgMCAwIDAgNS40IDAiIC8+CiAgPHBhdGggZD0iTTcuOSAxMC43Yy45LjggMi40IDEuMyA0LjEgMS4zczMuMi0uNSA0LjEtMS4zIiAvPgogIDxwYXRoIGQ9Ik0xMy45IDMuNWExLjkzIDEuOTMgMCAwIDAtMy44LS4xbC0zIDEwYy0uMS4yLS4xLjQtLjEuNiAwIDEuNyAyLjIgMyA1IDNzNS0xLjMgNS0zYzAtLjIgMC0uNC0uMS0uNVoiIC8+CiAgPHBhdGggZD0ibTcuNSAxMi4yLTQuNyAyLjdjLS41LjMtLjguNy0uOCAxLjFzLjMuOC44IDEuMWw3LjYgNC41Yy45LjUgMi4xLjUgMyAwbDcuNi00LjVjLjctLjMgMS0uNyAxLTEuMXMtLjMtLjgtLjgtMS4xbC00LjctMi44IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/traffic-cone\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 TrafficCone = createLucideIcon('TrafficCone', [\n ['path', { d: 'M9.3 6.2a4.55 4.55 0 0 0 5.4 0', key: 'flyxqv' }],\n ['path', { d: 'M7.9 10.7c.9.8 2.4 1.3 4.1 1.3s3.2-.5 4.1-1.3', key: '1nlxxg' }],\n [\n 'path',\n {\n d: 'M13.9 3.5a1.93 1.93 0 0 0-3.8-.1l-3 10c-.1.2-.1.4-.1.6 0 1.7 2.2 3 5 3s5-1.3 5-3c0-.2 0-.4-.1-.5Z',\n key: 'vz7x1l',\n },\n ],\n [\n 'path',\n {\n d: 'm7.5 12.2-4.7 2.7c-.5.3-.8.7-.8 1.1s.3.8.8 1.1l7.6 4.5c.9.5 2.1.5 3 0l7.6-4.5c.7-.3 1-.7 1-1.1s-.3-.8-.8-1.1l-4.7-2.8',\n key: '1xfzlw',\n },\n ],\n]);\n\nexport default TrafficCone;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC9E,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,79 @@
#!/usr/bin/env node
const spawn = require('child_process').spawnSync;
const filesToCheck = '*.js';
const FORMAT_START = process.env.FORMAT_START || 'main';
const IS_WIN = process.platform === 'win32';
const ESLINT_PATH = IS_WIN ? 'node_modules\\.bin\\eslint.cmd' : 'node_modules/.bin/eslint';
function main (args) {
let fix = false;
while (args.length > 0) {
switch (args[0]) {
case '-f':
case '--fix':
fix = true;
break;
default:
}
args.shift();
}
// Check js files that change on unstaged file
const fileUnStaged = spawn(
'git',
['diff', '--name-only', '--diff-filter=d', FORMAT_START, filesToCheck],
{
encoding: 'utf-8'
}
);
// Check js files that change on staged file
const fileStaged = spawn(
'git',
['diff', '--name-only', '--cached', '--diff-filter=d', FORMAT_START, filesToCheck],
{
encoding: 'utf-8'
}
);
const options = [
...fileStaged.stdout.split('\n').filter((f) => f !== ''),
...fileUnStaged.stdout.split('\n').filter((f) => f !== '')
];
if (fix) {
options.push('--fix');
}
const result = spawn(ESLINT_PATH, [...options], {
encoding: 'utf-8'
});
if (result.error && result.error.errno === 'ENOENT') {
console.error('Eslint not found! Eslint is supposed to be found at ', ESLINT_PATH);
return 2;
}
if (result.status === 1) {
console.error('Eslint error:', result.stdout);
const fixCmd = 'npm run lint:fix';
console.error(`ERROR: please run "${fixCmd}" to format changes in your commit
Note that when running the command locally, please keep your local
main branch and working branch up to date with nodejs/node-addon-api
to exclude un-related complains.
Or you can run "env FORMAT_START=upstream/main ${fixCmd}".
Also fix JS files by yourself if necessary.`);
return 1;
}
if (result.stderr) {
console.error('Error running eslint:', result.stderr);
return 2;
}
}
if (require.main === module) {
process.exitCode = main(process.argv.slice(2));
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"cloud-sun.js","sources":["../../../src/icons/cloud-sun.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CloudSun\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMnYyIiAvPgogIDxwYXRoIGQ9Im00LjkzIDQuOTMgMS40MSAxLjQxIiAvPgogIDxwYXRoIGQ9Ik0yMCAxMmgyIiAvPgogIDxwYXRoIGQ9Im0xOS4wNyA0LjkzLTEuNDEgMS40MSIgLz4KICA8cGF0aCBkPSJNMTUuOTQ3IDEyLjY1YTQgNCAwIDAgMC01LjkyNS00LjEyOCIgLz4KICA8cGF0aCBkPSJNMTMgMjJIN2E1IDUgMCAxIDEgNC45LTZIMTNhMyAzIDAgMCAxIDAgNloiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/cloud-sun\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 CloudSun = createLucideIcon('CloudSun', [\n ['path', { d: 'M12 2v2', key: 'tus03m' }],\n ['path', { d: 'm4.93 4.93 1.41 1.41', key: '149t6j' }],\n ['path', { d: 'M20 12h2', key: '1q8mjw' }],\n ['path', { d: 'm19.07 4.93-1.41 1.41', key: '1shlcs' }],\n ['path', { d: 'M15.947 12.65a4 4 0 0 0-5.925-4.128', key: 'dpwdj0' }],\n ['path', { d: 'M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z', key: 's09mg5' }],\n]);\n\nexport default CloudSun;\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,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,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAyB,CAAA,CAAA,CAAA,CAAA,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,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC7E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
Prism.languages.nim={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/,greedy:!0},char:{pattern:/'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/,greedy:!0},function:{pattern:/(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,greedy:!0,inside:{operator:/\*$/}},identifier:{pattern:/`[^`\r\n]+`/,greedy:!0,inside:{punctuation:/`/}},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/folders/types.ts"],"sourcesContent":["import type { CollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { CollectionSlug, SanitizedCollectionConfig } from '../index.js'\nimport type { Document } from '../types/index.js'\n\nexport type FolderInterface = {\n documentsAndFolders?: {\n docs: {\n relationTo: CollectionSlug\n value: Document\n }[]\n }\n folder?: FolderInterface | (number | string | undefined)\n folderType: CollectionSlug[]\n name: string\n} & TypeWithID\n\nexport type FolderBreadcrumb = {\n folderType?: CollectionSlug[]\n id: null | number | string\n name: string\n}\n\nexport type Subfolder = {\n fileCount: number\n hasSubfolders: boolean\n id: number | string\n name: string\n subfolderCount: number\n}\n\nexport type FolderEnabledColection = {\n admin: {\n custom: {\n folderCollectionSlug: CollectionSlug\n }\n }\n slug: CollectionSlug\n} & SanitizedCollectionConfig\n\n/**\n * `${relationTo}-${id}` is used as a key for the item\n */\nexport type FolderDocumentItemKey = `${string}-${number | string}`\n\n/**\n * Needed for document card view for upload enabled collections\n */\ntype DocumentMediaData = {\n filename?: string\n mimeType?: string\n url?: string\n}\n/**\n * A generic structure for a folder or document item.\n */\nexport type FolderOrDocument = {\n itemKey: FolderDocumentItemKey\n relationTo: CollectionSlug\n value: {\n _folderOrDocumentTitle: string\n createdAt?: string\n folderID?: number | string\n folderType: CollectionSlug[]\n id: number | string\n updatedAt?: string\n } & DocumentMediaData\n}\n\nexport type GetFolderDataResult = {\n breadcrumbs: FolderBreadcrumb[] | null\n documents: FolderOrDocument[]\n folderAssignedCollections: CollectionSlug[] | undefined\n subfolders: FolderOrDocument[]\n}\n\nexport type RootFoldersConfiguration = {\n /**\n * If true, the browse by folder view will be enabled\n *\n * @default true\n */\n browseByFolder?: boolean\n /**\n * An array of functions to be ran when the folder collection is initialized\n * This allows plugins to modify the collection configuration\n */\n collectionOverrides?: (({\n collection,\n }: {\n collection: Omit<CollectionConfig, 'trash'>\n }) => Omit<CollectionConfig, 'trash'> | Promise<Omit<CollectionConfig, 'trash'>>)[]\n /**\n * If true, you can scope folders to specific collections.\n *\n * @default true\n */\n collectionSpecific?: boolean\n /**\n * Ability to view hidden fields and collections related to folders\n *\n * @default false\n */\n debug?: boolean\n /**\n * The Folder field name\n *\n * @default \"folder\"\n */\n fieldName?: string\n /**\n * Slug for the folder collection\n *\n * @default \"payload-folders\"\n */\n slug?: string\n}\n\nexport type CollectionFoldersConfiguration = {\n /**\n * If true, the collection will be included in the browse by folder view\n *\n * @default true\n */\n browseByFolder?: boolean\n}\n\ntype BaseFolderSortKeys = 'createdAt' | 'name' | 'updatedAt'\n\nexport type FolderSortKeys = `-${BaseFolderSortKeys}` | BaseFolderSortKeys\n"],"names":[],"mappings":"AAgIA,WAA0E"}

View File

@@ -0,0 +1,42 @@
var wrappy = require('wrappy')
module.exports = wrappy(once)
module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
value: function () {
return once(this)
},
configurable: true
})
Object.defineProperty(Function.prototype, 'onceStrict', {
value: function () {
return onceStrict(this)
},
configurable: true
})
})
function once (fn) {
var f = function () {
if (f.called) return f.value
f.called = true
return f.value = fn.apply(this, arguments)
}
f.called = false
return f
}
function onceStrict (fn) {
var f = function () {
if (f.called)
throw new Error(f.onceError)
f.called = true
return f.value = fn.apply(this, arguments)
}
var name = fn.name || 'Function wrapped with `once`'
f.onceError = name + " shouldn't be called more than once"
f.called = false
return f
}

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