@powerhousedao/pieces-framework 6.2.3-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +59 -0
- package/README.md +202 -0
- package/UPSTREAM.md +172 -0
- package/dist/action--RmO83_Y.d.ts +12766 -0
- package/dist/action--RmO83_Y.d.ts.map +1 -0
- package/dist/authentication-B7brX_It.js +242 -0
- package/dist/authentication-B7brX_It.js.map +1 -0
- package/dist/common.d.ts +324 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +828 -0
- package/dist/common.js.map +1 -0
- package/dist/host.d.ts +95 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +723 -0
- package/dist/host.js.map +1 -0
- package/dist/index-BW6GxXEN.d.ts +5544 -0
- package/dist/index-BW6GxXEN.d.ts.map +1 -0
- package/dist/index.d.ts +1156 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1569 -0
- package/dist/index.js.map +1 -0
- package/dist/input-COuhC1I-.js +308 -0
- package/dist/input-COuhC1I-.js.map +1 -0
- package/dist/markdown-property-Df2l6_y_.js +285 -0
- package/dist/markdown-property-Df2l6_y_.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-property-Df2l6_y_.js","names":[],"sources":["../upstream/framework/lib/property/input/common.ts","../upstream/framework/lib/property/input/property-type.ts","../upstream/framework/lib/property/input/text-property.ts","../upstream/framework/lib/property/input/dropdown/common.ts","../upstream/framework/lib/property/input/dropdown/static-dropdown.ts","../upstream/framework/lib/property/input/checkbox-property.ts","../upstream/framework/lib/property/input/number-property.ts","../upstream/framework/lib/property/input/file-property.ts","../upstream/framework/lib/property/input/date-range-property.ts","../upstream/core-piece-types/lib/markdown.ts","../upstream/core-utils/lib/utils.ts","../upstream/core-utils/lib/try-catch.ts","../upstream/framework/lib/property/input/markdown-property.ts"],"sourcesContent":["// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/common.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport type { ApFile } from \"./file-property.js\";\nimport type { PropertyType } from \"./property-type.js\";\n\nexport const BasePropertySchema = z.object({\n displayName: z.string(),\n description: z.optional(z.string()),\n advanced: z.optional(z.boolean()),\n width: z.optional(z.enum([\"half\", \"full\"])),\n icon: z.optional(z.string()),\n placeholder: z.optional(z.string()),\n});\n\nexport type BasePropertySchema = z.infer<typeof BasePropertySchema>;\n\nexport const TPropertyValue = <T extends z.ZodMiniType, U extends PropertyType>(\n _T: T,\n propertyType: U,\n) =>\n z.object({\n type: z.literal(propertyType),\n required: z.boolean(),\n defaultValue: z.optional(z.any()),\n });\n\nexport type TPropertyValue<\n T,\n U extends PropertyType,\n REQUIRED extends boolean,\n> = {\n valueSchema: T;\n type: U;\n required: REQUIRED;\n // TODO this should be T or undefined\n defaultValue?: U extends PropertyType.ARRAY\n ? unknown[]\n : U extends PropertyType.JSON\n ? object\n : U extends PropertyType.CHECKBOX\n ? boolean\n : U extends PropertyType.LONG_TEXT\n ? string\n : U extends PropertyType.RICH_TEXT\n ? string\n : U extends PropertyType.SHORT_TEXT\n ? string\n : U extends PropertyType.NUMBER\n ? number\n : U extends PropertyType.DROPDOWN\n ? unknown\n : U extends PropertyType.MULTI_SELECT_DROPDOWN\n ? unknown[]\n : U extends PropertyType.STATIC_MULTI_SELECT_DROPDOWN\n ? unknown[]\n : U extends PropertyType.STATIC_DROPDOWN\n ? unknown\n : U extends PropertyType.DATE_TIME\n ? string\n : U extends PropertyType.DATE_RANGE\n ? object\n : U extends PropertyType.FILE\n ? ApFile\n : U extends PropertyType.COLOR\n ? string\n : unknown;\n};\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/property-type.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nexport enum PropertyType {\n SHORT_TEXT = \"SHORT_TEXT\",\n LONG_TEXT = \"LONG_TEXT\",\n RICH_TEXT = \"RICH_TEXT\",\n MARKDOWN = \"MARKDOWN\",\n DROPDOWN = \"DROPDOWN\",\n STATIC_DROPDOWN = \"STATIC_DROPDOWN\",\n NUMBER = \"NUMBER\",\n CHECKBOX = \"CHECKBOX\",\n OAUTH2 = \"OAUTH2\",\n SECRET_TEXT = \"SECRET_TEXT\",\n ARRAY = \"ARRAY\",\n OBJECT = \"OBJECT\",\n BASIC_AUTH = \"BASIC_AUTH\",\n JSON = \"JSON\",\n MULTI_SELECT_DROPDOWN = \"MULTI_SELECT_DROPDOWN\",\n STATIC_MULTI_SELECT_DROPDOWN = \"STATIC_MULTI_SELECT_DROPDOWN\",\n DYNAMIC = \"DYNAMIC\",\n CUSTOM_AUTH = \"CUSTOM_AUTH\",\n OIDC = \"OIDC\",\n DATE_TIME = \"DATE_TIME\",\n DATE_RANGE = \"DATE_RANGE\",\n FILE = \"FILE\",\n CUSTOM = \"CUSTOM\",\n COLOR = \"COLOR\",\n}\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/text-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\n\nexport const ShortTextProperty = z.object({\n ...BasePropertySchema.shape,\n ...TPropertyValue(z.string(), PropertyType.SHORT_TEXT).shape,\n});\n\nexport type ShortTextProperty<R extends boolean> = BasePropertySchema &\n TPropertyValue<string, PropertyType.SHORT_TEXT, R>;\n\nexport const LongTextProperty = z.object({\n ...BasePropertySchema.shape,\n ...TPropertyValue(z.string(), PropertyType.LONG_TEXT).shape,\n});\n\nexport type LongTextProperty<R extends boolean> = BasePropertySchema &\n TPropertyValue<string, PropertyType.LONG_TEXT, R>;\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/dropdown/common.ts. MIT; see ../../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\n\nexport const DropdownOption = z.object({\n label: z.string(),\n value: z.unknown(),\n description: z.optional(z.string()),\n icon: z.optional(z.string()),\n});\n\nexport type DropdownOption<T> = {\n label: string;\n value: T;\n description?: string;\n icon?: string;\n};\n\nexport const DropdownState = z.object({\n disabled: z.optional(z.boolean()),\n placeholder: z.optional(z.string()),\n options: z.array(DropdownOption),\n});\n\nexport type DropdownState<T> = {\n disabled?: boolean;\n placeholder?: string;\n options: DropdownOption<T>[];\n};\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/dropdown/static-dropdown.ts. MIT; see ../../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"../common.js\";\nimport { DropdownState } from \"./common.js\";\nimport { PropertyType } from \"../property-type.js\";\n\nexport const StaticDropdownDisplay = z.enum([\"cards\"]);\nexport type StaticDropdownDisplay = z.infer<typeof StaticDropdownDisplay>;\n\nexport const StaticDropdownProperty = z.object({\n ...BasePropertySchema.shape,\n options: DropdownState,\n display: z.optional(StaticDropdownDisplay),\n ...TPropertyValue(z.unknown(), PropertyType.STATIC_DROPDOWN).shape,\n});\n\nexport type StaticDropdownProperty<\n T,\n R extends boolean,\n> = BasePropertySchema & {\n options: DropdownState<T>;\n display?: StaticDropdownDisplay;\n} & TPropertyValue<T, PropertyType.STATIC_DROPDOWN, R>;\n\nexport const StaticMultiSelectDropdownProperty = z.object({\n ...BasePropertySchema.shape,\n options: DropdownState,\n ...TPropertyValue(\n z.array(z.unknown()),\n PropertyType.STATIC_MULTI_SELECT_DROPDOWN,\n ).shape,\n});\n\nexport type StaticMultiSelectDropdownProperty<\n T,\n R extends boolean,\n> = BasePropertySchema & {\n options: DropdownState<T>;\n} & TPropertyValue<T[], PropertyType.STATIC_MULTI_SELECT_DROPDOWN, R>;\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/checkbox-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\n\nexport const CheckboxProperty = z.object({\n ...BasePropertySchema.shape,\n reveals: z.optional(z.array(z.string())),\n ...TPropertyValue(z.boolean(), PropertyType.CHECKBOX).shape,\n});\n\nexport type CheckboxProperty<R extends boolean> = BasePropertySchema & {\n /** Names of sibling props revealed (rendered nested) when this checkbox is on. Effective inside a 'section' group. */\n reveals?: string[];\n} & TPropertyValue<boolean, PropertyType.CHECKBOX, R>;\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/number-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\n\nexport const NumberProperty = z.object({\n ...BasePropertySchema.shape,\n display: z.optional(z.enum([\"stepper\"])),\n min: z.optional(z.number()),\n max: z.optional(z.number()),\n step: z.optional(z.number()),\n ...TPropertyValue(z.number(), PropertyType.NUMBER).shape,\n});\n\nexport type NumberProperty<R extends boolean> = BasePropertySchema & {\n display?: \"stepper\";\n min?: number;\n max?: number;\n step?: number;\n} & TPropertyValue<number, PropertyType.NUMBER, R>;\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/file-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport type { Readable } from \"node:stream\";\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\n\nexport class ApFile {\n constructor(\n public filename: string,\n public data: Buffer,\n public extension?: string,\n ) {}\n\n get base64(): string {\n return this.data.toString(\"base64\");\n }\n}\n\nexport const FileProperty = z.object({\n ...BasePropertySchema.shape,\n streaming: z.optional(z.boolean()),\n ...TPropertyValue(z.unknown(), PropertyType.FILE).shape,\n});\n\nexport type ApStreamingFile = {\n filename: string;\n extension?: string;\n size?: number;\n body: Readable;\n};\n\nexport type FileProperty<\n R extends boolean,\n S extends boolean = false,\n> = BasePropertySchema & {\n streaming?: S;\n} & TPropertyValue<\n S extends true ? ApStreamingFile | ApFile : ApFile,\n PropertyType.FILE,\n R\n >;\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/date-range-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\n\nexport const DateRangePreset = z.enum([\n \"any_time\",\n \"last_24_hours\",\n \"last_7_days\",\n \"last_30_days\",\n \"last_90_days\",\n \"this_month\",\n \"custom\",\n]);\nexport type DateRangePreset = z.infer<typeof DateRangePreset>;\n\nexport const DateRangeValue = z.object({\n preset: z.optional(DateRangePreset),\n after: z.optional(z.string()),\n before: z.optional(z.string()),\n});\nexport type DateRangeValue = {\n preset?: DateRangePreset;\n after?: string;\n before?: string;\n};\n\nexport const DateRangeProperty = z.object({\n ...BasePropertySchema.shape,\n display: z.optional(z.enum([\"dropdown\"])),\n ...TPropertyValue(DateRangeValue, PropertyType.DATE_RANGE).shape,\n});\n\nexport type DateRangeProperty<R extends boolean> = BasePropertySchema & {\n display?: \"dropdown\";\n} & TPropertyValue<DateRangeValue, PropertyType.DATE_RANGE, R>;\n\nfunction isoDaysAgo(days: number): string {\n return new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();\n}\n\nfunction startOfThisMonth(): string {\n const now = new Date();\n return new Date(now.getFullYear(), now.getMonth(), 1).toISOString();\n}\n\n// Relative presets are resolved against \"now\" so recurring flows roll forward.\nfunction resolve(value: DateRangeValue | null | undefined): {\n after?: string;\n before?: string;\n} {\n if (!value || !value.preset || value.preset === \"any_time\") {\n return {};\n }\n switch (value.preset) {\n case \"last_24_hours\":\n return { after: isoDaysAgo(1) };\n case \"last_7_days\":\n return { after: isoDaysAgo(7) };\n case \"last_30_days\":\n return { after: isoDaysAgo(30) };\n case \"last_90_days\":\n return { after: isoDaysAgo(90) };\n case \"this_month\":\n return { after: startOfThisMonth() };\n case \"custom\":\n return {\n after: value.after && value.after.length > 0 ? value.after : undefined,\n before:\n value.before && value.before.length > 0 ? value.before : undefined,\n };\n default:\n return {};\n }\n}\n\nexport const dateRangeUtils = { resolve };\n","// Vendored from activepieces/activepieces@0.91.0 packages/core/piece-types/src/lib/markdown.ts. MIT; see ../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nexport enum MarkdownVariant {\n BORDERLESS = \"BORDERLESS\",\n INFO = \"INFO\",\n WARNING = \"WARNING\",\n TIP = \"TIP\",\n}\n","// Vendored from activepieces/activepieces@0.91.0 packages/core/utils/src/lib/utils.ts. MIT; see ../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport { deepmerge } from \"deepmerge-ts\";\n\nexport function isString(str: unknown): str is string {\n return str != null && typeof str === \"string\";\n}\n\nexport function truncateString({\n value,\n maxLength,\n suffix = \"…\",\n}: {\n value: string;\n maxLength: number;\n suffix?: string;\n}): string {\n if (value.length <= maxLength) {\n return value;\n }\n let end = maxLength;\n const lastKeptCodeUnit = value.charCodeAt(end - 1);\n const splitsSurrogatePair =\n lastKeptCodeUnit >= 0xd800 && lastKeptCodeUnit <= 0xdbff;\n if (splitsSurrogatePair) {\n end -= 1;\n }\n return value.slice(0, end) + suffix;\n}\n\nexport function isNil<T>(\n value: T | null | undefined,\n): value is null | undefined {\n return value === null || value === undefined;\n}\n\nexport function stringifyNullOrUndefined(data: undefined | null): string {\n if (data === undefined) {\n return \"undefined\";\n }\n return \"null\";\n}\n\nexport function ensureTrailingSlash(url: string): string {\n return url.endsWith(\"/\") ? url : `${url}/`;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setAtPath<T, K extends keyof any>(\n obj: T,\n path: K | K[],\n value: any,\n): void {\n const pathArray = Array.isArray(path)\n ? path\n : ((path as string).match(/([^[.\\]])+/g) as unknown as K[]);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pathArray.reduce((acc: any, key: K, i: number) => {\n if (acc[key] === undefined) acc[key] = {};\n if (i === pathArray.length - 1) acc[key] = value;\n return acc[key];\n }, obj);\n}\n\nexport function insertAt<T>(array: T[], index: number, item: T): T[] {\n return [...array.slice(0, index), item, ...array.slice(index)];\n}\n\nexport function debounce<T>(\n func: (...args: T[]) => void,\n wait: number,\n): (key?: string, ...args: T[]) => void {\n let timeout: NodeJS.Timeout;\n let currentKey: string | undefined;\n return function (key?: string, ...args: T[]) {\n const later = () => {\n func(...args);\n };\n if (currentKey === key) {\n clearTimeout(timeout);\n }\n currentKey = key;\n timeout = setTimeout(later, wait);\n };\n}\n\ntype DeepPartial<T> = {\n [P in keyof T]?: T[P] extends Record<string, unknown>\n ? DeepPartial<T[P]>\n : T[P];\n};\n\n/**\n * This function also merges arrays, x = [1, 2], y = [3, 4], z = deepMergeAndCast(x, y) -> [1, 2, 3, 4]\n **/\nexport function deepMergeAndCast<T>(\n target: DeepPartial<T>,\n source: DeepPartial<T>,\n): T {\n return deepmerge(target as Partial<T>, source as Partial<T>) as T;\n}\n\nexport function kebabCase(str: string): string {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1-$2\") // Handle camelCase by adding hyphen between lowercase and uppercase letters\n .replace(/\\s+/g, \"-\") // Replace spaces with hyphens\n .replace(/_/g, \"-\") // Replace underscores with hyphens\n .toLowerCase() // Convert to lowercase\n .replace(/^-+|-+$/g, \"\"); // Remove leading and trailing hyphens\n}\n\nexport function slugify(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\nexport function isEmpty<T>(value: T | null | undefined): boolean {\n if (value == null) {\n return true;\n }\n\n if (typeof value === \"string\" || Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (typeof value === \"object\") {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n\nexport function startCase(str: string): string {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .replace(/^[a-z]/, (match) => match.toUpperCase())\n .replace(/\\b[a-z]/g, (match) => match.toUpperCase());\n}\n\nexport function camelCase(str: string): string {\n return str.replace(/([-_][a-z])/g, (group) =>\n group.toUpperCase().replace(\"-\", \"\").replace(\"_\", \"\"),\n );\n}\n\nexport function parseToJsonIfPossible(str: unknown): unknown {\n try {\n return JSON.parse(str as string);\n } catch (e) {\n return str;\n }\n}\n\nexport function pickBy<T extends Record<string, unknown>>(\n object: T,\n predicate: (value: T[keyof T], key: keyof T) => boolean,\n): Partial<T> {\n return Object.keys(object).reduce((result: Partial<T>, key: keyof T) => {\n if (predicate(object[key], key)) {\n result[key] = object[key];\n }\n return result;\n }, {});\n}\n\nexport function chunk<T>(records: T[], size: number) {\n const chunks: T[][] = [];\n for (let i = 0; i < records.length; i += size) {\n chunks.push(records.slice(i, i + size));\n }\n return chunks;\n}\n\nexport function partition<T>(\n array: T[],\n predicate: (item: T, index: number, arr: T[]) => boolean,\n): [T[], T[]] {\n const truthy: T[] = [];\n const falsy: T[] = [];\n array.forEach((item, idx) => {\n if (predicate(item, idx, array)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n });\n return [truthy, falsy];\n}\n\nexport function unique<T>(array: T[]): T[] {\n const seen = new Set<string | undefined>();\n return array.filter((item) => {\n const key = JSON.stringify(item);\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n\nexport function mapsAreSame<K, V>(a: Map<K, V>, b: Map<K, V>): boolean {\n if (a.size !== b.size) return false;\n for (const [key, value] of a) {\n if (!b.has(key)) return false;\n if (b.get(key) !== value) return false;\n }\n return true;\n}\n\nexport function validateIndexBound({\n index,\n limit,\n}: {\n index: number;\n limit: number;\n}) {\n if (index < 0) {\n return 0;\n }\n if (index >= limit) {\n return limit - 1;\n }\n return index;\n}\n\nexport function isManualPieceTrigger({\n pieceName,\n triggerName,\n}: {\n pieceName: string;\n triggerName: string;\n}) {\n return (\n pieceName === \"@activepieces/piece-manual-trigger\" &&\n triggerName === \"manual_trigger\"\n );\n}\n\nexport function isEnumValue<T extends { [key: string]: string | number }>(\n enumObj: T,\n value: string | number,\n): value is T[keyof T] {\n return Object.values(enumObj).includes(value as T[keyof T]);\n}\n\nexport type IsBase64Options = {\n allowMime?: boolean;\n};\n\nconst INVALID_BASE64_CHARS = /[^A-Za-z0-9+/=]/;\n\nexport function isBase64(value: string, options?: IsBase64Options): boolean {\n if (!isString(value) || value.length === 0) {\n return false;\n }\n\n if (options?.allowMime) {\n const base64MarkerIndex = value.indexOf(\";base64,\");\n if (base64MarkerIndex !== -1 && value.startsWith(\"data:\")) {\n const base64Part = value.slice(base64MarkerIndex + 8); // 8 = ';base64,'.length\n return _isValidBase64String(base64Part);\n }\n }\n\n return _isValidBase64String(value);\n}\n\nfunction _isValidBase64String(str: string): boolean {\n const len = str.length;\n if (len === 0 || len % 4 !== 0 || INVALID_BASE64_CHARS.test(str)) {\n return false;\n }\n // Validate that '=' only appears at the end (padding), at most 2 chars\n const firstPaddingIndex = str.indexOf(\"=\");\n return (\n firstPaddingIndex === -1 ||\n firstPaddingIndex === len - 1 ||\n (firstPaddingIndex === len - 2 && str[len - 1] === \"=\")\n );\n}\n","// Vendored from activepieces/activepieces@0.91.0 packages/core/utils/src/lib/try-catch.ts. MIT; see ../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\n// Types for the result object with discriminated union\ntype Success<T> = {\n data: T;\n error: null;\n};\n\ntype Failure<E> = {\n data: null;\n error: E;\n};\n\nexport type Result<T, E = Error> = Success<T> | Failure<E>;\n\n// Main wrapper function\nexport async function tryCatch<T, E = Error>(\n fn: () => Promise<T>,\n): Promise<Result<T, E>> {\n try {\n const data = await fn();\n return { data, error: null };\n } catch (error) {\n return { data: null, error: error as E };\n }\n}\n\nexport function tryCatchSync<T, E = Error>(fn: () => T): Result<T, E> {\n try {\n const data = fn();\n return { data, error: null };\n } catch (error) {\n return { data: null, error: error as E };\n }\n}\n\nexport function toError(value: unknown): Error {\n if (value instanceof Error) {\n return value;\n }\n if (typeof value === \"string\") {\n return new Error(value);\n }\n const { data: serialized } = tryCatchSync(() => JSON.stringify(value));\n return new Error(serialized ?? String(value));\n}\n","// Vendored from activepieces/activepieces@0.91.0 packages/pieces/framework/src/lib/property/input/markdown-property.ts. MIT; see ../../../../../LICENSE.\n// Generated by scripts/sync-upstream.mts — do not edit by hand.\nimport * as z from \"zod/mini\";\nimport { BasePropertySchema, TPropertyValue } from \"./common.js\";\nimport { PropertyType } from \"./property-type.js\";\nimport { MarkdownVariant } from \"../../../../core-piece-types/index.js\";\n\nexport const MarkDownProperty = z.object({\n ...BasePropertySchema.shape,\n ...TPropertyValue(z.void(), PropertyType.MARKDOWN).shape,\n variant: z.optional(z.enum(MarkdownVariant)),\n});\n\nexport type MarkDownProperty = BasePropertySchema &\n TPropertyValue<undefined, PropertyType.MARKDOWN, false> & {\n variant?: MarkdownVariant;\n };\n"],"mappings":";;;AAMA,MAAa,qBAAqB,EAAE,OAAO;CACzC,aAAa,EAAE,QAAQ;CACvB,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC;CACnC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC;CACjC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC,CAAC;CAC3C,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC5B,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC;CACpC,CAAC;AAIF,MA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OAAe,SAAoC;AAC1E,KAAI,CAAC,SAAS,MAAM,IAAI,MAAM,WAAW,EACvC,QAAO;AAGT,KAAI,SAAS,WAAW;EACtB,MAAM,oBAAoB,MAAM,QAAQ,WAAW;AACnD,MAAI,sBAAsB,MAAM,MAAM,WAAW,QAAQ,CAEvD,QAAO,qBADY,MAAM,MAAM,oBAAoB,EAAE,CACd;;AAI3C,QAAO,qBAAqB,MAAM;;AAGpC,SAAS,qBAAqB,KAAsB;CAClD,MAAM,MAAM,IAAI;AAChB,KAAI,QAAQ,KAAK,MAAM,MAAM,KAAK,qBAAqB,KAAK,IAAI,CAC9D,QAAO;CAGT,MAAM,oBAAoB,IAAI,QAAQ,IAAI;AAC1C,QACE,sBAAsB,MACtB,sBAAsB,MAAM,KAC3B,sBAAsB,MAAM,KAAK,IAAI,MAAM,OAAO;;;;;AC3QvD,eAAsB,SACpB,IACuB;AACvB,KAAI;AAEF,SAAO;GAAE,MADI,MAAM,IAAI;GACR,OAAO;GAAM;UACrB,OAAO;AACd,SAAO;GAAE,MAAM;GAAa;GAAY;;;AAI5C,SAAgB,aAA2B,IAA2B;AACpE,KAAI;AAEF,SAAO;GAAE,MADI,IAAI;GACF,OAAO;GAAM;UACrB,OAAO;AACd,SAAO;GAAE,MAAM;GAAa;GAAY;;;;;;ACzB5C,MAAa,mBAAmB,EAAE,OAAO;CACvC,GAAG,mBAAmB;CACtB,GAAG,eAAe,EAAE,MAAM,EAAE,aAAa,SAAS,CAAC;CACnD,SAAS,EAAE,SAAS,EAAE,KAAK,gBAAgB,CAAC;CAC7C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powerhousedao/pieces-framework",
|
|
3
|
+
"version": "6.2.3-dev.11",
|
|
4
|
+
"description": "Powerhouse's published copy of the Activepieces piece framework, widened with the reactor context.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
11
|
+
"directory": "packages/pieces-framework"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"UPSTREAM.md"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"source": "./src/index.ts",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./common": {
|
|
28
|
+
"source": "./src/common.ts",
|
|
29
|
+
"types": "./dist/common.d.ts",
|
|
30
|
+
"import": "./dist/common.js"
|
|
31
|
+
},
|
|
32
|
+
"./host": {
|
|
33
|
+
"source": "./src/host.ts",
|
|
34
|
+
"types": "./dist/host.d.ts",
|
|
35
|
+
"import": "./dist/host.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"upstream": {
|
|
40
|
+
"repository": "https://github.com/activepieces/activepieces",
|
|
41
|
+
"tag": "0.91.0",
|
|
42
|
+
"commit": "da4410d1bf6212054e55805a98d566ff1b9310b2",
|
|
43
|
+
"packages": {
|
|
44
|
+
"@activepieces/pieces-framework": "0.39.0",
|
|
45
|
+
"@activepieces/pieces-common": "0.14.0",
|
|
46
|
+
"@activepieces/core-piece-types": "0.11.1",
|
|
47
|
+
"@activepieces/core-utils": "0.6.2",
|
|
48
|
+
"@activepieces/engine": "0.7.0"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"dayjs": "1.11.9",
|
|
53
|
+
"form-data": "4.0.6",
|
|
54
|
+
"ipaddr.js": "2.3.0",
|
|
55
|
+
"nanoid": "3.3.17",
|
|
56
|
+
"zod": "4.3.6"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/node": "25.2.3",
|
|
60
|
+
"deepmerge-ts": "7.1.0",
|
|
61
|
+
"ts-morph": "27.0.2",
|
|
62
|
+
"tsdown": "0.21.1",
|
|
63
|
+
"tsx": "4.21.0",
|
|
64
|
+
"vitest": "4.1.1"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"tsc": "tsc",
|
|
68
|
+
"lint": "eslint",
|
|
69
|
+
"test": "vitest --run",
|
|
70
|
+
"build": "tsdown",
|
|
71
|
+
"sync-upstream": "tsx scripts/sync-upstream.mts"
|
|
72
|
+
}
|
|
73
|
+
}
|